Skip to:
Content

BuddyPress.org

Changeset 4049


Ignore:
Timestamp:
02/17/2011 03:27:47 PM (14 years ago)
Author:
boonebgorges
Message:

Reorders the way that the BP Groups Extension loads the main group tab and the admin tab, to ensure that the main tab is added before the group admin tab is rendered using bp_core_load_template()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-classes.php

    r4048 r4049  
    11451145        }
    11461146
     1147        // When we are viewing a single group, add the group extension nav item
     1148        if ( $this->visibility == 'public' || ( $this->visibility != 'public' && $bp->groups->current_group->user_has_access ) ) {
     1149            if ( $this->enable_nav_item ) {
     1150                if ( bp_is_current_component( 'groups' ) && $bp->is_single_item ) {
     1151                    bp_core_new_subnav_item( array( 'name' => ( !$this->nav_item_name ) ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => $bp->groups->root_slug, 'parent_url' => bp_get_group_permalink( $bp->groups->current_group ), 'position' => $this->nav_item_position, 'item_css_id' => 'nav-' . $this->slug, 'screen_function' => array( &$this, '_display_hook' ), 'user_has_access' => $this->enable_nav_item ) );
     1152                }
     1153
     1154                // When we are viewing the extension display page, set the title and options title
     1155                if ( bp_is_current_component( 'groups' ) && $bp->is_single_item && $bp->current_action == $this->slug ) {
     1156                    add_action( 'bp_template_content_header', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
     1157                    add_action( 'bp_template_title', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
     1158                }
     1159            }
     1160
     1161            // Hook the group home widget
     1162            if ( bp_is_current_component( 'groups' ) && $bp->is_single_item && ( !$bp->current_action || 'home' == $bp->current_action ) )
     1163                add_action( $this->display_hook, array( &$this, 'widget_display' ) );
     1164        }
     1165       
    11471166        // Construct the admin edit tab for the new group extension
    11481167        if ( !empty( $this->enable_edit_item ) && !empty( $bp->is_item_admin ) ) {
     
    11651184            }
    11661185        }
    1167 
    1168         // When we are viewing a single group, add the group extension nav item
    1169         if ( $this->visibility == 'public' || ( $this->visibility != 'public' && $bp->groups->current_group->user_has_access ) ) {
    1170             if ( $this->enable_nav_item ) {
    1171                 if ( bp_is_current_component( 'groups' ) && $bp->is_single_item ) {
    1172                     bp_core_new_subnav_item( array( 'name' => ( !$this->nav_item_name ) ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => $bp->groups->root_slug, 'parent_url' => bp_get_group_permalink( $bp->groups->current_group ), 'position' => $this->nav_item_position, 'item_css_id' => 'nav-' . $this->slug, 'screen_function' => array( &$this, '_display_hook' ), 'user_has_access' => $this->enable_nav_item ) );
    1173                 }
    1174 
    1175                 // When we are viewing the extension display page, set the title and options title
    1176                 if ( bp_is_current_component( 'groups' ) && $bp->is_single_item && $bp->current_action == $this->slug ) {
    1177                     add_action( 'bp_template_content_header', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
    1178                     add_action( 'bp_template_title', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
    1179                 }
    1180             }
    1181 
    1182             // Hook the group home widget
    1183             if ( bp_is_current_component( 'groups' ) && $bp->is_single_item && ( !$bp->current_action || 'home' == $bp->current_action ) )
    1184                 add_action( $this->display_hook, array( &$this, 'widget_display' ) );
    1185         }
    11861186    }
    11871187
Note: See TracChangeset for help on using the changeset viewer.