Skip to:
Content

BuddyPress.org

Changeset 1145


Ignore:
Timestamp:
02/25/2009 04:32:50 AM (15 years ago)
Author:
apeatling
Message:

Fixes #513

Location:
trunk
Files:
6 edited

Legend:

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

    r1052 r1145  
    279279
    280280function bp_core_force_buddypress_stylesheet( $stylesheet ) {
    281     global $bp, $is_single_group, $is_member_page;
     281    global $bp, $is_member_page;
    282282
    283283    $member_theme = get_site_option('active-member-theme');
  • trunk/bp-core/bp-core-templatetags.php

    r1079 r1145  
    7474 */
    7575function bp_get_options_nav() {
    76     global $bp, $is_single_group;
    77 
    78     /* Only render this navigation when the logged in user is looking at one of their own pages. */
    79     if ( bp_is_home() || $is_single_group ) {
     76    global $bp;
     77
     78    /***
     79     * Only render this navigation when the logged in user is looking at one of their own pages, or we are using it to display nav
     80     * menus for something like a group, or event.
     81     */
     82    if ( bp_is_home() || $bp->is_single_item ) {
    8083        if ( count( $bp->bp_options_nav[$bp->current_component] ) < 1 )
    8184            return false;
  • trunk/bp-forums/bp-forums-templatetags.php

    r1052 r1145  
    9494function bp_has_topics( $topics_per_page = 10 ) {
    9595    global $forum_template, $bp;
    96     global $is_single_group, $group_obj;
     96    global $group_obj;
    9797   
    9898    $forum_id = groups_get_groupmeta( $group_obj->id, 'forum_id' );
     
    369369function bp_has_topic_posts( $posts_per_page = 10 ) {
    370370    global $topic_template, $bp;
    371     global $is_single_group, $group_obj;
     371    global $group_obj;
    372372   
    373373    $topic_id = $bp->action_variables[1];
  • trunk/bp-groups.php

    r1142 r1145  
    189189function groups_setup_nav() {
    190190    global $bp, $current_blog;
    191     global $group_obj, $is_single_group;
     191    global $group_obj;
    192192   
    193193    if ( $group_id = BP_Groups_Group::group_exists($bp->current_action) ) {
     194       
    194195        /* This is a single group page. */
    195         $is_single_group = true;
     196        $bp->is_single_item = true;
    196197        $group_obj = new BP_Groups_Group( $group_id );
    197198   
     
    228229    if ( $bp->current_component == $bp->groups->slug ) {
    229230       
    230         if ( bp_is_home() && !$is_single_group ) {
     231        if ( bp_is_home() && !$bp->is_single_item ) {
    231232           
    232233            $bp->bp_options_title = __('My Groups', 'buddypress');
    233234           
    234         } else if ( !bp_is_home() && !$is_single_group ) {
     235        } else if ( !bp_is_home() && !$bp->is_single_item ) {
    235236
    236237            $bp->bp_options_avatar = bp_core_get_avatar( $bp->displayed_user->id, 1 );
    237238            $bp->bp_options_title = $bp->displayed_user->fullname;
    238239           
    239         } else if ( $is_single_group ) {
     240        } else if ( $bp->is_single_item ) {
    240241            // We are viewing a single group, so set up the
    241242            // group navigation menu using the $group_obj global.
     
    397398
    398399function groups_screen_group_home() {
    399     global $is_single_group, $bp;
    400    
    401     if ( $is_single_group ) {
     400    global $bp;
     401   
     402    if ( $bp->is_single_item ) {
    402403       
    403404        if ( isset($_GET['new']) ) {
     
    416417
    417418function groups_screen_group_forum() {
    418     global $is_single_group, $bp, $group_obj;
    419    
    420     if ( $is_single_group ) {
     419    global $bp, $group_obj;
     420   
     421    if ( $bp->is_single_item ) {
    421422        $topic_id = $bp->action_variables[1];
    422423        $forum_id = groups_get_groupmeta( $group_obj->id, 'forum_id' );
     
    452453function groups_screen_group_wire() {
    453454    global $bp;
    454     global $is_single_group, $group_obj;
     455    global $group_obj;
    455456   
    456457    $wire_action = $bp->action_variables[0];
    457458       
    458     if ( $is_single_group ) {
     459    if ( $bp->is_single_item ) {
    459460        if ( 'post' == $wire_action && BP_Groups_Member::check_is_member( $bp->loggedin_user->id, $group_obj->id ) ) {
    460461
     
    496497function groups_screen_group_members() {
    497498    global $bp;
    498     global $is_single_group, $group_obj;
    499    
    500     if ( $is_single_group ) {
     499    global $group_obj;
     500   
     501    if ( $bp->is_single_item ) {
    501502        do_action( 'groups_screen_group_members', $group_obj->id );
    502503       
     
    507508function groups_screen_group_photos() {
    508509    global $bp;
    509     global $is_single_group, $group_obj;
    510    
    511     if ( $is_single_group ) {
     510    global $group_obj;
     511   
     512    if ( $bp->is_single_item ) {
    512513        // Not implemented yet.
    513514        bp_core_load_template( 'groups/group-home' );
     
    517518function groups_screen_group_invite() {
    518519    global $bp;
    519     global $is_single_group, $group_obj;
    520    
    521     if ( $is_single_group ) {
     520    global $group_obj;
     521   
     522    if ( $bp->is_single_item ) {
    522523        if ( isset($bp->action_variables) && 'send' == $bp->action_variables[0] ) {
    523524            // Send the invites.
     
    538539function groups_screen_group_leave() {
    539540    global $bp;
    540     global $is_single_group, $group_obj;
    541    
    542     if ( $is_single_group ) {
     541    global $group_obj;
     542   
     543    if ( $bp->is_single_item ) {
    543544        if ( isset($bp->action_variables) && 'yes' == $bp->action_variables[0] ) {
    544545           
     
    923924function groups_action_join_group() {
    924925    global $bp;
    925     global $is_single_group, $group_obj;   
    926 
    927     if ( !$is_single_group || $bp->current_component != $bp->groups->slug || $bp->current_action != 'join' )
     926    global $group_obj; 
     927
     928    if ( !$bp->is_single_item || $bp->current_component != $bp->groups->slug || $bp->current_action != 'join' )
    928929        return false;
    929930       
     
    22192220
    22202221    if ( $current_component == $groups_bp->groups->slug )
    2221         $is_single_group = BP_Groups_Group::group_exists( $current_action, $groups_bp->groups->table_name );
    2222    
    2223     if ( $is_single_group ) {
     2222        $bp->is_single_item = BP_Groups_Group::group_exists( $current_action, $groups_bp->groups->table_name );
     2223   
     2224    if ( $bp->is_single_item ) {
    22242225        add_filter( 'theme_root', 'bp_core_set_member_theme_root' );
    22252226        add_filter( 'theme_root_uri', 'bp_core_set_member_theme_root_uri' );
     
    22352236
    22362237function groups_force_buddypress_stylesheet( $stylesheet ) {
    2237     global $bp, $is_single_group, $is_member_page, $current_component;
     2238    global $bp, $is_member_page, $current_component;
    22382239
    22392240    if ( $current_component != $bp->groups->slug )
     
    22452246        $member_theme = 'buddypress-member';
    22462247   
    2247     if ( $is_single_group ) {
     2248    if ( $bp->is_single_item ) {
    22482249        add_filter( 'theme_root', 'bp_core_set_member_theme_root' );
    22492250        add_filter( 'theme_root_uri', 'bp_core_set_member_theme_root_uri' );
  • trunk/bp-groups/bp-groups-templatetags.php

    r1138 r1145  
    164164function bp_has_groups( $groups_per_page = 10 ) {
    165165    global $groups_template, $bp;
    166     global $is_single_group, $group_obj;
    167    
    168     if ( !$is_single_group ) {
     166    global $group_obj;
     167   
     168    if ( !$bp->is_single_item ) {
    169169        $groups_template = new BP_Groups_Template( $bp->displayed_user->id, false, $groups_per_page );
    170170    } else {
  • trunk/buddypress-theme/member-themes/buddypress-member/functions.php

    r1052 r1145  
    99
    1010function bp_get_options_class() {
    11     global $bp, $is_single_group;
     11    global $bp;
    1212
    1313    if ( !bp_is_home() && $bp->current_component == $bp->profile->slug || $bp->current_component == $bp->friends->slug  || $bp->current_component == $bp->blogs->slug ) {
     
    1515    }
    1616   
    17     if ( ( $bp->current_component == $bp->groups->slug && $is_single_group ) || ( $bp->current_component == $bp->groups->slug && !bp_is_home() ) )
     17    if ( ( $bp->current_component == $bp->groups->slug && $bp->is_single_item ) || ( $bp->current_component == $bp->groups->slug && !bp_is_home() ) )
    1818        echo ' class="arrow"'; 
    1919}
Note: See TracChangeset for help on using the changeset viewer.