Changeset 3713 for trunk/bp-core/admin/bp-core-update.php
- Timestamp:
- 01/14/2011 11:49:17 PM (15 years ago)
- File:
-
- 1 moved
-
trunk/bp-core/admin/bp-core-update.php (moved) (moved from trunk/bp-core/admin/bp-core-upgrade.php) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-update.php
r3710 r3713 64 64 65 65 $this->new_version = constant( 'BP_DB_VERSION' ); 66 $this->setup_type = ( empty( $this->current_version ) && !(int)get_site_option( 'bp-core-db-version' ) ) ? 'new' : 'up grade';66 $this->setup_type = ( empty( $this->current_version ) && !(int)get_site_option( 'bp-core-db-version' ) ) ? 'new' : 'update'; 67 67 $this->current_step = $this->current_step(); 68 68 … … 71 71 $this->save( $_POST['save'] ); 72 72 73 // Build the steps needed for up grade or new installations73 // Build the steps needed for update or new installations 74 74 $this->steps = $this->add_steps(); 75 75 } … … 109 109 } 110 110 } else { 111 // Up grade wizard steps111 // Update wizard steps 112 112 113 113 if ( $this->is_network_activate ) 114 $steps[] = __( 'Multisite Up grade', 'buddypress' );114 $steps[] = __( 'Multisite Update', 'buddypress' ); 115 115 116 116 if ( $this->current_version < $this->new_version ) 117 $steps[] = __( 'Database Up grade', 'buddypress' );117 $steps[] = __( 'Database Update', 'buddypress' ); 118 118 119 119 if ( $this->current_version < 1225 ) … … 129 129 // Save any posted values 130 130 switch ( $step_name ) { 131 case 'db_up grade': default:132 $result = $this->step_db_up grade_save();131 case 'db_update': default: 132 $result = $this->step_db_update_save(); 133 133 break; 134 case 'ms_up grade': default:135 $result = $this->step_ms_up grade_save();134 case 'ms_update': default: 135 $result = $this->step_ms_update_save(); 136 136 break; 137 137 case 'ms_pages': default: 138 $result = $this->step_ms_up grade_save();138 $result = $this->step_ms_update_save(); 139 139 break; 140 140 case 'components': default: … … 168 168 <h3><?php _e( 'BuddyPress', 'buddypress' ) ?></h3> 169 169 <h4> 170 <?php if ( 'up grade' == $this->setup_type ) : ?>171 <?php _e( 'Up grade', 'buddypress' ) ?>170 <?php if ( 'update' == $this->setup_type ) : ?> 171 <?php _e( 'Update', 'buddypress' ) ?> 172 172 <?php else : ?> 173 173 <?php _e( 'Setup', 'buddypress' ) ?> … … 201 201 <div id="bp-admin-content"> 202 202 <?php switch ( $this->steps[$this->current_step] ) { 203 case __( 'Database Up grade', 'buddypress'):204 $this->step_db_up grade();203 case __( 'Database Update', 'buddypress'): 204 $this->step_db_update(); 205 205 break; 206 case __( 'Multisite Up grade', 'buddypress'):207 $this->step_ms_up grade();206 case __( 'Multisite Update', 'buddypress'): 207 $this->step_ms_update(); 208 208 break; 209 209 case __( 'Blog Directory', 'buddypress'): 210 $this->step_ms_up grade();210 $this->step_ms_update(); 211 211 break; 212 212 case __( 'Components', 'buddypress'): … … 235 235 /* Setup Step HTML */ 236 236 237 function step_db_up grade() {237 function step_db_update() { 238 238 if ( !current_user_can( 'activate_plugins' ) ) 239 239 return false; 240 240 ?> 241 241 <div class="prev-next submit clear"> 242 <p><input type="submit" value="<?php _e( 'Up grade & Next →', 'buddypress' ) ?>" name="submit" /></p>243 </div> 244 245 <p><?php _e( 'BuddyPress has been updated! Before you can continue using BuddyPress, we have to up grade your database to the newest version.', 'buddypress' ); ?></p>242 <p><input type="submit" value="<?php _e( 'Update & Next →', 'buddypress' ) ?>" name="submit" /></p> 243 </div> 244 245 <p><?php _e( 'BuddyPress has been updated! Before you can continue using BuddyPress, we have to update your database to the newest version.', 'buddypress' ); ?></p> 246 246 247 247 <div class="submit clear"> 248 <p><input type="submit" value="<?php _e( 'Up grade & Next →', 'buddypress' ) ?>" name="submit" /></p>249 250 <input type="hidden" name="save" value="db_up grade" />248 <p><input type="submit" value="<?php _e( 'Update & Next →', 'buddypress' ) ?>" name="submit" /></p> 249 250 <input type="hidden" name="save" value="db_update" /> 251 251 <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ) ?>" /> 252 <?php wp_nonce_field( 'bpwizard_db_up grade' ) ?>252 <?php wp_nonce_field( 'bpwizard_db_update' ) ?> 253 253 </div> 254 254 <?php 255 255 } 256 256 257 function step_ms_up grade() {257 function step_ms_update() { 258 258 if ( !current_user_can( 'activate_plugins' ) ) 259 259 return false; … … 315 315 <p><input type="submit" value="<?php _e( 'Save & Next →', 'buddypress' ) ?>" name="submit" /></p> 316 316 317 <input type="hidden" name="save" value="ms_up grade" />317 <input type="hidden" name="save" value="ms_update" /> 318 318 <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ) ?>" /> 319 <?php wp_nonce_field( 'bpwizard_ms_up grade' ) ?>319 <?php wp_nonce_field( 'bpwizard_ms_update' ) ?> 320 320 </div> 321 321 … … 717 717 <tr> 718 718 <th> 719 <h5>Automatically Up grade My WordPress Theme</h5>719 <h5>Automatically Update My WordPress Theme</h5> 720 720 <img src="<?php echo plugins_url( '/buddypress/bp-core/images/auto_theme.jpg' ) ?>" alt="bp-default" /> 721 721 </th> 722 722 <td> 723 <p>The BuddyPress [plugin name] plugin will automatically up grade your existing WordPress theme so it can display BuddyPress pages. Your existing theme's page.php template file will be used to show BuddyPress content.</p>723 <p>The BuddyPress [plugin name] plugin will automatically update your existing WordPress theme so it can display BuddyPress pages. Your existing theme's page.php template file will be used to show BuddyPress content.</p> 724 724 <p><strong>This is the best choice if you have an existing WordPress theme and simply want to start using BuddyPress features without control of template layout and design.</strong></p> 725 725 <p><label><input type="radio" name="theme" value="auto_wp" disabled="disabled" /> You must first install the [plugin name] before choosing this option</label></p> … … 730 730 <tr> 731 731 <th> 732 <h5><?php _e( 'Manually Up grade My WordPress Theme', 'buddypress' ) ?>'</h5>732 <h5><?php _e( 'Manually Update My WordPress Theme', 'buddypress' ) ?>'</h5> 733 733 <img src="<?php echo plugins_url( '/buddypress/bp-core/images/manual_theme.jpg' ) ?>" alt="bp-default" /> 734 734 </th> … … 805 805 806 806 <?php else : 807 $type = __( 'up grade', 'buddypress' ); ?>808 809 <h2>Up grade Complete!</h2>807 $type = __( 'update', 'buddypress' ); ?> 808 809 <h2>Update Complete!</h2> 810 810 811 811 <?php endif; ?> … … 831 831 /* Save Step Methods */ 832 832 833 function step_db_up grade_save() {833 function step_db_update_save() { 834 834 if ( isset( $_POST['submit'] ) ) { 835 check_admin_referer( 'bpwizard_db_up grade' );835 check_admin_referer( 'bpwizard_db_update' ); 836 836 837 837 if ( $this->current_version < 1225 ) 838 $this->up grade_1_3();838 $this->update_1_3(); 839 839 840 840 return true; … … 844 844 } 845 845 846 function step_ms_up grade_save() {846 function step_ms_update_save() { 847 847 global $current_blog; 848 848 849 849 if ( isset( $_POST['submit'] ) ) { 850 check_admin_referer( 'bpwizard_ms_up grade' );850 check_admin_referer( 'bpwizard_ms_update' ); 851 851 852 852 if ( !$disabled = get_option( 'bp-deactivated-components' ) ) … … 1096 1096 } 1097 1097 1098 /* Database up grade methods based on version numbers */1099 function up grade_1_3() {1100 // Run the schema install to up grade tables1098 /* Database update methods based on version numbers */ 1099 function update_1_3() { 1100 // Run the schema install to update tables 1101 1101 bp_core_install(); 1102 1102 … … 1123 1123 $bp_wizard = new BP_Core_Setup_Wizard; 1124 1124 } 1125 is_multisite() ? add_action( 'network_admin_menu', 'bp_core_setup_wizard_init' ) : add_action('admin_menu', 'bp_core_setup_wizard_init' );1125 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_setup_wizard_init' ); 1126 1126 1127 1127 … … 1162 1162 } 1163 1163 1164 function bp_core_up grade( $disabled ) {1164 function bp_core_update( $disabled ) { 1165 1165 global $wpdb; 1166 1166 … … 1168 1168 } 1169 1169 1170 function bp_up grade_db_stuff() {1170 function bp_update_db_stuff() { 1171 1171 // Rename the old user activity cached table if needed. 1172 1172 if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$wpdb->base_prefix}bp_activity_user_activity_cached%'" ) ) … … 1191 1191 bp_core_add_illegal_names(); 1192 1192 1193 // Up grade and remove the message threads table if it exists1193 // Update and remove the message threads table if it exists 1194 1194 if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$wpdb->base_prefix}bp_messages_threads%'" ) ) { 1195 $up grade = BP_Messages_Thread::upgrade_tables();1196 1197 if ( $up grade )1195 $update = BP_Messages_Thread::update_tables(); 1196 1197 if ( $update ) 1198 1198 $wpdb->query( "DROP TABLE {$wpdb->base_prefix}bp_messages_threads" ); 1199 1199 } … … 1245 1245 /* Alter thickbox screens so the entire plugin download and install interface is contained within. */ 1246 1246 function bp_core_wizard_thickbox() { 1247 ?> 1247 $form_action = is_multisite() ? network_admin_url( add_query_arg( array( 'page' => 'bp-wizard', 'updated' => '1' ), 'admin.php' ) ) : admin_url( add_query_arg( array( 'page' => 'bp-wizard', 'updated' => '1' ), 'admin.php' ) ); ?> 1248 1248 1249 <script type="text/javascript"> 1249 1250 jQuery('p.action-button a').attr( 'target', '' ); … … 1256 1257 jQuery('a').removeClass( 'thickbox thickbox-preview onclick' ); 1257 1258 jQuery('body.update-php div.wrap p:last').hide(); 1258 jQuery('body.update-php div.wrap p:last').after( '<p><a class="button" target="_parent" href="<?php echo site_url( '/wp-admin/admin.php?page=bp-wizard' ) ?>&updated=1"><?php _e( 'Finish', 'buddypress' ) ?> →</a></p>' );1259 jQuery('body.update-php div.wrap p:last').after( '<p><a class="button" target="_parent" href="<?php echo $form_action; ?>"><?php _e( 'Finish', 'buddypress' ) ?> →</a></p>' ); 1259 1260 } 1260 1261 </script> … … 1282 1283 $status = __( 'Setup', 'buddypress' ); 1283 1284 else 1284 $status = __( 'Up grade', 'buddypress' );1285 $status = __( 'Update', 'buddypress' ); 1285 1286 1286 1287 // Add the administration tab under the "Site Admin" tab for site administrators … … 1299 1300 add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' ); 1300 1301 } 1301 is_multisite() ? add_action( 'network_admin_menu', 'bp_core_add_admin_menu' ) : add_action( 'admin_menu','bp_core_add_admin_menu' );1302 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_add_admin_menu' ); 1302 1303 1303 1304 function bp_core_add_admin_menu_styles() {
Note: See TracChangeset
for help on using the changeset viewer.