Changeset 6987
- Timestamp:
- 05/01/2013 07:20:08 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/bp-groups/bp-groups-classes.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-classes.php
r6986 r6987 1443 1443 // If admin/create names and slugs are not provided, they fall back on the main 1444 1444 // name and slug for the extension 1445 if ( ! $this->admin_name ) {1445 if ( ! $this->admin_name ) { 1446 1446 $this->admin_name = $this->name; 1447 1447 } 1448 1448 1449 if ( ! $this->admin_slug ) {1449 if ( ! $this->admin_slug ) { 1450 1450 $this->admin_slug = $this->slug; 1451 1451 } 1452 1452 1453 if ( ! $this->create_name ) {1453 if ( ! $this->create_name ) { 1454 1454 $this->create_name = $this->name; 1455 1455 } 1456 1456 1457 if ( ! $this->create_slug ) {1457 if ( ! $this->create_slug ) { 1458 1458 $this->create_slug = $this->slug; 1459 1459 } 1460 1460 1461 if ( ! empty( $this->enable_create_step ) ) {1461 if ( ! empty( $this->enable_create_step ) ) { 1462 1462 // Insert the group creation step for the new group extension 1463 $bp->groups->group_creation_steps[$this->create_slug] = array( 'name' => $this->create_name, 'slug' => $this->create_slug, 'position' => $this->create_step_position ); 1463 $bp->groups->group_creation_steps[ $this->create_slug ] = array( 1464 'name' => $this->create_name, 1465 'slug' => $this->create_slug, 1466 'position' => $this->create_step_position, 1467 ); 1464 1468 1465 1469 // Attach the group creation step display content action … … 1474 1478 if ( $this->visibility == 'public' || ( $this->visibility != 'public' && $bp->groups->current_group->user_has_access ) ) { 1475 1479 if ( $this->enable_nav_item ) { 1476 bp_core_new_subnav_item( array( 'name' => ( !$this->nav_item_name ) ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => $bp->groups->current_group->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 ) ); 1480 bp_core_new_subnav_item( array( 1481 'name' => !$this->nav_item_name ? $this->name : $this->nav_item_name, 1482 'slug' => $this->slug, 1483 'parent_slug' => $bp->groups->current_group->slug, 1484 'parent_url' => bp_get_group_permalink( $bp->groups->current_group ), 1485 'position' => $this->nav_item_position, 1486 'item_css_id' => 'nav-' . $this->slug, 1487 'screen_function' => array( &$this, '_display_hook' ), 1488 'user_has_access' => $this->enable_nav_item 1489 ) ); 1477 1490 1478 1491 // When we are viewing the extension display page, set the title and options title … … 1484 1497 1485 1498 // Hook the group home widget 1486 if ( ! bp_current_action() && bp_is_current_action( 'home' ) )1499 if ( ! bp_current_action() && bp_is_current_action( 'home' ) ) { 1487 1500 add_action( $this->display_hook, array( &$this, 'widget_display' ) ); 1501 } 1488 1502 } 1489 1503 } 1490 1504 1491 1505 // Construct the admin edit tab for the new group extension 1492 if ( !empty( $this->enable_edit_item ) && bp_is_item_admin() ) { 1493 add_action( 'groups_admin_tabs', create_function( '$current, $group_slug', '$selected = ""; if ( "' . esc_attr( $this->admin_slug ) . '" == $current ) $selected = " class=\"current\""; echo "<li{$selected}><a href=\"' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr( $this->admin_slug ) ) . '\">' . esc_attr( $this->admin_name ) . '</a></li>";' ), 10, 2 ); 1506 if ( ! empty( $this->enable_edit_item ) && bp_is_item_admin() ) { 1507 add_action( 'groups_admin_tabs', create_function( '$current, $group_slug', 1508 '$selected = ""; 1509 if ( "' . esc_attr( $this->admin_slug ) . '" == $current ) 1510 $selected = " class=\"current\""; 1511 echo "<li{$selected}><a href=\"' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr( $this->admin_slug ) ) . '\">' . esc_attr( $this->admin_name ) . '</a></li>";' 1512 ), 10, 2 ); 1494 1513 1495 1514 // Catch the edit screen and forward it to the plugin template
Note: See TracChangeset
for help on using the changeset viewer.