From b0b9655b12f4d116f6d3788786fea2acadd6e403 Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Fri, 18 Jul 2014 04:49:19 +0000 Subject: [PATCH] Install Plugins screen: * Utilize the (currently-named) filter bar from the Add Themes screen. * Move the upload link to the h2, also like the Add Themes screen. see #28673. git-svn-id: https://develop.svn.wordpress.org/trunk@29218 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/forms.css | 2 +- .../class-wp-plugin-install-list-table.php | 37 ++++++++++++++++--- src/wp-admin/includes/plugin-install.php | 17 +++++++-- src/wp-admin/plugin-install.php | 8 +++- 4 files changed, 53 insertions(+), 11 deletions(-) diff --git a/src/wp-admin/css/forms.css b/src/wp-admin/css/forms.css index 14cfe850ca..98ab46ea23 100644 --- a/src/wp-admin/css/forms.css +++ b/src/wp-admin/css/forms.css @@ -465,7 +465,7 @@ p.search-box { } .search-box input[name="s"], -#search-plugins input[name="s"], +.tablenav .search-plugins input[name="s"], .tagsdiv .newtag { float: left; height: 28px; diff --git a/src/wp-admin/includes/class-wp-plugin-install-list-table.php b/src/wp-admin/includes/class-wp-plugin-install-list-table.php index 9454a0f29e..a6f3356282 100644 --- a/src/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/src/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -26,10 +26,9 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { // These are the tabs which are shown on the page $tabs = array(); - $tabs['dashboard'] = __( 'Search' ); + if ( 'search' == $tab ) $tabs['search'] = __( 'Search Results' ); - $tabs['upload'] = __( 'Upload' ); $tabs['featured'] = _x( 'Featured', 'Plugin Installer' ); $tabs['popular'] = _x( 'Popular', 'Plugin Installer' ); $tabs['new'] = _x( 'Newest', 'Plugin Installer' ); @@ -38,7 +37,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { $tabs['beta'] = _x( 'Beta Testing', 'Plugin Installer' ); } - $nonmenu_tabs = array( 'plugin-information' ); //Valid actions to perform which do not have a Menu item. + $nonmenu_tabs = array( 'upload', 'plugin-information' ); //Valid actions to perform which do not have a Menu item. /** * Filter the tabs shown on the Plugin Install screen. @@ -146,14 +145,42 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { $display_tabs = array(); foreach ( (array) $tabs as $action => $text ) { - $class = ( $action == $tab ) ? ' class="current"' : ''; + $class = 'wp-filter-link'; + $class .= ( $action == $tab ) ? ' current' : ''; $href = self_admin_url('plugin-install.php?tab=' . $action); - $display_tabs['plugin-install-'.$action] = "$text"; + $display_tabs['plugin-install-'.$action] = "$text"; } return $display_tabs; } + /** + * Override parent views so we can use the filter bar display. + */ + public function views() { + $views = $this->get_views(); + + /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */ + $views = apply_filters( "views_{$this->screen->id}", $views ); + +?> +
+ + + +
+
+ // assume no $type_selector means it's a simplified search form + if ( ! $type_selector ) { + $input_attrs = 'class="wp-filter-search" placeholder="' . esc_attr__( 'Search Plugins' ) . '" '; + $button_type .= ' screen-reader-text'; + } + + ?> - - - 'search-submit' ) ); ?> + + 'search-submit' ) ); ?>
set_help_sidebar( include(ABSPATH . 'wp-admin/admin-header.php'); ?>
-

+

+ + +

views(); ?>