Skip to:
Content

BuddyPress.org


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-activity/bp-activity-loader.php

    r3800 r3917  
    1818     */
    1919    function BP_Activity_Component() {
    20         parent::start( 'activity', __( 'Activity Streams', 'buddypress' ) );
     20        parent::start(
     21            'activity',
     22            __( 'Activity Streams', 'buddypress' ),
     23            BP_PLUGIN_DIR
     24        );
     25    }
     26
     27    /**
     28     * Include files
     29     */
     30    function _includes() {
     31        // Files to include
     32        $includes = array(
     33            'actions',
     34            'screens',
     35            'filters',
     36            'classes',
     37            'template',
     38            'functions',
     39            'notifications',
     40        );
     41
     42        parent::_includes( $includes );
    2143    }
    2244
     
    3759            define( 'BP_ACTIVITY_SLUG', $this->id );
    3860
    39         // Do some slug checks
    40         $this->slug      = BP_ACTIVITY_SLUG;
    41         $this->root_slug = isset( $bp->pages->activity->slug ) ? $bp->pages->activity->slug : $this->slug;
    42 
    43         // Tables
    44         $this->table_name      = $bp->table_prefix . 'bp_activity';
    45         $this->table_name_meta = $bp->table_prefix . 'bp_activity_meta';
    46        
    47         // Register this in the active components array
    48         $bp->active_components[$this->id] = $this->id;
    49 
    50         // The default text for the blogs directory search box
    51         $bp->default_search_strings[$this->id] = __( 'Search Activity...', 'buddypress' );     
    52     }
    53 
    54     /**
    55      * Include files
    56      */
    57     function _includes() {
    58         require_once( BP_PLUGIN_DIR . '/bp-activity/bp-activity-actions.php'   );
    59         require_once( BP_PLUGIN_DIR . '/bp-activity/bp-activity-filters.php'   );
    60         require_once( BP_PLUGIN_DIR . '/bp-activity/bp-activity-screens.php'   );
    61         require_once( BP_PLUGIN_DIR . '/bp-activity/bp-activity-classes.php'   );
    62         require_once( BP_PLUGIN_DIR . '/bp-activity/bp-activity-template.php'  );
    63         require_once( BP_PLUGIN_DIR . '/bp-activity/bp-activity-functions.php' );
     61        // Global tables for messaging component
     62        $global_tables = array(
     63            'table_name'      => $bp->table_prefix . 'bp_activity',
     64            'table_name_meta' => $bp->table_prefix . 'bp_activity_meta',
     65        );
     66
     67        // All globals for messaging component.
     68        // Note that global_tables is included in this array.
     69        $globals = array(
     70            'path'                  => BP_PLUGIN_DIR,
     71            'slug'                  => BP_ACTIVITY_SLUG,
     72            'root_slug'             => isset( $bp->pages->activity->slug ) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG,
     73            'search_string'         => __( 'Search Activity...', 'buddypress' ),
     74            'global_tables'         => $global_tables,
     75        );
     76
     77        parent::_setup_globals( $globals );
    6478    }
    6579
     
    7387
    7488        // Add 'Activity' to the main navigation
    75         bp_core_new_nav_item( array(
     89        $main_nav = array(
    7690            'name'                => __( 'Activity', 'buddypress' ),
    7791            'slug'                => $this->slug,
     
    7993            'screen_function'     => 'bp_activity_screen_my_activity',
    8094            'default_subnav_slug' => 'just-me',
    81             'item_css_id'         => $this->id )
     95            'item_css_id'         => $this->id
    8296        );
    8397
     
    101115
    102116        // Add the subnav items to the activity nav item if we are using a theme that supports this
    103         bp_core_new_subnav_item( array(
     117        $sub_nav[] = array(
    104118            'name'            => __( 'Personal', 'buddypress' ),
    105119            'slug'            => 'just-me',
     
    108122            'screen_function' => 'bp_activity_screen_my_activity',
    109123            'position'        => 10
    110         ) );
     124        );
    111125
    112126        // Additional menu if friends is active
    113127        if ( bp_is_active( 'friends' ) ) {
    114             bp_core_new_subnav_item( array(
     128            $sub_nav[] = array(
    115129                'name'            => __( 'Friends', 'buddypress' ),
    116130                'slug'            => $bp->friends->slug,
     
    120134                'position'        => 20,
    121135                'item_css_id'     => 'activity-friends'
    122             ) );
     136            ) ;
    123137        }
    124138
    125139        // Additional menu if groups is active
    126140        if ( bp_is_active( 'groups' ) ) {
    127             bp_core_new_subnav_item( array(
     141            $sub_nav[] = array(
    128142                'name'            => __( 'Groups', 'buddypress' ),
    129143                'slug'            => $bp->groups->slug,
     
    133147                'position'        => 30,
    134148                'item_css_id'     => 'activity-groups'
    135             ) );
     149            );
    136150        }
    137151
    138152        // Favorite activity items
    139         bp_core_new_subnav_item( array(
     153        $sub_nav[] = array(
    140154            'name'            => __( 'Favorites', 'buddypress' ),
    141155            'slug'            => 'favorites',
     
    145159            'position'        => 40,
    146160            'item_css_id'     => 'activity-favs'
    147         ) );
     161        );
    148162
    149163        // @ mentions
    150         bp_core_new_subnav_item( array(
     164        $sub_nav[] = array(
    151165            'name'            => sprintf( __( '@%s Mentions', 'buddypress' ), $user_login ),
    152166            'slug'            => 'mentions',
     
    156170            'position'        => 50,
    157171            'item_css_id'     => 'activity-mentions'
    158         ) );
     172        );
     173
     174        parent::_setup_nav( $main_nav, $sub_nav );
     175    }
     176
     177    /**
     178     * Sets up the title for pages and <title>
     179     *
     180     * @global obj $bp
     181     */
     182    function _setup_title() {
     183        global $bp;
    159184
    160185        // Adjust title based on view
     
    170195            }
    171196        }
     197
     198        parent::_setup_title();
    172199    }
    173200}
Note: See TracChangeset for help on using the changeset viewer.