Add CodePress syntax highlighting to Theme and Plugin editors (first run), props beaulebens, see #9173

git-svn-id: https://develop.svn.wordpress.org/trunk@10614 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-02-21 02:12:00 +00:00
parent 34994fca8b
commit c4e96ccd38
44 changed files with 2545 additions and 4 deletions

View File

@@ -77,6 +77,8 @@ default:
if ( !current_user_can('edit_themes') )
wp_die('<p>'.__('You do not have sufficient permissions to edit themes for this blog.').'</p>');
wp_enqueue_script( 'codepress' );
add_action( 'admin_print_footer_scripts', 'codepress_footer_js' );
require_once('admin-header.php');
update_recently_edited($file);
@@ -100,6 +102,7 @@ default:
}
$content = htmlspecialchars( $content );
$codepress_lang = codepress_get_lang($real_file);
}
?>
@@ -194,7 +197,7 @@ if ($allowed_files) :
?>
<form name="template" id="template" action="theme-editor.php" method="post">
<?php wp_nonce_field('edit-theme_' . $file . $theme) ?>
<div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea>
<div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress <?php echo $codepress_lang ?>"><?php echo $content ?></textarea>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="file" value="<?php echo $file ?>" />
<input type="hidden" name="theme" value="<?php echo $theme ?>" />