- Timestamp:
- 06/05/2014 10:00:24 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-media-list-table.php
r28553 r28682 24 24 25 25 public function prepare_items() { 26 global $lost, $wp_query, $post_mime_types, $avail_post_mime_types ;26 global $lost, $wp_query, $post_mime_types, $avail_post_mime_types, $mode; 27 27 28 28 $q = $_REQUEST; … … 34 34 35 35 $this->is_trash = isset( $_REQUEST['status'] ) && 'trash' == $_REQUEST['status']; 36 37 $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode']; 36 38 37 39 $this->set_pagination_args( array( … … 124 126 public function no_items() { 125 127 _e( 'No media attachments found.' ); 128 } 129 130 protected function pagination( $which ) { 131 global $mode; 132 133 parent::pagination( $which ); 134 135 $this->view_switcher( $mode ); 136 } 137 138 /** 139 * Display a view switcher 140 * 141 * @since 3.1.0 142 * @access protected 143 */ 144 protected function view_switcher( $current_mode ) { 145 $modes = array( 146 'list' => __( 'List View' ), 147 'grid' => __( 'Grid View' ) 148 ); 149 150 ?> 151 <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" /> 152 <div class="view-switch"> 153 <?php 154 foreach ( $modes as $mode => $title ) { 155 $classes = array( 'view-' . $mode ); 156 if ( $current_mode == $mode ) 157 $classes[] = 'current'; 158 printf( 159 "<a href='%s' class='%s'><img id='view-switch-$mode' src='%s' width='20' height='20' title='%s' alt='%s' /></a>\n", 160 esc_url( add_query_arg( 'mode', $mode ) ), 161 implode( ' ', $classes ), 162 esc_url( includes_url( 'images/blank.gif' ) ), 163 $title, 164 $title 165 166 ); 167 } 168 ?> 169 </div> 170 <?php 126 171 } 127 172
Note: See TracChangeset
for help on using the changeset viewer.