Changeset 5223 for trunk/bp-core/admin/bp-core-update.php
- Timestamp:
- 10/08/2011 06:46:09 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/admin/bp-core-update.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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;
Note: See TracChangeset
for help on using the changeset viewer.