Make WordPress Core

Changeset 29218


Ignore:
Timestamp:
07/18/2014 04:49:19 AM (10 years ago)
Author:
helen
Message:

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.

Location:
trunk/src/wp-admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/forms.css

    r28179 r29218  
    466466
    467467.search-box input[name="s"],
    468 #search-plugins input[name="s"],
     468.tablenav .search-plugins input[name="s"],
    469469.tagsdiv .newtag {
    470470    float: left;
  • trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php

    r29201 r29218  
    2727        // These are the tabs which are shown on the page
    2828        $tabs = array();
    29         $tabs['dashboard'] = __( 'Search' );
     29
    3030        if ( 'search' == $tab )
    3131            $tabs['search'] = __( 'Search Results' );
    32         $tabs['upload']    = __( 'Upload' );
    3332        $tabs['featured']  = _x( 'Featured', 'Plugin Installer' );
    3433        $tabs['popular']   = _x( 'Popular', 'Plugin Installer' );
     
    3938        }
    4039
    41         $nonmenu_tabs = array( 'plugin-information' ); //Valid actions to perform which do not have a Menu item.
     40        $nonmenu_tabs = array( 'upload', 'plugin-information' ); //Valid actions to perform which do not have a Menu item.
    4241
    4342        /**
     
    147146        $display_tabs = array();
    148147        foreach ( (array) $tabs as $action => $text ) {
    149             $class = ( $action == $tab ) ? ' class="current"' : '';
     148            $class = 'wp-filter-link';
     149            $class .= ( $action == $tab ) ? ' current' : '';
    150150            $href = self_admin_url('plugin-install.php?tab=' . $action);
    151             $display_tabs['plugin-install-'.$action] = "<a href='$href'$class>$text</a>";
     151            $display_tabs['plugin-install-'.$action] = "<a href='$href' class='$class'>$text</a>";
    152152        }
    153153
    154154        return $display_tabs;
     155    }
     156
     157    /**
     158     * Override parent views so we can use the filter bar display.
     159     */
     160    public function views() {
     161        $views = $this->get_views();
     162
     163        /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */
     164        $views = apply_filters( "views_{$this->screen->id}", $views );
     165
     166?>
     167<div class="wp-filter">
     168    <ul class="wp-filter-links">
     169        <?php
     170        if ( ! empty( $views ) ) {
     171            foreach ( $views as $class => $view ) {
     172                $views[ $class ] = "\t<li class='$class'>$view";
     173            }
     174            echo implode( " </li>\n", $views ) . "</li>\n";
     175        }
     176        ?>
     177    </ul>
     178
     179    <?php install_search_form( false ); ?>
     180</div>
     181<?php
    155182    }
    156183
  • trunk/src/wp-admin/includes/plugin-install.php

    r29206 r29218  
    164164    $type = isset($_REQUEST['type']) ? wp_unslash( $_REQUEST['type'] ) : 'term';
    165165    $term = isset($_REQUEST['s']) ? wp_unslash( $_REQUEST['s'] ) : '';
    166 
    167     ?><form id="search-plugins" method="get" action="">
     166    $input_attrs = '';
     167    $button_type = 'button';
     168
     169    // assume no $type_selector means it's a simplified search form
     170    if ( ! $type_selector ) {
     171        $input_attrs = 'class="wp-filter-search" placeholder="' . esc_attr__( 'Search Plugins' ) . '" ';
     172        $button_type .= ' screen-reader-text';
     173    }
     174
     175    ?><form class="search-plugins" method="get" action="">
    168176        <input type="hidden" name="tab" value="search" />
    169177        <?php if ( $type_selector ) : ?>
     
    174182        </select>
    175183        <?php endif; ?>
    176         <input type="search" name="s" id="plugin-search-input" value="<?php echo esc_attr($term) ?>" autofocus="autofocus" />
    177         <label class="screen-reader-text" for="plugin-search-input"><?php _e('Search Plugins'); ?></label>
    178         <?php submit_button( __( 'Search Plugins' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
     184        <label><span class="screen-reader-text"><?php _e('Search Plugins'); ?></span>
     185            <input type="search" name="s" value="<?php echo esc_attr($term) ?>" <?php echo $input_attrs; ?>/>
     186        </label>
     187        <?php submit_button( __( 'Search Plugins' ), $button_type, false, false, array( 'id' => 'search-submit' ) ); ?>
    179188    </form><?php
    180189}
  • trunk/src/wp-admin/plugin-install.php

    r27469 r29218  
    7474?>
    7575<div class="wrap">
    76 <h2><?php echo esc_html( $title ); ?></h2>
     76<h2>
     77    <?php
     78        echo esc_html( $title );
     79        $href = self_admin_url( 'plugin-install.php?tab=upload' );
     80    ?>
     81    <a href="<?php echo $href; ?>" class="upload add-new-h2"><?php _e( 'Upload Plugin' ); ?></a>
     82</h2>
    7783
    7884<?php $wp_list_table->views(); ?>
Note: See TracChangeset for help on using the changeset viewer.