WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/07/2010 12:17:13 AM (8 years ago)
Author:
ryan
Message:

Move wpmu_menu() logic into menu.php. Props Denis-de-Bernardy. fixes #11763

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/menu.php

    r12614 r12618  
    110110    $update_count = count( $update_plugins->response );
    111111
    112 $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' );
    113     $submenu['plugins.php'][5]  = array( __('Installed'), 'activate_plugins', 'plugins.php' );
    114     if ( is_super_admin() ) {
    115         /* translators: add new plugin */
    116         $submenu['plugins.php'][10] = array(_x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php');
    117     }
    118     if ( !is_multisite() )
    119         $submenu['plugins.php'][15] = array( __('Editor'), 'edit_plugins', 'plugin-editor.php' );
     112$menu_perms = get_site_option('menu_items', array());
     113if ( is_super_admin() || is_multisite() && $menu_perms['plugins'] ) {
     114    $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' );
     115        $submenu['plugins.php'][5]  = array( __('Installed'), 'activate_plugins', 'plugins.php' );
     116        if ( is_super_admin() ) {
     117            /* translators: add new plugin */
     118            $submenu['plugins.php'][10] = array(_x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php');
     119        }
     120        if ( !is_multisite() )
     121            $submenu['plugins.php'][15] = array( __('Editor'), 'edit_plugins', 'plugin-editor.php' );
     122}
    120123
    121124if ( current_user_can('edit_users') )
     
    127130    $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.
    128131    $submenu['users.php'][5] = array(__('Authors &amp; Users'), 'edit_users', 'users.php');
    129     $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php');
     132    if ( !is_multisite() )
     133        $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php');
     134    elseif ( is_super_admin() || get_site_option( 'add_new_users' ) )
     135        $submenu['users.php'][10] = array(__('Add New') . ' <strong>*</strong>', 'create_users', 'ms-options.php#addnewusers');
     136       
    130137    $submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php');
    131138} else {
     
    138145    $submenu['tools.php'][10] = array( __('Import'), 'import', 'import.php' );
    139146    $submenu['tools.php'][15] = array( __('Export'), 'import', 'export.php' );
    140     $submenu['tools.php'][20] = array( __('Upgrade'), 'install_plugins',  'update-core.php');
     147    if ( is_super_admin() )
     148        $submenu['tools.php'][20] = array( __('Upgrade'), 'install_plugins',  'update-core.php');
    141149
    142150$menu[80] = array( __('Settings'), 'manage_options', 'options-general.php', '', 'menu-top', 'menu-settings', 'div' );
     
    148156    $submenu['options-general.php'][35] = array(__('Privacy'), 'manage_options', 'options-privacy.php');
    149157    $submenu['options-general.php'][40] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
    150     $submenu['options-general.php'][45] = array(__('Miscellaneous'), 'manage_options', 'options-misc.php');
     158    if ( is_super_admin() )
     159        $submenu['options-general.php'][45] = array(__('Miscellaneous'), 'manage_options', 'options-misc.php');
    151160
    152161$_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group
Note: See TracChangeset for help on using the changeset viewer.