Changeset 16235 for trunk/wp-admin/includes/class-wp-plugins-list-table.php
- Timestamp:
- 11/08/2010 03:43:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-plugins-list-table.php
r16205 r16235 58 58 ); 59 59 60 if ( ! is_multisite() || ( $this->screen->is_network && current_user_can('manage_network_plugins') ) ) { 60 $screen = get_current_screen(); 61 62 if ( ! is_multisite() || ( $screen->is_network && current_user_can('manage_network_plugins') ) ) { 61 63 if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) 62 64 $plugins['mustuse'] = get_mu_plugins(); … … 86 88 foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) { 87 89 // Filter into individual sections 88 if ( is_plugin_active_for_network($plugin_file) && !$ this->screen->is_network ) {90 if ( is_plugin_active_for_network($plugin_file) && !$screen->is_network ) { 89 91 unset( $plugins['all'][ $plugin_file ] ); 90 92 continue; 91 93 } elseif ( is_multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins' ) ) { 92 94 $plugins['network'][ $plugin_file ] = $plugin_data; 93 } elseif ( ( !$ this->screen->is_network && is_plugin_active( $plugin_file ) )94 || ( $ this->screen->is_network && is_plugin_active_for_network( $plugin_file ) ) ) {95 } elseif ( ( !$screen->is_network && is_plugin_active( $plugin_file ) ) 96 || ( $screen->is_network && is_plugin_active_for_network( $plugin_file ) ) ) { 95 97 $plugins['active'][ $plugin_file ] = $plugin_data; 96 98 } else { 97 if ( !$ this->screen->is_network && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?99 if ( !$screen->is_network && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated? 98 100 $plugins['recently_activated'][ $plugin_file ] = $plugin_data; 99 101 $plugins['inactive'][ $plugin_file ] = $plugin_data; … … 129 131 } 130 132 131 $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page") );133 $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ) ); 132 134 133 135 $start = ( $page - 1 ) * $plugins_per_page; … … 254 256 $actions = array(); 255 257 258 $screen = get_current_screen(); 259 256 260 if ( 'active' != $status ) { 257 $action = $ this->screen->is_network ? 'network-activate-selected' : 'activate-selected';261 $action = $screen->is_network ? 'network-activate-selected' : 'activate-selected'; 258 262 $actions[ $action ] = __( 'Activate' ); 259 263 } … … 262 266 $actions['deactivate-selected'] = __( 'Deactivate' ); 263 267 264 if ( !is_multisite() || $ this->screen->is_network ) {268 if ( !is_multisite() || $screen->is_network ) { 265 269 if ( current_user_can( 'update_plugins' ) ) 266 270 $actions['update-selected'] = __( 'Update' ); … … 302 306 303 307 $context = $status; 308 309 $screen = get_current_screen(); 304 310 305 311 foreach ( $this->items as $plugin_file => $plugin_data ) { … … 314 320 315 321 if ( 'mustuse' == $context ) { 316 if ( is_multisite() && !$ this->screen->is_network )322 if ( is_multisite() && !$screen->is_network ) 317 323 continue; 318 324 $is_active = true; 319 325 } elseif ( 'dropins' == $context ) { 320 if ( is_multisite() && !$ this->screen->is_network )326 if ( is_multisite() && !$screen->is_network ) 321 327 continue; 322 328 $dropins = _get_dropins(); … … 338 344 } else { 339 345 $is_active_for_network = is_plugin_active_for_network($plugin_file); 340 if ( $ this->screen->is_network )346 if ( $screen->is_network ) 341 347 $is_active = $is_active_for_network; 342 348 else 343 349 $is_active = is_plugin_active( $plugin_file ); 344 350 345 if ( $is_active_for_network && !is_super_admin() && !$ this->screen->is_network )351 if ( $is_active_for_network && !is_super_admin() && !$screen->is_network ) 346 352 continue; 347 353 348 if ( $ this->screen->is_network ) {354 if ( $screen->is_network ) { 349 355 if ( $is_active_for_network ) { 350 356 if ( current_user_can( 'manage_network_plugins' ) ) … … 360 366 $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>'; 361 367 } else { 362 if ( is_network_only_plugin( $plugin_file ) && !$ this->screen->is_network )368 if ( is_network_only_plugin( $plugin_file ) && !$screen->is_network ) 363 369 continue; 364 370 … … 368 374 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 369 375 } // end if $is_active 370 } // end if $ this->screen->is_network376 } // end if $screen->is_network 371 377 372 378 if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
Note: See TracChangeset
for help on using the changeset viewer.