diff --git wp-admin/includes/class-wp-plugins-list-table.php wp-admin/includes/class-wp-plugins-list-table.php
index a1cbeec..aaddef6 100644
|
|
|
class WP_Plugins_List_Table extends WP_List_Table { |
| 53 | 53 | |
| 54 | 54 | $screen = $this->screen; |
| 55 | 55 | |
| 56 | | if ( ! is_multisite() || ( $screen->is_network && current_user_can('manage_network_plugins') ) ) { |
| | 56 | if ( ! is_multisite() || ( $screen->in_admin( 'network' ) && current_user_can('manage_network_plugins') ) ) { |
| 57 | 57 | if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) |
| 58 | 58 | $plugins['mustuse'] = get_mu_plugins(); |
| 59 | 59 | if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) ) |
| … |
… |
class WP_Plugins_List_Table extends WP_List_Table { |
| 72 | 72 | |
| 73 | 73 | set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), DAY_IN_SECONDS ); |
| 74 | 74 | |
| 75 | | if ( ! $screen->is_network ) { |
| | 75 | if ( ! $screen->in_admin( 'network' ) ) { |
| 76 | 76 | $recently_activated = get_option( 'recently_activated', array() ); |
| 77 | 77 | |
| 78 | 78 | foreach ( $recently_activated as $key => $time ) |
| … |
… |
class WP_Plugins_List_Table extends WP_List_Table { |
| 83 | 83 | |
| 84 | 84 | foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) { |
| 85 | 85 | // Filter into individual sections |
| 86 | | if ( is_multisite() && ! $screen->is_network && is_network_only_plugin( $plugin_file ) ) { |
| | 86 | if ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) ) { |
| 87 | 87 | unset( $plugins['all'][ $plugin_file ] ); |
| 88 | | } elseif ( ! $screen->is_network && is_plugin_active_for_network( $plugin_file ) ) { |
| | 88 | } elseif ( ! $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) { |
| 89 | 89 | unset( $plugins['all'][ $plugin_file ] ); |
| 90 | | } elseif ( ( ! $screen->is_network && is_plugin_active( $plugin_file ) ) |
| 91 | | || ( $screen->is_network && is_plugin_active_for_network( $plugin_file ) ) ) { |
| | 90 | } elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) ) |
| | 91 | || ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) { |
| 92 | 92 | $plugins['active'][ $plugin_file ] = $plugin_data; |
| 93 | 93 | } else { |
| 94 | | if ( ! $screen->is_network && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated? |
| | 94 | if ( ! $screen->in_admin( 'network' ) && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated? |
| 95 | 95 | $plugins['recently_activated'][ $plugin_file ] = $plugin_data; |
| 96 | 96 | $plugins['inactive'][ $plugin_file ] = $plugin_data; |
| 97 | 97 | } |
| … |
… |
class WP_Plugins_List_Table extends WP_List_Table { |
| 237 | 237 | $actions = array(); |
| 238 | 238 | |
| 239 | 239 | if ( 'active' != $status ) |
| 240 | | $actions['activate-selected'] = $this->screen->is_network ? __( 'Network Activate' ) : __( 'Activate' ); |
| | 240 | $actions['activate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Activate' ) : __( 'Activate' ); |
| 241 | 241 | |
| 242 | 242 | if ( 'inactive' != $status && 'recent' != $status ) |
| 243 | | $actions['deactivate-selected'] = $this->screen->is_network ? __( 'Network Deactivate' ) : __( 'Deactivate' ); |
| | 243 | $actions['deactivate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Deactivate' ) : __( 'Deactivate' ); |
| 244 | 244 | |
| 245 | | if ( !is_multisite() || $this->screen->is_network ) { |
| | 245 | if ( !is_multisite() || $this->screen->in_admin( 'network' ) ) { |
| 246 | 246 | if ( current_user_can( 'update_plugins' ) ) |
| 247 | 247 | $actions['update-selected'] = __( 'Update' ); |
| 248 | 248 | if ( current_user_can( 'delete_plugins' ) && ( 'active' != $status ) ) |
| … |
… |
class WP_Plugins_List_Table extends WP_List_Table { |
| 269 | 269 | |
| 270 | 270 | echo '<div class="alignleft actions">'; |
| 271 | 271 | |
| 272 | | if ( ! $this->screen->is_network && 'recently_activated' == $status ) |
| | 272 | if ( ! $this->screen->in_admin( 'network' ) && 'recently_activated' == $status ) |
| 273 | 273 | submit_button( __( 'Clear List' ), 'button', 'clear-recent-list', false ); |
| 274 | 274 | elseif ( 'top' == $which && 'mustuse' == $status ) |
| 275 | 275 | echo '<p>' . sprintf( __( 'Files in the <code>%s</code> directory are executed automatically.' ), str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) ) . '</p>'; |
| … |
… |
class WP_Plugins_List_Table extends WP_List_Table { |
| 289 | 289 | function display_rows() { |
| 290 | 290 | global $status; |
| 291 | 291 | |
| 292 | | if ( is_multisite() && ! $this->screen->is_network && in_array( $status, array( 'mustuse', 'dropins' ) ) ) |
| | 292 | if ( is_multisite() && ! $this->screen->in_admin( 'network' ) && in_array( $status, array( 'mustuse', 'dropins' ) ) ) |
| 293 | 293 | return; |
| 294 | 294 | |
| 295 | 295 | foreach ( $this->items as $plugin_file => $plugin_data ) |
| … |
… |
class WP_Plugins_List_Table extends WP_List_Table { |
| 331 | 331 | if ( $plugin_data['Description'] ) |
| 332 | 332 | $description .= '<p>' . $plugin_data['Description'] . '</p>'; |
| 333 | 333 | } else { |
| 334 | | if ( $screen->is_network ) |
| | 334 | if ( $screen->in_admin( 'network' ) ) |
| 335 | 335 | $is_active = is_plugin_active_for_network( $plugin_file ); |
| 336 | 336 | else |
| 337 | 337 | $is_active = is_plugin_active( $plugin_file ); |
| 338 | 338 | |
| 339 | | if ( $screen->is_network ) { |
| | 339 | if ( $screen->in_admin( 'network' ) ) { |
| 340 | 340 | if ( $is_active ) { |
| 341 | 341 | if ( current_user_can( 'manage_network_plugins' ) ) |
| 342 | 342 | $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="' . esc_attr__('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>'; |
| … |
… |
class WP_Plugins_List_Table extends WP_List_Table { |
| 355 | 355 | if ( ! is_multisite() && current_user_can('delete_plugins') ) |
| 356 | 356 | $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="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; |
| 357 | 357 | } // end if $is_active |
| 358 | | } // end if $screen->is_network |
| | 358 | } // end if $screen->in_admin( 'network' ) |
| 359 | 359 | |
| 360 | | if ( ( ! is_multisite() || $screen->is_network ) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) |
| | 360 | if ( ( ! is_multisite() || $screen->in_admin( 'network' ) ) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) |
| 361 | 361 | $actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . esc_attr__('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>'; |
| 362 | 362 | } // end if $context |
| 363 | 363 | |
| 364 | | $prefix = $screen->is_network ? 'network_admin_' : ''; |
| | 364 | $prefix = $screen->in_admin( 'network' ) ? 'network_admin_' : ''; |
| 365 | 365 | $actions = apply_filters( $prefix . 'plugin_action_links', array_filter( $actions ), $plugin_file, $plugin_data, $context ); |
| 366 | 366 | $actions = apply_filters( $prefix . "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context ); |
| 367 | 367 | |