Attach 'Screen Options' button to the sliding layer and related changes

git-svn-id: http://svn.automattic.com/wordpress/trunk@9363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-10-27 01:22:24 +00:00
parent bb7249cffe
commit 2e6d9f228e
19 changed files with 107 additions and 187 deletions

View File

@ -73,22 +73,12 @@ unset($hook_suffixes, $hook_suffix);
<div id="wpcontent"> <div id="wpcontent">
<div id="wphead"> <div id="wphead">
<?php <?php
$settings_pages = array( 'categories.php', 'edit.php', 'edit-comments.php', 'edit-form-advanced.php', 'edit-link-categories.php', 'edit-link-form.php', 'edit-page-form.php', 'edit-tags.php', 'link-manager.php', 'upload.php', 'users.php', 'edit-pages.php', 'post-new.php', 'post.php', 'page-new.php', 'page.php', 'index.php' );
$blog_name = get_bloginfo('name', 'display'); $blog_name = get_bloginfo('name', 'display');
if ( '' == $blog_name ) if ( '' == $blog_name )
$blog_name = '&nbsp;'; $blog_name = '&nbsp;';
?> ?>
<img id="logo50" src="images/wp-logo.gif" alt="" /> <h1><a href="<?php echo trailingslashit( get_bloginfo('url') ); ?>" title="<?php _e('Visit site') ?>"><?php echo $blog_name ?></a> <img id="logo50" src="images/wp-logo.gif" alt="" /> <h1><a href="<?php echo trailingslashit( get_bloginfo('url') ); ?>" title="<?php _e('Visit site') ?>"><?php echo $blog_name ?></a></h1>
<?php if ( false === strpos($_SERVER['REQUEST_URI'], 'page=') && in_array( $pagenow, $settings_pages ) ) { ?>
<span id="screen-options-link-wrap" class="hide-if-no-js screen-options-closed">
<span id="screen-options">
<a href="#screen-options" id="show-settings-link" class="show-settings"><?php _e('Screen Options') ?></a>
<a href="#screen-options" id="hide-settings-link" class="show-settings" style="display:none;"><?php _e('Hide Options') ?></a>
</span>
</span>
<?php } ?></h1>
<div id="wphead-info"> <div id="wphead-info">
<div id="user_info"> <div id="user_info">
@ -98,13 +88,11 @@ if ( '' == $blog_name )
<?php favorite_actions(); ?> <?php favorite_actions(); ?>
</div> </div>
</div> </div>
<?php
require(ABSPATH . 'wp-admin/menu-header.php');
?>
<div id="wpbody"> <div id="wpbody">
<?php require(ABSPATH . 'wp-admin/menu-header.php'); ?>
<div id="wpbody-content"> <div id="wpbody-content">
<?php <?php
do_action('admin_notices'); do_action('admin_notices');

View File

@ -131,15 +131,7 @@ $messages[4] = __('Category not added.');
$messages[5] = __('Category not updated.'); $messages[5] = __('Category not updated.');
?> ?>
<div id="screen-options-wrap" class="hidden"> <?php screen_options('category') ?>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php manage_columns_prefs('category') ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div>
<?php <?php
if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?> if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
@ -147,8 +139,8 @@ if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']); <?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
endif; ?> endif; ?>
<div class="wrap"> <div class="wrap nosubsub">
<h2 class="floatedh2"><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>
<form class="search-form topmargin" action="" method="get"> <form class="search-form topmargin" action="" method="get">
<p class="search-box"> <p class="search-box">

View File

@ -807,8 +807,12 @@ table.diff .diff-addedline ins {
} }
#screen-options-wrap { #screen-options-wrap {
background-color: #E4F2FD; background-color: #f1f1f1;
border-color: #c6d9e9; border-color: #dfdfdf;
}
#screen-options a.show-settings {
color: #606060;
} }
#replydiv, #replydiv,

View File

