Changeset 15481 for trunk/wp-admin/plugins.php
- Timestamp:
- 07/30/2010 08:34:54 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/plugins.php
r15324 r15481 123 123 $parent_file = 'plugins.php'; 124 124 125 require_once( './admin-header.php' );125 require_once( ABSPATH . 'wp-admin/admin-header.php' ); 126 126 127 127 echo '<div class="wrap">'; … … 220 220 if ( ! isset($_REQUEST['verify-delete']) ) { 221 221 wp_enqueue_script('jquery'); 222 require_once( './admin-header.php');222 require_once(ABSPATH . 'wp-admin/admin-header.php'); 223 223 ?> 224 224 <div class="wrap"> … … 328 328 $title = __('Plugins'); 329 329 330 require_once( './admin-header.php');330 require_once(ABSPATH . 'wp-admin/admin-header.php'); 331 331 332 332 $invalid = validate_active_plugins(); … … 346 346 <?php 347 347 if ( !isset($_GET['charsout']) && wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $plugin) ) { ?> 348 <iframe style="border:0" width="100%" height="70px" src="<?php echo admin_url('plugins.php?action=error_scrape&plugin=' . esc_attr($plugin) . '&_wpnonce=' . esc_attr($_GET['_error_nonce'])); ?>"></iframe>348 <iframe style="border:0" width="100%" height="70px" src="<?php echo 'plugins.php?action=error_scrape&plugin=' . esc_attr($plugin) . '&_wpnonce=' . esc_attr($_GET['_error_nonce']); ?>"></iframe> 349 349 <?php 350 350 } … … 385 385 $recently_activated = get_option('recently_activated', array()); 386 386 $upgrade_plugins = array(); 387 $network_plugins = array();388 387 $mustuse_plugins = $dropins_plugins = array(); 389 if ( ! is_multisite() || current_user_can('manage_network_plugins') ) {388 if ( ! is_multisite() || ( is_network_admin() && current_user_can('manage_network_plugins') ) ) { 390 389 if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) 391 390 $mustuse_plugins = get_mu_plugins(); … … 414 413 415 414 foreach ( (array) $all_plugins as $plugin_file => $plugin_data) { 415 if ( is_network_admin() ) 416 $is_active = is_plugin_active_for_network($plugin_file); 417 else 418 $is_active = is_plugin_active($plugin_file); 416 419 // Filter into individual sections 417 if ( is_ multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins') ) {420 if ( is_plugin_active_for_network($plugin_file) && !is_network_admin() ) { 418 421 unset( $all_plugins[ $plugin_file ] ); 419 422 continue; 420 } elseif ( is_plugin_active_for_network($plugin_file) ) { 421 $network_plugins[ $plugin_file ] = $plugin_data; 422 } elseif ( is_plugin_active($plugin_file) ) { 423 } elseif ( is_multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins' ) ) { 424 unset( $all_plugins[ $plugin_file ] ); 425 continue; 426 } elseif ( $is_active ) { 423 427 $active_plugins[ $plugin_file ] = $plugin_data; 424 428 } else { 425 if ( isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?429 if ( !is_network_admin() && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated? 426 430 $recent_plugins[ $plugin_file ] = $plugin_data; 427 431 $inactive_plugins[ $plugin_file ] = $plugin_data; … … 440 444 $total_recent_plugins = count($recent_plugins); 441 445 $total_upgrade_plugins = count($upgrade_plugins); 442 $total_network_plugins = count($network_plugins);443 446 $total_mustuse_plugins = count($mustuse_plugins); 444 447 $total_dropins_plugins = count($dropins_plugins); … … 544 547 545 548 if ( 'mustuse' == $context ) { 549 if ( is_multisite() && !is_network_admin() ) 550 continue; 546 551 $is_active = true; 547 552 } elseif ( 'dropins' == $context ) { 553 if ( is_multisite() && !is_network_admin() ) 554 continue; 548 555 $dropins = _get_dropins(); 549 556 $plugin_name = $plugin_file; … … 564 571 } else { 565 572 $is_active_for_network = is_plugin_active_for_network($plugin_file); 566 $is_active = $is_active_for_network || is_plugin_active( $plugin_file ); 567 if ( $is_active_for_network && !is_super_admin() ) 573 if ( is_network_admin() ) 574 $is_active = $is_active_for_network; 575 else 576 $is_active = is_plugin_active( $plugin_file ); 577 578 if ( $is_active_for_network && !is_super_admin() && !is_network_admin() ) 568 579 continue; 569 580 570 if ( $is_active) {581 if ( is_network_admin() ) { 571 582 if ( $is_active_for_network ) { 572 if ( is_super_admin() )583 if ( current_user_can( 'manage_network_plugins' ) ) 573 584 $actions['network_deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>'; 574 585 } else { 575 $actions['deactivate'] = '<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>'; 586 if ( current_user_can( 'manage_network_plugins' ) ) 587 $actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>'; 588 if ( current_user_can('delete_plugins') ) 589 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 576 590 } 577 591 } else { 578 if ( is_multisite() && is_network_only_plugin( $plugin_file ) ) 579 $actions['network_only'] = '<span title="' . __('This plugin can only be activated for all sites in a network') . '">' . __('Network Only') . '</span>'; 580 else 592 if ( $is_active ) { 593 $actions['deactivate'] = '<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>'; 594 } else { 595 if ( is_network_only_plugin( $plugin_file ) && !is_network_admin() ) 596 continue; 597 581 598 $actions['activate'] = '<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>'; 582 599 583 if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) 584 $actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>'; 585 586 if ( current_user_can('delete_plugins') ) 587 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 588 } // end if $is_active 600 if ( current_user_can('delete_plugins') ) 601 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 602 } // end if $is_active 603 } // end if is_network_admin() 589 604 590 605 if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) … … 690 705 <?php do_action( 'pre_current_active_plugins', $all_plugins ) ?> 691 706 692 <form method="post" action=" <?php echo admin_url('plugins.php') ?>">707 <form method="post" action="plugins.php"> 693 708 <?php wp_nonce_field('bulk-manage-plugins') ?> 694 709 <input type="hidden" name="plugin_status" value="<?php echo esc_attr($status) ?>" /> … … 784 799 785 800 <?php 786 include( './admin-footer.php');787 ?> 801 include(ABSPATH . 'wp-admin/admin-footer.php'); 802 ?>
Note: See TracChangeset
for help on using the changeset viewer.