Fix the position of the search field on all admin pages.

git-svn-id: http://svn.automattic.com/wordpress/trunk@8867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-09-11 18:54:05 +00:00
parent 68f9ff53b9
commit f7f0523642
12 changed files with 112 additions and 103 deletions

View File

@ -119,8 +119,16 @@ $messages[4] = __('Category not added.');
$messages[5] = __('Category not updated.'); $messages[5] = __('Category not updated.');
?> ?>
<?php if (isset($_GET['message'])) : ?> <form class="search-form" action="" method="get">
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div> <p id="category-search" class="search-box">
<label class="hidden" for="category-search-input"><?php _e('Search Categories'); ?></label>
<input type="text" id="category-search-input" class="search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
</p>
</form>
<?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
<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; ?>
@ -128,12 +136,6 @@ endif; ?>
<form id="posts-filter" action="" method="get"> <form id="posts-filter" action="" method="get">
<h2><?php printf( current_user_can('manage_categories') ? __('Categories (<a href="%s">Add New</a>)') : __('Manage Tags'), '#addcat' ); ?></h2> <h2><?php printf( current_user_can('manage_categories') ? __('Categories (<a href="%s">Add New</a>)') : __('Manage Tags'), '#addcat' ); ?></h2>
<p id="category-search" class="search-box">
<label class="hidden" for="category-search-input"><?php _e('Search Categories'); ?></label>
<input type="text" id="category-search-input" class="search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
</p>
<br class="clear" /> <br class="clear" />
<div class="tablenav"> <div class="tablenav">

View File

@ -27,13 +27,6 @@ div#available-widgets-filter {
border-bottom-style: solid; border-bottom-style: solid;
} }
p#widget-search {
position: absolute;
right: 0;
top: 0;
margin: 0;
}
ul#widget-list { ul#widget-list {
list-style: none; list-style: none;
margin: 0; margin: 0;

View File