@ -13,7 +13,6 @@
#wpbody-content { #wpbody-content {
overflow: hidden; overflow: hidden;
padding-top: 10px;
} }
#adminmenu { #adminmenu {
@ -163,10 +162,8 @@ h6 {
.subsubsub { .subsubsub {
list-style: none; list-style: none;
margin: 0; margin: 0 0 5px;
padding: 0; padding: 0;
position: relative;
top: -5px;
white-space: nowrap; white-space: nowrap;
font-size: 12px; font-size: 12px;
float: left; float: left;
@ -296,10 +293,9 @@ th.check-column + th, th.check-column + td {
} }
.wrap h2 { .wrap h2 {
clear: both;
font: italic normal normal 24px/29px Georgia, "Times New Roman", Times, serif; font: italic normal normal 24px/29px Georgia, "Times New Roman", Times, serif;
margin: 5px 0 10px; margin: 0;
padding: 8px 15px 4px 0; padding: 20px 15px 10px 0;
} }
.wrap h2.long-header { .wrap h2.long-header {

View File

@ -81,15 +81,7 @@ $post_id = isset($_GET['p']) ? (int) $_GET['p'] : 0;
$search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : ''; $search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : '';
$search = attribute_escape( $search_dirty ); ?> $search = attribute_escape( $search_dirty ); ?>
<div id="screen-options-wrap" class="hidden"> <?php screen_options('comment') ?>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php manage_columns_prefs('comment') ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div>
<?php <?php
if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['spam'] ) ) { if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['spam'] ) ) {

View File

@ -459,14 +459,7 @@ endif;
?> ?>
<div id="screen-options-wrap" class="hidden"> <?php screen_options('post', 1) ?>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php meta_box_prefs('post') ?>
<br class="clear" />
</div></form>
</div>
<?php if ( $notice ) : ?> <?php if ( $notice ) : ?>
<div id="notice" class="error"><p><?php echo $notice ?></p></div> <div id="notice" class="error"><p><?php echo $notice ?></p></div>

View File

@ -60,25 +60,17 @@ $messages[4] = __('Category not added.');
$messages[5] = __('Category not updated.'); $messages[5] = __('Category not updated.');
$messages[6] = __('Categories deleted.'); ?> $messages[6] = __('Categories deleted.'); ?>
<div id="screen-options-wrap" class="hidden"> <?php screen_options('link-category') ?>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php manage_columns_prefs('link-category') ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div>
<?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?> <?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$msg]; ?></p></div> <div id="message" class="updated fade"><p><?php echo $messages[$msg]; ?></p></div>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']); <?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
endif; ?> endif; ?>
<div class="wrap"> <div class="wrap nosubsub">
<h2 class="floatedh2"><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>
<form class="search-form topmargin" action="" method="get"> <form class="search-form" action="" method="get">
<p class="search-box"> <p class="search-box">
<label class="hidden" for="category-search-input"><?php _e( 'Search Categories' ); ?>:</label> <label class="hidden" for="category-search-input"><?php _e( 'Search Categories' ); ?>:</label>
<input type="text" class="search-input" id="category-search-input" name="s" value="<?php _admin_search_query(); ?>" /> <input type="text" class="search-input" id="category-search-input" name="s" value="<?php _admin_search_query(); ?>" />

View File

@ -309,15 +309,7 @@ function link_advanced_meta_box($link) {
} }
add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core'); ?> add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core'); ?>
<div id="screen-options-wrap" class="hidden"> <?php screen_options('link', 1) ?>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php meta_box_prefs('link') ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div>
<div class="wrap"> <div class="wrap">
<h2><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>

View File

@ -349,15 +349,7 @@ add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'p
endif; endif;
?> ?>
<div id="screen-options-wrap" class="hidden"> <?php screen_options('page', 1); ?>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php meta_box_prefs('page') ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div>
<div class="wrap"> <div class="wrap">
<h2><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>

View File

@ -100,15 +100,7 @@ if ( is_singular() ) {
require_once('admin-header.php'); ?> require_once('admin-header.php'); ?>
<div id="screen-options-wrap" class="hidden"> <?php screen_options('page') ?>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php manage_columns_prefs('page') ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div>
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) ) { ?> <?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) ) { ?>
<div id="message" class="updated fade"><p> <div id="message" class="updated fade"><p>

View File

@ -129,25 +129,17 @@ $messages[4] = __('Tag not added.');
$messages[5] = __('Tag not updated.'); $messages[5] = __('Tag not updated.');
$messages[6] = __('Tags deleted.'); ?> $messages[6] = __('Tags deleted.'); ?>
<div id="screen-options-wrap" class="hidden"> <?php screen_options('tag') ?>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php manage_columns_prefs('tag') ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div>
<?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?> <?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$msg]; ?></p></div> <div id="message" class="updated fade"><p><?php echo $messages[$msg]; ?></p></div>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']); <?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
endif; ?> endif; ?>
<div class="wrap"> <div class="wrap nosubsub">
<h2 class="floatedh2"><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>
<form class="search-form topmargin" action="" method="get"> <form class="search-form" action="" method="get">
<p class="search-box"> <p class="search-box">
<label class="hidden" for="tag-search-input"><?php _e( 'Search Tags' ); ?>:</label> <label class="hidden" for="tag-search-input"><?php _e( 'Search Tags' ); ?>:</label>
<input type="text" class="search-input" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" /> <input type="text" class="search-input" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" />

