Update indicator for the Network Admin link. fixes #16063.

git-svn-id: http://svn.automattic.com/wordpress/trunk@17217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-01-04 08:36:06 +00:00
parent 82dd4d569c
commit b61a5b0526
2 changed files with 12 additions and 7 deletions

View File

@ -151,7 +151,7 @@ $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="' . esc_attr__('Network Admin') . '">' . __('Network Admin') . '</a>';
$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>';
}
@ -170,7 +170,7 @@ echo implode(' ', $links);
<div id="wpbody">
<?php
unset($title_class, $blog_name);
unset($title_class, $blog_name, $total_update_count, $update_title);
require(ABSPATH . 'wp-admin/menu-header.php');

View File

@ -28,7 +28,9 @@ $submenu[ 'index.php' ][0] = array( __('Dashboard'), 'read', 'index.php' );
if ( is_multisite() ) {
$submenu[ 'index.php' ][5] = array( __('My Sites'), 'read', 'my-sites.php' );
} else {
}
if ( ! is_multisite() || is_super_admin() ) {
$plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
$update_plugins = get_site_transient( 'update_plugins' );
if ( !empty($update_plugins->response) )
@ -40,7 +42,7 @@ if ( is_multisite() ) {
if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
$wordpress_update_count = 1;
$update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
$total_update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
$update_title = array();
if ( $wordpress_update_count )
$update_title[] = sprintf(__('%d WordPress Update'), $wordpress_update_count);
@ -50,11 +52,14 @@ if ( is_multisite() ) {
$update_title[] = sprintf(_n('%d Theme Update', '%d Themes Updates', $theme_update_count), $theme_update_count);
$update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : '';
$submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'update_core', 'update-core.php');
unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title, $update_themes, $update_plugins, $update_wordpress);
}
if ( ! is_multisite() ) {
$submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-$total_update_count' title='$total_update_title'><span class='update-count'>" . number_format_i18n($total_update_count) . "</span></span>" ), 'update_core', 'update-core.php');
}
unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_themes, $update_plugins, $update_wordpress);
$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
$menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top menu-icon-post', 'menu-posts', 'div' );