Responsive columns on the dashboard and write screens, first run, see #20015

git-svn-id: https://develop.svn.wordpress.org/trunk@20272 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2012-03-23 21:41:00 +00:00
parent a42caf87b4
commit 74cfcd36e3
14 changed files with 368 additions and 396 deletions
+15 -38
View File
@@ -196,51 +196,28 @@ function wp_dashboard() {
global $screen_layout_columns;
$screen = get_current_screen();
$class = 'columns-' . $screen_layout_columns;
$hide2 = $hide3 = $hide4 = '';
switch ( $screen_layout_columns ) {
case 4:
$width = 'width:25%;';
break;
case 3:
$width = 'width:33.333333%;';
$hide4 = 'display:none;';
break;
case 2:
$width = 'width:50%;';
$hide3 = $hide4 = 'display:none;';
break;
default:
$width = 'width:100%;';
$hide2 = $hide3 = $hide4 = 'display:none;';
}
?>
<div id="dashboard-widgets" class="metabox-holder">
<?php
echo "\t<div id='postbox-container-1' class='postbox-container' style='$width'>\n";
do_meta_boxes( $screen->id, 'normal', '' );
<div id="dashboard-widgets" class="metabox-holder <?php echo $class; ?>">
<div id='postbox-container-1' class='postbox-container'>
<?php do_meta_boxes( $screen->id, 'normal', '' ); ?>
</div>
<div id='postbox-container-2' class='postbox-container'>
<?php do_meta_boxes( $screen->id, 'side', '' ); ?>
</div>
<div id='postbox-container-3' class='postbox-container'>
<?php do_meta_boxes( $screen->id, 'column3', '' ); ?>
</div>
<div id='postbox-container-4' class='postbox-container'>
<?php do_meta_boxes( $screen->id, 'column4', '' ); ?>
</div>
</div>
echo "\t</div><div id='postbox-container-2' class='postbox-container' style='{$hide2}$width'>\n";
do_meta_boxes( $screen->id, 'side', '' );
echo "\t</div><div id='postbox-container-3' class='postbox-container' style='{$hide3}$width'>\n";
do_meta_boxes( $screen->id, 'column3', '' );
echo "\t</div><div id='postbox-container-4' class='postbox-container' style='{$hide4}$width'>\n";
do_meta_boxes( $screen->id, 'column4', '' );
?>
</div></div>
<form style="display:none" method="get" action="">
<p>
<?php
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
?>
</p>
</form>
<?php
}
/* Dashboard Widgets */
+34 -31
View File
@@ -658,38 +658,41 @@ if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('m
*
* @param object $link
*/
function link_categories_meta_box($link) { ?>
<ul id="category-tabs" class="category-tabs">
<li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
<li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
</ul>
<div id="categories-all" class="tabs-panel">
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php
if ( isset($link->link_id) )
wp_link_category_checklist($link->link_id);
else
wp_link_category_checklist();
?>
function link_categories_meta_box($link) {
?>
<div id="taxonomy-linkcategory" class="categorydiv">
<ul id="category-tabs" class="category-tabs">
<li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
<li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
</ul>
</div>
<div id="categories-pop" class="tabs-panel" style="display: none;">
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
<?php wp_popular_terms_checklist('link_category'); ?>
</ul>
</div>
<div id="category-adder" class="wp-hidden-children">
<h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
<p id="link-category-add" class="wp-hidden-child">
<label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
<input type="button" id="category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php esc_attr_e( 'Add' ); ?>" />
<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
<span id="category-ajax-response"></span>
</p>
<div id="categories-all" class="tabs-panel">
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php
if ( isset($link->link_id) )
wp_link_category_checklist($link->link_id);
else
wp_link_category_checklist();
?>
</ul>
</div>
<div id="categories-pop" class="tabs-panel" style="display: none;">
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
<?php wp_popular_terms_checklist('link_category'); ?>
</ul>
</div>
<div id="category-adder" class="wp-hidden-children">
<h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
<p id="link-category-add" class="wp-hidden-child">
<label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
<input type="button" id="category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php esc_attr_e( 'Add' ); ?>" />
<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
<span id="category-ajax-response"></span>
</p>
</div>
</div>
<?php
}
+2 -2
View File
@@ -929,12 +929,12 @@ final class WP_Screen {
}
?>
<h5><?php _e('Screen Layout'); ?></h5>
<h5 class="screen-layout"><?php _e('Screen Layout'); ?></h5>
<div class='columns-prefs'><?php
_e('Number of Columns:');
for ( $i = 1; $i <= $num; ++$i ):
?>
<label>
<label class="columns-prefs-<?php echo $i; ?>">
<input type='radio' name='screen_columns' value='<?php echo esc_attr( $i ); ?>'
<?php checked( $screen_layout_columns, $i ); ?> />
<?php echo esc_html( $i ); ?>