Make WordPress Core

Ticket #15849: placeholder.15849.diff

File placeholder.15849.diff, 4.5 KB (added by scribu, 14 years ago)

Always display the table, with placeholder row

  • wp-admin/includes/class-wp-list-table.php

     
    647647        }
    648648
    649649        /**
    650          * Display the table or a message if there are no items
     650         * Display the table
    651651         *
    652652         * @since 3.1.0
    653653         * @access public
    654654         */
    655655        function display() {
    656                 if ( $this->has_items() ) {
    657                         $this->display_table();
    658                 } else {
    659 ?>
    660                 <br class="clear" />
    661                 <p><?php $this->no_items(); ?></p>
    662 <?php
    663                 }
    664         }
    665 
    666         /**
    667          * Get a list of CSS classes for the <table> tag
    668          *
    669          * @since 3.1.0
    670          * @access protected
    671          *
    672          * @return array
    673          */
    674         function get_table_classes() {
    675                 return array( 'widefat', 'fixed', $this->_args['plural'] );
    676         }
    677 
    678         /**
    679          * Display the full table
    680          *
    681          * @since 3.1.0
    682          * @access public
    683          */
    684         function display_table() {
    685656                extract( $this->_args );
    686657
    687658                $this->display_tablenav( 'top' );
     
    701672        </tfoot>
    702673
    703674        <tbody id="the-list"<?php if ( $singular ) echo " class='list:$singular'"; ?>>
    704                 <?php $this->display_rows(); ?>
     675                <?php $this->display_rows_or_placeholder(); ?>
    705676        </tbody>
    706677</table>
    707678<?php
    708 
    709679                $this->display_tablenav( 'bottom' );
    710680        }
    711681
    712682        /**
     683         * Get a list of CSS classes for the <table> tag
     684         *
     685         * @since 3.1.0
     686         * @access protected
     687         *
     688         * @return array
     689         */
     690        function get_table_classes() {
     691                return array( 'widefat', 'fixed', $this->_args['plural'] );
     692        }
     693
     694        /**
    713695         * Generate the table navigation above or below the table
    714696         *
    715697         * @since 3.1.0
     
    749731         * @since 3.1.0
    750732         * @access protected
    751733         */
     734        function display_rows_or_placeholder() {
     735                if ( $this->has_items() ) {
     736                        $this->display_rows();
     737                } else {
     738                        echo '<tr class="no-items"><td colspan="2">';
     739                        $this->no_items();
     740                        echo '</td></tr>';
     741                }
     742        }
     743
     744        /**
     745         * Generate the table rows
     746         *
     747         * @since 3.1.0
     748         * @access protected
     749         */
    752750        function display_rows() {
    753751                foreach ( $this->items as $item )
    754752                        $this->single_row( $item );
     
    823821                extract( $this->_pagination_args );
    824822
    825823                ob_start();
    826                 $this->display_rows();
     824                $this->display_rows_or_placeholder();
    827825                $rows = ob_get_clean();
    828826
    829827                $response = array( 'rows' => $rows );
  • wp-admin/includes/class-wp-theme-install-list-table.php

     
    126126                return array();
    127127        }
    128128
    129         function display_table() {
     129        function display() {
    130130?>
    131131                <div class="tablenav">
    132132                        <div class="alignleft actions">
  • wp-admin/includes/class-wp-themes-list-table.php

     
    8383                printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) );
    8484        }
    8585
    86         function display_table() {
     86        function display() {
    8787?>
    8888                <div class="tablenav">
    8989                        <?php $this->pagination( 'top' ); ?>
  • wp-admin/includes/class-wp-comments-list-table.php

     
    254254                );
    255255        }
    256256
    257         function display_table() {
     257        function display() {
    258258                extract( $this->_args );
    259259
    260260                $this->display_tablenav( 'top' );
  • wp-admin/edit-tags.php

     
    241241<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
    242242<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
    243243
    244 <?php $wp_list_table->display_table(); ?>
     244<?php $wp_list_table->display(); ?>
    245245
    246246<br class="clear" />
    247247</form>
  • wp-admin/css/global.dev.css

     
    425425        font-size: 11px;
    426426}
    427427
     428.widefat .no-items td {
     429        border-bottom-width: 0;
     430}
     431
    428432.widefat td {
    429433        padding: 3px 7px;
    430434        vertical-align: top;