Ticket #15414: 15414.plugin.search.patch
File 15414.plugin.search.patch, 3.8 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/class-wp-plugins-list-table.php
15 15 if ( empty( $default_status ) ) 16 16 $default_status = 'all'; 17 17 $status = isset( $_REQUEST['plugin_status'] ) ? $_REQUEST['plugin_status'] : $default_status; 18 if ( !in_array( $status, array( 'all', 'active', 'inactive', 'recently_activated', 'upgrade', 'network', 'mustuse', 'dropins' , 'search') ) )18 if ( !in_array( $status, array( 'all', 'active', 'inactive', 'recently_activated', 'upgrade', 'network', 'mustuse', 'dropins' ) ) ) 19 19 $status = 'all'; 20 if ( $status != $default_status && 'search' != $status)20 if ( $status != $default_status ) 21 21 update_user_meta( get_current_user_id(), 'plugins_last_view', $status ); 22 22 23 23 $page = $this->get_pagenum(); … … 48 48 49 49 $plugins = array( 50 50 'all' => apply_filters( 'all_plugins', get_plugins() ), 51 'search' => array(),52 51 'active' => array(), 53 52 'inactive' => array(), 54 53 'recently_activated' => array(), … … 103 102 $plugins['upgrade'] = array(); 104 103 105 104 if ( $s ) { 106 $status = 'search'; 107 $plugins['search'] = array_filter( $plugins['all'], array( &$this, '_search_callback' ) ); 105 $plugins[$status] = array_filter( $plugins[$status], array( &$this, '_search_callback' ) ); 108 106 } 109 107 110 108 $totals = array(); 111 109 foreach ( $plugins as $type => $list ) 112 110 $totals[ $type ] = count( $list ); 113 111 114 if ( empty( $plugins[ $status ] ) && !in_array( $status, array( 'all', 'search' ) ) )115 $status = 'all';116 117 112 $this->items = array(); 118 113 foreach ( $plugins[ $status ] as $plugin_file => $plugin_data ) { 119 114 // Translate, Apply Markup, Sanitize HTML … … 194 189 ); 195 190 } 196 191 197 function display_tablenav( $which ) {198 global $status;199 192 200 if ( !in_array( $status, array( 'mustuse', 'dropins' ) ) )201 parent::display_tablenav( $which );202 }203 193 204 194 function get_views() { 205 195 global $totals, $status; … … 234 224 case 'upgrade': 235 225 $text = _n( 'Upgrade Available <span class="count">(%s)</span>', 'Upgrade Available <span class="count">(%s)</span>', $count ); 236 226 break; 237 case 'search':238 $text = _n( 'Search Results <span class="count">(%s)</span>', 'Search Results <span class="count">(%s)</span>', $count );239 break;240 227 } 241 228 242 229 $status_links[$type] = sprintf( "<a href='%s' %s>%s</a>", -
wp-admin/plugins.php
363 363 <p class="search-box"> 364 364 <label class="screen-reader-text" for="plugin-search-input"><?php _e( 'Search Plugins' ); ?>:</label> 365 365 <input type="text" id="plugin-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 366 <input type="hidden" name="plugin_status" value="<?php echo esc_attr($status) ?>" /> 366 367 <?php submit_button( __( 'Search Installed Plugins' ), 'button', '', false ); ?> 367 368 </p> 368 369 </form> … … 377 378 378 379 <?php 379 380 if ( 'mustuse' == $status ) 380 echo '< br class="clear"><p>' . __( 'Files in the <code>/wp-content/mu-plugins</code> directory are executed automatically.' ) . '</p>';381 echo '<div class="alignleft clear"><p>' . __( 'Files in the <code>/wp-content/mu-plugins</code> directory are executed automatically.' ) . '</p></div>'; 381 382 elseif ( 'dropins' == $status ) 382 echo '< br class="clear"><p>' . __( 'Drop-ins are advanced plugins in the <code>/wp-content</code> directory that replace WordPress functionality when present.' ) . '</p>';383 echo '<<div class="alignleft clear"><p>' . __( 'Drop-ins are advanced plugins in the <code>/wp-content</code> directory that replace WordPress functionality when present.' ) . '</p></div>'; 383 384 ?> 384 385 385 386 <?php $wp_list_table->display(); ?>