summaryrefslogtreecommitdiffstats
path: root/wp-admin/plugins.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-03 17:00:59 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-03 17:00:59 +0000
commit2b6348978ec434e2fa4114085783cf9ada097b22 (patch)
treea3745bb9ace00b0a8f687bc8c1bfb74bb885077c /wp-admin/plugins.php
parent102dc1d903d95fd7abdf2243d7e047b4b20099d3 (diff)
downloadwordpress-mu-2b6348978ec434e2fa4114085783cf9ada097b22.tar.gz
wordpress-mu-2b6348978ec434e2fa4114085783cf9ada097b22.tar.xz
wordpress-mu-2b6348978ec434e2fa4114085783cf9ada097b22.zip
WP Merge to rev 8249
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1347 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/plugins.php')
-rw-r--r--wp-admin/plugins.php31
1 files changed, 20 insertions, 11 deletions
diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php
index ee5d101..00742d1 100644
--- a/wp-admin/plugins.php
+++ b/wp-admin/plugins.php
@@ -9,7 +9,7 @@ if( $menu_perms[ 'plugins' ] != 1 )
return;
$action = '';
-foreach( array('activate-selected', 'deactivate-selected', 'delete-selected') as $action_key ) {
+foreach( array('activate-selected', 'deactivate-selected', 'delete-selected', 'clear-recent-list') as $action_key ) {
if( isset($_POST[$action_key]) ) {
$action = $action_key;
break;
@@ -156,11 +156,13 @@ if( !empty($action) ) {
<?php
require_once('admin-footer.php');
exit;
- }
- //$delete_result = delete_plugins($plugins);
+ } //Endif verify-delete
+ $delete_result = delete_plugins($plugins);
wp_cache_delete('plugins', 'plugins');
-
+ break;
+ case 'clear-recent-list':
+ update_option('recently_activated', array());
break;
}
}
@@ -204,8 +206,9 @@ validate_active_plugins();
<p><?php _e('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.'); ?></p>
<?php
+$all_plugins = apply_filters( 'all_plugins', get_plugins() );
$active_plugins = array();
-$available_plugins = array();
+$inactive_plugins = array();
$recent_plugins = array();
$recently_activated = (array)get_option('recently_activated');
@@ -216,8 +219,6 @@ foreach( $recently_activated as $key => $time )
if( $recently_activated != get_option('recently_activated') ) //If array changed, update it.
update_option('recently_activated', $recently_activated);
-$all_plugins = apply_filters( 'all_plugins', get_plugins() );
-
$plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
foreach( (array)$all_plugins as $plugin_file => $plugin_data) {
@@ -230,13 +231,14 @@ foreach( (array)$all_plugins as $plugin_file => $plugin_data) {
if( ! empty($plugin_data['Author']) )
$plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>';
+ //Filter into individual sections
if ( is_plugin_active($plugin_file) ) {
$active_plugins[ $plugin_file ] = $plugin_data;
} else {
if ( isset( $recently_activated[ $plugin_file ] ) ) //Was the plugin recently activated?
$recent_plugins[ $plugin_file ] = $plugin_data;
else
- $available_plugins[ $plugin_file ] = $plugin_data;
+ $inactive_plugins[ $plugin_file ] = $plugin_data;
}
}
@@ -296,6 +298,7 @@ function print_plugins_table($plugins, $context = '') {
} //End print_plugins_table()
?>
+<?php if ( ! empty($active_plugins) ) : ?>
<h3 id="currently-active"><?php _e('Currently Active Plugins') ?></h3>
<form method="post" action="<?php echo admin_url('plugins.php') ?>">
<?php wp_nonce_field('bulk-manage-plugins') ?>
@@ -310,9 +313,11 @@ function print_plugins_table($plugins, $context = '') {
</form>
<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>
+<?php endif; ?>
<?php if ( ! empty($recent_plugins) ) : ?>
<h3 id="recent-plugins"><?php _e('Recently Active Plugins') ?></h3>
+<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>
<form method="post" action="<?php echo admin_url('plugins.php') ?>">
<?php wp_nonce_field('bulk-manage-plugins') ?>
@@ -326,20 +331,24 @@ function print_plugins_table($plugins, $context = '') {
</form>
<?php endif; ?>
-<h3 id="available-plugins"><?php _e('Available Plugins') ?></h3>
+<?php if ( ! empty($inactive_plugins) ) : ?>
+<h3 id="inactive-plugins"><?php _e('Inactive Plugins') ?></h3>
<form method="post" action="<?php echo admin_url('plugins.php') ?>">
<?php wp_nonce_field('bulk-manage-plugins') ?>
-<?php if ( ! empty($available_plugins) ) : ?>
<div class="tablenav">
<div class="alignleft">
<input type="submit" name="activate-selected" value="<?php _e('Activate') ?>" class="button-secondary" />
</div>
</div>
<br class="clear" />
-<?php print_plugins_table($available_plugins, 'available') ?>
+<?php print_plugins_table($inactive_plugins, 'inactive') ?>
</form>
<?php endif; ?>
+
+<?php if ( empty($all_plugins) ) : ?>
+<p><?php _e('You do not appear to have any plugins available at this time.') ?></p>
+<?php endif; ?>
<?php if( is_site_admin() ) { ?>
<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.'), PLUGINDIR); ?></p>