Make WordPress Core


Ignore:
Timestamp:
08/07/2005 10:11:30 AM (21 years ago)
Author:
matt
Message:

Making the presentation page a little more intuitive

File:
1 edited

Legend:

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

    r2756 r2757  
    4040$current_template = $themes[$current_theme]['Template'];
    4141$current_stylesheet = $themes[$current_theme]['Stylesheet'];
     42$current_screenshot = $themes[$current_theme]['Screenshot'];
    4243?>
    4344
    … …  
    4546<h2><?php _e('Current Theme'); ?></h2>
    4647<div id="currenttheme">
     48<?php if ( $current_screenshot ) : ?>
     49<img src="<?php echo get_option('siteurl') . '/' . $current_stylesheet_dir . '/' . $current_screenshot; ?>" alt="Current theme preview" />
     50<?php endif; ?>
    4751<h3><?php printf(__('%1$s %2$s by %3$s'), $current_title, $current_version, $themes[$current_theme]['Author']) ; ?></h3>
    4852<p><?php echo $themes[$current_theme]['Description']; ?></p>
    4953<?php if ($current_parent_theme) { ?>
    50         <p><?php printf(__('The active theme is <strong>%1$s</strong>.  The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$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>
     54        <p><?php printf(__('The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$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>
    5155<?php } else { ?>
    52         <p><?php printf(__('The active theme is <strong>%1$s</strong>.  The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.'), $current_theme, $current_template_dir, $current_stylesheet_dir); ?></p>
     56        <p><?php printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $current_theme, $current_template_dir, $current_stylesheet_dir); ?></p>
    5357<?php } ?>
    5458</div>
    … …  
    5660<h2><?php _e('Available Themes'); ?></h2>
    5761<?php if ( 1 < count($themes) ) { ?>
    58 <table width="100%" cellpadding="3" cellspacing="3">
    59         <tr>
    60                 <th><?php _e('Name'); ?></th>
    61                 <th><?php _e('Author'); ?></th>
    62                 <th><?php _e('Description'); ?></th>
    63                 <th></th>
    64         </tr>
     62
    6563<?php
    66         $style = '';
     64$style = '';
    6765
    68         $theme_names = array_keys($themes);
    69         natcasesort($theme_names);
     66$theme_names = array_keys($themes);
     67natcasesort($theme_names);
    7068
    71         foreach ($theme_names as $theme_name) {
    72                 $template = $themes[$theme_name]['Template'];
    73                 $stylesheet = $themes[$theme_name]['Stylesheet'];
    74                 $title = $themes[$theme_name]['Title'];
    75                 $version = $themes[$theme_name]['Version'];
    76                 $description = $themes[$theme_name]['Description'];
    77                 $author = $themes[$theme_name]['Author'];
    78 
     69foreach ($theme_names as $theme_name) {
     70        if ( $theme_name == $current_theme )
     71                continue;
     72        $template = $themes[$theme_name]['Template'];
     73        $stylesheet = $themes[$theme_name]['Stylesheet'];
     74        $title = $themes[$theme_name]['Title'];
     75        $version = $themes[$theme_name]['Version'];
     76        $description = $themes[$theme_name]['Description'];
     77        $author = $themes[$theme_name]['Author'];
     78        $screenshot = $themes[$theme_name]['Screenshot'];
     79        $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
     80?>
     81<div class="available-theme">
     82<h3><a href="<?php echo "themes.php?action=activate&amp;template=$template&amp;stylesheet=$stylesheet"; ?>"><?php echo "$title $version"; ?>
     83<span>
     84<?php if ( $screenshot ) : ?>
     85<img src="<?php echo get_option('siteurl') . '/' . $stylesheet_dir . '/' . $screenshot; ?>" alt="" />
     86<?php endif; ?>
     87</span>
     88</a></h3>
     89<p><?php echo $description; ?></p>
     90</div>
     91<?php
     92/*
    7993                if ($template == $current_template && $stylesheet == $current_stylesheet) {
    8094                        $action = '<strong>' . __('Active Theme') . '</strong>';
    8195                        $current = true;
    8296                } else {
    83                         $action = "<a href='themes.php?action=activate&amp;template=$template&amp;stylesheet=$stylesheet' title='" . __('Select this theme') . "' class='edit'>" . __('Select') . '</a>';
     97                        $action = "<a href='' title='" . __('Select this theme') . "' class='edit'>" . __('Select') . '</a>';
    8498                        $current = false;
    8599                }
    … …  
    94108        echo "<td><strong>$title $version</strong></td>";
    95109else
    96         echo "<td>$title $version</td>";
     110        echo "<td></td>";
    97111echo "
    98112             <td class=\"auth\">$author</td>
    … …  
    100114             <td class=\"togl\">$action</td>
    101115          </tr>";
     116*/
    102117        }
     118
    103119?>
    104120
    105 </table>
    106121<?php
    107122}
Note: See TracChangeset for help on using the changeset viewer.