Make WordPress Core

Ticket #28946: 28946.patch

File 28946.patch, 8.6 KB (added by michalzuber, 12 years ago)
  • src/wp-admin/includes/class-wp-list-table.php

     
    273273                if ( ! empty( $_REQUEST['detached'] ) )
    274274                        echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
    275275?>
    276 <p class="search-box">
     276<div class="media-toolbar-primary">
    277277        <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(); ?>" />
    279279        <?php submit_button( $text, 'button', false, false, array('id' => 'search-submit') ); ?>
    280 </p>
     280</div>
    281281<?php
    282282        }
    283283
     
    369369                if ( empty( $this->_actions ) )
    370370                        return;
    371371
     372                echo "<div class='bulk-select'>";
    372373                echo "<select name='action$two'>\n";
    373374                echo "<option value='-1' selected='selected'>" . __( 'Bulk Actions' ) . "</option>\n";
    374375
     
    381382                echo "</select>\n";
    382383
    383384                submit_button( __( 'Apply' ), 'action', false, false, array( 'id' => "doaction$two" ) );
    384                 echo "\n";
     385                echo "</div>\n";
    385386        }
    386387
    387388        /**
     
    592593         * @since 3.1.0
    593594         * @access protected
    594595         */
    595         protected function pagination( $which ) {
     596        protected function pagination() {
    596597                if ( empty( $this->_pagination_args ) ) {
    597598                        return;
    598599                }
     
    635636                        '&lsaquo;'
    636637                );
    637638
    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                );
    647644                $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
    648645                $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>';
    649646
     
    672669                } else {
    673670                        $page_class = ' no-pages';
    674671                }
    675                 $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
     672                $this->_pagination = "<div class='alignright tablenav-pages{$page_class}'>$output</div>";
    676673
    677674                echo $this->_pagination;
    678675        }
     
    846843        public function display() {
    847844                $singular = $this->_args['singular'];
    848845
    849                 $this->display_tablenav( 'top' );
     846                $this->display_tablenav();
    850847
    851848?>
    852849<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
     
    870867        </tbody>
    871868</table>
    872869<?php
    873                 $this->display_tablenav( 'bottom' );
    874870        }
    875871
    876872        /**
     
    891887         * @since 3.1.0
    892888         * @access protected
    893889         */
    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'] );
    899892
    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();
    906896?>
     897<div class="media-toolbar">
    907898
    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(); ?>
    909903        </div>
     904
     905        <?php $this->search_box( __( 'Search Media' ), 'media' ); ?>
     906
     907</div>
    910908<?php
    911909        }
    912910
     
    916914         * @since 3.1.0
    917915         * @access protected
    918916         */
    919         protected function extra_tablenav( $which ) {}
     917        protected function extra_tablenav() {}
    920918
    921919        /**
    922920         * Generate the <tbody> part of the table
  • src/wp-admin/includes/class-wp-media-list-table.php

     
    8585                return $actions;
    8686        }
    8787
    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 ) {
    9393                        $this->months_dropdown( 'attachment' );
    9494
    9595                        /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
     
    101101                        submit_button( __( 'Scan for lost attachments' ), 'secondary', 'find_detached', false );
    102102                } elseif ( $this->is_trash && current_user_can( 'edit_others_posts' ) ) {
    103103                        submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
    104                 } ?>
    105                 </div>
    106 <?php
     104                }
     105
     106                echo '</div>';
     107
    107108        }
    108109
    109110        public function current_action() {
     
    127128                _e( 'No media attachments found.' );
    128129        }
    129130
    130         protected function pagination( $which ) {
     131        protected function pagination() {
    131132                global $mode;
    132133
    133                 parent::pagination( $which );
    134 
    135                 $this->view_switcher( $mode );
     134                parent::pagination();
    136135        }
    137136
    138137        /**
  • src/wp-admin/upload.php

     
    200200$parent_file = 'upload.php';
    201201
    202202wp_enqueue_script( 'media' );
     203wp_enqueue_style( 'media-views' );
    203204
    204205add_screen_option( 'per_page', array('label' => _x( 'Media items', 'items per page (screen options)' )) );
    205206
     
    288289
    289290<?php $wp_list_table->views(); ?>
    290291
    291 <form id="posts-filter" action="" method="get">
     292<form id="posts-filter" class="<?php echo $mode; ?>-view" action="" method="get">
    292293
    293 <?php $wp_list_table->search_box( __( 'Search Media' ), 'media' ); ?>
    294 
    295294<?php $wp_list_table->display(); ?>
    296295
    297296<div id="ajax-response"></div>
  • src/wp-includes/css/media-views.css

     
    1919        line-height: 16px;
    2020}
    2121
    22 .media-frame select,
    23 .wp-admin .media-frame select {
    24         line-height: 28px;
    25         margin-top: 3px;
    26 }
    27 
    2822.media-frame a {
    2923        border-bottom: none;
    3024        color: #21759b;
     
    218212        height: 100%;
    219213}
    220214
     215.wp-admin .media-toolbar select {
     216        height: 32px;
     217        line-height: 30px;
     218        margin-top: 1px;
     219}
     220
    221221.media-toolbar-primary > .media-button,
    222222.media-toolbar-primary > .media-button-group {
    223223        margin-left: 10px;
     
    628628        max-height: 100%;
    629629}
    630630
    631 .media-frame-content .crop-content .upload-errors
    632 {
     631.media-frame-content .crop-content .upload-errors {
    633632        position: absolute;
    634633        width: 300px;
    635634        top: 50%;
     
    657656 * Attachment Browser Filters
    658657 */
    659658.media-frame select.attachment-filters {
    660         margin-top: 11px;
    661659        margin-right: 10px;
    662660}
    663661
     
    26252623        margin-top: 0;
    26262624}
    26272625
    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 {
    26342628        display: inline-block;
    26352629}
    26362630
     
    26392633 *
    26402634 * This should be OOCSS'd so both use a shared selector.
    26412635 */
    2642 .media-grid-view .attachments-browser .media-toolbar {
     2636.media-toolbar {
    26432637        background: #fff;
    26442638        -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
    26452639        box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
     
    26572651        border: none;
    26582652}
    26592653
    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"] {
    26612663        margin: 1px;
    26622664        padding: 3px 5px;
    26632665        position: absolute;
     
    26672669        font-weight: 300;
    26682670        line-height: 1.5;
    26692671        width: 280px;
     2672        -webkit-border-radius: 3px;
     2673           -moz-border-radius: 3px;
     2674                        border-radius: 3px;
    26702675}
    26712676
    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 {
    26732687        display: inline-block;
    26742688        float: none;
    26752689        vertical-align: middle;
     
    26772691        margin: 0 20px 0 0;
    26782692}
    26792693
    2680 .media-grid-view select {
     2694.media-toolbar select {
    26812695        margin: 0 10px 0 0;
     2696        font-size: inherit;
    26822697}
    26832698
    26842699.media-grid-view .spinner {