Make WordPress Core

Ticket #20104: 20104.diff

File 20104.diff, 3.5 KB (added by abackstrom, 13 years ago)
  • wp-admin/includes/class-wp-plugins-list-table.php

    diff --git wp-admin/includes/class-wp-plugins-list-table.php wp-admin/includes/class-wp-plugins-list-table.php
    index 24deb0b..0c357af 100644
    class WP_Plugins_List_Table extends WP_List_Table { 
    8686                        // Filter into individual sections
    8787                        if ( is_multisite() && is_network_only_plugin( $plugin_file ) && !$screen->is_network ) {
    8888                                unset( $plugins['all'][ $plugin_file] );
    89                         } elseif ( is_plugin_active_for_network($plugin_file) && !$screen->is_network ) {
    90                                 unset( $plugins['all'][ $plugin_file ] );
    9189                        } elseif ( is_multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins' ) ) {
    9290                                $plugins['network'][ $plugin_file ] = $plugin_data;
    9391                        } elseif ( ( !$screen->is_network && is_plugin_active( $plugin_file ) )
    class WP_Plugins_List_Table extends WP_List_Table { 
    353351                        else
    354352                                $is_active = is_plugin_active( $plugin_file );
    355353
    356                         if ( $is_active_for_network && !is_super_admin() && !$screen->is_network )
    357                                 return;
    358 
    359354                        if ( $screen->is_network ) {
    360355                                if ( $is_active_for_network ) {
    361356                                        if ( current_user_can( 'manage_network_plugins' ) )
    class WP_Plugins_List_Table extends WP_List_Table { 
    367362                                                $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
    368363                                }
    369364                        } else {
    370                                 if ( $is_active ) {
     365                                if ( $is_active_for_network ) {
     366                                        $actions['network_active'] = 'Network Active';
     367                                } elseif ( $is_active ) {
    371368                                        $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
    372369                                } else {
    373370                                        $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
    class WP_Plugins_List_Table extends WP_List_Table { 
    387384
    388385                $class = $is_active ? 'active' : 'inactive';
    389386                $checkbox_id =  "checkbox_" . md5($plugin_data['Name']);
    390                 $checkbox = in_array( $status, array( 'mustuse', 'dropins' ) ) ? '' : "<input type='checkbox' name='checked[]' value='" . esc_attr( $plugin_file ) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $plugin_data['Name'] . "</label>";
     387
     388                if ( ! $screen->is_network && isset( $is_active_for_network ) && $is_active_for_network )
     389                        $checkbox = '';
     390                else
     391                        $checkbox = in_array( $status, array( 'mustuse', 'dropins' ) ) ? '' : "<input type='checkbox' name='checked[]' value='" . esc_attr( $plugin_file ) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $plugin_data['Name'] . "</label>";
     392
    391393                if ( 'dropins' != $context ) {
    392394                        $description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : '&nbsp;' ) . '</p>';
    393395                        $plugin_name = $plugin_data['Name'];