Changes from trunk/wp-admin/menu.php at r18254 to branches/3.1/wp-admin/menu.php at r17432
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/wp-admin/menu.php
r18254 r17432 25 25 $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div' ); 26 26 27 $submenu[ 'index.php' ][0] = array( __(' Home'), 'read', 'index.php' );27 $submenu[ 'index.php' ][0] = array( __('Dashboard'), 'read', 'index.php' ); 28 28 29 29 if ( is_multisite() ) { … … 33 33 if ( ! is_multisite() || is_super_admin() ) { 34 34 $plugin_update_count = $theme_update_count = $wordpress_update_count = 0; 35 36 if ( current_user_can( 'update_plugins' ) ) { 37 $update_plugins = get_site_transient( 'update_plugins' ); 38 if ( ! empty( $update_plugins->response ) ) 39 $plugin_update_count = count( $update_plugins->response ); 40 } 41 42 if ( current_user_can( 'update_themes' ) ) { 43 $update_themes = get_site_transient( 'update_themes' ); 44 if ( !empty($update_themes->response) ) 45 $theme_update_count = count( $update_themes->response ); 46 } 47 48 if ( current_user_can( 'update_core' ) ) { 49 $update_wordpress = get_core_updates( array('dismissed' => false) ); 50 if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) && current_user_can('update_core') ) 51 $wordpress_update_count = 1; 52 } 35 $update_plugins = get_site_transient( 'update_plugins' ); 36 if ( !empty($update_plugins->response) ) 37 $plugin_update_count = count( $update_plugins->response ); 38 $update_themes = get_site_transient( 'update_themes' ); 39 if ( !empty($update_themes->response) ) 40 $theme_update_count = count( $update_themes->response ); 41 $update_wordpress = get_core_updates( array('dismissed' => false) ); 42 if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) ) 43 $wordpress_update_count = 1; 53 44 54 45 $total_update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count; … … 59 50 $update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $plugin_update_count), $plugin_update_count); 60 51 if ( $theme_update_count ) 61 $update_title[] = sprintf(_n('%d Theme Update', '%d Theme Updates', $theme_update_count), $theme_update_count);52 $update_title[] = sprintf(_n('%d Theme Update', '%d Themes Updates', $theme_update_count), $theme_update_count); 62 53 63 54 $update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : ''; … … 68 59 } 69 60 70 unset($ theme_update_count, $wordpress_update_count, $update_themes, $update_plugins, $update_wordpress);61 unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_themes, $update_plugins, $update_wordpress); 71 62 72 63 $menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' ); 73 64 74 65 $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top menu-icon-post', 'menu-posts', 'div' ); 75 $submenu['edit.php'][5] = array( __(' AllPosts'), 'edit_posts', 'edit.php' );66 $submenu['edit.php'][5] = array( __('Posts'), 'edit_posts', 'edit.php' ); 76 67 /* translators: add new post */ 77 68 $submenu['edit.php'][10] = array( _x('Add New', 'post'), 'edit_posts', 'post-new.php' ); … … 92 83 93 84 $menu[15] = array( __('Links'), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'div' ); 94 $submenu['link-manager.php'][5] = array( __(' AllLinks'), 'manage_links', 'link-manager.php' );85 $submenu['link-manager.php'][5] = array( __('Links'), 'manage_links', 'link-manager.php' ); 95 86 /* translators: add new links */ 96 87 $submenu['link-manager.php'][10] = array( _x('Add New', 'link'), 'manage_links', 'link-add.php' ); … … 98 89 99 90 $menu[20] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'menu-top menu-icon-page', 'menu-pages', 'div' ); 100 $submenu['edit.php?post_type=page'][5] = array( __(' AllPages'), 'edit_pages', 'edit.php?post_type=page' );91 $submenu['edit.php?post_type=page'][5] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page' ); 101 92 /* translators: add new page */ 102 93 $submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), 'edit_pages', 'post-new.php?post_type=page' ); … … 112 103 $awaiting_mod = wp_count_comments(); 113 104 $awaiting_mod = $awaiting_mod->moderated; 114 $menu[25] = array( sprintf( __('Comments %s'), "<span class='awaiting-modcount-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top menu-icon-comments', 'menu-comments', 'div' );105 $menu[25] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top menu-icon-comments', 'menu-comments', 'div' ); 115 106 unset($awaiting_mod); 116 117 $submenu[ 'edit-comments.php' ][0] = array( __('All Comments'), 'edit_posts', 'edit-comments.php' );118 107 119 108 $_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group … … 140 129 141 130 $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-posts-' . $ptype_for_id, $menu_icon ); 142 $submenu["edit.php?post_type=$ptype"][5] = array( $ptype_obj->labels-> all_items, $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype");131 $submenu["edit.php?post_type=$ptype"][5] = array( $ptype_obj->labels->menu_name, $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype"); 143 132 $submenu["edit.php?post_type=$ptype"][10] = array( $ptype_obj->labels->add_new, $ptype_obj->cap->edit_posts, "post-new.php?post_type=$ptype" ); 144 133 … … 175 164 } 176 165 177 $menu_perms = get_site_option( 'menu_items', array() ); 166 $update_plugins = get_site_transient( 'update_plugins' ); 167 $update_count = 0; 168 if ( !empty($update_plugins->response) ) 169 $update_count = count( $update_plugins->response ); 170 171 $menu_perms = get_site_option('menu_items', array()); 178 172 if ( ! is_multisite() || is_super_admin() || ! empty( $menu_perms['plugins'] ) ) { 179 $count = ''; 180 if ( ! is_multisite() && current_user_can( 'update_plugins' ) ) 181 $count = "<span class='update-plugins count-$plugin_update_count'><span class='plugin-count'>" . number_format_i18n($plugin_update_count) . "</span></span>"; 182 173 $count = "<span class='update-plugins count-$update_count'><span class='plugin-count'>" . number_format_i18n($update_count) . "</span></span>"; 174 if ( is_multisite() ) 175 $count = ''; 183 176 $menu[65] = array( sprintf( __('Plugins %s'), $count ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div' ); 184 185 $submenu['plugins.php'][5] = array( __('Installed Plugins'), 'activate_plugins', 'plugins.php' );186 187 177 if ( ! is_multisite() ) { 188 178 /* translators: add new plugin */ 179 $submenu['plugins.php'][5] = array( __('Plugins'), 'activate_plugins', 'plugins.php' ); 189 180 $submenu['plugins.php'][10] = array( _x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php' ); 190 181 $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' ); 191 182 } 192 183 } 193 unset($menu_perms, $update_plugins, $ plugin_update_count);184 unset($menu_perms, $update_plugins, $update_count); 194 185 195 186 if ( current_user_can('list_users') ) … … 200 191 if ( current_user_can('list_users') ) { 201 192 $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php. 202 $submenu['users.php'][5] = array(__(' AllUsers'), 'list_users', 'users.php');193 $submenu['users.php'][5] = array(__('Users'), 'list_users', 'users.php'); 203 194 if ( current_user_can('create_users') ) 204 195 $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php'); … … 217 208 218 209 $menu[75] = array( __('Tools'), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'div' ); 219 $submenu['tools.php'][5] = array( __(' AvailableTools'), 'edit_posts', 'tools.php' );210 $submenu['tools.php'][5] = array( __('Tools'), 'edit_posts', 'tools.php' ); 220 211 $submenu['tools.php'][10] = array( __('Import'), 'import', 'import.php' ); 221 $submenu['tools.php'][15] = array( __('Export'), ' export', 'export.php' );212 $submenu['tools.php'][15] = array( __('Export'), 'import', 'export.php' ); 222 213 if ( is_multisite() && !is_main_site() ) 223 214 $submenu['tools.php'][25] = array( __('Delete Site'), 'manage_options', 'ms-delete-site.php' ); 224 215 if ( ! is_multisite() && defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE ) 225 $submenu['tools.php'][50] = array(__('Network Setup'), 'manage_options', 'network.php');216 $submenu['tools.php'][50] = array(__('Network'), 'manage_options', 'network.php'); 226 217 227 218 $menu[80] = array( __('Settings'), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div' ); … … 236 227 $_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group 237 228 238 $menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator ' );229 $menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' ); 239 230 240 231 // Back-compat for old top-levels
Note: See TracChangeset
for help on using the changeset viewer.