2010-07-30 16:34:54 -04:00
|
|
|
<?php
|
2010-10-21 07:21:13 -04:00
|
|
|
/**
|
|
|
|
* Build Network Administration Menu.
|
|
|
|
*
|
|
|
|
* @package WordPress
|
2010-11-10 09:27:15 -05:00
|
|
|
* @subpackage Multisite
|
2010-10-21 07:21:13 -04:00
|
|
|
* @since 3.1.0
|
|
|
|
*/
|
2010-07-30 16:34:54 -04:00
|
|
|
|
|
|
|
/* translators: Network menu item */
|
2010-10-20 10:52:10 -04:00
|
|
|
$menu[0] = array(__('Dashboard'), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div');
|
2010-07-30 16:34:54 -04:00
|
|
|
|
|
|
|
$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
|
|
|
|
|
|
|
|
/* translators: Sites menu item */
|
|
|
|
$menu[5] = array(__('Sites'), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'div');
|
2010-10-21 09:49:49 -04:00
|
|
|
$submenu['sites.php'][5] = array( __('Sites'), 'manage_sites', 'sites.php' );
|
2010-10-30 10:31:13 -04:00
|
|
|
$submenu['sites.php'][10] = array( __('Add New'), 'create_sites', 'site-new.php' );
|
2010-10-21 09:49:49 -04:00
|
|
|
|
2010-07-30 16:34:54 -04:00
|
|
|
$menu[10] = array(__('Users'), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div');
|
2010-11-04 12:16:52 -04:00
|
|
|
$submenu['users.php'][5] = array( __('Users'), 'manage_network_users', 'users.php' );
|
2010-11-04 12:27:18 -04:00
|
|
|
$submenu['users.php'][10] = array( __('Add New'), 'create_users', 'user-new.php' );
|
2010-10-21 13:06:52 -04:00
|
|
|
|
2010-07-30 16:34:54 -04:00
|
|
|
$menu[15] = array(__('Themes'), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div');
|
2010-10-21 13:06:52 -04:00
|
|
|
$submenu['themes.php'][5] = array( __('Themes'), 'manage_network_themes', 'themes.php' );
|
2010-11-12 10:32:40 -05:00
|
|
|
$submenu['themes.php'][10] = array( _x('Add New', 'theme'), 'install_themes', 'theme-install.php' );
|
2010-10-21 13:06:52 -04:00
|
|
|
$submenu['themes.php'][15] = array( _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php' );
|
2010-10-20 10:16:03 -04:00
|
|
|
|
2010-10-20 12:38:00 -04:00
|
|
|
$plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
|
2010-10-21 15:55:28 -04:00
|
|
|
$update_plugins = get_site_transient( 'update_plugins' );
|
|
|
|
if ( !empty($update_plugins->response) )
|
|
|
|
$plugin_update_count = count( $update_plugins->response );
|
2010-10-20 10:16:03 -04:00
|
|
|
$menu[20] = array(sprintf( __('Plugins %s'), "<span class='update-plugins count-$plugin_update_count'><span class='plugin-count'>" . number_format_i18n($plugin_update_count) . "</span></span>" ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div');
|
|
|
|
$submenu['plugins.php'][5] = array( __('Plugins'), 'manage_network_plugins', 'plugins.php' );
|
|
|
|
$submenu['plugins.php'][10] = array( _x('Add New', 'plugin editor'), 'install_plugins', 'plugin-install.php' );
|
|
|
|
$submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
|
|
|
|
|
|
|
|
|
2010-07-30 16:34:54 -04:00
|
|
|
$menu[25] = array(__('Settings'), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div');
|
2010-10-20 12:38:00 -04:00
|
|
|
|
|
|
|
$update_themes = get_site_transient( 'update_themes' );
|
|
|
|
if ( !empty($update_themes->response) )
|
|
|
|
$theme_update_count = count( $update_themes->response );
|
|
|
|
$update_wordpress = get_core_updates( array('dismissed' => false) );
|
|
|
|
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;
|
|
|
|
$update_title = array();
|
|
|
|
if ( $wordpress_update_count )
|
|
|
|
$update_title[] = sprintf(__('%d WordPress Update'), $wordpress_update_count);
|
|
|
|
if ( $plugin_update_count )
|
|
|
|
$update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $plugin_update_count), $plugin_update_count);
|
|
|
|
if ( $theme_update_count )
|
|
|
|
$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)) : '';
|
|
|
|
|
2010-10-21 13:52:44 -04:00
|
|
|
$menu[30] = 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>" ), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div');
|
2010-10-20 12:38:00 -04:00
|
|
|
$submenu[ 'upgrade.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>" ), 'install_plugins', 'update-core.php');
|
|
|
|
$submenu[ 'upgrade.php' ][15] = array( __( 'Update Network' ), 'manage_network', 'upgrade.php' );
|
|
|
|
unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title, $update_themes, $update_plugins, $update_wordpress);
|
|
|
|
|
2010-07-30 16:34:54 -04:00
|
|
|
|
|
|
|
$menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' );
|
|
|
|
|
2010-10-04 15:25:39 -04:00
|
|
|
require_once(ABSPATH . 'wp-admin/includes/menu.php');
|
2010-07-30 16:34:54 -04:00
|
|
|
|
|
|
|
?>
|