Changeset 4556 for trunk/bp-core/bp-core-loader.php
- Timestamp:
- 06/24/2011 05:12:13 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-loader.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-loader.php
r4488 r4556 54 54 /** Components ********************************************************/ 55 55 56 // Set the included and optional components 57 $bp->optional_components = apply_filters( 'bp_optional_components', array( 'activity', 'blogs', 'forums', 'friends', 'groups', 'messages', 'settings', 'xprofile', ) ); 56 // Set the included and optional components. 57 $bp->optional_components = array( 'activity', 'forums', 'friends', 'groups', 'messages', 'settings', 'xprofile', ); 58 59 // Blogs component only available for multisite 60 if ( is_multisite() ) 61 $bp->optional_components[] = 'blogs'; 62 63 $bp->optional_components = apply_filters( 'bp_optional_components', $bp->optional_components ); 58 64 59 65 // Set the required components 60 $bp->required_components = apply_filters( 'bp_required_components', array( 'members',) );66 $bp->required_components = apply_filters( 'bp_required_components', array( 'members' ) ); 61 67 62 68 // Get a list of activated components 63 69 if ( $active_components = get_site_option( 'bp-active-components' ) ) { 64 $bp->active_components = apply_filters( 'bp_active_components', $active_components );70 $bp->active_components = apply_filters( 'bp_active_components', $active_components ); 65 71 $bp->deactivated_components = apply_filters( 'bp_deactivated_components', array_values( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_keys( $bp->active_components ) ) ) ); 66 72 … … 68 74 } elseif ( $deactivated_components = get_site_option( 'bp-deactivated-components' ) ) { 69 75 // Trim off namespace and filename 70 foreach ( $deactivated_components as $component => $value )76 foreach ( (array) $deactivated_components as $component => $value ) 71 77 $trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) ); 72 78 … … 75 81 76 82 // Setup the active components 77 $active_components = array_flip( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_values( $bp->deactivated_components ) ) );83 $active_components = array_flip( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_values( $bp->deactivated_components ) ) ); 78 84 79 85 // Loop through active components and set the values 80 foreach( $active_components as $component => $value ) 81 $bp->active_components[$component] = 1; 86 $bp->active_components = array_map( '__return_true', $active_components ); 82 87 83 88 // Set the active component global 84 $bp->active_components = apply_filters( 'bp_active_components', $bp->active_components ); 89 $bp->active_components = apply_filters( 'bp_active_components', $bp->active_components ); 90 91 // Default to all components active 92 } else { 93 // Set globals 94 $bp->deactivated_components = array(); 95 96 // Setup the active components 97 $active_components = array_flip( array_values( array_merge( $bp->optional_components, $bp->required_components ) ) ); 98 99 // Loop through active components and set the values 100 $bp->active_components = array_map( '__return_true', $active_components ); 101 102 // Set the active component global 103 $bp->active_components = apply_filters( 'bp_active_components', $bp->active_components ); 85 104 } 86 105
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)