Changeset 3917 for trunk/bp-activity/bp-activity-loader.php
- Timestamp:
- 01/25/2011 08:58:56 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-loader.php
r3800 r3917 18 18 */ 19 19 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 ); 21 43 } 22 44 … … 37 59 define( 'BP_ACTIVITY_SLUG', $this->id ); 38 60 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 ); 64 78 } 65 79 … … 73 87 74 88 // Add 'Activity' to the main navigation 75 bp_core_new_nav_item(array(89 $main_nav = array( 76 90 'name' => __( 'Activity', 'buddypress' ), 77 91 'slug' => $this->slug, … … 79 93 'screen_function' => 'bp_activity_screen_my_activity', 80 94 'default_subnav_slug' => 'just-me', 81 'item_css_id' => $this->id )95 'item_css_id' => $this->id 82 96 ); 83 97 … … 101 115 102 116 // 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( 104 118 'name' => __( 'Personal', 'buddypress' ), 105 119 'slug' => 'just-me', … … 108 122 'screen_function' => 'bp_activity_screen_my_activity', 109 123 'position' => 10 110 ) );124 ); 111 125 112 126 // Additional menu if friends is active 113 127 if ( bp_is_active( 'friends' ) ) { 114 bp_core_new_subnav_item(array(128 $sub_nav[] = array( 115 129 'name' => __( 'Friends', 'buddypress' ), 116 130 'slug' => $bp->friends->slug, … … 120 134 'position' => 20, 121 135 'item_css_id' => 'activity-friends' 122 ) );136 ) ; 123 137 } 124 138 125 139 // Additional menu if groups is active 126 140 if ( bp_is_active( 'groups' ) ) { 127 bp_core_new_subnav_item(array(141 $sub_nav[] = array( 128 142 'name' => __( 'Groups', 'buddypress' ), 129 143 'slug' => $bp->groups->slug, … … 133 147 'position' => 30, 134 148 'item_css_id' => 'activity-groups' 135 ) );149 ); 136 150 } 137 151 138 152 // Favorite activity items 139 bp_core_new_subnav_item(array(153 $sub_nav[] = array( 140 154 'name' => __( 'Favorites', 'buddypress' ), 141 155 'slug' => 'favorites', … … 145 159 'position' => 40, 146 160 'item_css_id' => 'activity-favs' 147 ) );161 ); 148 162 149 163 // @ mentions 150 bp_core_new_subnav_item(array(164 $sub_nav[] = array( 151 165 'name' => sprintf( __( '@%s Mentions', 'buddypress' ), $user_login ), 152 166 'slug' => 'mentions', … … 156 170 'position' => 50, 157 171 '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; 159 184 160 185 // Adjust title based on view … … 170 195 } 171 196 } 197 198 parent::_setup_title(); 172 199 } 173 200 }
Note: See TracChangeset
for help on using the changeset viewer.