Make WordPress Core

Ticket #8652: 8652.3.diff

File 8652.3.diff, 6.4 KB (added by DD32, 16 years ago)
  • wp-admin/css/theme-install.css

     
     1.theme-listing .theme-item {
     2        display: inline-block;
     3        width: 200px;
     4        border: thin solid #ccc;
     5        vertical-align: top;
     6}
     7
     8.theme-listing .theme-item h3 {
     9        text-align: center;
     10        font-size: 14px;
     11        font-style: italic;
     12        margin: 0;
     13        padding: 0;
     14}
     15
     16.theme-listing .theme-item img {
     17        max-width: 150px;
     18        max-height: 150px;
     19}
     20
     21.theme-listing .theme-item-info span {
     22        display: none;
     23}
     24.theme-listing .theme-item:hover .theme-item-info span {
     25        display: inline;
     26}
     27.theme-listing .theme-item:hover .theme-item-info span.dots {
     28        display: none;
     29}
     30.theme-listing .theme-item-info span.action-links {
     31        font-weight: bold;
     32        text-align: center;
     33}
     34
     35.theme-listing br.line {
     36        border-bottom: thin solid #ccc;
     37        margin-bottom: 3px;
     38}
     39 No newline at end of file
  • wp-admin/includes/theme-install.php

     
    4747                                $res = new WP_Error('themes_api_failed', __('An unknown error occured'), $request['body']);
    4848                }
    4949        }
    50 
     50        //var_dump(array($args, $res));
    5151        return apply_filters('themes_api_result', $res, $action, $args);
    5252}
    5353
     
    9494
    9595        switch( $type ){
    9696                case 'tag':
    97                         $args['tag'] = sanitize_title_with_dashes($term);
     97                        $terms = explode(',', $term);
     98                        $terms = array_map('trim', $terms);
     99                        $terms = array_map('sanitize_title_with_dashes', $terms);
     100                        $args['tag'] = $terms;
    98101                        break;
    99102                case 'term':
    100103                        $args['search'] = $term;
     
    257260?>
    258261        <div class="tablenav">
    259262                <div class="alignleft actions">
    260                 <?php do_action('install_themes_table_header'); ?>
     263<?php do_action('install_themes_table_header'); ?>
    261264                </div>
    262                 <?php
    263                         $url = clean_url($_SERVER['REQUEST_URI']);
    264                         if ( ! empty($term) )
    265                                 $url = add_query_arg('s', $term, $url);
    266                         if ( ! empty($type) )
    267                                 $url = add_query_arg('type', $type, $url);
     265<?php
     266                $url = clean_url($_SERVER['REQUEST_URI']);
     267                if ( ! empty($term) )
     268                        $url = add_query_arg('s', $term, $url);
     269                if ( ! empty($type) )
     270                        $url = add_query_arg('type', $type, $url);
    268271
    269                         $page_links = paginate_links( array(
    270                                 'base' => add_query_arg('paged', '%#%', $url),
    271                                 'format' => '',
    272                                 'prev_text' => __('&laquo;'),
    273                                 'next_text' => __('&raquo;'),
    274                                 'total' => $totalpages,
    275                                 'current' => $page
    276                         ));
     272                $page_links = paginate_links( array(
     273                        'base' => add_query_arg('paged', '%#%', $url),
     274                        'format' => '',
     275                        'prev_text' => __('&laquo;'),
     276                        'next_text' => __('&raquo;'),
     277                        'total' => $totalpages,
     278                        'current' => $page
     279                ));
    277280
    278                         if ( $page_links )
    279                                 echo "\t\t<div class='tablenav-pages'>$page_links</div>";
     281                if ( $page_links )
     282                        echo "\t\t<div class='tablenav-pages'>$page_links</div>";
    280283?>
    281284                <br class="clear" />
    282285        </div>
     286        <div class="theme-listing">
     287                <?php
     288                $in_column = 0;
     289                foreach ( $themes as $theme ) {
     290                        //var_dump($theme);
     291                       
     292                        $name = wp_kses($theme->name, $themes_allowedtags);
     293                        $desc = wp_kses($theme->description, $themes_allowedtags);
     294                        if ( strlen($desc) > 30 )
     295                                $desc =  substr($desc, 0, 30) . '<span class="dots">...</span><span>' . substr($desc, 30) . '</span>';
     296
     297                        $action_links = array();
     298                        $action_links[] = '<a href="' . admin_url('theme-install.php?tab=theme-information&amp;theme=' . $theme->slug .
     299                                                                '&amp;TB_iframe=true&amp;width=600&amp;height=800') . '" class="thickbox onclick" title="' .
     300                                                                attribute_escape($name) . '">' . __('Install') . '</a>';
     301                        $action_links[] = '<a href="' . $theme->preview_url . '&TB_iframe" class="thickbox onclick" title="' .
     302                                                                attribute_escape( sprintf(__('Preview %s'), $name) ) . '">' . __('Preview') . '</a>';
     303
     304                        $action_links = apply_filters('theme_install_action_links', $action_links, $theme);
     305                        $actions = implode ( ' | ', $action_links );
     306                        echo "
     307                <div class='theme-item'>
     308                        <h3>{$theme->name}</h3>
     309                        <img src='{$theme->screenshot_url}' width='150' /><br />
     310                        <div class='theme-item-info'>
     311                                {$desc}
     312                                <br class='line' />
     313                                <span class='action-links'>$actions</span>
     314                        </div>
     315                </div>";
     316                /*
     317                object(stdClass)[59]
     318                  public 'name' => string 'Magazine Basic' (length=14)
     319                  public 'slug' => string 'magazine-basic' (length=14)
     320                  public 'version' => string '1.1' (length=3)
     321                  public 'author' => string 'tinkerpriest' (length=12)
     322                  public 'preview_url' => string 'http://wp-themes.com/?magazine-basic' (length=36)
     323                  public 'screenshot_url' => string 'http://wp-themes.com/wp-content/themes/magazine-basic/screenshot.png' (length=68)
     324                  public 'rating' => float 80
     325                  public 'num_ratings' => int 1
     326                  public 'homepage' => string 'http://wordpress.org/extend/themes/magazine-basic' (length=49)
     327                  public 'description' => string 'A basic magazine style layout with a fully customizable layout through a backend interface. Designed by <a href="http://bavotasan.com">c.bavota</a> of <a href="http://tinkerpriestmedia.com">Tinker Priest Media</a>.' (length=214)
     328                  public 'download_link' => string 'http://wordpress.org/extend/themes/download/magazine-basic.1.1.zip' (length=66)
     329                  */
     330                }
     331               
     332                ?>
     333        </div>
    283334        <table class="widefat" id="install-themes" cellspacing="0">
    284335                <thead>
    285336                        <tr>
  • wp-admin/theme-install.php

     
    1818$parent_file = 'themes.php';
    1919
    2020wp_reset_vars( array('tab', 'paged') );
    21 //wp_enqueue_style( 'theme-install' );
    22 //wp_enqueue_script( 'theme-install' );
    23 //TODO: Combine? This'll do until a new UI is dreamed up though :)
    24 wp_enqueue_style( 'plugin-install' );
    25 wp_enqueue_script( 'plugin-install' );
     21wp_enqueue_style( 'theme-install' );
     22wp_enqueue_script( 'theme-install' );
    2623
    2724add_thickbox();
    2825
     
    3128$tabs['dashboard'] = __('Start Page'); //TODO: Better name?
    3229if ( 'search' == $tab )
    3330        $tabs['search'] = __('Search Results');
     31$tabs['tag-filter'] = __('Tag Filter');
    3432$tabs['featured'] = __('Featured');
    35 $tabs['popular']  = __('Popular');
     33//$tabs['popular']  = __('Popular');
    3634$tabs['new']      = __('Newest');
    3735$tabs['updated']  = __('Recently Updated');
    3836