Changeset 5316 for trunk/bp-core/bp-core-loader.php
- Timestamp:
- 11/09/2011 05:43:09 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-loader.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-loader.php
r5311 r5316 1 1 <?php 2 3 /** 4 * BuddyPress Core Loader 5 * 6 * Core contains the commonly used functions, classes, and API's 7 * 8 * @package BuddyPress 9 * @subpackage Core 10 */ 11 2 12 // Exit if accessed directly 3 13 if ( !defined( 'ABSPATH' ) ) exit; 4 14 5 // Require all of the BuddyPress core libraries6 require( BP_PLUGIN_DIR . '/bp-core/bp-core-cache.php' );7 require( BP_PLUGIN_DIR . '/bp-core/bp-core-hooks.php' );8 require( BP_PLUGIN_DIR . '/bp-core/bp-core-cssjs.php' );9 require( BP_PLUGIN_DIR . '/bp-core/bp-core-update.php' );10 require( BP_PLUGIN_DIR . '/bp-core/bp-core-classes.php' );11 require( BP_PLUGIN_DIR . '/bp-core/bp-core-filters.php' );12 require( BP_PLUGIN_DIR . '/bp-core/bp-core-avatars.php' );13 require( BP_PLUGIN_DIR . '/bp-core/bp-core-widgets.php' );14 require( BP_PLUGIN_DIR . '/bp-core/bp-core-template.php' );15 require( BP_PLUGIN_DIR . '/bp-core/bp-core-buddybar.php' );16 require( BP_PLUGIN_DIR . '/bp-core/bp-core-catchuri.php' );17 require( BP_PLUGIN_DIR . '/bp-core/bp-core-component.php' );18 require( BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php' );19 require( BP_PLUGIN_DIR . '/bp-core/bp-core-moderation.php' );20 21 // Load deprecated functions22 require( BP_PLUGIN_DIR . '/bp-core/deprecated/1.5.php' );23 //require( BP_PLUGIN_DIR . '/bp-core/deprecated/1.6.php' );24 25 // Load the WP admin bar.26 if ( !defined( 'BP_DISABLE_ADMIN_BAR' ) )27 require( BP_PLUGIN_DIR . '/bp-core/bp-core-adminbar.php' );28 29 // Move active components from sitemeta, if necessary30 // Provides backpat with earlier versions of BP31 if ( is_multisite() && $active_components = get_site_option( 'bp-active-components' ) )32 bp_update_option( 'bp-active-components', $active_components );33 34 15 class BP_Core extends BP_Component { 35 16 17 /** 18 * Start the members component creation process 19 * 20 * @since BuddyPress (1.5) 21 * 22 * @uses BP_Core::bootstrap() 23 */ 36 24 function __construct() { 37 25 parent::start( … … 44 32 } 45 33 34 /** 35 * Populate the global data needed before BuddyPress can continue 36 * 37 * This involves figuring out the currently required, active, deactive, 38 * and optional components. 39 * 40 * @since BuddyPress (1.5) 41 * 42 * @global BuddyPress $bp 43 */ 46 44 private function bootstrap() { 47 45 global $bp; … … 58 56 /** Components ********************************************************/ 59 57 58 // Move active components from sitemeta, if necessary 59 // Provides backpat with earlier versions of BP 60 if ( is_multisite() && $active_components = get_site_option( 'bp-active-components' ) ) 61 bp_update_option( 'bp-active-components', $active_components ); 62 60 63 // Set the included and optional components. 61 64 $bp->optional_components = apply_filters( 'bp_optional_components', array( 'activity', 'blogs', 'forums', 'friends', 'groups', 'messages', 'settings', 'xprofile' ) ); … … 71 74 // Pre 1.5 Backwards compatibility 72 75 } elseif ( $deactivated_components = bp_get_option( 'bp-deactivated-components' ) ) { 76 73 77 // Trim off namespace and filename 74 78 foreach ( (array) $deactivated_components as $component => $value ) … … 89 93 // Default to all components active 90 94 } else { 95 91 96 // Set globals 92 97 $bp->deactivated_components = array(); … … 116 121 } 117 122 123 /** 124 * Sets up a majority of the BuddyPress globals that require a minimal 125 * amount of processing, meaning they cannot be set in the BuddyPress class. 126 * 127 * @since BuddyPress (1.5) 128 * 129 * @global BuddyPress $bp 130 */ 118 131 function setup_globals() { 119 132 global $bp; … … 136 149 if ( empty( $bp->pages ) ) 137 150 $bp->pages = bp_core_get_directory_pages(); 138 139 /** Admin Bar *********************************************************/140 141 // Set the 'My Account' global to prevent debug notices142 $bp->my_account_menu_id = false;143 144 /** Component and Action **********************************************/145 146 // Used for overriding the 2nd level navigation menu so it can be used to147 // display custom navigation for an item (for example a group)148 $bp->is_single_item = false;149 150 // Sets up the array container for the component navigation rendered151 // by bp_get_nav()152 $bp->bp_nav = array();153 154 // Sets up the array container for the component options navigation155 // rendered by bp_get_options_nav()156 $bp->bp_options_nav = array();157 158 // Contains an array of all the active components. The key is the slug,159 // value the internal ID of the component.160 //$bp->active_components = array();161 151 162 152 /** Basic current user data *******************************************/ … … 194 184 } 195 185 186 /** 187 * Setup BuddyBar navigation 188 * 189 * @since BuddyPress (1.5) 190 * 191 * @global BuddyPress $bp 192 */ 196 193 function setup_nav() { 197 194 global $bp; 198 195 199 /*** 200 * If the extended profiles component is disabled, we need to revert to using the 201 * built in WordPress profile information 202 */ 196 // If xprofile component is disabled, revert to WordPress profile 203 197 if ( !bp_is_active( 'xprofile' ) ) { 198 199 // Define local variable 200 $sub_nav = array(); 204 201 205 202 // Fallback values if xprofile is disabled … … 226 223 'screen_function' => 'bp_core_catch_profile_uri' 227 224 ); 225 226 parent::setup_nav( $main_nav, $sub_nav ); 228 227 } 229 228 } 230 229 } 231 230 231 /** 232 * Setup the BuddyPress Core component 233 * 234 * @since BuddyPress (1.6) 235 * 236 * @global BuddyPress $bp 237 */ 232 238 function bp_setup_core() { 233 239 global $bp;
Note: See TracChangeset
for help on using the changeset viewer.