Changeset 5758 for trunk/bp-core/bp-core-template.php
- Timestamp:
- 02/13/2012 05:46:52 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-template.php
r5729 r5758 23 23 // If we are looking at a member profile, then the we can use the current component as an 24 24 // index. Otherwise we need to use the component's root_slug 25 $component_index = !empty( $bp->displayed_user ) ? $bp->current_component : bp_get_root_slug( $bp->current_component);25 $component_index = !empty( $bp->displayed_user ) ? bp_current_component() : bp_get_root_slug( bp_current_component() ); 26 26 27 27 if ( !bp_is_single_item() ) { … … 32 32 } 33 33 } else { 34 if ( !isset( $bp->bp_options_nav[ $bp->current_item] ) || count( $bp->bp_options_nav[$bp->current_item] ) < 1 ) {34 if ( !isset( $bp->bp_options_nav[bp_current_item()] ) || count( $bp->bp_options_nav[bp_current_item()] ) < 1 ) { 35 35 return false; 36 36 } else { 37 $the_index = $bp->current_item;37 $the_index = bp_current_item(); 38 38 } 39 39 } … … 45 45 46 46 // If the current action or an action variable matches the nav item id, then add a highlight CSS class. 47 if ( $subnav_item['slug'] == $bp->current_action) {47 if ( $subnav_item['slug'] == bp_current_action() ) { 48 48 $selected = ' class="current selected"'; 49 49 } else { … … 661 661 // Use current global component if none passed 662 662 if ( empty( $component ) ) 663 $component = $bp->current_component;663 $component = bp_current_component(); 664 664 665 665 // Component is active … … 695 695 // If no slug is passed, look at current_component 696 696 if ( empty( $root_slug ) ) 697 $root_slug = $bp->current_component;697 $root_slug = bp_current_component(); 698 698 699 699 // No current component or root slug, so flee … … 763 763 764 764 if ( !empty( $bp->current_component ) ) { 765 765 766 // First, check to see whether $component_name and the current 766 767 // component are a simple match … … 781 782 // corresponding slug from $bp->active_components. 782 783 } else if ( $key = array_search( $component, $bp->active_components ) ) { 783 if ( strstr( $bp->current_component, $key ) ) 784 if ( strstr( $bp->current_component, $key ) ) { 784 785 $is_current_component = true; 786 } 785 787 786 788 // If we haven't found a match yet, check against the root_slugs … … 790 792 // If the $component parameter does not match the current_component, 791 793 // then move along, these are not the droids you are looking for 792 if ( empty( $bp->{$id}->root_slug ) || $bp->{$id}->root_slug != $bp->current_component ) 794 if ( empty( $bp->{$id}->root_slug ) || $bp->{$id}->root_slug != $bp->current_component ) { 793 795 continue; 796 } 794 797 795 798 if ( $id == $component ) { … … 808 811 809 812 // Component name is in the page template name 810 if ( !empty( $page_template ) && strstr( strtolower( $page_template ), strtolower( $component ) ) ) 813 if ( !empty( $page_template ) && strstr( strtolower( $page_template ), strtolower( $component ) ) ) { 811 814 $is_current_component = true; 815 } 812 816 } 813 817 … … 833 837 */ 834 838 function bp_is_current_action( $action = '' ) { 835 global $bp; 836 837 if ( $action == $bp->current_action ) 839 if ( $action == bp_current_action() ) 838 840 return true; 839 841 … … 1081 1083 1082 1084 function bp_is_single_activity() { 1083 global $bp; 1084 1085 if ( bp_is_activity_component() && is_numeric( $bp->current_action ) ) 1085 if ( bp_is_activity_component() && is_numeric( bp_current_action() ) ) 1086 1086 return true; 1087 1087
Note: See TracChangeset
for help on using the changeset viewer.