- Timestamp:
- 03/02/2012 10:26:58 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-theme-install-list-table.php
r20094 r20096 8 8 * @access private 9 9 */ 10 class WP_Theme_Install_List_Table extends WP_ Themes_List_Table {10 class WP_Theme_Install_List_Table extends WP_List_Table { 11 11 12 var $features = array(); 12 function __construct() { 13 parent::__construct( array( 14 'ajax' => true, 15 ) ); 16 } 13 17 14 18 function ajax_user_can() { 15 return current_user_can( 'install_themes');19 return current_user_can('install_themes'); 16 20 } 17 21 … … 19 23 include( ABSPATH . 'wp-admin/includes/theme-install.php' ); 20 24 21 global $tabs, $tab, $paged, $type, $theme_field_defaults; 25 global $tabs, $tab, $paged, $type, $term, $theme_field_defaults; 26 22 27 wp_reset_vars( array( 'tab' ) ); 23 24 $search_terms = array();25 $search_string = '';26 if ( ! empty( $_REQUEST['s'] ) ){27 $search_string = strtolower( stripslashes( $_REQUEST['s'] ) );28 $search_terms = array_unique( array_filter( array_map( 'trim', explode( ',', $search_string ) ) ) );29 }30 31 if ( ! empty( $_REQUEST['features'] ) )32 $this->features = $_REQUEST['features'];33 28 34 29 $paged = $this->get_pagenum(); … … 61 56 case 'search': 62 57 $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : ''; 58 $term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : ''; 59 63 60 switch ( $type ) { 64 61 case 'tag': 65 $args['tag'] = array_map( 'sanitize_title_with_dashes', $search_terms ); 62 $terms = explode( ',', $term ); 63 $terms = array_map( 'trim', $terms ); 64 $terms = array_map( 'sanitize_key', $terms ); 65 $args['tag'] = $terms; 66 66 break; 67 67 case 'term': 68 $args['search'] = $ search_string;68 $args['search'] = $term; 69 69 break; 70 70 case 'author': 71 $args['author'] = $ search_string;71 $args['author'] = $term; 72 72 break; 73 73 } 74 74 75 if ( ! empty( $this->features ) ) { 76 $args['tag'] = $this->features; 77 $_REQUEST['s'] = implode( ',', $this->features ); 75 if ( !empty( $_REQUEST['features'] ) ) { 76 $terms = $_REQUEST['features']; 77 $terms = array_map( 'trim', $terms ); 78 $terms = array_map( 'sanitize_key', $terms ); 79 $args['tag'] = $terms; 80 $_REQUEST['s'] = implode( ',', $terms ); 78 81 $_REQUEST['type'] = 'tag'; 79 82 } … … 93 96 } 94 97 95 if ( ! 98 if ( !$args ) 96 99 return; 97 100 … … 106 109 'total_items' => $api->info['results'], 107 110 'per_page' => $per_page, 108 'infinite_scroll' => true,109 111 ) ); 110 112 } … … 127 129 } 128 130 131 function get_columns() { 132 return array(); 133 } 134 129 135 function display() { 136 130 137 wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 131 138 ?> … … 143 150 </div> 144 151 145 <?php 146 parent::tablenav( 'bottom' ); 152 <div class="tablenav bottom themes"> 153 <?php $this->pagination( 'bottom' ); ?> 154 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" /> 155 <br class="clear" /> 156 </div> 157 <?php 147 158 } 148 159 … … 160 171 <?php } // end foreach $theme_names 161 172 } 162 163 /**164 * Send required variables to JavaScript land165 *166 * @since 3.4167 * @access private168 *169 * @uses $tab Global; current tab within Themes->Install screen170 * @uses $type Global; type of search.171 */172 function _js_vars() {173 global $tab, $type;174 parent::_js_vars( compact( $tab, $type ) );175 }176 173 }
Note: See TracChangeset
for help on using the changeset viewer.