@ -69,6 +69,14 @@ $search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : '';
$search = attribute_escape( $search_dirty ); $search = attribute_escape( $search_dirty );
?> ?>
<form class="search-form" action="" method="get">
<p id="comment-search" class="search-box">
<label class="hidden" for="comment-search-input"><?php _e( 'Search Comments' ); ?></label>
<input type="text" id="comment-search-input" class="search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Comments' ); ?>" class="button" />
</p>
</form>
<?php <?php
if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['spam'] ) ) { if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['spam'] ) ) {
$approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0; $approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0;
@ -128,12 +136,6 @@ unset($status_links);
?> ?>
</ul> </ul>
<p id="comment-search" class="search-box">
<label class="hidden" for="comment-search-input"><?php _e( 'Search Comments' ); ?></label>
<input type="text" id="comment-search-input" class="search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Comments' ); ?>" class="button" />
</p>
<input type="hidden" name="mode" value="<?php echo $mode; ?>" /> <input type="hidden" name="mode" value="<?php echo $mode; ?>" />
<input type="hidden" name="comment_status" value="<?php echo $comment_status; ?>" /> <input type="hidden" name="comment_status" value="<?php echo $comment_status; ?>" />
</form> </form>

View File

@ -56,9 +56,19 @@ $messages[3] = __('Category updated.');
$messages[4] = __('Category not added.'); $messages[4] = __('Category not added.');
$messages[5] = __('Category not updated.'); $messages[5] = __('Category not updated.');
$messages[6] = __('Categories deleted.'); $messages[6] = __('Categories deleted.');
?>
if (isset($_GET['message'])) : ?> <form class="search-form" action="" method="get">
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div> <p id="link-category-search" class="search-box">
<label class="hidden" for="link-category-search-input"><?php _e( 'Search Categories' ); ?></label>
<input type="text" id="link-category-search-input" class="search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
</p>
</form>
<?php
if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
<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; ?>
@ -67,12 +77,6 @@ endif; ?>
<form id="posts-filter" action="" method="get"> <form id="posts-filter" action="" method="get">
<h2><?php printf( current_user_can('manage_categories') ? __('Link Categories (<a href="%s">Add New</a>)') : __('Manage Tags'), '#addcat' ); ?></h2> <h2><?php printf( current_user_can('manage_categories') ? __('Link Categories (<a href="%s">Add New</a>)') : __('Manage Tags'), '#addcat' ); ?></h2>
<p id="link-category-search" class="search-box">
<label class="hidden" for="link-category-search-input"><?php _e( 'Search Categories' ); ?></label>
<input type="text" id="link-category-search-input" class="search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
</p>
<br class="clear" /> <br class="clear" />
<div class="tablenav"> <div class="tablenav">

View File

@ -76,6 +76,15 @@ if ( is_singular() ) {
require_once('admin-header.php'); require_once('admin-header.php');
?> ?>
<form class="search-form" action="" method="get">
<p id="page-search" class="search-box">
<label class="hidden" for="page-search-input"><?php _e( 'Search Pages' ); ?></label>
<input type="text" id="page-search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Pages' ); ?>" class="button" />
</p>
</form>
<div class="wrap"> <div class="wrap">
<form id="posts-filter" action="" method="get"> <form id="posts-filter" action="" method="get">
@ -138,12 +147,6 @@ if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET
endif; endif;
?> ?>
<p id="page-search" class="search-box">
<label class="hidden" for="page-search-input"><?php _e( 'Search Pages' ); ?></label>
<input type="text" id="page-search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Pages' ); ?>" class="button" />
</p>
<div class="tablenav"> <div class="tablenav">
<?php <?php

View File

@ -125,8 +125,16 @@ $messages[5] = __('Tag not updated.');
$messages[6] = __('Tags deleted.'); $messages[6] = __('Tags deleted.');
?> ?>
<?php if (isset($_GET['message'])) : ?> <form class="search-form" action="" method="get">
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div> <p id="tag-search" class="search-box">
<label class="hidden" for="tag-search-input"><?php _e( 'Search Tags' ); ?></label>
<input type="text" id="tag-search-input" class="search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Tags' ); ?>" class="button" />
</p>
</form>
<?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
<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; ?>
@ -135,12 +143,6 @@ endif; ?>
<form id="posts-filter" action="" method="get"> <form id="posts-filter" action="" method="get">
<h2><?php printf( current_user_can('manage_categories') ? __('Tags (<a href="%s">Add New</a>)') : __('Manage Tags'), '#addtag' ); ?></h2> <h2><?php printf( current_user_can('manage_categories') ? __('Tags (<a href="%s">Add New</a>)') : __('Manage Tags'), '#addtag' ); ?></h2>
<p id="tag-search" class="search-box">
<label class="hidden" for="tag-search-input"><?php _e( 'Search Tags' ); ?></label>
<input type="text" id="tag-search-input" class="search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Tags' ); ?>" class="button" />
</p>
<br class="clear" /> <br class="clear" />
<div class="tablenav"> <div class="tablenav">

View File

@ -71,6 +71,14 @@ else
$mode = attribute_escape($_GET['mode']); $mode = attribute_escape($_GET['mode']);
?> ?>
<form class="search-form" action="" method="get">
<p id="post-search" class="search-box">
<label class="hidden" for="post-search-input"><?php _e( 'Search Posts' ); ?></label>
<input type="text" id="post-search-input" class="search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Posts' ); ?>" class="button" />
</p>
</form>
<div class="wrap"> <div class="wrap">
<form id="posts-filter" action="" method="get"> <form id="posts-filter" action="" method="get">
@ -154,12 +162,6 @@ if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET
endif; endif;
?> ?>
<p id="post-search" class="search-box">
<label class="hidden" for="post-search-input"><?php _e( 'Search Posts' ); ?></label>
<input type="text" id="post-search-input" class="search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Posts' ); ?>" class="button" />
</p>
<input type="hidden" name="mode" value="<?php echo $mode; ?>" /> <input type="hidden" name="mode" value="<?php echo $mode; ?>" />
<ul class="view-switch"> <ul class="view-switch">

View File

@ -71,7 +71,17 @@ switch ($order_by) {
$sqlorderby = 'name'; $sqlorderby = 'name';
break; break;
} }
?>
<form class="search-form" action="" method="get">
<p id="link-search" class="search-box">
<label class="hidden" for="link-search-input"><?php _e( 'Search Links' ); ?></label>
<input type="text" id="link-search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Links' ); ?>" class="button" />
</p>
</form>
<?php
if ( isset($_GET['deleted']) ) { if ( isset($_GET['deleted']) ) {
echo '<div id="message" class="updated fade"><p>'; echo '<div id="message" class="updated fade"><p>';
$deleted = (int) $_GET['deleted']; $deleted = (int) $_GET['deleted'];
@ -86,12 +96,6 @@ if ( isset($_GET['deleted']) ) {
<form id="links-filter" action="" method="get"> <form id="links-filter" action="" method="get">
<h2><?php printf( __('Links (<a href="%s">Add New</a>)' ), 'link-add.php' ); ?></h2> <h2><?php printf( __('Links (<a href="%s">Add New</a>)' ), 'link-add.php' ); ?></h2>
<p id="link-search" class="search-box">
<label class="hidden" for="link-search-input"><?php _e( 'Search Links' ); ?></label>
<input type="text" id="link-search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Links' ); ?>" class="button" />
</p>
<br class="clear" /> <br class="clear" />
<div class="tablenav"> <div class="tablenav">

View File

@ -63,6 +63,14 @@ if ( !isset( $_GET['paged'] ) )
?> ?>
<form class="search-form" action="" method="get">
<p id="media-search" class="search-box" >
<label class="hidden" for="media-search-input"><?php _e( 'Search Media' ); ?></label>
<input type="text" id="media-search-input" class="search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Media' ); ?>" class="button" />
</p>
</form>
<div class="wrap"> <div class="wrap">
<form id="posts-filter" action="" method="get"> <form id="posts-filter" action="" method="get">
@ -139,12 +147,6 @@ if (isset($_GET['message'])) : ?>
endif; endif;
?> ?>
<p id="media-search" class="search-box" >
<label class="hidden" for="media-search-input"><?php _e( 'Search Media' ); ?></label>
<input type="text" id="media-search-input" class="search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Media' ); ?>" class="button" />
</p>
<?php do_action('restrict_manage_posts'); ?> <?php do_action('restrict_manage_posts'); ?>
<div class="tablenav"> <div class="tablenav">

View File

@ -207,51 +207,55 @@ default:
// Query the users // Query the users
$wp_user_search = new WP_User_Search($usersearch, $userspage, $role); $wp_user_search = new WP_User_Search($usersearch, $userspage, $role);
$messages = array();
if ( isset($_GET['update']) ) : if ( isset($_GET['update']) ) :
switch($_GET['update']) { switch($_GET['update']) {
case 'del': case 'del':
case 'del_many': case 'del_many':
?> $delete_count = isset($_GET['delete_count']) ? (int) $_GET['delete_count'] : 0;
<?php $delete_count = isset($_GET['delete_count']) ? (int) $_GET['delete_count'] : 0; ?> $messages[] = '<div id="message" class="updated fade"><p>' . sprintf(__ngettext('%s user deleted', '%s users deleted', $delete_count), $delete_count) . '</p></div>';
<div id="message" class="updated fade"><p><?php printf(__ngettext('%s user deleted', '%s users deleted', $delete_count), $delete_count); ?></p></div>
<?php
break; break;
case 'add': case 'add':
?> $messages[] = '<div id="message" class="updated fade"><p>' . __('New user created.') . '</p></div>';
<div id="message" class="updated fade"><p><?php _e('New user created.'); ?></p></div>
<?php
break; break;
case 'promote': case 'promote':
?> $messages[] = '<div id="message" class="updated fade"><p>' . __('Changed roles.') . '</p></div>';
<div id="message" class="updated fade"><p><?php _e('Changed roles.'); ?></p></div>
<?php
break; break;
case 'err_admin_role': case 'err_admin_role':
?> $messages[] = '<div id="message" class="error"><p>' . __("The current user's role must have user editing capabilities.") . '</p></div>';
<div id="message" class="error"><p><?php _e("The current user's role must have user editing capabilities."); ?></p></div> $messages[] = '<div id="message" class="updated fade"><p>' . __('Other user roles have been changed.') . '</p></div>';
<div id="message" class="updated fade"><p><?php _e('Other user roles have been changed.'); ?></p></div>
<?php
break; break;
case 'err_admin_del': case 'err_admin_del':
?> $messages[] = '<div id="message" class="error"><p>' . __("You can't delete the current user.") . '</p></div>';
<div id="message" class="error"><p><?php _e("You can't delete the current user."); ?></p></div> $messages[] = '<div id="message" class="updated fade"><p>' . __('Other users have been deleted.') . '</p></div>';
<div id="message" class="updated fade"><p><?php _e('Other users have been deleted.'); ?></p></div>
<?php
break; break;
} }
endif; ?> endif; ?>
<form class="search-form" action="" method="get">
<p id="user-search" class="search-box">
<label class="hidden" for="user-search-input"><?php _e( 'Search Users' ); ?></label>
<input type="text" id="user-search-input" class="search-input" name="usersearch" value="<?php echo attribute_escape($wp_user_search->search_term); ?>" />
<input type="submit" value="<?php _e( 'Search Users' ); ?>" class="button" />
</p>
</form>
<?php if ( isset($errors) && is_wp_error( $errors ) ) : ?> <?php if ( isset($errors) && is_wp_error( $errors ) ) : ?>
<div class="error"> <div class="error">
<ul> <ul>
<?php <?php
foreach ( $errors->get_error_messages() as $message ) foreach ( $errors->get_error_messages() as $err )
echo "<li>$message</li>"; echo "<li>$err</li>\n";
?> ?>
</ul> </ul>
</div> </div>
<?php endif; ?> <?php endif;
if ( ! empty($messages) ) {
foreach ( $messages as $msg )
echo $msg;
} ?>
<div class="wrap"> <div class="wrap">
<form id="posts-filter" action="" method="get"> <form id="posts-filter" action="" method="get">
@ -300,12 +304,6 @@ unset($role_links);
?> ?>
</ul> </ul>
<p id="user-search" class="search-box">
<label class="hidden" for="user-search-input"><?php _e( 'Search Users' ); ?></label>
<input type="text" id="user-search-input" class="search-input" name="usersearch" value="<?php echo attribute_escape($wp_user_search->search_term); ?>" />
<input type="submit" value="<?php _e( 'Search Users' ); ?>" class="button" />
</p>
<div class="tablenav"> <div class="tablenav">
<?php if ( $wp_user_search->results_are_paged() ) : ?> <?php if ( $wp_user_search->results_are_paged() ) : ?>

View File

@ -101,9 +101,6 @@ if ( $http_post && isset($sidebars_widgets[$_POST['sidebar']]) ) {
exit; exit;
} }
// What widget (if any) are we editing // What widget (if any) are we editing
$edit_widget = -1; $edit_widget = -1;
@ -225,17 +222,22 @@ $show_values = array(
$show = isset($_GET['show']) && isset($show_values[$_GET['show']]) ? attribute_escape( $_GET['show'] ) : false; $show = isset($_GET['show']) && isset($show_values[$_GET['show']]) ? attribute_escape( $_GET['show'] ) : false;
$messages = array( $messages = array(
'updated' => __('Changes saved.') 'updated' => __('Changes saved.')
); );
require_once( 'admin-header.php' ); require_once( 'admin-header.php' ); ?>
if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) : ?> <form class="search-form" action="" method="get">
<p id="widget-search" class="search-box">
<label class="hidden" for="widget-search-input"><?php _e( 'Search Widgets' ); ?></label>
<input type="text" id="widget-search-input" class="search-input" name="s" value="<?php echo attribute_escape( $widget_search ); ?>" />
<input type="submit" class="button" value="<?php _e( 'Search Widgets' ); ?>" />
</p>
</form>
<?php if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div> <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
<?php endif; ?> <?php endif; ?>
<div class="wrap"> <div class="wrap">
@ -243,11 +245,6 @@ if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) : ?>
<form id="widgets-filter" action="" method="get"> <form id="widgets-filter" action="" method="get">
<h2><?php _e( 'Widgets' ); ?></h2> <h2><?php _e( 'Widgets' ); ?></h2>
<p id="widget-search" class="search-box">
<label class="hidden" for="widget-search-input"><?php _e( 'Search Widgets' ); ?></label>
<input type="text" id="widget-search-input" class="search-input" name="s" value="<?php echo attribute_escape( $widget_search ); ?>" />
<input type="submit" class="button" value="<?php _e( 'Search Widgets' ); ?>" />
</p>
<div class="widget-liquid-left-holder"> <div class="widget-liquid-left-holder">
<div id="available-widgets-filter" class="widget-liquid-left"> <div id="available-widgets-filter" class="widget-liquid-left">

View File

@ -1547,8 +1547,8 @@ p#big-add-button .button {
p.search-box { p.search-box {
position: absolute; position: absolute;
right: 0; right: 15px;
top: -64px; top: 52px;
margin: 0; margin: 0;
} }