Changeset 5384
- Timestamp:
- 11/27/2011 03:47:08 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-classes.php
r5329 r5384 1187 1187 var $name = false; 1188 1188 var $slug = false; 1189 1190 /* The name/slug of the Group Admin tab for this extension */ 1191 var $admin_name = ''; 1192 var $admin_slug = ''; 1193 1194 /* The name/slug of the Group Creation tab for this extension */ 1195 var $create_name = ''; 1196 var $create_slug = ''; 1189 1197 1190 1198 /* Will this extension be visible to non-members of a group? Options: public/private */ … … 1221 1229 function _register() { 1222 1230 global $bp; 1231 1232 // If admin/create names and slugs are not provided, they fall back on the main 1233 // name and slug for the extension 1234 if ( !$this->admin_name ) { 1235 $this->admin_name = $this->name; 1236 } 1237 1238 if ( !$this->admin_slug ) { 1239 $this->admin_slug = $this->slug; 1240 } 1241 1242 if ( !$this->create_name ) { 1243 $this->create_name = $this->name; 1244 } 1245 1246 if ( !$this->create_slug ) { 1247 $this->create_slug = $this->slug; 1248 } 1223 1249 1224 1250 if ( !empty( $this->enable_create_step ) ) { 1225 1251 // Insert the group creation step for the new group extension 1226 $bp->groups->group_creation_steps[$this-> slug] = array( 'name' => $this->name, 'slug' => $this->slug, 'position' => $this->create_step_position );1252 $bp->groups->group_creation_steps[$this->create_slug] = array( 'name' => $this->create_name, 'slug' => $this->create_slug, 'position' => $this->create_step_position ); 1227 1253 1228 1254 // Attach the group creation step display content action … … 1230 1256 1231 1257 // Attach the group creation step save content action 1232 add_action( 'groups_create_group_step_save_' . $this-> slug, array( &$this, 'create_screen_save' ) );1258 add_action( 'groups_create_group_step_save_' . $this->create_slug, array( &$this, 'create_screen_save' ) ); 1233 1259 } 1234 1260 … … 1254 1280 // Construct the admin edit tab for the new group extension 1255 1281 if ( !empty( $this->enable_edit_item ) && !empty( $bp->is_item_admin ) ) { 1256 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 );1282 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=\"' . 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 ); 1257 1283 1258 1284 // Catch the edit screen and forward it to the plugin template 1259 if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) && bp_is_action_variable( $this-> slug, 0 ) ) {1285 if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) && bp_is_action_variable( $this->admin_slug, 0 ) ) { 1260 1286 // Check whether the user is saving changes 1261 1287 $this->edit_screen_save();
Note: See TracChangeset
for help on using the changeset viewer.