Make WordPress Core


Ignore:
Timestamp:
07/18/2014 04:49:19 AM (11 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.