WordPress.org

Make WordPress Core

Changeset 8218


Ignore:
Timestamp:
06/30/2008 11:12:18 PM (10 years ago)
Author:
ryan
Message:

Plugins page layout improvements from DD32. see #7091

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/plugins.php

    r8095 r8218  
    33
    44$action = '';
    5 foreach( array('activate-selected', 'deactivate-selected', 'delete-selected') as $action_key ) {
     5foreach( array('activate-selected', 'deactivate-selected', 'delete-selected', 'clear-recent-list') as $action_key ) {
    66    if( isset($_POST[$action_key]) ) {
    77        $action = $action_key;
     
    150150                require_once('admin-footer.php');
    151151                exit;
    152             }
     152            } //Endif verify-delete
    153153            $delete_result = delete_plugins($plugins);
    154154
    155155            wp_cache_delete('plugins', 'plugins');
    156 
     156            break;
     157        case 'clear-recent-list':
     158            update_option('recently_activated', array());
    157159            break;
    158160    }
     
    198200<?php
    199201
     202$all_plugins = get_plugins();
    200203$active_plugins = array();
    201 $available_plugins = array();
     204$inactive_plugins = array();
    202205$recent_plugins = array();
    203206$recently_activated = (array)get_option('recently_activated');
     
    209212if( $recently_activated != get_option('recently_activated') ) //If array changed, update it.
    210213    update_option('recently_activated', $recently_activated);
    211 
    212 $all_plugins = get_plugins();
    213214
    214215$plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
     
    224225        $plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>';
    225226
     227    //Filter into individual sections
    226228    if ( is_plugin_active($plugin_file) ) {
    227229        $active_plugins[ $plugin_file ] = $plugin_data;
     
    230232            $recent_plugins[ $plugin_file ] = $plugin_data;
    231233        else
    232             $available_plugins[ $plugin_file ] = $plugin_data;
     234            $inactive_plugins[ $plugin_file ] = $plugin_data;
    233235    }
    234236}
     
    290292?>
    291293
     294<?php if ( ! empty($active_plugins) ) : ?>
    292295<h3 id="currently-active"><?php _e('Currently Active Plugins') ?></h3>
    293296<form method="post" action="<?php echo admin_url('plugins.php') ?>">
     
    304307
    305308<p><?php printf(__('If something goes wrong with a plugin and you can&#8217;t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.'), WP_PLUGIN_DIR); ?></p>
     309<?php endif; ?>
    306310
    307311<?php if ( ! empty($recent_plugins) ) : ?>
    308312<h3 id="recent-plugins"><?php _e('Recently Active Plugins') ?></h3>
     313<p><?php _e('The following plugins were recently active. When a plugin has been inactive for more than 7 days it will be moved to the Inactive plugin list.') ?></p>
    309314<form method="post" action="<?php echo admin_url('plugins.php') ?>">
    310315<?php wp_nonce_field('bulk-manage-plugins') ?>
     
    316321        <input type="submit" name="delete-selected" value="<?php _e('Delete') ?>" class="button-secondary" />
    317322<?php endif; ?>
     323        <input type="submit" name="clear-recent-list" value="<?php _e('Clear List') ?>" class="button-secondary" />
    318324    </div>
    319325</div>
     
    323329<?php endif; ?>
    324330
    325 <h3 id="available-plugins"><?php _e('Available Plugins') ?></h3>
     331<?php if ( ! empty($inactive_plugins) ) : ?>
     332<h3 id="inactive-plugins"><?php _e('Inactive Plugins') ?></h3>
    326333<form method="post" action="<?php echo admin_url('plugins.php') ?>">
    327334<?php wp_nonce_field('bulk-manage-plugins') ?>
    328335
    329 <?php if ( ! empty($available_plugins) ) : ?>
    330336<div class="tablenav">
    331337    <div class="alignleft">
     
    337343</div>
    338344<br class="clear" />
    339 <?php print_plugins_table($available_plugins, 'available') ?>
     345<?php print_plugins_table($inactive_plugins, 'inactive') ?>
    340346</form>
     347<?php endif; ?>
     348
     349<?php if ( empty($all_plugins) ) : ?>
     350<p><?php _e('You do not appear to have any plugins available at this time.') ?></p>
    341351<?php endif; ?>
    342352
Note: See TracChangeset for help on using the changeset viewer.