WordPress.org

Make WordPress Core

Changeset 11008


Ignore:
Timestamp:
04/19/09 20:56:02 (6 years ago)
Author:
westi
Message:

Better view on Manage Themes when only one theme installed. Fixes #9029.

File:
1 edited

Legend:

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

    r10993 r11008  
    4646$themes = get_themes(); 
    4747$ct = current_theme_info(); 
     48unset($themes[$ct->name]); 
    4849 
    4950uksort( $themes, "strnatcasecmp" ); 
     
    133134 
    134135</div> 
     136 
    135137<div class="clear"></div> 
    136138<h3><?php _e('Available Themes'); ?></h3> 
    137139<div class="clear"></div> 
     140 
     141<?php if ( $theme_total ) { ?> 
    138142 
    139143<?php if ( $page_links ) : ?> 
     
    148152<?php endif; ?> 
    149153 
    150 <?php if ( 1 < $theme_total ) { ?> 
    151154<table id="availablethemes" cellspacing="0" cellpadding="0"> 
    152155<?php 
     
    182185    $screenshot = $themes[$theme_name]['Screenshot']; 
    183186    $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir']; 
     187    $template_dir = $themes[$theme_name]['Template Dir']; 
     188    $parent_theme = $themes[$theme_name]['Parent Theme']; 
    184189    $preview_link = clean_url( get_option('home') . '/'); 
    185190    $preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), $preview_link ) ); 
     
    203208<?php endif; ?> 
    204209        </a> 
    205         <h3><?php echo $title; ?></h3> 
    206         <span class='action-links'><?php echo $actions ?></span> 
    207         <p><?php echo $description; ?></p> 
     210<h3><?php 
     211    /* translators: 1: theme title, 2: theme version, 3: theme author */ 
     212    printf(__('%1$s %2$s by %3$s'), $title, $version, $author) ; ?></h3> 
     213<p class="description"><?php echo $description; ?></p> 
     214<span class='action-links'><?php echo $actions ?></span> 
     215    <?php if ($parent_theme) { ?> 
     216    <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.'), $title, $template_dir, $stylesheet_dir, $title, $parent_theme); ?></p> 
     217<?php } else { ?> 
     218    <p><?php printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $title, $template_dir, $stylesheet_dir); ?></p> 
     219<?php } ?> 
    208220<?php if ( $tags ) : ?> 
    209         <p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p> 
     221<p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p> 
    210222<?php endif; ?> 
    211223        <?php theme_update_available( $themes[$theme_name] ); ?> 
     
    216228<?php } // end foreach $table ?> 
    217229</table> 
    218 <?php } ?> 
    219  
     230<?php } else { ?> 
     231<p><?php _e('You only have one theme installed at the moment so there is nothing to show you here.  Maybe you should download some more to try out.'); ?></p> 
     232<?php } // end if $theme_total?> 
    220233<br class="clear" /> 
    221234 
     
    266279?> 
    267280 
    268 <h2><?php _e('Get More Themes'); ?></h2> 
     281<h3><?php _e('Get More Themes'); ?></h3> 
    269282<p><?php _e('You can find additional themes for your site in the <a href="http://wordpress.org/extend/themes/">WordPress theme directory</a>. To install a theme you generally just need to upload the theme folder into your <code>wp-content/themes</code> directory. Once a theme is uploaded, you should see it on this page.'); ?></p> 
    270283 
Note: See TracChangeset for help on using the changeset viewer.