Improve comments item in admin bar. see #18197.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b188bea4c8
commit
053fb714ba
|
@ -190,27 +190,27 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
|
||||||
if ( is_user_logged_in() ) {
|
if ( is_user_logged_in() ) {
|
||||||
// Add blog links
|
// Add blog links
|
||||||
$blue_wp_logo_url = includes_url('images/wpmini-blue.png');
|
$blue_wp_logo_url = includes_url('images/wpmini-blue.png');
|
||||||
|
|
||||||
foreach ( (array) $wp_admin_bar->user->blogs as $blog ) {
|
foreach ( (array) $wp_admin_bar->user->blogs as $blog ) {
|
||||||
// Skip the current blog (unless we're in the network/user admin).
|
// Skip the current blog (unless we're in the network/user admin).
|
||||||
if ( $blog->userblog_id == get_current_blog_id() && ! is_network_admin() && ! is_user_admin() ) {
|
if ( $blog->userblog_id == get_current_blog_id() && ! is_network_admin() && ! is_user_admin() ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @todo Replace with some favicon lookup.
|
// @todo Replace with some favicon lookup.
|
||||||
//$blavatar = '<img src="' . esc_url( blavatar_url( blavatar_domain( $blog->siteurl ), 'img', 16, $blue_wp_logo_url ) ) . '" alt="Blavatar" width="16" height="16" />';
|
//$blavatar = '<img src="' . esc_url( blavatar_url( blavatar_domain( $blog->siteurl ), 'img', 16, $blue_wp_logo_url ) ) . '" alt="Blavatar" width="16" height="16" />';
|
||||||
$blavatar = '<img src="' . esc_url($blue_wp_logo_url) . '" alt="' . esc_attr__( 'Blavatar' ) . '" width="16" height="16" class="blavatar"/>';
|
$blavatar = '<img src="' . esc_url($blue_wp_logo_url) . '" alt="' . esc_attr__( 'Blavatar' ) . '" width="16" height="16" class="blavatar"/>';
|
||||||
|
|
||||||
$blogname = empty( $blog->blogname ) ? $blog->domain : $blog->blogname;
|
$blogname = empty( $blog->blogname ) ? $blog->domain : $blog->blogname;
|
||||||
|
|
||||||
$wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-' . $blog->userblog_id, 'title' => $blavatar . $blogname, 'href' => get_admin_url($blog->userblog_id) ) );
|
$wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-' . $blog->userblog_id, 'title' => $blavatar . $blogname, 'href' => get_admin_url($blog->userblog_id) ) );
|
||||||
$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-d', 'title' => __( 'Dashboard' ), 'href' => get_admin_url($blog->userblog_id) ) );
|
$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-d', 'title' => __( 'Dashboard' ), 'href' => get_admin_url($blog->userblog_id) ) );
|
||||||
|
|
||||||
if ( current_user_can_for_blog( $blog->userblog_id, 'edit_posts' ) ) {
|
if ( current_user_can_for_blog( $blog->userblog_id, 'edit_posts' ) ) {
|
||||||
$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-n', 'title' => __( 'New Post' ), 'href' => get_admin_url($blog->userblog_id, 'post-new.php') ) );
|
$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-n', 'title' => __( 'New Post' ), 'href' => get_admin_url($blog->userblog_id, 'post-new.php') ) );
|
||||||
$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-c', 'title' => __( 'Manage Comments' ), 'href' => get_admin_url($blog->userblog_id, 'edit-comments.php') ) );
|
$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-c', 'title' => __( 'Manage Comments' ), 'href' => get_admin_url($blog->userblog_id, 'edit-comments.php') ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-v', 'title' => __( 'Visit Site' ), 'href' => get_home_url($blog->userblog_id) ) );
|
$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-v', 'title' => __( 'Visit Site' ), 'href' => get_home_url($blog->userblog_id) ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -358,16 +358,21 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$awaiting_mod = wp_count_comments();
|
$awaiting_mod = wp_count_comments();
|
||||||
$awaiting_mod = number_format_i18n( $awaiting_mod->moderated );
|
$awaiting_mod = $awaiting_mod->moderated;
|
||||||
|
|
||||||
$bubble = "<div class='ab-comments-bubble'>";
|
$icon = "<div class='ab-comments-icon'>";
|
||||||
$bubble .= "<div class='ab-comments-count'>$awaiting_mod</div>";
|
$icon .= "<div class='ab-comments-icon-body'></div>";
|
||||||
$bubble .= "<div class='ab-comments-arrow'></div>";
|
$icon .= "<div class='ab-comments-icon-arrow'></div>";
|
||||||
$bubble .= "</div>";
|
$icon .= "</div>";
|
||||||
|
|
||||||
|
if ( $awaiting_mod )
|
||||||
|
$title = sprintf( _n('%d Comment', '%d Comments', $awaiting_mod ), number_format_i18n( $awaiting_mod ) );
|
||||||
|
else
|
||||||
|
$title = __('Comments');
|
||||||
|
|
||||||
$wp_admin_bar->add_menu( array(
|
$wp_admin_bar->add_menu( array(
|
||||||
'id' => 'comments',
|
'id' => 'comments',
|
||||||
'title' => $bubble,
|
'title' => $icon . $title,
|
||||||
'href' => admin_url('edit-comments.php'),
|
'href' => admin_url('edit-comments.php'),
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -345,42 +345,40 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Comments bubble
|
* Comments icon
|
||||||
*/
|
*/
|
||||||
#wpadminbar .ab-comments-bubble {
|
#wpadminbar .ab-comments-icon {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
|
float: left;
|
||||||
}
|
}
|
||||||
#wpadminbar .ab-comments-count {
|
#wpadminbar .ab-comments-icon-body {
|
||||||
background: #ccc;
|
margin: 3px 4px 0 -2px;
|
||||||
color: #555;
|
background: #999;
|
||||||
text-shadow: none;
|
height: 10px;
|
||||||
height: 1.2em;
|
width: 14px;
|
||||||
line-height: 1.2em;
|
|
||||||
padding: 0 8px 0;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
-moz-border-radius: 10px;
|
-moz-border-radius: 10px;
|
||||||
-khtml-border-radius: 10px;
|
-khtml-border-radius: 10px;
|
||||||
-webkit-border-radius: 10px;
|
-webkit-border-radius: 10px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wpadminbar a:hover .ab-comments-count {
|
#wpadminbar a:hover .ab-comments-icon-body {
|
||||||
background: #bbb;
|
background: #bbb;
|
||||||
color: #333;
|
color: #555;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wpadminbar a .ab-comments-arrow {
|
#wpadminbar a .ab-comments-icon-arrow {
|
||||||
height: 0;
|
height: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -4px;
|
bottom: -3px;
|
||||||
left: 6px;
|
left: 1px;
|
||||||
/* Use transparent borders to form a triangle */
|
/* Use transparent borders to form a triangle */
|
||||||
border-left: 5px solid #ccc;
|
border-left: 4px solid #999;
|
||||||
border-bottom: 5px solid transparent;
|
border-bottom: 4px solid transparent;
|
||||||
}
|
}
|
||||||
#wpadminbar a:hover .ab-comments-arrow {
|
#wpadminbar a:hover .ab-comments-icon-arrow {
|
||||||
border-left-color: #bbb;
|
border-left-color: #bbb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -423,7 +423,7 @@ function wp_default_styles( &$styles ) {
|
||||||
$styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.3u1' );
|
$styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.3u1' );
|
||||||
$styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
|
$styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
|
||||||
$styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
|
$styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
|
||||||
$styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20110916' );
|
$styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20110916b' );
|
||||||
$styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array(), '20101224' );
|
$styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array(), '20101224' );
|
||||||
$styles->add( 'editor-buttons', "/wp-includes/css/editor-buttons$suffix.css", array(), '20110802' );
|
$styles->add( 'editor-buttons', "/wp-includes/css/editor-buttons$suffix.css", array(), '20110802' );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue