From 86695c7c5f20bef05d922e6b476e07412a573ba1 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 19 Apr 2009 01:11:13 +0000 Subject: [PATCH] Add plugin filter by status. Move help verbage to contextual help. see #9527 git-svn-id: http://svn.automattic.com/wordpress/trunk@10999 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/plugins.php | 87 +++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 45 deletions(-) diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index 755567c26e..7fccf37c94 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -164,6 +164,11 @@ if( !empty($action) ) { wp_enqueue_script('plugin-install'); add_thickbox(); +$help = '

' . sprintf(__('If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the %s directory and it will be automatically deactivated.'), WP_PLUGIN_DIR) . '

'; +$help .= '

' . sprintf(__('You can find additional plugins for your site by using the new Plugin Browser/Installer functionality or by browsing the WordPress Plugin Directory directly and installing manually. To manually install a plugin you generally just need to upload the plugin file into your %2$s directory. Once a plugin has been installed, you may activate it here.'), 'plugin-install.php', WP_PLUGIN_DIR) . '

'; + +add_contextual_help('plugins', $help); + $title = __('Manage Plugins'); require_once('admin-header.php'); @@ -228,16 +233,23 @@ foreach ( (array)$all_plugins as $plugin_file => $plugin_data) { if ( is_plugin_active($plugin_file) ) { $active_plugins[ $plugin_file ] = $plugin_data; } else { - if ( isset( $recently_activated[ $plugin_file ] ) ) //Was the plugin recently activated? + if ( isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated? $recent_plugins[ $plugin_file ] = $plugin_data; - else - $inactive_plugins[ $plugin_file ] = $plugin_data; + $inactive_plugins[ $plugin_file ] = $plugin_data; } } -?> +$total_plugins = count($all_plugins); +$total_inactive_plugins = count($inactive_plugins); +$total_active_plugins = count($active_plugins); +$total_recent_plugins = count($recent_plugins); + +$status = ( isset($_GET['plugin_status']) ) ? $_GET['plugin_status'] : 'all'; +if ( !in_array($status, array('all', 'active', 'inactive', 'recent')) ) + $status = 'all'; +$plugin_array_name = "${status}_plugins"; +$plugins = &$$plugin_array_name; - + {$plugin_data['Title']}"; $i = 0; @@ -343,57 +355,42 @@ function print_plugin_actions($context) { } ?> - -

-
- -
-
- -
- -

%s directory and it will be automatically deactivated.'), WP_PLUGIN_DIR); ?>

- - - -

-

-
- +
- +
- +
- - - -

-
- - -
- -
-
- -
-

-

-

Plugin Browser/Installer functionality, Or by browsing the WordPress Plugin Directory directly and installing manually.'); ?>

-

manually install a plugin you generally just need to upload the plugin file into your %s directory.'), WP_PLUGIN_DIR); ?>

-

-