Make WordPress Core


Ignore:
Timestamp:
09/15/2011 04:26:26 AM (13 years ago)
Author:
azaozz
Message:

Responsive themes screen, props helenyhou, see #18198

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-theme-install-list-table.php

    r17322 r18673  
    2323        $paged = $this->get_pagenum();
    2424
    25         $per_page = 30;
     25        $per_page = 36;
    2626
    2727        // These are the tabs which are shown on the page,
     
    131131        // wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
    132132?>
    133         <div class="tablenav top">
     133        <div class="tablenav top themes">
    134134            <div class="alignleft actions">
    135135                <?php do_action( 'install_themes_table_header' ); ?>
     
    140140        </div>
    141141
    142         <table id="availablethemes" cellspacing="0" cellpadding="0">
    143             <tbody id="the-list" class="list:themes">
    144                 <?php $this->display_rows_or_placeholder(); ?>
    145             </tbody>
    146         </table>
     142        <div id="availablethemes">
     143            <?php $this->display_rows_or_placeholder(); ?>
     144        </div>
    147145
    148         <div class="tablenav bottom">
     146        <div class="tablenav bottom themes">
    149147            <?php $this->pagination( 'bottom' ); ?>
    150148            <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
     
    156154    function display_rows() {
    157155        $themes = $this->items;
     156        $theme_names = array_keys( $themes );
    158157
    159         $rows = ceil( count( $themes ) / 3 );
    160         $table = array();
    161         $theme_keys = array_keys( $themes );
    162         for ( $row = 1; $row <= $rows; $row++ )
    163             for ( $col = 1; $col <= 3; $col++ )
    164                 $table[$row][$col] = array_shift( $theme_keys );
    165 
    166         foreach ( $table as $row => $cols ) {
    167             echo "\t<tr>\n";
    168             foreach ( $cols as $col => $theme_index ) {
     158        foreach ( $theme_names as $theme_name ) {
    169159                $class = array( 'available-theme' );
    170                 if ( $row == 1 ) $class[] = 'top';
    171                 if ( $col == 1 ) $class[] = 'left';
    172                 if ( $row == $rows ) $class[] = 'bottom';
    173                 if ( $col == 3 ) $class[] = 'right';
    174160                ?>
    175                 <td class="<?php echo join( ' ', $class ); ?>"><?php
    176                     if ( isset( $themes[$theme_index] ) )
    177                         display_theme( $themes[$theme_index] );
    178                 ?></td>
    179             <?php } // end foreach $cols
    180             echo "\t</tr>\n";
    181         } // end foreach $table
     161                <div class="<?php echo join( ' ', $class ); ?>"><?php
     162                    if ( isset( $themes[$theme_name] ) )
     163                        display_theme( $themes[$theme_name] );
     164                ?></div>
     165        <?php } // end foreach $theme_names
    182166    }
    183167}
Note: See TracChangeset for help on using the changeset viewer.