Ticket #18198: 18198.theme-screens.diff
| File 18198.theme-screens.diff, 6.4 KB (added by , 15 years ago) |
|---|
-
wp-admin/includes/class-wp-theme-install-list-table.php
22 22 23 23 $paged = $this->get_pagenum(); 24 24 25 $per_page = 3 0;25 $per_page = 36; 26 26 27 27 // These are the tabs which are shown on the page, 28 28 $tabs = array(); … … 130 130 131 131 // wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 132 132 ?> 133 <div class="tablenav top ">133 <div class="tablenav top themes"> 134 134 <div class="alignleft actions"> 135 135 <?php do_action( 'install_themes_table_header' ); ?> 136 136 </div> … … 139 139 <br class="clear" /> 140 140 </div> 141 141 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> 147 145 148 <div class="tablenav bottom ">146 <div class="tablenav bottom themes"> 149 147 <?php $this->pagination( 'bottom' ); ?> 150 148 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" /> 151 149 <br class="clear" /> … … 155 153 156 154 function display_rows() { 157 155 $themes = $this->items; 156 $theme_names = array_keys( $themes ); 158 157 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 ) { 169 159 $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';174 160 ?> 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 182 166 } 183 167 } 184 168 -
wp-admin/includes/class-wp-themes-list-table.php
47 47 unset( $themes[$ct->name] ); 48 48 uksort( $themes, "strnatcasecmp" ); 49 49 50 $per_page = 15;50 $per_page = 24; 51 51 $page = $this->get_pagenum(); 52 52 53 53 $start = ( $page - 1 ) * $per_page; … … 92 92 if ( $this->get_pagination_arg( 'total_pages' ) <= 1 ) 93 93 return; 94 94 ?> 95 <div class="tablenav <?php echo $which; ?>">95 <div class="tablenav themes <?php echo $which; ?>"> 96 96 <?php $this->pagination( $which ); ?> 97 97 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" /> 98 98 <br class="clear" /> … … 105 105 ?> 106 106 <?php $this->tablenav( 'top' ); ?> 107 107 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> 113 111 114 112 <?php $this->tablenav( 'bottom' ); ?> 115 113 <?php … … 120 118 } 121 119 122 120 function display_rows() { 123 $themes = $this->items; 121 $themes = $this->items; 124 122 $theme_names = array_keys( $themes ); 125 123 natcasesort( $theme_names ); 126 124 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 ) ) : 146 130 $template = $themes[$theme_name]['Template']; 147 131 $stylesheet = $themes[$theme_name]['Stylesheet']; 148 132 $title = $themes[$theme_name]['Title']; … … 194 178 <?php endif; ?> 195 179 <?php theme_update_available( $themes[$theme_name] ); ?> 196 180 <?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 201 183 } 202 184 203 185 function search_theme( $theme ) { -
wp-admin/css/wp-admin.dev.css
2363 2363 vertical-align: middle; 2364 2364 } 2365 2365 2366 .tablenav.themes { 2367 max-width: 98%; 2368 } 2369 2366 2370 .tablenav .tablenav-pages { 2367 2371 float: right; 2368 2372 display: block; … … 3539 3543 border-width: 1px; 3540 3544 border-style: solid; 3541 3545 line-height: 2em; 3546 max-width: 1000px; 3542 3547 padding: 8px 12px 12px; 3543 3548 text-align: justify; 3544 3549 } … … 4335 4340 height:auto; 4336 4341 } 4337 4342 4338 table#availablethemes { 4339 border-spacing: 0; 4340 border-width: 1px 0; 4341 border-style: solid none; 4342 margin: 10px auto; 4343 width: 100%; 4344 } 4345 4346 table#availablethemes .no-items td{ 4347 border-width:0; 4348 padding:5px; 4349 } 4350 4351 td.available-theme { 4343 .available-theme { 4344 display: inline-block; 4345 margin-bottom: 10px; 4346 margin-right: 25px; 4347 overflow: hidden; 4348 padding: 20px; 4352 4349 vertical-align: top; 4353 4350 width: 240px; 4354 margin: 0;4355 padding: 20px;4356 text-align: left;4357 4351 } 4358 4352 4359 table#availablethemes td {4360 border-width: 0 1px 1px;4361 border-style: none solid solid;4362 }4363 4364 table#availablethemes td.right,4365 table#availablethemes td.left {4366 border-right: 0 none;4367 border-left: 0 none;4368 }4369 4370 table#availablethemes td.bottom {4371 border-bottom: 0 none;4372 }4373 4374 4353 .available-theme a.screenshot { 4375 4354 width: 240px; 4376 4355 height: 180px;