WordPress.org

Make WordPress Core

Changeset 12613


Ignore:
Timestamp:
01/06/10 23:41:03 (4 years ago)
Author:
ryan
Message:

Move some multisite menu checks directly into menu.php. see #11763

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms.php

    r12610 r12613  
    551551function wpmu_menu() { 
    552552    global $menu, $submenu, $current_user; 
    553  
    554     if( is_site_admin() ) { 
    555         $menu[1] = array( '', 'read', '', '', 'wp-menu-separator' ); 
    556         $menu[2] = array(__('Site Admin'), '10', 'wpmu-admin.php', '', 'menu-top menu-top-first', 'menu-site', 'div'); 
    557         $submenu[ 'wpmu-admin.php' ][1] = array( __('Admin'), '10', 'wpmu-admin.php' ); 
    558         $submenu[ 'wpmu-admin.php' ][5] = array( __('Blogs'), '10', 'wpmu-blogs.php' ); 
    559         $submenu[ 'wpmu-admin.php' ][10] = array( __('Users'), '10', 'wpmu-users.php' ); 
    560         $submenu[ 'wpmu-admin.php' ][20] = array( __('Themes'), '10', 'wpmu-themes.php' ); 
    561         $submenu[ 'wpmu-admin.php' ][25] = array( __('Options'), '10', 'wpmu-options.php' ); 
    562         $submenu[ 'wpmu-admin.php' ][30] = array( __('Upgrade'), '10', 'wpmu-upgrade-site.php' ); 
    563     } 
    564  
    565     if( !is_site_admin() ) 
    566         unset( $submenu['plugins.php'][10] ); // always remove the plugin installer for regular users 
    567     unset( $submenu['plugins.php'][15] ); // always remove the plugin editor 
    568     unset( $submenu['themes.php'][10] ); // always remove the themes editor 
    569553 
    570554    $menu_perms = get_site_option( "menu_items" ); 
  • trunk/wp-admin/menu.php

    r12597 r12613  
    2828$menu[0] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top', 'menu-dashboard', 'div' ); 
    2929 
     30if ( is_multisite() && is_super_admin() ) { 
     31    $menu[1] = array( '', 'read', 'separator0', '', 'wp-menu-separator' ); 
     32    $menu[2] = array(__('Site Admin'), '10', 'ms-admin.php', '', 'menu-top menu-top-first', 'menu-site', 'div'); 
     33    $submenu[ 'ms-admin.php' ][1] = array( __('Admin'), 'delete_users', 'ms-admin.php' ); 
     34    $submenu[ 'ms-admin.php' ][5] = array( __('Blogs'), 'delete_users', 'ms-blogs.php' ); 
     35    $submenu[ 'ms-admin.php' ][10] = array( __('Users'), 'delete_users', 'ms-users.php' ); 
     36    $submenu[ 'ms-admin.php' ][20] = array( __('Themes'), 'delete_users', 'ms-themes.php' ); 
     37    $submenu[ 'ms-admin.php' ][25] = array( __('Options'), 'delete_users', 'ms-options.php' ); 
     38    $submenu[ 'ms-admin.php' ][30] = array( __('Upgrade'), 'delete_users', 'ms-upgrade-site.php' ); 
     39} 
     40 
    3041$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' ); 
    3142 
     
    89100$menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top', 'menu-appearance', 'div' ); 
    90101    $submenu['themes.php'][5]  = array(__('Themes'), 'switch_themes', 'themes.php'); 
    91     $submenu['themes.php'][10] = array(__('Editor'), 'edit_themes', 'theme-editor.php'); 
     102    if ( !is_multisite() ) 
     103        $submenu['themes.php'][10] = array(__('Editor'), 'edit_themes', 'theme-editor.php'); 
    92104    $submenu['themes.php'][15] = array(__('Add New Themes'), 'install_themes', 'theme-install.php'); 
    93105 
     
    99111$menu[65] = array( sprintf( __('Plugins %s'), "<span class='update-plugins count-$update_count'><span class='plugin-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'activate_plugins', 'plugins.php', '', 'menu-top', 'menu-plugins', 'div' ); 
    100112    $submenu['plugins.php'][5]  = array( __('Installed'), 'activate_plugins', 'plugins.php' ); 
    101     /* translators: add new plugin */ 
    102     $submenu['plugins.php'][10] = array(_x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php'); 
    103     $submenu['plugins.php'][15] = array( __('Editor'), 'edit_plugins', 'plugin-editor.php' ); 
     113    if ( is_super_admin() ) { 
     114        /* translators: add new plugin */ 
     115        $submenu['plugins.php'][10] = array(_x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php'); 
     116    } 
     117    if ( !is_multisite() ) 
     118        $submenu['plugins.php'][15] = array( __('Editor'), 'edit_plugins', 'plugin-editor.php' ); 
    104119 
    105120if ( current_user_can('edit_users') ) 
Note: See TracChangeset for help on using the changeset viewer.