]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/network/menu.php
Wordpress 3.2
[autoinstalls/wordpress.git] / wp-admin / network / menu.php
1 <?php
2 /**
3  * Build Network Administration Menu.
4  *
5  * @package WordPress
6  * @subpackage Multisite
7  * @since 3.1.0
8  */
9
10 /* translators: Network menu item */
11 $menu[0] = array(__('Dashboard'), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div');
12
13 $menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
14
15 /* translators: Sites menu item */
16 $menu[5] = array(__('Sites'), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'div');
17 $submenu['sites.php'][5]  = array( __('All Sites'), 'manage_sites', 'sites.php' );
18 $submenu['sites.php'][10]  = array( _x('Add New', 'site'), 'create_sites', 'site-new.php' );
19
20 $menu[10] = array(__('Users'), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div');
21 $submenu['users.php'][5]  = array( __('All Users'), 'manage_network_users', 'users.php' );
22 $submenu['users.php'][10]  = array( _x('Add New', 'user'), 'create_users', 'user-new.php' );
23
24 if ( current_user_can( 'update_themes' ) ) {
25         $plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
26         $update_themes = get_site_transient( 'update_themes' );
27         if ( !empty($update_themes->response) )
28                 $theme_update_count = count( $update_themes->response );
29         $menu[15] = array(sprintf( __( 'Themes %s' ), "<span class='update-plugins count-$theme_update_count'><span class='theme-count'>" . number_format_i18n( $theme_update_count ) . "</span></span>" ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
30 } else {
31         $menu[15] = array( __( 'Themes' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
32 }
33 $submenu['themes.php'][5]  = array( __('Installed Themes'), 'manage_network_themes', 'themes.php' );
34 $submenu['themes.php'][10] = array( _x('Add New', 'theme'), 'install_themes', 'theme-install.php' );
35 $submenu['themes.php'][15] = array( _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php' );
36
37 if ( current_user_can( 'update_plugins' ) ) {
38         $update_plugins = get_site_transient( 'update_plugins' );
39         if ( !empty($update_plugins->response) )
40                 $plugin_update_count = count( $update_plugins->response );
41         $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');
42 } else {
43         $menu[20] = array( __('Plugins'), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div' );
44 }
45 $submenu['plugins.php'][5]  = array( __('Installed Plugins'), 'manage_network_plugins', 'plugins.php' );
46 $submenu['plugins.php'][10] = array( _x('Add New', 'plugin editor'), 'install_plugins', 'plugin-install.php' );
47 $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
48
49
50 $menu[25] = array(__('Settings'), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div');
51 if ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
52         $submenu['settings.php'][5]  = array( __('Network Settings'), 'manage_network_options', 'settings.php' );
53         $submenu['settings.php'][10] = array( __('Network Setup'), 'manage_network_options', 'setup.php' );
54 }
55
56 if ( current_user_can( 'update_core' ) ) {
57         $update_wordpress = get_core_updates( array('dismissed' => false) );
58         if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
59                 $wordpress_update_count = 1;
60         
61         $update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
62         $update_title = array();
63         if ( $wordpress_update_count )
64                 $update_title[] = sprintf(__('%d WordPress Update'), $wordpress_update_count);
65         if ( $plugin_update_count )
66                 $update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $plugin_update_count), $plugin_update_count);
67         if ( $theme_update_count )
68                 $update_title[] = sprintf(_n('%d Theme Update', '%d Theme Updates', $theme_update_count), $theme_update_count);
69         
70         $update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : '';
71         
72         $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' );
73 } else {
74         $menu[30] = array( __( 'Updates' ), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div' );
75 }
76
77 $submenu[ 'upgrade.php' ][10] = array( __( 'Available Updates' ), 'update_core',  'update-core.php' );
78 $submenu[ 'upgrade.php' ][15] = array( __( 'Update Network' ), 'manage_network', 'upgrade.php' );
79 unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title, $update_themes, $update_plugins, $update_wordpress);
80
81
82 $menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' );
83
84 require_once(ABSPATH . 'wp-admin/includes/menu.php');
85
86 ?>