Add user actions dropdown to admin header. see #17324.

git-svn-id: https://develop.svn.wordpress.org/trunk@17827 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2011-05-06 23:06:24 +00:00
parent 535ced5186
commit a786996aa5
6 changed files with 132 additions and 23 deletions

View File

@ -141,30 +141,44 @@ if ( function_exists('mb_strlen') ) {
<?php endif; ?>
</h1>
<?php do_action('in_admin_header'); ?>
<?php
do_action('in_admin_header');
// Generate user profile and info links.
$howdy = sprintf( __('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity );
$links = array();
if ( is_multisite() && is_super_admin() ) {
if ( !is_network_admin() )
$links[10] = '<a href="' . network_admin_url() . '" title="' . ( ! empty( $update_title ) ? $update_title : esc_attr__('Network Admin') ) . '">' . __('Network Admin') . ( ! empty( $total_update_count ) ? ' (' . number_format_i18n( $total_update_count ) . ')' : '' ) . '</a>';
else
$links[10] = '<a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>';
}
$links[15] = '<a href="' . wp_logout_url() . '" title="' . esc_attr__('Log Out') . '">' . __('Log Out') . '</a>';
$links = apply_filters( 'admin_user_info_links', $links, $current_user );
ksort( $links );
// Trim whitespace and pipes from links, then convert to list items.
$links = array_map( 'trim', $links, array_fill( 0, count( $links ), " |\n\t" ) );
$links = '<li>' . implode( '</li><li>', $links ) . '</li>';
?>
<div id="wphead-info">
<div id="user_info">
<p><?php
$links = array();
$links[5] = sprintf(__('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity);
if ( is_multisite() && is_super_admin() ) {
if ( !is_network_admin() )
$links[10] = '| <a href="' . network_admin_url() . '" title="' . ( ! empty( $update_title ) ? $update_title : esc_attr__('Network Admin') ) . '">' . __('Network Admin') . ( ! empty( $total_update_count ) ? ' (' . number_format_i18n( $total_update_count ) . ')' : '' ) . '</a>';
else
$links[10] = '| <a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>';
}
$links[15] = '| <a href="' . wp_logout_url() . '" title="' . esc_attr__('Log Out') . '">' . __('Log Out') . '</a>';
$links = apply_filters('admin_user_info_links', $links, $current_user);
ksort($links);
echo implode(' ', $links);
?></p>
<p><?php echo $howdy; ?></p>
<div id="user_info_arrow">
<div id="user_info_links_wrap"><div id="user_info_links">
<ul><?php echo $links; ?></ul>
</div></div>
</div>
</div>
</div>
</div>
<div id="wpbody">
<?php
unset($title_class, $blog_name, $total_update_count, $update_title);

File diff suppressed because one or more lines are too long

View File

@ -719,6 +719,33 @@ table.widefat span.spam a,
color: #777;
}
#user_info_arrow {
background: transparent url(../images/arrows.png) no-repeat 6px 6px;
}
#user_info_arrow:hover {
background: transparent url(../images/arrows-dark.png) no-repeat 6px 6px;
}
#user_info_links ul {
background: #f9f9f9;
border-color: #dfdfdf;
-moz-box-shadow: inset 0 1px 0 #fff;
-webkit-box-shadow: inset 0 1px 0 #fff;
box-shadow: inset 0 1px 0 #fff;
}
#user_info_links li:hover {
background-color: #EAF2FA;
color: #333;
}
#user_info_links li:hover a,
#user_info_links li a:hover {
color: #333;
text-decoration: none;
}
#user_info a:link,
#user_info a:visited,
#footer a:link,
@ -729,7 +756,7 @@ table.widefat span.spam a,
#user_info a:hover,
#footer a:hover {
color: #000;
text-decoration: underline !important;
text-decoration: underline;
}
div#media-upload-error,

File diff suppressed because one or more lines are too long

View File

@ -842,14 +842,82 @@ form.upgrade .hint {
font-size: 12px;
line-height: 32px;
height: 32px;
position: relative;
}
#user_info p {
margin: 0;
margin: 0 20px 0 0;
padding: 0;
line-height: 32px;
}
#user_info_arrow {
height: 32px;
width: 24px;
position: absolute;
right: -2px;
top: 2px;
z-index: 999;
}
#user_info_links_wrap {
width: 160px;
position: absolute;
top: 30px;
right: 0;
padding: 0;
text-shadow: rgba(255,255,255,0.7) 0 1px 0;
}
#user_info_links {
overflow: hidden;
}
#user_info_arrow:hover #user_info_links_wrap {
top: 22px;
right: -8px;
padding: 8px;
}
#user_info_arrow:hover #user_info_links ul {
margin-top: 0;
-moz-transition: margin-top 150ms ease-out;
-webkit-transition: margin-top 150ms ease-out;
-o-transition: margin-top 150ms ease-out;
transition: margin-top 150ms ease-out;
}
#user_info_links ul {
border-width: 1px;
border-style: solid;
margin-top: -100%;
-moz-transition: margin-top 300ms ease-in;
-webkit-transition: margin-top 300ms ease-in;
-o-transition: margin-top 300ms ease-in;
transition: margin-top 300ms ease-in;
}
#user_info_links ul,
#user_info_links li:last-child {
-moz-border-radius: 0 0 3px 3px;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
-khtml-border-bottom-right-radius: 3px;
-khtml-border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
#user_info_links li {
display: block;
margin: 0;
}
#user_info_links a {
display: block;
padding: 6px 8px;
}
#wphead {
height: 32px;
margin-right: 15px;

View File

@ -485,13 +485,13 @@ function wp_default_styles( &$styles ) {
// Any rtl stylesheets that don't have a .dev version for ltr
$no_suffix = array( 'farbtastic' );
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20110506b' );
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20110506c' );
$styles->add( 'ie', "/wp-admin/css/ie$suffix.css", array(), '20101102' );
$styles->add_data( 'ie', 'conditional', 'lte IE 7' );
// all colors stylesheets need to have the same query strings (cache manifest compat)
$colors_version = '20110506b';
$colors_version = '20110506c';
// Register "meta" stylesheet for admin colors. All colors-* style sheets should have the same version string.
$styles->add( 'colors', true, array(), $colors_version );