Skip to:
Content

BuddyPress.org

Changeset 3730


Ignore:
Timestamp:
01/18/2011 06:03:57 PM (16 years ago)
Author:
djpaul
Message:

Correct phpdoc for bp_get_displayed_user_nav(). Fixes #3011, props LanceHudson

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-templatetags.php

    r3728 r3730  
    455455        global $bp;
    456456
    457         $default_search_value = bp_get_search_default_text(); 
     457        $default_search_value = bp_get_search_default_text();
    458458        $search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value;
    459459
     
    534534
    535535/**
    536  * bp_get_displayed_user_nav()
    537  * TEMPLATE TAG
    538  *
    539  * Uses the $bp->bp_users_nav global to render out the user navigation when viewing another user other than
     536 * Uses the $bp->bp_nav global to render out the user navigation when viewing another user other than
    540537 * yourself.
    541538 *
     
    583580function bp_get_options_nav() {
    584581        global $bp;
    585        
     582
    586583        // If we are looking at a member profile, then the we can use the current component as an
    587584        // index. Otherwise we need to use the component's root_slug
    588585        $component_index = !empty( $bp->displayed_user ) ? $bp->current_component : bp_get_root_slug( $bp->current_component );
    589        
     586
    590587        if ( count( $bp->bp_options_nav[$component_index] ) < 1 )
    591588                return false;
     
    10531050}
    10541051
    1055 /** 
    1056  * Get the default text for the search box for a given component. 
    1057  * 
    1058  * @global object $bp BuddyPress global settings 
    1059  * @return string 
    1060  * @since 1.3 
    1061  */ 
    1062 function bp_search_default_text() { 
    1063         echo bp_get_search_default_text(); 
    1064 } 
    1065         function bp_get_search_default_text( $component = false ) { 
    1066                 global $bp; 
    1067                
    1068                 if ( empty( $component ) ) 
     1052/**
     1053 * Get the default text for the search box for a given component.
     1054 *
     1055 * @global object $bp BuddyPress global settings
     1056 * @return string
     1057 * @since 1.3
     1058 */
     1059function bp_search_default_text() {
     1060        echo bp_get_search_default_text();
     1061}
     1062        function bp_get_search_default_text( $component = false ) {
     1063                global $bp;
     1064
     1065                if ( empty( $component ) )
    10691066                        $component = $bp->current_component;
    1070                
     1067
    10711068                $default_text = __( 'Search anything...', 'buddypress' );
    1072                
     1069
    10731070                if ( !empty( $bp->default_search_strings[$component] ) ) {
    10741071                        // Most of the time, $component will be the actual component name
     
    10831080                        }
    10841081                }
    1085                
    1086                 return apply_filters( 'bp_search_default_text', $default_text, $component ); 
    1087         } 
     1082
     1083                return apply_filters( 'bp_search_default_text', $default_text, $component );
     1084        }
    10881085
    10891086function bp_search_form() {
     
    11211118/**
    11221119 * Creates and outputs a button.
    1123  * 
     1120 *
    11241121 * @param array $args See bp_get_button() for the list of arguments.
    11251122 * @see bp_get_button()
     
    11741171
    11751172        preg_match( "%\s*((?:<[^>]+>)+\S*)\s*|\s+%s", $text, $matches, PREG_OFFSET_CAPTURE, $excerpt_length );
    1176        
     1173
    11771174        if ( !empty( $matches ) ) {
    1178                 $pos = array_pop( array_pop( $matches ) );     
     1175                $pos = array_pop( array_pop( $matches ) );
    11791176                $text = substr( $text, 0, $pos ) . ' [...]';
    11801177        }
    1181        
     1178
    11821179        return apply_filters( 'bp_create_excerpt', $text, $original_text );
    11831180}
     
    16061603
    16071604                        // Component has specific root slug
    1608                         if ( !empty( $bp->{$component_name}->root_slug ) ) 
     1605                        if ( !empty( $bp->{$component_name}->root_slug ) )
    16091606                                $root_slug = $bp->{$component_name}->root_slug;
    16101607                }
     
    19041901function bp_is_user_groups() {
    19051902        global $bp;
    1906        
     1903
    19071904        if ( bp_is_current_component( BP_GROUPS_SLUG ) )
    19081905                return true;
     
    19131910function bp_is_group() {
    19141911        global $bp;
    1915        
     1912
    19161913        if ( bp_is_current_component( BP_GROUPS_SLUG ) && isset( $bp->groups->current_group ) && $bp->groups->current_group )
    19171914                return true;
Note: See TracChangeset for help on using the changeset viewer.