Make WordPress Core

Changeset 2757


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

Making the presentation page a little more intuitive

Location:
trunk
Files:
2 added
4 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}
  • trunk/wp-admin/wp-admin.css

    r2756 r2757  
    161161}
    162162
     163.available-theme {
     164        width: 250px;
     165        margin-right: 2.5em;
     166        float: left;
     167        text-align: center;
     168}
     169
     170.available-theme span {
     171        width: 250px;
     172        height: 187px;
     173        display: block;
     174        margin: auto;
     175        background: #f1f1f1;
     176        border: 1px solid #ccc;
     177}
     178
     179.available-theme img {
     180        width: 100%;
     181}
     182
    163183.checkbox {
    164184        background: #fff;
    … …  
    268288.wrap h2 {
    269289        margin: .8em 0 .5em;
     290        clear: both;
    270291}
    271292
    … …  
    340361        margin-left: 2%;
    341362        width: 97%;
     363}
     364
     365#currenttheme img {
     366        float: left;
     367        border: 1px solid #666;
     368        margin-right: 1em;
     369        margin-bottom: 1.5em;
    342370}
    343371
  • trunk/wp-includes/functions.php

    r2740 r2757  
    15121512        $name = trim($name);
    15131513        $theme = $name;
    1514         if ('' != $theme_uri[1] && '' != $name) {
    1515                 $theme = '<a href="' . $theme_uri[1] . '" title="' . __('Visit theme homepage') . '">' . $theme . '</a>';
    1516         }
    15171514
    15181515        if ('' == $author_uri[1]) {
    … …  
    15701567        foreach($theme_files as $theme_file) {
    15711568                $theme_data = get_theme_data("$theme_root/$theme_file");
    1572          
     1569
    15731570                $name = $theme_data['Name'];
    15741571                $title = $theme_data['Title'];
    … …  
    15781575                $template = $theme_data['Template'];
    15791576                $stylesheet = dirname($theme_file);
     1577
     1578                $screenshot = glob("$theme_root/$stylesheet/screenshot.png");
     1579                if ( !empty( $screenshot ) )
     1580                        $screenshot = basename( $screenshot[0] );
     1581                else
     1582                        $screenshot = false;
    15801583
    15811584                if (empty($name)) {
    … …  
    16411644                }
    16421645               
    1643                 $themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status']);
     1646                $themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status'], 'Screenshot' => $screenshot);
    16441647        }
    16451648
  • trunk/wp-includes/version.php

    r2750 r2757  
    33// This just holds the version number, in a separate file so we can bump it without cluttering the SVN
    44
    5 $wp_version = '1.6-ALPHA-2';
     5$wp_version = '1.6-ALPHA-2-still-dont-use';
    66
    77?>
Note: See TracChangeset for help on using the changeset viewer.