Changeset 5885 for trunk/bp-core/admin/bp-core-settings.php
- Timestamp:
- 03/05/2012 06:17:43 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-settings.php
r5883 r5885 16 16 * @since BuddyPress (r2786) 17 17 */ 18 function bp_admin_setting_callback_main_section() { 19 ?> 20 21 <p><?php _e( 'Main community settings for enabling features and setting time limits', 'buddypress' ); ?></p> 22 23 <?php 24 } 18 function bp_admin_setting_callback_main_section() { } 19 20 /** 21 * Throttle setting field 22 * 23 * @since BuddyPress (r2737) 24 * 25 * @uses bp_form_option() To output the option value 26 */ 27 function bp_admin_setting_callback_admin_bar() { 28 ?> 29 30 <input id="hide-loggedout-adminbar" name="hide-loggedout-adminbar" type="checkbox" value="1" <?php checked( !bp_hide_loggedout_adminbar( false ) ); ?> /> 31 <label for="hide-loggedout-adminbar"><?php _e( 'Show the admin bar for logged out users', 'buddypress' ); ?></label> 32 33 <?php 34 } 35 36 /** 37 * Allow subscriptions setting field 38 * 39 * @since BuddyPress (r2737) 40 * 41 * @uses checked() To display the checked attribute 42 */ 43 function bp_admin_setting_callback_account_deletion() { 44 ?> 45 46 <input id="bp-disable-account-deletion" name="bp-disable-account-deletion" type="checkbox" value="1" <?php checked( !bp_disable_account_deletion( true ) ); ?> /> 47 <label for="bp-disable-account-deletion"><?php _e( 'Allow registered members to delete their own accounts', 'buddypress' ); ?></label> 48 49 <?php 50 } 51 52 /** 53 * Use the WordPress editor setting field 54 * 55 * @since BuddyPress (r3586) 56 * 57 * @uses checked() To display the checked attribute 58 */ 59 function bp_admin_setting_callback_use_wp_editor() { 60 ?> 61 62 <input id="_bp_use_wp_editor" name="_bp_use_wp_editor" type="checkbox" id="_bp_use_wp_editor" value="1" <?php checked( bp_use_wp_editor( true ) ); ?> /> 63 <label for="_bp_use_wp_editor"><?php _e( 'Use the fancy WordPress editor to create and edit topics and replies', 'buddypress' ); ?></label> 64 65 <?php 66 } 67 68 /** Activity *******************************************************************/ 69 70 /** 71 * Groups settings section description for the settings page 72 * 73 * @since BuddyPress (1.6) 74 */ 75 function bp_admin_setting_callback_activity_section() { } 76 77 /** 78 * Allow Akismet setting field 79 * 80 * @since BuddyPress (r3575) 81 * 82 * @uses checked() To display the checked attribute 83 */ 84 function bp_admin_setting_callback_activity_akismet() { 85 ?> 86 87 <input id="_bp_enable_akismet" name="_bp_enable_akismet" type="checkbox" value="1" <?php checked( bp_is_akismet_active( true ) ); ?> /> 88 <label for="_bp_enable_akismet"><?php _e( 'Allow Akismet to scan for activity stream spam', 'buddypress' ); ?></label> 89 90 <?php 91 } 92 93 /** XProfile ******************************************************************/ 94 95 /** 96 * Profile settings section description for the settings page 97 * 98 * @since BuddyPress (1.0) 99 */ 100 function bp_admin_setting_callback_xprofile_section() { } 25 101 26 102 /** … … 41 117 42 118 /** 43 * Throttle setting field44 *45 * @since BuddyPress (r2737)46 *47 * @uses bp_form_option() To output the option value48 */49 function bp_admin_setting_callback_admin_bar() {50 ?>51 52 <input id="hide-loggedout-adminbar" name="hide-loggedout-adminbar" type="checkbox" value="1" <?php checked( !bp_hide_loggedout_adminbar( false ) ); ?> />53 <label for="hide-loggedout-adminbar"><?php _e( 'Show the admin bar for guest/anonymous users', 'buddypress' ); ?></label>54 55 <?php56 }57 58 /**59 119 * Allow favorites setting field 60 120 * … … 67 127 68 128 <input id="bp-disable-avatar-uploads" name="bp-disable-avatar-uploads" type="checkbox" value="1" <?php checked( !bp_disable_avatar_uploads( true ) ); ?> /> 69 <label for="bp-disable-avatar-uploads"><?php _e( 'Allow members to upload avatars', 'buddypress' ); ?></label> 70 71 <?php 72 } 73 74 /** 75 * Allow subscriptions setting field 76 * 77 * @since BuddyPress (r2737) 78 * 79 * @uses checked() To display the checked attribute 80 */ 81 function bp_admin_setting_callback_account_deletion() { 82 ?> 83 84 <input id="bp-disable-account-deletion" name="bp-disable-account-deletion" type="checkbox" value="1" <?php checked( !bp_disable_account_deletion( true ) ); ?> /> 85 <label for="bp-disable-account-deletion"><?php _e( 'Allow members to delete their own accounts', 'buddypress' ); ?></label> 86 87 <?php 88 } 89 90 /** 91 * Use the WordPress editor setting field 92 * 93 * @since BuddyPress (r3586) 94 * 95 * @uses checked() To display the checked attribute 96 */ 97 function bp_admin_setting_callback_use_wp_editor() { 98 ?> 99 100 <input id="_bp_use_wp_editor" name="_bp_use_wp_editor" type="checkbox" id="_bp_use_wp_editor" value="1" <?php checked( bp_use_wp_editor( true ) ); ?> /> 101 <label for="_bp_use_wp_editor"><?php _e( 'Use the fancy WordPress editor to create and edit topics and replies', 'buddypress' ); ?></label> 102 103 <?php 104 } 105 106 /** Activity *******************************************************************/ 129 <label for="bp-disable-avatar-uploads"><?php _e( 'Allow registered members to upload avatars', 'buddypress' ); ?></label> 130 131 <?php 132 } 133 134 /** Groups Section ************************************************************/ 107 135 108 136 /** … … 111 139 * @since BuddyPress (1.6) 112 140 */ 113 function bp_admin_setting_callback_activity_section() { 114 ?> 115 116 <p><?php _e( 'Settings for the Actvity component', 'buddypress' ); ?></p> 117 118 <?php 119 } 120 121 /** 122 * Allow Akismet setting field 123 * 124 * @since BuddyPress (r3575) 125 * 126 * @uses checked() To display the checked attribute 127 */ 128 function bp_admin_setting_callback_activity_akismet() { 129 ?> 130 131 <input id="_bp_enable_akismet" name="_bp_enable_akismet" type="checkbox" value="1" <?php checked( bp_is_akismet_active( true ) ); ?> /> 132 <label for="_bp_enable_akismet"><?php _e( 'Allow Akismet to scan for activity stream spam', 'buddypress' ); ?></label> 133 134 <?php 135 } 136 137 /** Groups Section ************************************************************/ 138 139 /** 140 * Groups settings section description for the settings page 141 * 142 * @since BuddyPress (1.6) 143 */ 144 function bp_admin_setting_callback_groups_section() { 145 ?> 146 147 <p><?php _e( 'Settings for the Groups component', 'buddypress' ); ?></p> 148 149 <?php 150 } 141 function bp_admin_setting_callback_groups_section() { } 151 142 152 143 /** … … 167 158 } 168 159 160 /** Forums Section ************************************************************/ 161 162 /** 163 * Forums settings section description for the settings page 164 * 165 * @since BuddyPress (1.6) 166 */ 167 function bp_admin_setting_callback_bbpress_section() { } 168 169 /** 170 * Allow topic and reply revisions 171 * 172 * @since BuddyPress (1.6) 173 * @uses checked() To display the checked attribute 174 * @uses bp_get_option() To get the config location 175 * @uses bp_form_option() To get the sanitized form option 176 */ 177 function bp_admin_setting_callback_bbpress_configuration() { 178 179 $config_location = bp_get_option( 'bb-config-location' ); 180 $file_exists = (bool) ( file_exists( $config_location ) || is_file( $config_location ) ); ?> 181 182 <input name="bb-config-location" type="text" id="bb-config-location" value="<?php bp_form_option( 'bb-config-location', '' ); ?>" class="medium-text" style="width: 300px;" /> 183 184 <?php if ( false === $file_exists ) : ?> 185 186 <a class="button" href="<?php bp_admin_url( 'admin.php?page=bb-forums-setup&repair=1' ); ?>" title="<?php _e( 'Attempt to save a new config file.', 'buddypress' ); ?>"><?php _e( 'Repair', 'buddypress' ) ?></a> 187 <span class="attention"><?php _e( 'File does not exist', 'buddypress' ); ?></span> 188 189 <?php endif; ?> 190 191 <p class="description"><?php _e( 'Absolute path to your bbPress configuration file.', 'buddypress' ); ?></p> 192 193 <?php 194 } 195 169 196 /** Settings Page *************************************************************/ 170 197 … … 180 207 function bp_core_admin_settings() { 181 208 global $wp_settings_fields; 182 183 // We're saving our own options, until the WP Settings API is updated to work with Multisite184 $form_action = add_query_arg( 'page', 'bp-settings', bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) );185 209 186 210 if ( !empty( $_POST['submit'] ) ) { 187 211 check_admin_referer( 'buddypress-options' ); 188 212 189 213 // Because many settings are saved with checkboxes, and thus will have no values 190 214 // in the $_POST array when unchecked, we loop through the registered settings … … 193 217 foreach( $settings as $setting_name => $setting ) { 194 218 $value = isset( $_POST[$setting_name] ) ? $_POST[$setting_name] : ''; 195 219 196 220 bp_update_option( $setting_name, $value ); 197 221 } 198 222 } 199 223 } 200 224 201 225 // Some legacy options are not registered with the Settings API 202 226 $legacy_options = array( … … 207 231 'bp_restrict_group_creation' 208 232 ); 209 233 210 234 foreach( $legacy_options as $legacy_option ) { 211 235 // Note: Each of these options is represented by its opposite in the UI … … 216 240 } 217 241 } 218 ?> 242 243 // We're saving our own options, until the WP Settings API is updated to work with Multisite 244 $form_action = add_query_arg( 'page', 'bp-settings', bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ); ?> 219 245 220 246 <div class="wrap"> … … 368 394 /** bbPress Core ******************************************************/ 369 395 370 if ( defined( 'BBP_VERSION') ) {396 if ( bp_forums_is_bbpress_active() ) { 371 397 372 398 // Forum archive slug
Note: See TracChangeset
for help on using the changeset viewer.