Responsive themes screen, props helenyhou, see #18198

git-svn-id: http://svn.automattic.com/wordpress/trunk@18673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz
2011-09-15 04:26:26 +00:00
parent 64e98fd257
commit bff7722dd1
5 changed files with 41 additions and 104 deletions

View File

@@ -22,7 +22,7 @@ class WP_Theme_Install_List_Table extends WP_List_Table {
$paged = $this->get_pagenum();
$per_page = 30;
$per_page = 36;
// These are the tabs which are shown on the page,
$tabs = array();
@@ -130,7 +130,7 @@ class WP_Theme_Install_List_Table extends WP_List_Table {
// wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
?>
<div class="tablenav top">
<div class="tablenav top themes">
<div class="alignleft actions">
<?php do_action( 'install_themes_table_header' ); ?>
</div>
@@ -139,13 +139,11 @@ class WP_Theme_Install_List_Table extends WP_List_Table {
<br class="clear" />
</div>
<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>
<div class="tablenav bottom">
<div class="tablenav bottom themes">
<?php $this->pagination( 'bottom' ); ?>
<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
<br class="clear" />
@@ -155,30 +153,16 @@ class WP_Theme_Install_List_Table extends WP_List_Table {
function display_rows() {
$themes = $this->items;
$theme_names = array_keys( $themes );
$rows = ceil( count( $themes ) / 3 );
$table = array();
$theme_keys = array_keys( $themes );
for ( $row = 1; $row <= $rows; $row++ )
for ( $col = 1; $col <= 3; $col++ )
$table[$row][$col] = array_shift( $theme_keys );
foreach ( $table as $row => $cols ) {
echo "\t<tr>\n";
foreach ( $cols as $col => $theme_index ) {
foreach ( $theme_names as $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 ( isset( $themes[$theme_index] ) )
display_theme( $themes[$theme_index] );
?></td>
<?php } // end foreach $cols
echo "\t</tr>\n";
} // end foreach $table
<div class="<?php echo join( ' ', $class ); ?>"><?php
if ( isset( $themes[$theme_name] ) )
display_theme( $themes[$theme_name] );
?></div>
<?php } // end foreach $theme_names
}
}

View File

@@ -47,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;
@@ -92,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" />
@@ -105,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
@@ -124,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'];
@@ -194,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 ) {