Changeset 2077 for trunk/bp-core/bp-core-admin.php
- Timestamp:
- 11/02/2009 07:54:21 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-admin.php (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-admin.php
r2029 r2077 4 4 global $wpdb, $bp, $current_blog; 5 5 ?> 6 6 7 7 <?php 8 8 if ( isset( $_POST['bp-admin-submit'] ) && isset( $_POST['bp-admin'] ) ) { 9 9 if ( !check_admin_referer('bp-admin') ) 10 10 return false; 11 11 12 12 // Settings form submitted, now save the settings. 13 13 foreach ( $_POST['bp-admin'] as $key => $value ) { 14 14 15 15 if ( function_exists( 'xprofile_install' ) ) { 16 16 if ( 'bp-xprofile-base-group-name' == $key ) { 17 17 $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET name = %s WHERE name = %s AND id = 1", $value, stripslashes( get_site_option('bp-xprofile-base-group-name') ) ) ); 18 18 } 19 19 20 20 if ( 'bp-xprofile-fullname-field-name' == $key ) { 21 21 $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET name = %s WHERE name = %s AND group_id = 1", $value, stripslashes( get_site_option('bp-xprofile-fullname-field-name') ) ) ); 22 22 } 23 23 } 24 24 25 25 update_site_option( $key, $value ); 26 26 } 27 27 } 28 28 ?> 29 29 30 30 <div class="wrap"> 31 31 32 32 <h2><?php _e( 'BuddyPress Settings', 'buddypress' ) ?></h2> 33 33 … … 39 39 40 40 <form action="" method="post" id="bp-admin-form"> 41 41 42 42 <table class="form-table"> 43 43 <tbody> … … 47 47 <td> 48 48 <input name="bp-admin[bp-xprofile-base-group-name]" id="bp-xprofile-base-group-name" value="<?php echo get_site_option('bp-xprofile-base-group-name') ?>" /> 49 </td> 49 </td> 50 50 </tr> 51 51 <tr> … … 60 60 <input type="radio" name="bp-admin[bp-disable-profile-sync]"<?php if ( (int)get_site_option( 'bp-disable-profile-sync' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-profile-sync" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> 61 61 <input type="radio" name="bp-admin[bp-disable-profile-sync]"<?php if ( !(int)get_site_option( 'bp-disable-profile-sync' ) || '' == get_site_option( 'bp-disable-profile-sync' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-profile-sync" value="0" /> <?php _e( 'No', 'buddypress' ) ?> 62 </td> 62 </td> 63 63 </tr> 64 64 <?php endif; ?> … … 68 68 <input type="radio" name="bp-admin[hide-loggedout-adminbar]"<?php if ( (int)get_site_option( 'hide-loggedout-adminbar' ) ) : ?> checked="checked"<?php endif; ?> id="bp-admin-hide-loggedout-adminbar-yes" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> 69 69 <input type="radio" name="bp-admin[hide-loggedout-adminbar]"<?php if ( !(int)get_site_option( 'hide-loggedout-adminbar' ) ) : ?> checked="checked"<?php endif; ?> id="bp-admin-hide-loggedout-adminbar-no" value="0" /> <?php _e( 'No', 'buddypress' ) ?> 70 </td> 70 </td> 71 71 </tr> 72 72 <tr> … … 83 83 <input type="radio" name="bp-admin[non-friend-wire-posting]"<?php if ( (int)get_site_option( 'non-friend-wire-posting' ) ) : ?> checked="checked"<?php endif; ?> id="bp-admin-non-friend-wire-post" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> 84 84 <input type="radio" name="bp-admin[non-friend-wire-posting]"<?php if ( !(int)get_site_option( 'non-friend-wire-posting' ) ) : ?> checked="checked"<?php endif; ?> id="bp-admin-non-friend-wire-post" value="0" /> <?php _e( 'No', 'buddypress' ) ?> 85 </td> 86 </tr> 87 <?php } ?> 85 </td> 86 </tr> 87 <?php } ?> 88 88 <tr> 89 89 <th scope="row"><?php _e( 'Disable user account deletion?', 'buddypress' ) ?>:</th> … … 91 91 <input type="radio" name="bp-admin[bp-disable-account-deletion]"<?php if ( (int)get_site_option( 'bp-disable-account-deletion' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-account-deletion" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> 92 92 <input type="radio" name="bp-admin[bp-disable-account-deletion]"<?php if ( !(int)get_site_option( 'bp-disable-account-deletion' ) || '' == get_site_option( 'bp-disable-account-deletion' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-account-deletion" value="0" /> <?php _e( 'No', 'buddypress' ) ?> 93 </td> 93 </td> 94 94 </tr> 95 95 <?php if ( function_exists( 'bp_forums_setup') ) : ?> … … 99 99 <input type="radio" name="bp-admin[bp-disable-forum-directory]"<?php if ( (int)get_site_option( 'bp-disable-forum-directory' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-forum-directory" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> 100 100 <input type="radio" name="bp-admin[bp-disable-forum-directory]"<?php if ( !(int)get_site_option( 'bp-disable-forum-directory' ) || '' == get_site_option( 'bp-disable-forum-directory' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-forum-directory" value="0" /> <?php _e( 'No', 'buddypress' ) ?> 101 </td> 102 </tr> 103 <?php endif; ?> 104 101 </td> 102 </tr> 103 <?php endif; ?> 104 105 105 <?php $themes = bp_core_get_buddypress_themes() ?> 106 106 <?php if ( $themes ) : ?> … … 109 109 <td> 110 110 <select name="bp-admin[active-member-theme]" id="active-member-theme"> 111 <?php 112 for ( $i = 0; $i < count($themes); $i++ ) { 111 <?php 112 for ( $i = 0; $i < count($themes); $i++ ) { 113 113 if ( $themes[$i]['template'] == get_site_option( 'active-member-theme' ) ) { 114 114 $selected = ' selected="selected"'; … … 120 120 <?php } ?> 121 121 </select> 122 </td> 122 </td> 123 123 </tr> 124 124 <?php else : ?> … … 129 129 <?php endif; ?> 130 130 <?php endif; ?> 131 131 132 132 <tr> 133 133 <th scope="row"><?php _e( 'Default User Avatar', 'buddypress' ) ?></th> … … 147 147 148 148 <?php do_action( 'bp_core_admin_screen' ) ?> 149 149 150 150 <p class="submit"> 151 151 <input class="button-primary" type="submit" name="bp-admin-submit" id="bp-admin-submit" value="<?php _e( 'Save Settings', 'buddypress' ) ?>"/> … … 153 153 154 154 <?php wp_nonce_field( 'bp-admin' ) ?> 155 155 156 156 </form> 157 157 158 158 </div> 159 160 <?php 159 160 <?php 161 161 } 162 162 … … 164 164 global $wpdb, $bp; 165 165 ?> 166 166 167 167 <?php 168 168 if ( isset( $_POST['bp-admin-component-submit'] ) && isset( $_POST['bp_components'] ) ) { 169 169 if ( !check_admin_referer('bp-admin-component-setup') ) 170 170 return false; 171 171 172 172 // Settings form submitted, now save the settings. 173 173 foreach ( $_POST['bp_components'] as $key => $value ) { 174 174 if ( !(int) $value ) 175 $disabled[$key] = 1; 175 $disabled[$key] = 1; 176 176 } 177 177 update_site_option( 'bp-deactivated-components', $disabled ); 178 178 } 179 179 ?> 180 180 181 181 <div class="wrap"> 182 182 183 183 <h2><?php _e( 'BuddyPress Component Setup', 'buddypress' ) ?></h2> 184 184 185 185 <?php if ( isset( $_POST['bp-admin-component-submit'] ) ) : ?> 186 186 <div id="message" class="updated fade"> … … 188 188 </div> 189 189 <?php endif; ?> 190 190 191 191 <form action="" method="post" id="bp-admin-component-form"> 192 192 193 193 <p> 194 <?php _e( 195 'By default, all BuddyPress components are enabled. You can selectively disable any of the 194 <?php _e( 195 'By default, all BuddyPress components are enabled. You can selectively disable any of the 196 196 components by using the form below. Your BuddyPress installation will continue to function, however 197 197 the features of the disabled components will no longer be accessible to … … 199 199 ', 'buddypress' )?> 200 200 </p> 201 201 202 202 <?php $disabled_components = get_site_option( 'bp-deactivated-components' ); ?> 203 203 204 204 <table class="form-table" style="width: 80%"> 205 205 <tbody> … … 210 210 <input type="radio" name="bp_components[bp-activity.php]" value="1"<?php if ( !isset( $disabled_components['bp-activity.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?> 211 211 <input type="radio" name="bp_components[bp-activity.php]" value="0"<?php if ( isset( $disabled_components['bp-activity.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?> 212 </td> 212 </td> 213 213 </tr> 214 214 <?php endif; ?> … … 219 219 <input type="radio" name="bp_components[bp-blogs.php]" value="1"<?php if ( !isset( $disabled_components['bp-blogs.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?> 220 220 <input type="radio" name="bp_components[bp-blogs.php]" value="0"<?php if ( isset( $disabled_components['bp-blogs.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?> 221 </td> 221 </td> 222 222 </tr> 223 223 <?php endif; ?> … … 228 228 <input type="radio" name="bp_components[bp-forums.php]" value="1"<?php if ( !isset( $disabled_components['bp-forums.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?> 229 229 <input type="radio" name="bp_components[bp-forums.php]" value="0"<?php if ( isset( $disabled_components['bp-forums.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?> 230 </td> 230 </td> 231 231 </tr> 232 232 <?php endif; ?> … … 237 237 <input type="radio" name="bp_components[bp-friends.php]" value="1"<?php if ( !isset( $disabled_components['bp-friends.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?> 238 238 <input type="radio" name="bp_components[bp-friends.php]" value="0"<?php if ( isset( $disabled_components['bp-friends.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?> 239 </td> 239 </td> 240 240 </tr> 241 241 <?php endif; ?> … … 246 246 <input type="radio" name="bp_components[bp-groups.php]" value="1"<?php if ( !isset( $disabled_components['bp-groups.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?> 247 247 <input type="radio" name="bp_components[bp-groups.php]" value="0"<?php if ( isset( $disabled_components['bp-groups.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?> 248 </td> 248 </td> 249 249 </tr> 250 250 <?php endif; ?> … … 255 255 <input type="radio" name="bp_components[bp-messages.php]" value="1"<?php if ( !isset( $disabled_components['bp-messages.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?> 256 256 <input type="radio" name="bp_components[bp-messages.php]" value="0"<?php if ( isset( $disabled_components['bp-messages.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?> 257 </td> 257 </td> 258 258 </tr> 259 259 <?php endif; ?> … … 264 264 <input type="radio" name="bp_components[bp-wire.php]" value="1"<?php if ( !isset( $disabled_components['bp-wire.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?> 265 265 <input type="radio" name="bp_components[bp-wire.php]" value="0"<?php if ( isset( $disabled_components['bp-wire.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?> 266 </td> 266 </td> 267 267 </tr> 268 268 <?php endif; ?> … … 287 287 </tbody> 288 288 </table> 289 289 290 290 <p class="submit"> 291 291 <input class="button-primary" type="submit" name="bp-admin-component-submit" id="bp-admin-component-submit" value="<?php _e( 'Save Settings', 'buddypress' ) ?>"/> 292 292 </p> 293 293 294 294 <?php wp_nonce_field( 'bp-admin-component-setup' ) ?> 295 295 296 296 </form> 297 297 298 298 </div> 299 300 <?php 299 300 <?php 301 301 } 302 302
Note: See TracChangeset
for help on using the changeset viewer.