Skip to:
Content

BuddyPress.org

Changeset 3917 for trunk/bp-loader.php


Ignore:
Timestamp:
01/25/2011 08:58:56 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Rename new 'bp-users' component to 'bp-members' for consistency through-out project.
Core, Messages, and Friends Components now use the BP_Component class.
Split Friends and Messages components into smaller files.
Change references to 'profile' to 'xprofile' through-out project for consistency.
Introduce 'bp_actions' and 'bp_screens' standard hooks to replace the usage of 'wp' through-out project.
Move component loader sequence into bp-core-bootstrap.php,
Move old root_component action into 1.3 deprecated file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-loader.php

    r3789 r3917  
    99 * Network:     true
    1010 */
    11 
    1211/** Constants *****************************************************************/
    1312
     
    4443/** Loader ********************************************************************/
    4544
    46 // Register BuddyPress themes contained within the bp-themes folder
    47 register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );
    48      
    49 // Test to see whether this is a new installation or an upgraded version of BuddyPress 
    50 if ( !$bp_db_version = get_site_option( 'bp-db-version' ) )
    51     $bp_db_version = get_site_option( 'bp-core-db-version' );  // BP 1.2 option name
    52      
    53 // This is a new installation. Run the wizard before loading BP core files
    54 if ( empty( $bp_db_version ) ) {
    55     define( 'BP_IS_INSTALL', true );
    56     require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
    57    
    58 // Existing successful installation
    59 } else {
    60 
    61     /***
    62      * This file will load in each BuddyPress component based on which
    63      * of the components have been activated on the "BuddyPress" admin menu.
    64      */
    65     require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-loader.php' );
    66     $bp_deactivated = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );
    67 
    68     /**
    69      * At this point in the stack, BuddyPress core has been loaded but
    70      * individual components (friends/activity/groups/etc...) have not.
    71      *
    72      * The 'bp_core_loaded' action lets you execute code ahead of the
    73      * other components.
    74      */
    75     do_action( 'bp_core_loaded' );
    76 
    77     // Activity Streams
    78     if ( !isset( $bp_deactivated['bp-activity/bp-activity-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-activity/bp-activity-loader.php') )
    79         include( BP_PLUGIN_DIR . '/bp-activity/bp-activity-loader.php' );
    80 
    81     // Blog Tracking
    82     if ( !isset( $bp_deactivated['bp-blogs/bp-blogs-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-loader.php') )
    83         include( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-loader.php' );
    84 
    85     // bbPress Forum Integration
    86     if ( !isset( $bp_deactivated['bp-forums/bp-forums-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-forums/bp-forums-loader.php') )
    87         include( BP_PLUGIN_DIR . '/bp-forums/bp-forums-loader.php' );
    88 
    89     // Friend Connections
    90     if ( !isset( $bp_deactivated['bp-friends/bp-friends-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-friends/bp-friends-loader.php') )
    91         include( BP_PLUGIN_DIR . '/bp-friends/bp-friends-loader.php' );
    92 
    93     // Groups Support
    94     if ( !isset( $bp_deactivated['bp-groups/bp-groups-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-groups/bp-groups-loader.php') )
    95         include( BP_PLUGIN_DIR . '/bp-groups/bp-groups-loader.php' );
    96 
    97     // Private Messaging
    98     if ( !isset( $bp_deactivated['bp-messages/bp-messages-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-messages/bp-messages-loader.php') )
    99         include( BP_PLUGIN_DIR . '/bp-messages/bp-messages-loader.php' );
    100 
    101     // Extended Profiles
    102     if ( !isset( $bp_deactivated['bp-xprofile/bp-xprofile-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-loader.php') )
    103         include( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-loader.php' );
    104        
    105     // Users
    106     include( BP_PLUGIN_DIR . '/bp-users/bp-users-loader.php'       );
    107 
    108     // Settings
    109     include( BP_PLUGIN_DIR . '/bp-settings/bp-settings-loader.php' );
    110 
    111     // If this is an upgrade, load the upgrade file
    112     if ( $bp_db_version < constant( 'BP_DB_VERSION' ) ) {
    113         define( 'BP_IS_UPGRADE', true );
    114         require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
    115     }
    116 }
    117 
    118 /********************************************************************************
    119  * Functions to set up custom BuddyPress actions that components should
    120  * hook in to.
    121  */
    122 
    123 /**
    124  * Include files on this action
    125  */
    126 function bp_include() {
    127     do_action( 'bp_include' );
    128 }
    129 
    130 /**
    131  * Setup BuddyPress root directory components
    132  */
    133 function bp_setup_root_components() {
    134     do_action( 'bp_setup_root_components' );
    135 }
    136 
    137 /**
    138  * Setup global variables and objects
    139  */
    140 function bp_setup_globals() {
    141     do_action( 'bp_setup_globals' );
    142 }
    143 
    144 /**
    145  * Set navigation elements
    146  */
    147 function bp_setup_nav() {
    148     do_action( 'bp_setup_nav' );
    149 }
    150 
    151 /**
    152  * Register widgets
    153  */
    154 function bp_setup_widgets() {
    155     do_action( 'bp_register_widgets' );
    156 }
    157 
    158 /**
    159  * Initlialize code
    160  */
    161 function bp_init() {
    162     do_action( 'bp_init' );
    163 }
    164 
    165 /**
    166  * Attached to plugins_loaded
    167  */
    168 function bp_loaded() {
    169     do_action( 'bp_loaded' );
    170 }
    171 
    172 /**
    173  * Attach potential template screens
    174  */
    175 function bp_screens() {
    176     do_action( 'bp_screens' );
    177 }
     45require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-bootstrap.php' );
    17846
    17947/**
Note: See TracChangeset for help on using the changeset viewer.