Changeset 4057
- Timestamp:
- 02/21/2011 01:03:41 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
bp-core/bp-core-buddybar.php (modified) (2 diffs)
-
bp-core/bp-core-template.php (modified) (1 diff)
-
bp-groups/bp-groups-loader.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-buddybar.php
r4027 r4057 54 54 55 55 /*** 56 * If we are not viewing a user, and this is a root component, don't attach the 57 * default subnav function so we can display a directory or something else. 56 * If the nav item is visible, we are not viewing a user, and this is a root 57 * component, don't attach the default subnav function so we can display a 58 * directory or something else. 58 59 */ 59 if ( bp_is_root_component( $slug ) && !bp_displayed_user_id() )60 if ( ( -1 != $position ) && bp_is_root_component( $slug ) && !bp_displayed_user_id() ) 60 61 return; 61 62 63 // Look for current component 62 64 if ( bp_is_current_component( $slug ) && !bp_current_action() ) { 65 if ( !is_object( $screen_function[0] ) ) 66 add_action( 'bp_screens', $screen_function ); 67 else 68 add_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ), 3 ); 69 70 if ( !empty( $default_subnav_slug ) ) 71 $bp->current_action = $default_subnav_slug; 72 73 // Look for current item 74 } elseif ( bp_is_current_item( $slug ) && !bp_current_action() ) { 63 75 if ( !is_object( $screen_function[0] ) ) 64 76 add_action( 'bp_screens', $screen_function ); … … 186 198 ); 187 199 200 // Look for current component 188 201 if ( ( $bp->current_action == $slug && $bp->current_component == $parent_slug ) && $user_has_access ) { 202 if ( !is_object( $screen_function[0] ) ) 203 add_action( 'bp_screens', $screen_function ); 204 else 205 add_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ) ); 206 207 // Look for current item 208 } elseif ( ( $bp->current_action == $slug && $bp->current_item == $parent_slug ) && $user_has_access ) { 189 209 if ( !is_object( $screen_function[0] ) ) 190 210 add_action( 'bp_screens', $screen_function ); -
trunk/bp-core/bp-core-template.php
r4050 r4057 22 22 $component_index = !empty( $bp->displayed_user ) ? $bp->current_component : bp_get_root_slug( $bp->current_component ); 23 23 24 if ( !isset( $bp->bp_options_nav[$component_index] ) || count( $bp->bp_options_nav[$component_index] ) < 1 ) 25 return false; 24 if ( !bp_is_single_item() ) { 25 if ( !isset( $bp->bp_options_nav[$component_index] ) || count( $bp->bp_options_nav[$component_index] ) < 1 ) { 26 return false; 27 } else { 28 $the_index = $component_index; 29 } 30 } else { 31 if ( !isset( $bp->bp_options_nav[$bp->current_item] ) || count( $bp->bp_options_nav[$bp->current_item] ) < 1 ) { 32 return false; 33 } else { 34 $the_index = $bp->current_item; 35 } 36 } 26 37 27 38 // Loop through each navigation item 28 foreach ( (array)$bp->bp_options_nav[$ component_index] as $subnav_item ) {39 foreach ( (array)$bp->bp_options_nav[$the_index] as $subnav_item ) { 29 40 if ( !$subnav_item['user_has_access'] ) 30 41 continue; -
trunk/bp-groups/bp-groups-loader.php
r3982 r4057 232 232 if ( bp_is_groups_component() && bp_is_single_item() ) { 233 233 234 unset( $main_nav ); unset( $sub_nav ); 235 234 236 // Add 'Groups' to the main navigation 235 237 $main_nav = array( 236 238 'name' => __( 'Groups', 'buddypress' ), 237 'slug' => $this-> root_slug,239 'slug' => $this->current_group->slug, 238 240 'position' => -1, // Do not show in BuddyBar 239 241 'screen_function' => 'groups_screen_group_home', … … 249 251 'slug' => 'home', 250 252 'parent_url' => $group_link, 251 'parent_slug' => $this-> root_slug,253 'parent_slug' => $this->current_group->slug, 252 254 'screen_function' => 'groups_screen_group_home', 253 255 'position' => 10, … … 261 263 'slug' => 'admin', 262 264 'parent_url' => $group_link, 263 'parent_slug' => $this-> root_slug,265 'parent_slug' => $this->current_group->slug, 264 266 'screen_function' => 'groups_screen_group_admin', 265 267 'position' => 20, … … 280 282 'slug' => 'request-membership', 281 283 'parent_url' => $group_link, 282 'parent_slug' => $this-> root_slug,284 'parent_slug' => $this->current_group->slug, 283 285 'screen_function' => 'groups_screen_group_request_membership', 284 286 'position' => 30 … … 292 294 'slug' => 'forum', 293 295 'parent_url' => $group_link, 294 'parent_slug' => $this-> root_slug,296 'parent_slug' => $this->current_group->slug, 295 297 'screen_function' => 'groups_screen_group_forum', 296 298 'position' => 40, … … 304 306 'slug' => 'members', 305 307 'parent_url' => $group_link, 306 'parent_slug' => $this-> root_slug,308 'parent_slug' => $this->current_group->slug, 307 309 'screen_function' => 'groups_screen_group_members', 308 310 'position' => 60, … … 317 319 'slug' => 'send-invites', 318 320 'parent_url' => $group_link, 319 'parent_slug' => $this-> root_slug,321 'parent_slug' => $this->current_group->slug, 320 322 'screen_function' => 'groups_screen_group_invite', 321 323 'item_css_id' => 'invite',
Note: See TracChangeset
for help on using the changeset viewer.