- Timestamp:
- 10/08/2011 06:46:09 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-admin.php
r5151 r5223 79 79 return false; 80 80 81 // "Switch to Admin Bar" is an optional option, so handle it here 82 if ( !empty( $_POST['bp-admin']['bp-force-buddybar'] ) ) { 83 unset( $_POST['bp-admin']['bp-force-buddybar'] ); 84 85 // Switch to the WP Admin Bar by removing the BuddyBar override 86 bp_delete_option( 'bp-force-buddybar' ); 87 } 88 81 89 // Settings form submitted, now save the settings. 82 90 foreach ( (array)$_POST['bp-admin'] as $key => $value ) … … 164 172 <?php endif; ?> 165 173 174 <?php if ( (bool) bp_get_option( 'bp-force-buddybar', false ) ) : ?> 175 <tr> 176 <th scope="row"><?php _e( 'Switch the site to the WordPress Admin Bar?', 'buddypress' ); ?></th> 177 <td> 178 <input type="checkbox" name="bp-admin[bp-force-buddybar]" value="1" id="bp-switch-to-admin-bar" /> 179 </td> 180 </tr> 181 <?php endif; ?> 182 166 183 <?php do_action( 'bp_core_admin_screen_fields' ) ?> 167 184 -
trunk/bp-core/admin/bp-core-update.php
r5202 r5223 85 85 $steps[] = __( 'Database Update', 'buddypress' ); 86 86 87 // New for BP 1.5 87 88 if ( $this->database_version < 1801 || !bp_core_get_directory_page_ids() ) { 88 89 $steps[] = __( 'Components', 'buddypress' ); … … 90 91 } 91 92 93 // New for BP 1.6 94 if ( $this->database_version < 5222 && !defined( 'BP_USE_WP_ADMIN_BAR' ) ) 95 $steps[] = __( 'Admin Bar', 'buddypress' ); 96 92 97 $steps[] = __( 'Finish', 'buddypress' ); 93 98 } … … 100 105 // Save any posted values 101 106 switch ( $step_name ) { 102 case 'db_update': default:107 case 'db_update': 103 108 $result = $this->step_db_update_save(); 104 109 break; 105 110 106 case 'ms_update': default:111 case 'ms_update': 107 112 $result = $this->step_ms_update_save(); 108 113 break; 109 114 110 case 'ms_pages': default:115 case 'ms_pages': 111 116 $result = $this->step_ms_update_save(); 112 117 break; 113 118 114 case 'components': default:119 case 'components': 115 120 $result = $this->step_components_save(); 116 121 break; 117 122 118 case 'pages': default:123 case 'pages': 119 124 $result = $this->step_pages_save(); 120 125 break; 121 126 122 case 'permalinks': default:127 case 'permalinks': 123 128 $result = $this->step_permalinks_save(); 124 129 break; 125 130 126 case 'theme': default:131 case 'theme': 127 132 $result = $this->step_theme_save(); 128 133 break; 129 134 130 case 'finish': default: 135 case 'admin_bar': 136 $result = $this->step_admin_bar_save(); 137 break; 138 139 case 'finish': 140 default: 131 141 $result = $this->step_finish_save(); 132 142 break; … … 233 243 break; 234 244 245 case __( 'Admin Bar', 'buddypress' ) : 246 $this->step_admin_bar(); 247 break; 248 235 249 case __( 'Finish', 'buddypress') : 236 250 $this->step_finish(); 237 251 break; 238 239 252 } ?> 240 253 … … 730 743 } 731 744 745 /** 746 * When upgrading to BP 1.6, prompt the admin to switch to WordPress' admin bar. 747 * 748 * @since 1.6 749 */ 750 function step_admin_bar() { 751 if ( !current_user_can( 'activate_plugins' ) ) 752 return false; 753 ?> 754 755 <p><?php _e( "BuddyPress now uses WordPress' Admin Bar; this sits at the top of your site and contains various links to useful admin screens. We've turbo-charged the Admin Bar by adding social items to help your users explore your site, and manage their content.", 'buddypress' ); ?></p> 756 757 <p><?php _e( "We've noticed that your site uses the old bar from earlier versions of BuddyPress.", 'buddypress' ); ?></p> 758 759 <p> 760 <label> 761 <input type="checkbox" name="keep_buddybar" value="1" /> 762 <?php _e( "If you'd prefer to not switch to the WordPress Admin bar just yet, check this box. Don't worry, you can change your mind later.", 'buddypress' ); ?> 763 </label> 764 </p> 765 766 <div class="submit clear"> 767 <input type="hidden" name="save" value="admin_bar" /> 768 <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ); ?>" /> 769 770 <?php wp_nonce_field( 'bpwizard_admin_bar' ) ?> 771 </div> 772 773 <?php 774 } 775 732 776 function step_finish() { 733 777 if ( !current_user_can( 'activate_plugins' ) ) … … 1016 1060 if ( is_multisite() ) 1017 1061 restore_current_blog(); 1062 1063 return true; 1064 } 1065 1066 return false; 1067 } 1068 1069 /** 1070 * When upgrading to BP 1.6, the admin is prompted to switch to WordPress' admin bar. 1071 * If they choose not to, record that preference in the options table. 1072 * 1073 * @since 1.6 1074 */ 1075 function step_admin_bar_save() { 1076 if ( isset( $_POST['submit'] ) ) { 1077 check_admin_referer( 'bpwizard_admin_bar' ); 1078 1079 if ( !empty( $_POST['keep_buddybar'] ) ) 1080 bp_update_option( 'bp-force-buddybar', 1 ); 1018 1081 1019 1082 return true; -
trunk/bp-core/bp-core-functions.php
r5221 r5223 1289 1289 * 1290 1290 * The WP Admin Bar, introduced in WP 3.1, is fully supported in BuddyPress as of BP 1.5. 1291 * 1292 * For the BP 1.5 development cycle, the BuddyBar will remain the default navigation for BP 1293 * installations. In the future, this behavior will be changed, so that the WP Admin Bar is the 1294 * default. 1295 * 1296 * @package BuddyPress 1297 * @since 1.5 1298 * 1291 * For BP 1.6, the WP Admin Bar is the default. 1292 * 1293 * @return bool False when WP Admin Bar support is disabled; true when enabled (default) 1294 * @since 1.5 1299 1295 * @uses apply_filters() Filter 'bp_use_wp_admin_bar' to alter 1300 * @return bool False when WP Admin Bar support is disabled (default); true when enabled1301 1296 */ 1302 1297 function bp_use_wp_admin_bar() { 1303 return apply_filters( 'bp_use_wp_admin_bar', defined( 'BP_USE_WP_ADMIN_BAR' ) && BP_USE_WP_ADMIN_BAR ); 1298 $use_admin_bar = true; 1299 1300 // Has the WP Admin Bar constant been explicity set? 1301 if ( defined( 'BP_USE_WP_ADMIN_BAR' ) && ! BP_USE_WP_ADMIN_BAR ) 1302 $use_admin_bar = false; 1303 1304 // Has the admin chosen to use the BuddyBar during an upgrade? 1305 elseif ( (bool) bp_get_option( 'bp-force-buddybar', false ) ) 1306 $use_admin_bar = false; 1307 1308 return apply_filters( 'bp_use_wp_admin_bar', $use_admin_bar ); 1304 1309 } 1305 1310 -
trunk/bp-loader.php
r5222 r5223 22 22 // Define the database version 23 23 if ( !defined( 'BP_DB_VERSION' ) ) 24 define( 'BP_DB_VERSION', 3820);24 define( 'BP_DB_VERSION', 5222 ); 25 25 26 26 // Place your custom code (actions/filters) in a file called
Note: See TracChangeset
for help on using the changeset viewer.