WordPress.org

Make WordPress Core

Changeset 10567


Ignore:
Timestamp:
02/12/2009 10:12:57 PM (9 years ago)
Author:
ryan
Message:

UI tweaks to theme installer. see #8652

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/theme-install.php

    r10559 r10567  
    123123function install_themes_dashboard() {
    124124    ?>
    125     <p><?php _e('Themes give your WordPress a personalized feel &amp; touch. You may automatically install themes from the <a href="http://wordpress.org/extend/themes/">WordPress Theme Directory</a> or upload a theme in .zip format via this page.') ?></p>
    126 
    127     <h4><?php _e('Search') ?></h4>
     125    <p><?php _e('Search for themes by keyword, author, or tag.') ?></p>
     126
    128127    <?php install_theme_search_form('<a href="' . add_query_arg('show-help', !isset($_REQUEST['show-help'])) .'" onclick="jQuery(\'#search-help\').toggle(); return false;">' . __('[need help?]') . '</a>') ?>
    129128    <div id="search-help" style="display: <?php echo isset($_REQUEST['show-help']) ? 'block' : 'none'; ?>;">
     
    134133    </div>
    135134
    136     <h4><?php _e('Install a theme in .zip format') ?></h4>
    137     <p><?php _e('If you have a theme in a .zip format, You may install it by uploading it here.') ?></p>
    138     <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('theme-install.php?tab=upload') ?>">
    139         <?php wp_nonce_field( 'theme-upload') ?>
    140         <input type="file" name="themezip" />
    141         <input type="submit" class="button" value="<?php _e('Install Now') ?>" />
    142     </form>
     135    <h4><?php _e('Advanced Search') ?></h4>
     136    <p><?php _e('Tag filter goes here') ?></p>
    143137
    144138    <h4><?php _e('Popular tags') ?></h4>
     
    239233    $api = themes_api('query_themes', $args);
    240234    display_themes($api->themes, $api->info['page'], $api->info['pages']);
     235}
     236
     237add_action('install_themes_upload', 'install_themes_upload', 10, 1);
     238function install_themes_upload() {
     239?>
     240    <h4><?php _e('Install a theme in .zip format') ?></h4>
     241    <p><?php _e('If you have a theme in a .zip format, You may install it by uploading it here.') ?></p>
     242    <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('theme-install.php?tab=upload') ?>">
     243        <?php wp_nonce_field( 'theme-upload') ?>
     244        <input type="file" name="themezip" />
     245        <input type="submit" class="button" value="<?php _e('Install Now') ?>" />
     246    </form>
     247<?php
    241248}
    242249
     
    332339        ?>
    333340    </div>
    334     <table class="widefat" id="install-themes" cellspacing="0">
    335         <thead>
    336             <tr>
    337                 <th scope="col" class="name"><?php _e('Name'); ?></th>
    338                 <th scope="col" class="num"><?php _e('Version'); ?></th>
    339                 <th scope="col" class="num"><?php _e('Rating'); ?></th>
    340                 <th scope="col" class="desc"><?php _e('Description'); ?></th>
    341                 <th scope="col" class="action-links"><?php _e('Actions'); ?></th>
    342             </tr>
    343         </thead>
    344 
    345         <tfoot>
    346             <tr>
    347                 <th scope="col" class="name"><?php _e('Name'); ?></th>
    348                 <th scope="col" class="num"><?php _e('Version'); ?></th>
    349                 <th scope="col" class="num"><?php _e('Rating'); ?></th>
    350                 <th scope="col" class="desc"><?php _e('Description'); ?></th>
    351                 <th scope="col" class="action-links"><?php _e('Actions'); ?></th>
    352             </tr>
    353         </tfoot>
    354 
    355         <tbody class="themes">
    356         <?php
    357             if( empty($themes) )
    358                 echo '<tr><td colspan="5">', __('No themes match your request.'), '</td></tr>';
    359 
    360             foreach( (array) $themes as $theme ){
    361                 if ( is_object($theme) )
    362                     $theme = (array) $theme;
    363 
    364                 $title = wp_kses($theme['name'], $themes_allowedtags);
    365                 $description = wp_kses($theme['description'], $themes_allowedtags);
    366                 $version = wp_kses($theme['version'], $themes_allowedtags);
    367 
    368                 $name = strip_tags($title . ' ' . $version);
    369 
    370                 $author = $theme['author'];
    371                 if( ! empty($theme['author']) )
    372                     $author = ' <cite>' . sprintf( __('By %s'), $author ) . '.</cite>';
    373 
    374                 $author = wp_kses($author, $themes_allowedtags);
    375 
    376                 if( isset($theme['homepage']) )
    377                     $title = '<a target="_blank" href="' . attribute_escape($theme['homepage']) . '">' . $title . '</a>';
    378 
    379                 $action_links = array();
    380                 $action_links[] = '<a href="' . admin_url('theme-install.php?tab=theme-information&amp;theme=' . $theme['slug'] .
    381                                     '&amp;TB_iframe=true&amp;width=600&amp;height=800') . '" class="thickbox onclick" title="' .
    382                                     attribute_escape($name) . '">' . __('Install') . '</a>';
    383 
    384                 $action_links = apply_filters('theme_install_action_links', $action_links, $theme);
    385             ?>
    386             <tr>
    387                 <td class="name"><?php echo $title; ?></td>
    388                 <td class="vers"><?php echo $version; ?></td>
    389                 <td class="vers">
    390                     <div class="star-holder" title="<?php printf(__ngettext('(based on %s rating)', '(based on %s ratings)', $theme['num_ratings']), number_format_i18n($theme['num_ratings'])) ?>">
    391                         <div class="star star-rating" style="width: <?php echo attribute_escape($theme['rating']) ?>px"></div>
    392                         <div class="star star5"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('5 stars') ?>" /></div>
    393                         <div class="star star4"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('4 stars') ?>" /></div>
    394                         <div class="star star3"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('3 stars') ?>" /></div>
    395                         <div class="star star2"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('2 stars') ?>" /></div>
    396                         <div class="star star1"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('1 star') ?>" /></div>
    397                     </div>
    398                 </td>
    399                 <td class="desc"><p><?php echo $description, $author; ?></p></td>
    400                 <td class="action-links"><?php if ( !empty($action_links) ) echo implode(' | ', $action_links); ?></td>
    401             </tr>
    402             <?php
    403             }
    404             ?>
    405         </tbody>
    406     </table>
    407341
    408342    <div class="tablenav">
  • trunk/wp-admin/theme-install.php

    r10559 r10567  
    2626//These are the tabs which are shown on the page,
    2727$tabs = array();
    28 $tabs['dashboard'] = __('Start Page'); //TODO: Better name?
     28$tabs['dashboard'] = __('Search');
    2929if ( 'search' == $tab )
    3030    $tabs['search'] = __('Search Results');
    31 $tabs['tag-filter'] = __('Tag Filter');
     31$tabs['upload'] = __('Upload');
    3232$tabs['featured'] = __('Featured');
    3333//$tabs['popular']  = __('Popular');
Note: See TracChangeset for help on using the changeset viewer.