Skip to:
Content

BuddyPress.org

Changeset 3706 for trunk/bp-core.php


Ignore:
Timestamp:
01/14/2011 07:35:58 AM (16 years ago)
Author:
johnjamesjacoby
Message:

First round of WordPress 3.1 adjustments for BuddyPress installer/upgrader.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r3675 r3706  
    299299        require ( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-admin.php' );
    300300}
    301 add_action( 'admin_menu', 'bp_core_admin_menu_init' );
     301is_multisite() ? add_action( 'network_admin_menu', 'bp_core_admin_menu_init' ) : add_action( 'admin_menu', 'bp_core_admin_menu_init' );
    302302
    303303/**
    … …  
    315315                return false;
    316316
    317         /* Add the administration tab under the "Site Admin" tab for site administrators */
     317        // Add the administration tab under the "Site Admin" tab for site administrators
    318318        $hook = bp_core_add_admin_menu_page( array(
    319                 'menu_title' => __( 'BuddyPress', 'buddypress' ),
    320                 'page_title' => __( 'BuddyPress', 'buddypress' ),
    321                 'access_level' => 10, 'file' => 'bp-general-settings',
    322                 'function' => 'bp_core_admin_dashboard',
    323                 'position' => 2
     319                'menu_title'   => __( 'BuddyPress', 'buddypress' ),
     320                'page_title'   => __( 'BuddyPress', 'buddypress' ),
     321                'capability'   => 'manage_options',
     322                'file'         => 'bp-general-settings',
     323                'function'     => 'bp_core_admin_dashboard',
     324                'position'     => 2
    324325        ) );
    325326
    326327        add_submenu_page( 'bp-general-settings', __( 'BuddyPress Dashboard', 'buddypress' ), __( 'Dashboard', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_dashboard' );
    327         add_submenu_page( 'bp-general-settings', __( 'Settings', 'buddypress' ), __( 'Settings', 'buddypress' ), 'manage_options', 'bp-settings', 'bp_core_admin_settings' );
    328 
    329         /* Add a hook for css/js */
     328        add_submenu_page( 'bp-general-settings', __( 'Settings', 'buddypress' ),             __( 'Settings',  'buddypress' ), 'manage_options', 'bp-settings',         'bp_core_admin_settings' );
     329
     330        // Add a hook for css/js
    330331        add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' );
    331332}
    332 add_action( 'admin_menu', 'bp_core_add_admin_menu' );
     333is_multisite() ? add_action( 'network_admin_menu', 'bp_core_add_admin_menu' ) : add_action( 'admin_menu', 'bp_core_add_admin_menu' );
    333334
    334335/**
    … …  
    18161817
    18171818        $defaults = array(
    1818                 'page_title' => '',
    1819                 'menu_title' => '',
    1820                 'access_level' => 2,
    1821                 'file' => false,
    1822                 'function' => false,
    1823                 'icon_url' => false,
    1824                 'position' => 100
     1819                'page_title'   => '',
     1820                'menu_title'   => '',
     1821                'capability'   => 'manage_options',
     1822                'file'         => false,
     1823                'function'     => false,
     1824                'icon_url'     => false,
     1825                'position'     => 100
    18251826        );
    18261827
    … …  
    18451846        } while ( !empty( $menu[$position] ) );
    18461847
    1847         $menu[$position] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
     1848        $menu[$position] = array ( $menu_title, $capability, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
    18481849
    18491850        $_registered_pages[$hookname] = true;
Note: See TracChangeset for help on using the changeset viewer.