Make WordPress Core


Ignore:
Timestamp:
09/15/2011 04:26:26 AM (15 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-themes-list-table.php

    r17691 r18673  
    4848                uksort( $themes, "strnatcasecmp" );
    4949
    50                 $per_page = 15;
     50                $per_page = 24;
    5151                $page = $this->get_pagenum();
    5252
    … …  
    9393                        return;
    9494                ?>
    95                 <div class="tablenav <?php echo $which; ?>">
     95                <div class="tablenav themes <?php echo $which; ?>">
    9696                        <?php $this->pagination( $which ); ?>
    9797                   <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
    … …  
    106106                <?php $this->tablenav( 'top' ); ?>
    107107
    108                 <table id="availablethemes" cellspacing="0" cellpadding="0">
    109                         <tbody id="the-list" class="list:themes">
    110                                 <?php $this->display_rows_or_placeholder(); ?>
    111                         </tbody>
    112                 </table>
     108                <div id="availablethemes">
     109                        <?php $this->display_rows_or_placeholder(); ?>
     110                </div>
    113111
    114112                <?php $this->tablenav( 'bottom' ); ?>
    … …  
    125123                natcasesort( $theme_names );
    126124
    127                 $table = array();
    128                 $rows = ceil( count( $theme_names ) / 3 );
    129                 for ( $row = 1; $row <= $rows; $row++ )
    130                         for ( $col = 1; $col <= 3; $col++ )
    131                                 $table[$row][$col] = array_shift( $theme_names );
    132 
    133                 foreach ( $table as $row => $cols ) {
    134 ?>
    135 <tr>
    136 <?php
    137 foreach ( $cols as $col => $theme_name ) {
    138         $class = array( 'available-theme' );
    139         if ( $row == 1 ) $class[] = 'top';
    140         if ( $col == 1 ) $class[] = 'left';
    141         if ( $row == $rows ) $class[] = 'bottom';
    142         if ( $col == 3 ) $class[] = 'right';
    143 ?>
    144         <td class="<?php echo join( ' ', $class ); ?>">
    145 <?php if ( !empty( $theme_name ) ) :
     125        foreach ( $theme_names as $theme_name ) {
     126                $class = array( 'available-theme' );
     127        ?>
     128        <div class="<?php echo join( ' ', $class ); ?>">
     129        <?php if ( !empty( $theme_name ) ) :
    146130        $template = $themes[$theme_name]['Template'];
    147131        $stylesheet = $themes[$theme_name]['Stylesheet'];
    … …  
    195179                <?php theme_update_available( $themes[$theme_name] ); ?>
    196180<?php endif; // end if not empty theme_name ?>
    197         </td>
    198 <?php } // end foreach $cols ?>
    199 </tr>
    200 <?php } // end foreach $table
     181        </div>
     182<?php } // end foreach $theme_names
    201183        }
    202184
Note: See TracChangeset for help on using the changeset viewer.