Ticket #28946: 28946.patch
| File 28946.patch, 8.6 KB (added by , 12 years ago) |
|---|
-
src/wp-admin/includes/class-wp-list-table.php
273 273 if ( ! empty( $_REQUEST['detached'] ) ) 274 274 echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />'; 275 275 ?> 276 < p class="search-box">276 <div class="media-toolbar-primary"> 277 277 <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label> 278 <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />278 <input type="search" id="<?php echo $input_id ?>" name="s" placeholder="<?php _e( 'Search' ); ?>" value="<?php _admin_search_query(); ?>" /> 279 279 <?php submit_button( $text, 'button', false, false, array('id' => 'search-submit') ); ?> 280 </ p>280 </div> 281 281 <?php 282 282 } 283 283 … … 369 369 if ( empty( $this->_actions ) ) 370 370 return; 371 371 372 echo "<div class='bulk-select'>"; 372 373 echo "<select name='action$two'>\n"; 373 374 echo "<option value='-1' selected='selected'>" . __( 'Bulk Actions' ) . "</option>\n"; 374 375 … … 381 382 echo "</select>\n"; 382 383 383 384 submit_button( __( 'Apply' ), 'action', false, false, array( 'id' => "doaction$two" ) ); 384 echo " \n";385 echo "</div>\n"; 385 386 } 386 387 387 388 /** … … 592 593 * @since 3.1.0 593 594 * @access protected 594 595 */ 595 protected function pagination( $which) {596 protected function pagination() { 596 597 if ( empty( $this->_pagination_args ) ) { 597 598 return; 598 599 } … … 635 636 '‹' 636 637 ); 637 638 638 if ( 'bottom' == $which ) { 639 $html_current_page = $current; 640 } else { 641 $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='paged' value='%s' size='%d' />", 642 esc_attr__( 'Current page' ), 643 $current, 644 strlen( $total_pages ) 645 ); 646 } 639 $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='paged' value='%s' size='%d' />", 640 esc_attr__( 'Current page' ), 641 $current, 642 strlen( $total_pages ) 643 ); 647 644 $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) ); 648 645 $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>'; 649 646 … … 672 669 } else { 673 670 $page_class = ' no-pages'; 674 671 } 675 $this->_pagination = "<div class=' tablenav-pages{$page_class}'>$output</div>";672 $this->_pagination = "<div class='alignright tablenav-pages{$page_class}'>$output</div>"; 676 673 677 674 echo $this->_pagination; 678 675 } … … 846 843 public function display() { 847 844 $singular = $this->_args['singular']; 848 845 849 $this->display_tablenav( 'top');846 $this->display_tablenav(); 850 847 851 848 ?> 852 849 <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>"> … … 870 867 </tbody> 871 868 </table> 872 869 <?php 873 $this->display_tablenav( 'bottom' );874 870 } 875 871 876 872 /** … … 891 887 * @since 3.1.0 892 888 * @access protected 893 889 */ 894 protected function display_tablenav( $which ) { 895 if ( 'top' == $which ) 896 wp_nonce_field( 'bulk-' . $this->_args['plural'] ); 897 ?> 898 <div class="tablenav <?php echo esc_attr( $which ); ?>"> 890 protected function display_tablenav() { 891 wp_nonce_field( 'bulk-' . $this->_args['plural'] ); 899 892 900 <div class="alignleft actions bulkactions"> 901 <?php $this->bulk_actions(); ?> 902 </div> 903 <?php 904 $this->extra_tablenav( $which ); 905 $this->pagination( $which ); 893 $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode']; 894 895 $this->pagination(); 906 896 ?> 897 <div class="media-toolbar"> 907 898 908 <br class="clear" /> 899 <div class="media-toolbar-secondary"> 900 <?php $this->view_switcher( $mode ); ?> 901 <?php $this->extra_tablenav(); ?> 902 <?php $this->bulk_actions(); ?> 909 903 </div> 904 905 <?php $this->search_box( __( 'Search Media' ), 'media' ); ?> 906 907 </div> 910 908 <?php 911 909 } 912 910 … … 916 914 * @since 3.1.0 917 915 * @access protected 918 916 */ 919 protected function extra_tablenav( $which) {}917 protected function extra_tablenav() {} 920 918 921 919 /** 922 920 * Generate the <tbody> part of the table -
src/wp-admin/includes/class-wp-media-list-table.php
85 85 return $actions; 86 86 } 87 87 88 protected function extra_tablenav( $which) {89 ?> 90 <div class="alignleft actions">91 <?php 92 if ( 'top' == $which &&!is_singular() && !$this->detached && !$this->is_trash ) {88 protected function extra_tablenav() { 89 90 echo '<div class="filters">'; 91 92 if ( !is_singular() && !$this->detached && !$this->is_trash ) { 93 93 $this->months_dropdown( 'attachment' ); 94 94 95 95 /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */ … … 101 101 submit_button( __( 'Scan for lost attachments' ), 'secondary', 'find_detached', false ); 102 102 } elseif ( $this->is_trash && current_user_can( 'edit_others_posts' ) ) { 103 103 submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false ); 104 } ?> 105 </div> 106 <?php 104 } 105 106 echo '</div>'; 107 107 108 } 108 109 109 110 public function current_action() { … … 127 128 _e( 'No media attachments found.' ); 128 129 } 129 130 130 protected function pagination( $which) {131 protected function pagination() { 131 132 global $mode; 132 133 133 parent::pagination( $which ); 134 135 $this->view_switcher( $mode ); 134 parent::pagination(); 136 135 } 137 136 138 137 /** -
src/wp-admin/upload.php
200 200 $parent_file = 'upload.php'; 201 201 202 202 wp_enqueue_script( 'media' ); 203 wp_enqueue_style( 'media-views' ); 203 204 204 205 add_screen_option( 'per_page', array('label' => _x( 'Media items', 'items per page (screen options)' )) ); 205 206 … … 288 289 289 290 <?php $wp_list_table->views(); ?> 290 291 291 <form id="posts-filter" action="" method="get">292 <form id="posts-filter" class="<?php echo $mode; ?>-view" action="" method="get"> 292 293 293 <?php $wp_list_table->search_box( __( 'Search Media' ), 'media' ); ?>294 295 294 <?php $wp_list_table->display(); ?> 296 295 297 296 <div id="ajax-response"></div> -
src/wp-includes/css/media-views.css
19 19 line-height: 16px; 20 20 } 21 21 22 .media-frame select,23 .wp-admin .media-frame select {24 line-height: 28px;25 margin-top: 3px;26 }27 28 22 .media-frame a { 29 23 border-bottom: none; 30 24 color: #21759b; … … 218 212 height: 100%; 219 213 } 220 214 215 .wp-admin .media-toolbar select { 216 height: 32px; 217 line-height: 30px; 218 margin-top: 1px; 219 } 220 221 221 .media-toolbar-primary > .media-button, 222 222 .media-toolbar-primary > .media-button-group { 223 223 margin-left: 10px; … … 628 628 max-height: 100%; 629 629 } 630 630 631 .media-frame-content .crop-content .upload-errors 632 { 631 .media-frame-content .crop-content .upload-errors { 633 632 position: absolute; 634 633 width: 300px; 635 634 top: 50%; … … 657 656 * Attachment Browser Filters 658 657 */ 659 658 .media-frame select.attachment-filters { 660 margin-top: 11px;661 659 margin-right: 10px; 662 660 } 663 661 … … 2625 2623 margin-top: 0; 2626 2624 } 2627 2625 2628 .media-grid-view .media-toolbar select { 2629 margin-top: 1px; 2630 font-size: inherit; 2631 } 2632 2633 .media-grid-view .attachments-browser .bulk-select { 2626 .media-toolbar .filters, 2627 .media-toolbar .bulk-select { 2634 2628 display: inline-block; 2635 2629 } 2636 2630 … … 2639 2633 * 2640 2634 * This should be OOCSS'd so both use a shared selector. 2641 2635 */ 2642 .media- grid-view .attachments-browser .media-toolbar {2636 .media-toolbar { 2643 2637 background: #fff; 2644 2638 -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1); 2645 2639 box-shadow: 0 1px 1px 0 rgba(0,0,0,.1); … … 2657 2651 border: none; 2658 2652 } 2659 2653 2660 .media-grid-view input[type="search"] { 2654 .list-view .media-toolbar { 2655 margin-top: 0; 2656 } 2657 2658 .list-view .media-toolbar-primary { 2659 padding-top: 10px; 2660 } 2661 2662 .media-toolbar input[type="search"] { 2661 2663 margin: 1px; 2662 2664 padding: 3px 5px; 2663 2665 position: absolute; … … 2667 2669 font-weight: 300; 2668 2670 line-height: 1.5; 2669 2671 width: 280px; 2672 -webkit-border-radius: 3px; 2673 -moz-border-radius: 3px; 2674 border-radius: 3px; 2670 2675 } 2671 2676 2672 .media-grid-view .view-switch { 2677 .wp-core-ui .media-toolbar .button { 2678 height: 32px; 2679 line-height: 30px; 2680 } 2681 2682 .list-view .media-toolbar input[type="search"] { 2683 position: static; 2684 } 2685 2686 .media-toolbar .view-switch { 2673 2687 display: inline-block; 2674 2688 float: none; 2675 2689 vertical-align: middle; … … 2677 2691 margin: 0 20px 0 0; 2678 2692 } 2679 2693 2680 .media- grid-viewselect {2694 .media-toolbar select { 2681 2695 margin: 0 10px 0 0; 2696 font-size: inherit; 2682 2697 } 2683 2698 2684 2699 .media-grid-view .spinner {