WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/14/2004 12:01:31 PM (17 years ago)
Author:
saxmatt
Message:

Some UI changes to theme manager. Seems to be updating the stylesheet but not the template.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/themes.php

    r1643 r1655  
    1616      }
    1717
    18       header('Location: themes.php?activate=true');
     18      header('Location: themes.php?activated=true');
    1919    }
    2020 }
     
    2525require_once('admin-header.php');
    2626
    27 if ($user_level < 9) // Must be at least level 9
    28     die (__('Sorry, you must be at least a level 8 user to modify themes.'));
     27if ($user_level < 9)
     28    die (__('Sorry, you must be at least a level 9 user to modify themes.'));
    2929?>
     30
     31<?php if ( isset($activated) ) : ?>
     32<div class="updated"><p><?php _e('New theme activated'); ?></p></div>
     33<?php endif; ?>
    3034
    3135<?php
    3236$themes = get_themes();
    3337$current_theme = get_current_theme();
     38$current_title = $themes[$current_theme]['Title'];
     39$current_version = $themes[$current_theme]['Version'];
    3440$current_parent_theme = $themes[$current_theme]['Parent Theme'];
    3541$current_template_dir = $themes[$current_theme]['Template Dir'];
     
    3945?>
    4046
     47<div class="wrap">
     48<h2><?php _e('Current Theme'); ?></h2>
     49<div id="currenttheme">
     50<h3><?php printf(__('%s %s by %s'), $current_title, $current_version, $themes[$current_theme]['Author']) ; ?></h3>
     51<p><?php echo $themes[$current_theme]['Description']; ?></p>
    4152<?php if ($current_parent_theme) { ?>
    42     <div class="updated"><p><?php printf(__('The active theme is <strong>%s</strong>.  The template files are located in <code>%s</code>.  The stylesheet files are located in <code>%s</code>.  <strong>%s</strong> uses templates from <strong>%s</strong>.  Changes made to the templates will affect both themes.'), $current_theme, $current_template_dir, $current_stylesheet_dir, $current_theme, $current_parent_theme); ?></p></div>
     53    <p><?php printf(__('The active theme is <strong>%s</strong>.  The template files are located in <code>%s</code>.  The stylesheet files are located in <code>%s</code>.  <strong>%s</strong> uses templates from <strong>%s</strong>.  Changes made to the templates will affect both themes.'), $current_theme, $current_template_dir, $current_stylesheet_dir, $current_theme, $current_parent_theme); ?></p>
    4354<?php } else { ?>
    44     <div class="updated"><p><?php printf(__('The active theme is <strong>%s</strong>.  The template files are located in <code>%s</code>.  The stylesheet files are located in <code>%s</code>.'), $current_theme, $current_template_dir, $current_stylesheet_dir); ?></p></div>
     55    <p><?php printf(__('The active theme is <strong>%s</strong>.  The template files are located in <code>%s</code>.  The stylesheet files are located in <code>%s</code>.'), $current_theme, $current_template_dir, $current_stylesheet_dir); ?></p>
    4556<?php } ?>
     57</div>
    4658
    47 <div class="wrap">
    48 <h2><?php _e('Theme Management'); ?></h2>
     59<h2><?php _e('Other Themes'); ?></h2>
    4960<p><?php _e('Themes are usually downloaded separately from WordPress. To install a theme you generally just need to put the theme file or files into your <code>wp-content/themes</code> directory. Once a theme is installed, you may select it here.'); ?></p>
    50 <?php
    5161
    52 if (empty($themes)) {
    53     _e("<p>Couldn't open themes directory or there are no themes available.</p>"); // TODO: make more helpful
    54 } else {
    55 ?>
     62<?php if ( 1 < count($themes) ) { ?>
    5663<table width="100%" cellpadding="3" cellspacing="3">
    5764    <tr>
    58         <th><?php _e('Theme'); ?></th>
    59         <th><?php _e('Version'); ?></th>
     65        <th><?php _e('Name'); ?></th>
    6066        <th><?php _e('Author'); ?></th>
    6167        <th><?php _e('Description'); ?></th>
     
    7783
    7884        if ($template == $current_template && $stylesheet == $current_stylesheet) {
    79             $action = "<a href='themes.php' title='" . __('Active theme') . "' class='edit'>" . __('Active Theme') . '</a>';
     85            $action = __('Active Theme');
    8086        } else {
    8187            $action = "<a href='themes.php?action=activate&amp;template=$template&amp;stylesheet=$stylesheet' title='" . __('Select this theme') . "' class='edit'>" . __('Select') . '</a>';
     
    8591        echo "
    8692      <tr $theme>
    87          <td>$title</td>
    88          <td>$version</td>
    89          <td>$author</td>
     93         <td>$title $version</td>
     94         <td align='center'>$author</td>
    9095         <td>$description</td>
    91          <td>$action</td>
     96         <td align='center'>$action</td>
    9297      </tr>";
    9398    }
Note: See TracChangeset for help on using the changeset viewer.