]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-wp-themes-list-table.php
Wordpress 3.3
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-themes-list-table.php
index 91e1d254a1fb085e25e6e6a922db23316d2a49af..4839b504e27938e4ec612d4c4727f9edfd6dbac7 100644 (file)
@@ -24,9 +24,8 @@ class WP_Themes_List_Table extends WP_List_Table {
 
                $themes = get_allowed_themes();
 
-               $search = !empty( $_REQUEST['s'] ) ? trim( stripslashes( $_REQUEST['s'] ) ) : '';
-
-               if ( '' !== $search ) {
+               if ( ! empty( $_REQUEST['s'] ) ) {
+                       $search = strtolower( stripslashes( $_REQUEST['s'] ) );
                        $this->search = array_merge( $this->search, array_filter( array_map( 'trim', explode( ',', $search ) ) ) );
                        $this->search = array_unique( $this->search );
                }
@@ -48,7 +47,7 @@ class WP_Themes_List_Table extends WP_List_Table {
                unset( $themes[$ct->name] );
                uksort( $themes, "strnatcasecmp" );
 
-               $per_page = 15;
+               $per_page = 24;
                $page = $this->get_pagenum();
 
                $start = ( $page - 1 ) * $per_page;
@@ -93,7 +92,7 @@ class WP_Themes_List_Table extends WP_List_Table {
                if ( $this->get_pagination_arg( 'total_pages' ) <= 1 )
                        return;
                ?>
-               <div class="tablenav <?php echo $which; ?>">
+               <div class="tablenav themes <?php echo $which; ?>">
                        <?php $this->pagination( $which ); ?>
                   <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
                  <br class="clear" />
@@ -106,11 +105,9 @@ class WP_Themes_List_Table extends WP_List_Table {
 ?>
                <?php $this->tablenav( 'top' ); ?>
 
-               <table id="availablethemes" cellspacing="0" cellpadding="0">
-                       <tbody id="the-list" class="list:themes">
-                               <?php $this->display_rows_or_placeholder(); ?>
-                       </tbody>
-               </table>
+               <div id="availablethemes">
+                       <?php $this->display_rows_or_placeholder(); ?>
+               </div>
 
                <?php $this->tablenav( 'bottom' ); ?>
 <?php
@@ -125,25 +122,11 @@ class WP_Themes_List_Table extends WP_List_Table {
                $theme_names = array_keys( $themes );
                natcasesort( $theme_names );
 
-               $table = array();
-               $rows = ceil( count( $theme_names ) / 3 );
-               for ( $row = 1; $row <= $rows; $row++ )
-                       for ( $col = 1; $col <= 3; $col++ )
-                               $table[$row][$col] = array_shift( $theme_names );
-
-               foreach ( $table as $row => $cols ) {
-?>
-<tr>
-<?php
-foreach ( $cols as $col => $theme_name ) {
-       $class = array( 'available-theme' );
-       if ( $row == 1 ) $class[] = 'top';
-       if ( $col == 1 ) $class[] = 'left';
-       if ( $row == $rows ) $class[] = 'bottom';
-       if ( $col == 3 ) $class[] = 'right';
-?>
-       <td class="<?php echo join( ' ', $class ); ?>">
-<?php if ( !empty( $theme_name ) ) :
+       foreach ( $theme_names as $theme_name ) {
+               $class = array( 'available-theme' );
+       ?>
+       <div class="<?php echo join( ' ', $class ); ?>">
+       <?php if ( !empty( $theme_name ) ) :
        $template = $themes[$theme_name]['Template'];
        $stylesheet = $themes[$theme_name]['Stylesheet'];
        $title = $themes[$theme_name]['Title'];
@@ -195,10 +178,8 @@ foreach ( $cols as $col => $theme_name ) {
 <?php endif; ?>
                <?php theme_update_available( $themes[$theme_name] ); ?>
 <?php endif; // end if not empty theme_name ?>
-       </td>
-<?php } // end foreach $cols ?>
-</tr>
-<?php } // end foreach $table
+       </div>
+<?php } // end foreach $theme_names
        }
 
        function search_theme( $theme ) {