View File

@ -90,15 +90,7 @@ if ( empty($_GET['mode']) )
else else
$mode = attribute_escape($_GET['mode']); ?> $mode = attribute_escape($_GET['mode']); ?>
<div id="screen-options-wrap" class="hidden"> <?php screen_options('post') ?>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php manage_columns_prefs('post') ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div>
<?php <?php
if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?> if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>

View File

@ -3090,4 +3090,31 @@ function _post_states($post) {
} }
} }
function screen_options($screen, $metabox = false) {
?>
<div id="screen-options">
<div id="screen-options-wrap" class="hidden">
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php
if ( $metabox ) {
meta_box_prefs($screen);
} else {
manage_columns_prefs($screen);
wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false );
}
?>
<br class="clear" />
</div></form>
</div>
<div id="screen-options-link-wrap" class="hide-if-no-js screen-options-closed">
<a href="#screen-options" id="show-settings-link" class="show-settings"><?php _e('Screen Options') ?></a>
<a href="#screen-options" id="hide-settings-link" class="show-settings" style="display:none;"><?php _e('Hide Options') ?></a>
</div>
</div>
<?php
}
?> ?>

View File

@ -28,14 +28,7 @@ require_once('admin-header.php');
$today = current_time('mysql', 1); $today = current_time('mysql', 1);
?> ?>
<div id="screen-options-wrap" class="hidden"> <?php screen_options('dashboard', 1); ?>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php meta_box_prefs('dashboard') ?>
<br class="clear" />
</div></form>
</div>
<div class="wrap"> <div class="wrap">
<h2><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>

View File

