Only show one search form for the plugin installer.

The field dropdown now appears in the filter bar only when doing a search.

see #28785.


git-svn-id: https://develop.svn.wordpress.org/trunk@29597 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi
2014-08-25 16:02:43 +00:00
parent f187cf1dec
commit 9252fbec58
3 changed files with 15 additions and 9 deletions

View File

@@ -1383,6 +1383,15 @@ div.action-links,
margin: 0 20px 20px 0;
}
.no-plugin-results {
color: #999;
font-size: 18px;
font-style: normal;
margin: 0;
padding: 100px 0 0;
text-align: center;
}
/* ms */
/* Background Color for Site Status */
.wp-list-table .site-deleted {

View File

@@ -121,7 +121,6 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
break;
}
add_action( 'install_plugins_table_header', 'install_search_form', 10, 0 );
break;
case 'featured':
@@ -195,7 +194,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
} else {
$message = __( 'No plugins match your request.' );
}
echo '<div class="wp-filter-no-results">' . $message . '</div>';
echo '<div class="no-plugin-results">' . $message . '</div>';
}
protected function get_views() {
@@ -203,8 +202,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
$display_tabs = array();
foreach ( (array) $tabs as $action => $text ) {
$class = 'wp-filter-link';
$class .= ( $action == $tab ) ? ' current' : '';
$class = ( $action == $tab ) ? ' current' : '';
$href = self_admin_url('plugin-install.php?tab=' . $action);
$display_tabs['plugin-install-'.$action] = "<a href='$href' class='$class'>$text</a>";
}
@@ -223,7 +221,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
?>
<div class="wp-filter">
<ul class="wp-filter-links">
<ul class="filter-links">
<?php
if ( ! empty( $views ) ) {
foreach ( $views as $class => $view ) {
@@ -234,7 +232,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
?>
</ul>
<?php install_search_form( false ); ?>
<?php install_search_form( isset( $views['plugin-install-search'] ) ); ?>
</div>
<?php
}

View File

@@ -164,15 +164,14 @@ function install_search_form( $type_selector = true ) {
$type = isset($_REQUEST['type']) ? wp_unslash( $_REQUEST['type'] ) : 'term';
$term = isset($_REQUEST['s']) ? wp_unslash( $_REQUEST['s'] ) : '';
$input_attrs = '';
$button_type = 'button';
$button_type = 'button screen-reader-text';
// 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';
}
?><form class="search-plugins" method="get" action="">
?><form class="search-form search-plugins" method="get" action="">
<input type="hidden" name="tab" value="search" />
<?php if ( $type_selector ) : ?>
<select name="type" id="typeselector">