mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Theme editor restyling from hansengel. see #5871
git-svn-id: https://develop.svn.wordpress.org/trunk@6878 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+52
-29
@@ -5,6 +5,7 @@ $title = __("Edit Themes");
|
||||
$parent_file = 'themes.php';
|
||||
|
||||
wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme'));
|
||||
wp_admin_css( 'css/theme-editor' );
|
||||
|
||||
$themes = get_themes();
|
||||
|
||||
@@ -78,42 +79,64 @@ default:
|
||||
?>
|
||||
<?php if (isset($_GET['a'])) : ?>
|
||||
<div id="message" class="updated fade"><p><?php _e('File edited successfully.') ?></p></div>
|
||||
<?php endif; ?>
|
||||
<div class="wrap">
|
||||
<form name="theme" action="theme-editor.php" method="post">
|
||||
<?php _e('Select theme to edit:') ?>
|
||||
<select name="theme" id="theme">
|
||||
<?php
|
||||
foreach ($themes as $a_theme) {
|
||||
$theme_name = $a_theme['Name'];
|
||||
if ($theme_name == $theme) $selected = " selected='selected'";
|
||||
else $selected = '';
|
||||
$theme_name = attribute_escape($theme_name);
|
||||
echo "\n\t<option value=\"$theme_name\" $selected>$theme_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<input type="submit" name="Submit" value="<?php _e('Select »') ?>" class="button" />
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;
|
||||
|
||||
<div class="wrap">
|
||||
<?php
|
||||
if ( is_writeable($real_file) ) {
|
||||
echo '<h2>' . sprintf(__('Editing <code>%s</code>'), $file_show) . '</h2>';
|
||||
} else {
|
||||
echo '<h2>' . sprintf(__('Browsing <code>%s</code>'), $file_show) . '</h2>';
|
||||
}
|
||||
?>
|
||||
$description = get_file_description($file);
|
||||
$desc_header = ( $description != $file_show ) ? "$description</strong> (%s)" : "%s";
|
||||
?>
|
||||
<div class="wrap">
|
||||
<div class="bordertitle">
|
||||
<h2 style="border: none; padding-bottom: 0px;">Theme Editor</h2>
|
||||
<form id="themeselector" name="theme" action="theme-editor.php" method="post">
|
||||
<strong><?php _e('Select theme to edit: '); ?></strong>
|
||||
<select name="theme" id="theme" style="margin: 0; padding: 0;">
|
||||
<?php
|
||||
foreach ($themes as $a_theme) {
|
||||
$theme_name = $a_theme['Name'];
|
||||
if ($theme_name == $theme) $selected = " selected='selected'";
|
||||
else $selected = '';
|
||||
$theme_name = attribute_escape($theme_name);
|
||||
echo "\n\t<option value=\"$theme_name\" $selected>$theme_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<input type="submit" name="Submit" value="<?php _e('Select') ?>" class="button" style="padding: 0px;" />
|
||||
</form>
|
||||
</div>
|
||||
<br style="clear: both;" />
|
||||
<div class="tablenav" style="margin-right: 210px;">
|
||||
<div style="float: left;">
|
||||
<big><strong><?php echo sprintf($desc_header, $file_show); ?></big>
|
||||
</div>
|
||||
<br style="clear: both;" />
|
||||
</div>
|
||||
<br style="clear: both;" />
|
||||
<div id="templateside">
|
||||
<h3><?php printf(__("<strong>'%s'</strong> theme files"), $theme) ?></h3>
|
||||
<h3 id="bordertitle" style="margin-bottom: 10px;"><?php _e("Theme Files"); ?></h3>
|
||||
|
||||
<?php
|
||||
if ($allowed_files) :
|
||||
?>
|
||||
<h4 style="margin-bottom: 0px;"><?php _e('Templates'); ?></h4>
|
||||
<ul>
|
||||
<?php foreach($allowed_files as $allowed_file) : ?>
|
||||
<li><a href="theme-editor.php?file=<?php echo "$allowed_file"; ?>&theme=<?php echo urlencode($theme) ?>"><?php echo get_file_description($allowed_file); ?></a></li>
|
||||
<?php foreach($themes[$theme]['Template Files'] as $template_file) :
|
||||
$description = get_file_description($template_file);
|
||||
$template_show = basename($template_file);
|
||||
$filedesc = ( $description != $template_file ) ? "$description <span class='nonessential'>($template_show)</span></small>" : "$description";
|
||||
$filedesc = ( $template_file == $file ) ? "<span class='highlight'>$description <span class='nonessential'>($template_show)</span></span>" : $filedesc;
|
||||
?>
|
||||
<li><a href="theme-editor.php?file=<?php echo "$template_file"; ?>&theme=<?php echo urlencode($theme) ?>"><?php echo $filedesc ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<h4 style="margin-bottom: 0px;"><?php _e('Styles'); ?></h4>
|
||||
<ul>
|
||||
<?php foreach($themes[$theme]['Stylesheet Files'] as $style_file) :
|
||||
$description = get_file_description($style_file);
|
||||
$style_show = basename($style_file);
|
||||
$filedesc = ( $description != $style_file ) ? "$description <span class='nonessential'>($style_show)</span>" : "$description";
|
||||
$filedesc = ( $style_file == $file ) ? "<span class='highlight'>$description <span class='nonessential'>($style_show)</span></span>" : $filedesc;
|
||||
?>
|
||||
<li><a href="theme-editor.php?file=<?php echo "$style_file"; ?>&theme=<?php echo urlencode($theme) ?>"><?php echo $filedesc ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user