// Construct the admin edit tab for the new group extension
if ( !empty( $this->enable_edit_item ) && !empty( $bp->is_item_admin ) ) {
add_action( 'groups_admin_tabs', create_function( '$current, $group_slug', '$selected = ""; if ( "' . esc_attr( $this->slug ) . '" == $current ) $selected = " class="current""; echo "<li{$selected}><a href="' . bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr( $this->slug ) . '">' . esc_attr( $this->name ) . '</a></li>";' ), 10, 2 );
// Catch the edit screen and forward it to the plugin template
if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) && bp_is_action_variable( $this->slug, 0 ) ) {
// Check whether the user is saving changes
$this->edit_screen_save();
add_action( 'groups_custom_edit_steps', array( &$this, 'edit_screen' ) );
if ( '' != locate_template( array( 'groups/single/home.php' ), false ) ) {
bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
} else {
add_action( 'bp_template_content_header', create_function( '', 'echo "<ul class="content-header-nav">"; bp_group_admin_tabs(); echo "</ul>";' ) );
add_action( 'bp_template_content', array( &$this, 'edit_screen' ) );
bp_core_load_template( apply_filters( 'bp_core_template_plugin', '/groups/single/plugins' ) );
}
}
}