+ protected function pagination( $which ) {
+ global $mode;
+
+ parent::pagination( $which );
+ }
+
+ /**
+ * Display a view switcher
+ *
+ * @since 3.1.0
+ * @access protected
+ */
+ protected function view_switcher( $current_mode ) {
+ $modes = array(
+ 'list' => __( 'List View' ),
+ 'grid' => __( 'Grid View' )
+ );
+
+?>
+ <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
+ <div class="view-switch">
+<?php
+ foreach ( $modes as $mode => $title ) {
+ $classes = array( 'view-' . $mode );
+ if ( $current_mode == $mode )
+ $classes[] = 'current';
+ printf(
+ "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
+ esc_url( add_query_arg( 'mode', $mode ) ),
+ implode( ' ', $classes ),
+ $title
+ );
+ }
+ ?>
+ </div>
+<?php
+ }
+
+ /**
+ * Override parent views so we can use the filter bar display.
+ */
+ public function views() {
+ global $mode;
+
+ $views = $this->get_views();
+?>
+<div class="wp-filter">
+ <?php $this->view_switcher( $mode ); ?>
+
+ <select class="attachment-filters" name="attachment-filter">
+ <?php
+ if ( ! empty( $views ) ) {
+ foreach ( $views as $class => $view ) {
+ echo "\t$view\n";
+ }
+ }
+ ?>
+ </select>
+
+<?php
+ $this->extra_tablenav( 'bar' );
+
+ /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */
+ $views = apply_filters( "views_{$this->screen->id}", array() );
+
+ // Back compat for pre-4.0 view links.
+ if ( ! empty( $views ) ) {
+ echo '<ul class="filter-links">';
+ foreach ( $views as $class => $view ) {
+ echo "<li class='$class'>$view</li>";
+ }
+ echo '</ul>';
+ }
+?>
+
+ <div class="search-form">
+ <label for="media-search-input" class="screen-reader-text"><?php esc_html_e( 'Search Media' ); ?></label>
+ <input type="search" placeholder="<?php esc_attr_e( 'Search' ) ?>" id="media-search-input" class="search" name="s" value="<?php _admin_search_query(); ?>"></div>
+ </div>
+ <?php
+ }
+
+ public function get_columns() {