Changeset 30154
- Timestamp:
- 11/01/2014 07:55:26 PM (10 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-list-table.php
r30105 r30154 64 64 */ 65 65 private $_pagination; 66 67 /** 68 * The view switcher modes 69 * 70 * @since 4.1.0 71 * @var array 72 * @access protected 73 */ 74 protected $modes = array(); 66 75 67 76 /** … … 114 123 // wp_enqueue_script( 'list-table' ); 115 124 add_action( 'admin_footer', array( $this, '_js_vars' ) ); 125 } 126 127 if ( empty( $this->modes ) ) { 128 $this->modes = array( 129 'list' => __( 'List View' ), 130 'excerpt' => __( 'Excerpt View' ) 131 ); 116 132 } 117 133 } … … 521 537 */ 522 538 protected function view_switcher( $current_mode ) { 523 $modes = array(524 'list' => __( 'List View' ),525 'excerpt' => __( 'Excerpt View' )526 );527 528 539 ?> 529 540 <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" /> 530 541 <div class="view-switch"> 531 542 <?php 532 foreach ( $ modes as $mode => $title ) {543 foreach ( $this->modes as $mode => $title ) { 533 544 $classes = array( 'view-' . $mode ); 534 545 if ( $current_mode == $mode ) -
trunk/src/wp-admin/includes/class-wp-media-list-table.php
r29810 r30154 23 23 $this->detached = ( isset( $_REQUEST['attachment-filter'] ) && 'detached' === $_REQUEST['attachment-filter'] ); 24 24 25 $this->modes = array( 26 'list' => __( 'List View' ), 27 'grid' => __( 'Grid View' ) 28 ); 29 25 30 parent::__construct( array( 26 31 'plural' => 'media', … … 146 151 147 152 parent::pagination( $which ); 148 }149 150 /**151 * Display a view switcher152 *153 * @since 3.1.0154 * @access protected155 */156 protected function view_switcher( $current_mode ) {157 $modes = array(158 'list' => __( 'List View' ),159 'grid' => __( 'Grid View' )160 );161 162 ?>163 <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />164 <div class="view-switch">165 <?php166 foreach ( $modes as $mode => $title ) {167 $classes = array( 'view-' . $mode );168 if ( $current_mode == $mode )169 $classes[] = 'current';170 printf(171 "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",172 esc_url( add_query_arg( 'mode', $mode ) ),173 implode( ' ', $classes ),174 $title175 );176 }177 ?>178 </div>179 <?php180 153 } 181 154
Note: See TracChangeset
for help on using the changeset viewer.