Make WordPress Core

Changeset 10559


Ignore:
Timestamp:
02/12/2009 06:31:16 PM (16 years ago)
Author:
ryan
Message:

Theme install updates from DD32. see #8652

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r10553 r10559  
    4848        }
    4949    }
    50 
     50    //var_dump(array($args, $res));
    5151    return apply_filters('themes_api_result', $res, $action, $args);
    5252}
     
    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':
     
    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);
    268 
    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             ));
    277 
    278             if ( $page_links )
    279                 echo "\t\t<div class='tablenav-pages'>$page_links</div>";
     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);
     271
     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        ));
     280
     281        if ( $page_links )
     282            echo "\t\t<div class='tablenav-pages'>$page_links</div>";
    280283?>
    281284        <br class="clear" />
     285    </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        ?>
    282333    </div>
    283334    <table class="widefat" id="install-themes" cellspacing="0">
  • trunk/wp-admin/theme-install.php

    r10553 r10559  
    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();
     
    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');
Note: See TracChangeset for help on using the changeset viewer.