@ -74,15 +74,7 @@ switch ($order_by) {
break; break;
} ?> } ?>
<div id="screen-options-wrap" class="hidden"> <?php screen_options('link') ?>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php manage_columns_prefs('link') ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div>
<?php <?php
if ( isset($_GET['deleted']) ) { if ( isset($_GET['deleted']) ) {
@ -94,14 +86,14 @@ if ( isset($_GET['deleted']) ) {
} }
?> ?>
<div class="wrap"> <div class="wrap nosubsub">
<h2 class="floatedh2"><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>
<form class="search-form topmargin" action="" method="get"> <form class="search-form" action="" method="get">
<p class="search-box"> <p class="search-box">
<label class="hidden" for="link-search-input"><?php _e( 'Search Links' ); ?>:</label> <label class="hidden" for="link-search-input"><?php _e( 'Search Links' ); ?>:</label>
<input type="text" class="search-input" id="link-search-input" name="s" value="<?php _admin_search_query(); ?>" /> <input type="text" class="search-input" id="link-search-input" name="s" value="<?php _admin_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Links' ); ?>" class="button" /> <input type="submit" value="<?php _e( 'Search Links' ); ?>" class="button-primary" />
</p> </p>
</form> </form>
<br class="clear" /> <br class="clear" />

View File

@ -129,7 +129,7 @@ function _wp_menu_output( &$menu, &$submenu, $submenu_as_parent = true ) {
?> ?>
<ul id="adminmenu" class="wp-menu"> <ul id="adminmenu">
<?php <?php

View File

@ -145,15 +145,7 @@ if ( is_singular() ) {
require_once('admin-header.php'); ?> require_once('admin-header.php'); ?>
<div id="screen-options-wrap" class="hidden"> <?php screen_options('media') ?>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php manage_columns_prefs('media') ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div>
<?php <?php
if ( isset($_GET['posted']) && (int) $_GET['posted'] ) { if ( isset($_GET['posted']) && (int) $_GET['posted'] ) {

View File

@ -237,15 +237,7 @@ default:
} }
endif; ?> endif; ?>
<div id="screen-options-wrap" class="hidden"> <?php screen_options('user') ?>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php manage_columns_prefs('user') ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div>
<?php if ( isset($errors) && is_wp_error( $errors ) ) : ?> <?php if ( isset($errors) && is_wp_error( $errors ) ) : ?>
<div class="error"> <div class="error">
@ -312,7 +304,7 @@ unset($role_links);
<p class="search-box"> <p class="search-box">
<label class="hidden" for="user-search-input"><?php _e( 'Search Users' ); ?>:</label> <label class="hidden" for="user-search-input"><?php _e( 'Search Users' ); ?>:</label>
<input type="text" class="search-input" id="user-search-input" name="usersearch" value="<?php echo attribute_escape($wp_user_search->search_term); ?>" /> <input type="text" class="search-input" id="user-search-input" name="usersearch" value="<?php echo attribute_escape($wp_user_search->search_term); ?>" />
<input type="submit" value="<?php _e( 'Search Users' ); ?>" class="button" /> <input type="submit" value="<?php _e( 'Search Users' ); ?>" class="button-primary" />
</p> </p>
</form> </form>

View File

@ -1019,6 +1019,7 @@ strong .post-com-count {
border-radius: 3px; border-radius: 3px;
} }
/*
#wpbody ul.wp-menu { #wpbody ul.wp-menu {
list-style: none; list-style: none;
margin: 10px 0; margin: 10px 0;
@ -1042,7 +1043,7 @@ strong .post-com-count {
text-decoration: none; text-decoration: none;
color: #666; color: #666;
} }
*/
/* end menu stuff */ /* end menu stuff */
/* Admin Footer */ /* Admin Footer */
@ -1408,11 +1409,6 @@ table.form-table td .updated {
text-decoration: underline; text-decoration: underline;
} }
.wrap h2.floatedh2 {
float: left;
margin: 5px 0;
}
#poststuff h2 { #poststuff h2 {
margin-top: 20px; margin-top: 20px;
font-size: 1.5em; font-size: 1.5em;
@ -1752,11 +1748,15 @@ p#big-add-button .button {
p.search-box { p.search-box {
float: right; float: right;
margin: -10px 0 0; margin: -5px 0 0;
} }
.topmargin p.search-box { #wpbody-content .nosubsub p.search-box {
margin-top: 25px; margin-top: -12px;
}
#wpbody-content .nosubsub h2 {
padding-bottom: 0;
} }
.search-input { .search-input {
@ -2258,39 +2258,46 @@ fieldset {
} }
/* show/hide settings */ /* show/hide settings */
#screen-options-link-wrap {
background: url( images/screen-options-left.gif ) no-repeat 0 0;
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
height: 23px;
position: absolute;
right: 100px;
top: 46px;
padding: 0 0 0 8px;
}
#screen-options { #screen-options {
vertical-align: middle; position: relative;
height: 23px; clear: both;
line-height: 23px;
font-size: 11px;
background: url( images/screen-options-right.gif ) no-repeat 100% 0;
display: block;
padding-right: 20px;
} }
.screen-options-open #screen-options { #wpbody {
background: url( images/screen-options-right-up.gif ) no-repeat 100% 0; clear: both;
}
#screen-options-link-wrap {
float: right;
background: transparent url( images/screen-options-left.gif ) no-repeat 0 0;
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
height: 23px;
padding: 0;
position: relative;
right: 100px;
top: -1px;
} }
#screen-options a.show-settings { #screen-options a.show-settings {
color: #666;
text-decoration: none; text-decoration: none;
z-index: 1; z-index: 1;
float: left; padding: 0 18px 0 8px;
margin-left: -8px; height: 23px;
padding-left: 8px; line-height: 23px;
margin-right: -20px; font-size: 11px;
padding-right: 20px; display: block;
background-repeat: no-repeat;
background-position: right top;
background-color: tarnsparent;
}
#screen-options a#show-settings-link {
background-image: url( images/screen-options-right.gif );
}
#screen-options a#hide-settings-link {
background-image: url( images/screen-options-right-up.gif );
} }
#screen-options a.show-settings:hover { #screen-options a.show-settings:hover {
@ -2307,7 +2314,7 @@ fieldset {
border-style: none solid solid; border-style: none solid solid;
border-top: 0 none; border-top: 0 none;
border-width: 0 1px 1px; border-width: 0 1px 1px;
margin: -10px 15px 10px; margin: 0 15px;
-moz-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px;
-webkit-border-bottom-left-radius: 4px; -webkit-border-bottom-left-radius: 4px;
-webkit-border-bottom-right-radius: 4px; -webkit-border-bottom-right-radius: 4px;