Changeset 3989
- Timestamp:
- 02/02/2011 01:26:28 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-admin.php
r3987 r3989 228 228 229 229 // Settings form submitted, now save the settings. First, set active components 230 foreach ( (array)$_POST['bp_components'] as $key => $value) {231 if ( !(int) $value )232 $disabled[$key] = 1;230 if ( isset( $_POST['bp_components'] ) ) { 231 $bp->active_components = stripslashes_deep( $_POST['bp_components'] ); 232 update_site_option( 'bp-active-components', $bp->active_components ); 233 233 } 234 update_site_option( 'bp-deactivated-components', $disabled ); 235 234 236 235 // Then, update the directory pages 237 $directory_pages = array(); 238 foreach ( (array)$_POST['bp_pages'] as $key => $value ) { 239 if ( !empty( $value ) ) 240 $directory_pages[$key] = (int)$value; 236 if ( isset( $_POST['bp_pages'] ) ) { 237 $directory_pages = array(); 238 foreach ( (array)$_POST['bp_pages'] as $key => $value ) { 239 if ( !empty( $value ) ) { 240 $directory_pages[$key] = (int)$value; 241 } 242 } 243 bp_core_update_page_meta( $directory_pages ); 241 244 } 242 bp_core_update_page_meta( $directory_pages );243 245 } ?> 244 246 … … 263 265 <?php 264 266 265 $disabled_components = get_site_option( 'bp-deactivated-components' );266 267 bp_core_admin_component_options(); 267 268 bp_core_admin_page_options(); … … 292 293 function bp_core_admin_component_options() { 293 294 global $bp_wizard; 294 295 $ disabled_components = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );295 296 $active_components = apply_filters( 'bp_active_components', get_site_option( 'bp-active-components' ) ); 296 297 297 298 // An array of strings looped over to create component setup markup … … 299 300 'xprofile' => array( 300 301 'title' => __( 'Extended Profiles', 'buddypress' ), 301 'description' => __( 'Fully editable profile fields allow you to define the fields users can fill in to describe themselves. Tailor profile fields to suit your audience.', 'buddypress' ) 302 'description' => __( 'Customize your community with fully editable profile fields that allow your users use to uniquely describe themselves.', 'buddypress' ) 303 ), 304 'settings' => array( 305 'title' => __( 'Account Settings', 'buddypress' ), 306 'description' => __( 'Allow your users to modify their account and notification settings directly from within their profiles.', 'buddypress' ) 302 307 ), 303 308 'friends' => array( 304 309 'title' => __( 'Friend Connections', 'buddypress' ), 305 'description' => __( 'Let your users make connections so they can track the activity of others , or filter on only those usersthey care about the most.', 'buddypress' )310 'description' => __( 'Let your users make connections so they can track the activity of others and focus on the people they care about the most.', 'buddypress' ) 306 311 ), 307 312 'messages' => array( 308 313 'title' => __( 'Private Messaging', 'buddypress' ), 309 'description' => __( ' Private messaging will allow your users to talk to each other directly, and in private. Not just limited to one on one discussions, your userscan send messages to multiple recipients.', 'buddypress' )314 'description' => __( 'Allow your users to talk to each other directly and in private. They are not just limited to one-on-one discussions, and can send messages to multiple recipients.', 'buddypress' ) 310 315 ), 311 316 'activity' => array( 312 317 'title' => __( 'Activity Streams', 'buddypress' ), 313 'description' => __( 'Global, personal and group activity streams with threaded commenting, direct posting, favoriting and @mentions. All with full RSS feed and email notification support.', 'buddypress' )318 'description' => __( 'Global, personal, and group activity streams with threaded commenting, direct posting, favoriting and @mentions, all with full RSS feed and email notification support.', 'buddypress' ) 314 319 ), 315 320 'groups' => array( 316 'title' => __( ' ExtensibleGroups', 'buddypress' ),317 'description' => __( ' Powerful public, private or hidden groups allow your users to break the discussion down into specific topics with a separate activity stream and member listing.', 'buddypress' )321 'title' => __( 'User Groups', 'buddypress' ), 322 'description' => __( 'Groups allow your users to organize themselves into specific public, private or hidden sections with a separate activity stream and member listing.', 'buddypress' ) 318 323 ), 319 324 'forums' => array( … … 350 355 351 356 <td> 352 <label for="bp_components[ bp-<?php echo esc_attr( $name ); ?>.php]">353 <input type="checkbox" name="bp_components[ bp-<?php echo esc_attr( $name ); ?>.php]" value="1"<?php if ( !isset( $disabled_components['bp-' . esc_attr( $name ) . '.php'] ) ) : ?> checked="checked"<?php endif?> />357 <label for="bp_components[<?php echo esc_attr( $name ); ?>]"> 358 <input type="checkbox" name="bp_components[<?php echo esc_attr( $name ); ?>]" value="1"<?php checked( isset( $active_components[esc_attr( $name )] ) ); ?> /> 354 359 355 360 <?php echo esc_html( $labels['description'] ); ?> … … 362 367 <?php endforeach ?> 363 368 369 <?php do_action( 'bp_active_external_components' ); ?> 370 364 371 </tbody> 365 372 </table> 366 373 367 <?php /* Make sure that the blogs component is deactivated when multisite is shut off */ ?> 368 <?php if ( !is_multisite() ) : ?> 369 370 <input type="hidden" name="bp_components[bp-blogs.php]" value="0" /> 371 372 <?php endif ?> 373 374 <input type="hidden" name="bp_components[members]" value="1" /> 375 374 376 <?php 375 377 } … … 387 389 // Get the existing WP pages 388 390 $existing_pages = bp_core_get_page_meta(); 389 391 390 392 // An array of strings looped over to create component setup markup 391 393 $directory_pages = array( 392 'groups' => __( 'Groups Directory', 'buddypress' ), 393 'forums' => __( 'Forums Directory', 'buddypress' ), 394 'members' => __( 'Members Directory', 'buddypress' ), 395 'activity' => __( 'Activity', 'buddypress' ), 396 'register' => __( 'Register', 'buddypress' ), 397 'activate' => __( 'Activate', 'buddypress' ) 394 'members' => __( 'Members Directory', 'buddypress' ), 395 'activity' => __( 'Activity Directory', 'buddypress' ), 396 'groups' => __( 'Groups Directory', 'buddypress' ), 397 'forums' => __( 'Forums Directory', 'buddypress' ), 398 398 ); 399 399 … … 401 401 $directory_pages['blogs'] = __( "Blogs Directory", 'buddypress' ); ?> 402 402 403 <h3><?php _e( 'Page Setup', 'buddypress' ); ?></h3> 404 405 <p><?php _e( 'Choose the WordPress pages you would like to associate with the following BuddyPress content.', 'buddypress' ); ?></p> 406 407 <p><?php _e( 'Leaving any of these items unset makes that content inaccessible to visitors, so be sure to fill this section out carefully.', 'buddypress' ); ?></p> 408 403 <h3><?php _e( 'Directory Pages', 'buddypress' ); ?></h3> 404 405 <p><?php _e( 'Choose a WordPress Page to associate with each BuddyPress component directory. Setting to "None" will render that page inaccessible.', 'buddypress' ); ?></p> 406 409 407 <table class="form-table"> 410 408 <tbody> 411 409 412 410 <?php foreach ( $directory_pages as $name => $label ) : ?> 411 412 <?php if ( bp_is_active( $name ) ) : ?> 413 414 <tr valign="top"> 415 <th scope="row"> 416 <label for="bp_pages[<?php echo esc_attr( $name ) ?>]"><?php echo esc_html( $label ) ?></label> 417 </th> 418 419 <td> 420 <?php echo wp_dropdown_pages( array( 421 'name' => 'bp_pages[' . esc_attr( $name ) . ']', 422 'echo' => false, 423 'show_option_none' => __( '- None -', 'buddypress' ), 424 'selected' => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false 425 ) ) ?> 426 </td> 427 </tr> 428 429 <?php endif; ?> 430 431 <?php endforeach ?> 432 433 <?php do_action( 'bp_active_external_directories' ); ?> 434 435 </tbody> 436 </table> 437 438 <?php 439 440 // Static pages 441 $static_pages = array( 442 'register' => __( 'Sign up Page', 'buddypress' ), 443 'activate' => __( 'Activation Page', 'buddypress' ), 444 ); ?> 445 446 <h3><?php _e( 'Other Pages', 'buddypress' ); ?></h3> 447 448 <p><?php _e( 'Associate WordPress Pages with the following BuddyPress pages. Setting to "None" will render that page inaccessible.', 'buddypress' ); ?></p> 449 450 <table class="form-table"> 451 <tbody> 452 453 <?php foreach ( $static_pages as $name => $label ) : ?> 413 454 414 455 <tr valign="top"> … … 429 470 <?php endforeach ?> 430 471 472 <?php do_action( 'bp_active_external_pages' ); ?> 473 431 474 </tbody> 432 475 </table> 433 476 434 477 <?php 435 478 } -
trunk/bp-core/bp-core-bootstrap.php
r3944 r3989 29 29 30 30 // Get a list of deactivated components 31 $bp _deactivated = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );31 $bp->active_components = apply_filters( 'bp_active_components', get_site_option( 'bp-active-components' ) ); 32 32 33 33 // Activity Streams 34 if ( !isset( $bp_deactivated['bp-activity/bp-activity-loader.php']) && file_exists( BP_PLUGIN_DIR . '/bp-activity/bp-activity-loader.php') )34 if ( bp_is_active( 'activity') && file_exists( BP_PLUGIN_DIR . '/bp-activity/bp-activity-loader.php') ) 35 35 include( BP_PLUGIN_DIR . '/bp-activity/bp-activity-loader.php' ); 36 36 37 37 // Blog Tracking 38 if ( !isset( $bp_deactivated['bp-blogs/bp-blogs-loader.php']) && file_exists( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-loader.php') )38 if ( bp_is_active( 'blogs') && file_exists( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-loader.php') ) 39 39 include( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-loader.php' ); 40 40 41 41 // bbPress Forum Integration 42 if ( !isset( $bp_deactivated['bp-forums/bp-forums-loader.php']) && file_exists( BP_PLUGIN_DIR . '/bp-forums/bp-forums-loader.php') )42 if ( bp_is_active( 'forums') && file_exists( BP_PLUGIN_DIR . '/bp-forums/bp-forums-loader.php') ) 43 43 include( BP_PLUGIN_DIR . '/bp-forums/bp-forums-loader.php' ); 44 44 45 45 // Friend Connections 46 if ( !isset( $bp_deactivated['bp-friends/bp-friends-loader.php']) && file_exists( BP_PLUGIN_DIR . '/bp-friends/bp-friends-loader.php') )46 if ( bp_is_active( 'friends') && file_exists( BP_PLUGIN_DIR . '/bp-friends/bp-friends-loader.php') ) 47 47 include( BP_PLUGIN_DIR . '/bp-friends/bp-friends-loader.php' ); 48 48 49 49 // Groups Support 50 if ( !isset( $bp_deactivated['bp-groups/bp-groups-loader.php']) && file_exists( BP_PLUGIN_DIR . '/bp-groups/bp-groups-loader.php') )50 if ( bp_is_active( 'groups') && file_exists( BP_PLUGIN_DIR . '/bp-groups/bp-groups-loader.php') ) 51 51 include( BP_PLUGIN_DIR . '/bp-groups/bp-groups-loader.php' ); 52 52 53 53 // Private Messaging 54 if ( !isset( $bp_deactivated['bp-messages/bp-messages-loader.php']) && file_exists( BP_PLUGIN_DIR . '/bp-messages/bp-messages-loader.php') )54 if ( bp_is_active( 'messages') && file_exists( BP_PLUGIN_DIR . '/bp-messages/bp-messages-loader.php') ) 55 55 include( BP_PLUGIN_DIR . '/bp-messages/bp-messages-loader.php' ); 56 56 57 57 // Extended Profiles 58 if ( !isset( $bp_deactivated['bp-xprofile/bp-xprofile-loader.php']) && file_exists( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-loader.php') )58 if ( bp_is_active( 'xprofile') && file_exists( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-loader.php') ) 59 59 include( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-loader.php' ); 60 60 61 61 // Member Settings 62 if ( !isset( $bp_deactivated['bp-settings/bp-settings-loader.php']) && file_exists( BP_PLUGIN_DIR . '/bp-settings/bp-settings-loader.php') )62 if ( bp_is_active( 'settings') && file_exists( BP_PLUGIN_DIR . '/bp-settings/bp-settings-loader.php') ) 63 63 include( BP_PLUGIN_DIR . '/bp-settings/bp-settings-loader.php' ); 64 64 -
trunk/bp-core/bp-core-template.php
r3983 r3989 858 858 859 859 function bp_is_active( $component ) { 860 global $bp _deactivated;861 862 if ( !isset( $bp_deactivated[ 'bp-' . $component . '/bp-' . $component . '-loader.php'] ) )860 global $bp; 861 862 if ( isset( $bp->active_components[$component] ) ) 863 863 return true; 864 864 -
trunk/bp-xprofile/admin/css/admin.dev.css
r3987 r3989 122 122 } 123 123 .field-group div.actions { 124 display: none;125 124 position: absolute; 126 125 right: 20px; -
trunk/bp-xprofile/bp-xprofile-admin.php
r3987 r3989 73 73 foreach ( $groups as $group ) { ?> 74 74 75 <li id="group_<?php echo $group->id; ?>"><a href="#tabs-<?php echo $group->id; ?>" class="ui-tab"><?php echo esc_attr( $group->name ); ?><?php if ( !$group->can_delete ) : ?> <?php _e( '( Core)', 'buddypress'); endif; ?></a></li>75 <li id="group_<?php echo $group->id; ?>"><a href="#tabs-<?php echo $group->id; ?>" class="ui-tab"><?php echo esc_attr( $group->name ); ?><?php if ( !$group->can_delete ) : ?> <?php _e( '(Primary)', 'buddypress'); endif; ?></a></li> 76 76 77 77 <?php } … … 361 361 362 362 <fieldset id="field_<?php echo esc_attr( $field->id ); ?>" class="sortable<?php echo ' ' . $field->type; if ( $class ) echo ' ' . $class; ?>"> 363 <legend><?php bp_the_profile_field_name(); ?> <?php if( !$field->can_delete ) : ?> <?php _e( '( Core)', 'buddypress' ); endif; ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></legend>363 <legend><?php bp_the_profile_field_name(); ?> <?php if( !$field->can_delete ) : ?> <?php _e( '(Primary)', 'buddypress' ); endif; ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(Required)', 'buddypress' ) ?><?php endif; ?></legend> 364 364 <div class="field-wrapper"> 365 365
Note: See TracChangeset
for help on using the changeset viewer.