Changeset 11029
- Timestamp:
- 04/21/2009 07:17:44 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/plugins.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/plugins.php
r11027 r11029 21 21 $plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : ''; 22 22 23 if( !empty($action) ) { 24 switch( $action ) { 23 $status = isset($_REQUEST['plugin_status']) ? $_REQUEST['plugin_status'] : 'all'; 24 if ( !in_array($status, array('all', 'active', 'inactive', 'recent', 'upgrade', 'search')) ) 25 $status = 'all'; 26 27 $page = isset($_REQUEST['paged']) ? $_REQUEST['paged'] : 1; 28 29 if ( !empty($action) ) { 30 switch ( $action ) { 25 31 case 'activate': 26 32 check_admin_referer('activate-plugin_' . $plugin); … … 33 39 update_option('recently_activated', $recent); 34 40 } 35 wp_redirect( 'plugins.php?activate=true'); // overrides the ?error=true one above41 wp_redirect("plugins.php?activate=true&plugin_status=$status&paged=$page"); // overrides the ?error=true one above 36 42 exit; 37 43 break; … … 48 54 update_option('recently_activated', $recent); 49 55 50 wp_redirect( 'plugins.php?activate-multi=true');56 wp_redirect("plugins.php?activate-multi=true&plugin_status=$status&paged=$page"); 51 57 exit; 52 58 break; … … 66 72 deactivate_plugins($plugin); 67 73 update_option('recently_activated', array($plugin => time()) + (array)get_option('recently_activated')); 68 wp_redirect( 'plugins.php?deactivate=true');74 wp_redirect("plugins.php?deactivate=true&plugin_status=$status&paged=$page"); 69 75 exit; 70 76 break; … … 76 82 $deactivated[ $plugin ] = time(); 77 83 update_option('recently_activated', $deactivated + (array)get_option('recently_activated')); 78 wp_redirect( 'plugins.php?deactivate-multi=true');84 wp_redirect("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page"); 79 85 exit; 80 86 break; … … 272 278 return false; 273 279 } 274 $ _GET['plugin_status']= 'search';280 $status = 'search'; 275 281 $search_plugins = array_filter($all_plugins, '_search_plugins_filter_callback'); 276 282 $total_search_plugins = count($search_plugins); 277 283 } 278 284 279 $status = isset($_GET['plugin_status']) ? $_GET['plugin_status'] : 'all';280 if ( !in_array($status, array('all', 'active', 'inactive', 'recent', 'upgrade', 'search')) )281 $status = 'all';282 285 $plugin_array_name = "${status}_plugins"; 283 286 $plugins = &$$plugin_array_name; 284 287 285 288 //Paging. 286 $page = isset($_GET['paged']) ? $_GET['paged'] : 1;287 289 $total_this_page = "total_{$status}_plugins"; 288 290 $total_this_page = $$total_this_page; … … 316 318 */ 317 319 function print_plugins_table($plugins, $context = '') { 320 global $page; 318 321 ?> 319 322 <table class="widefat" cellspacing="0" id="<?php echo $context ?>-plugins-table"> … … 349 352 350 353 if ( $is_active ) 351 $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file , 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';354 $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>'; 352 355 else //Inactive or Recently deactivated 353 $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file , 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';356 $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>'; 354 357 355 358 if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) … … 425 428 <form method="post" action="<?php echo admin_url('plugins.php') ?>"> 426 429 <?php wp_nonce_field('bulk-manage-plugins') ?> 430 <input type="hidden" name="plugin_status" value="<?php echo attribute_escape($status) ?>" /> 431 <input type="hidden" name="paged" value="<?php echo attribute_escape($page) ?>" /> 427 432 428 433 <ul class="subsubsub">
Note: See TracChangeset
for help on using the changeset viewer.