Changeset 3728 for trunk/bp-core/admin/bp-core-update.php
- Timestamp:
- 01/18/2011 12:53:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-update.php
r3721 r3728 12 12 13 13 /** 14 * bp_core_activate_site_options()15 *16 14 * When switching from single to multisite we need to copy blog options to 17 15 * site options. … … 91 89 global $wp_rewrite; 92 90 91 // Setup wizard steps 93 92 if ( 'new' == $this->setup_type ) { 94 // Setup wizard steps95 93 $steps = array( 96 94 __( 'Components', 'buddypress' ), 97 __( 'Pages', 'buddypress' ),95 __( 'Pages', 'buddypress' ), 98 96 __( 'Permalinks', 'buddypress' ), 99 __( 'Theme', 'buddypress' ),100 __( 'Finish', 'buddypress' )97 __( 'Theme', 'buddypress' ), 98 __( 'Finish', 'buddypress' ) 101 99 ); 102 100 … … 108 106 $steps = array_merge( array(), $steps ); 109 107 } 108 109 // Update wizard steps 110 110 } else { 111 // Update wizard steps112 113 111 if ( $this->is_network_activate ) 114 112 $steps[] = __( 'Multisite Update', 'buddypress' ); … … 167 165 <div id="bp-admin-header"> 168 166 <h3><?php _e( 'BuddyPress', 'buddypress' ) ?></h3> 169 <h2> 170 <?php if ( 'update' == $this->setup_type ) : ?> 171 172 <?php _e( 'Update', 'buddypress' ) ?> 173 174 <?php else : ?> 175 176 <?php _e( 'Setup', 'buddypress' ) ?> 177 178 <?php endif; ?> 179 </h2> 167 <h2><?php ( 'update' == $this->setup_type ) ? _e( 'Update', 'buddypress' ) : _e( 'Setup', 'buddypress' ); ?></h2> 180 168 </div> 181 169 182 170 <?php 183 171 do_action( 'bp_admin_notices' ); 172 184 173 $step_count = count( $this->steps ) - 1; 185 174 $wiz_or_set = $this->current_step >= $step_count ? 'bp-general-settings' : 'bp-wizard'; … … 190 179 <div id="bp-admin-nav"> 191 180 <ol> 181 192 182 <?php foreach( (array)$this->steps as $i => $name ) : ?> 183 193 184 <li<?php if ( $this->current_step == $i ) : ?> class="current"<?php endif; ?>> 194 185 <?php if ( $this->current_step > $i ) : ?> 186 195 187 <span class="complete"> </span> 196 <?php else : ?> 197 <?php echo $i + 1 . '. ' ?> 198 <?php endif; ?> 199 <?php echo esc_attr( $name ) ?> 188 189 <?php else : 190 191 echo $i + 1 . '. '; 192 193 endif; 194 echo esc_attr( $name ) ?> 195 200 196 </li> 197 201 198 <?php endforeach; ?> 199 202 200 </ol> 203 201 <div class="prev-next submit clear"> … … 207 205 208 206 <div id="bp-admin-content"> 207 209 208 <?php switch ( $this->steps[$this->current_step] ) { 210 209 case __( 'Database Update', 'buddypress'): … … 233 232 break; 234 233 } ?> 234 235 235 </div> 236 236 </form> 237 238 </div> 237 </div> 238 239 239 <?php 240 240 } 241 241 242 / * Setup Step HTML */242 // Setup Step HTML 243 243 244 244 function step_db_update() { 245 245 if ( !current_user_can( 'activate_plugins' ) ) 246 return false; 247 ?> 246 return false; ?> 247 248 248 <div class="prev-next submit clear"> 249 249 <p><input type="submit" value="<?php _e( 'Update & Next →', 'buddypress' ) ?>" name="submit" /></p> … … 257 257 <input type="hidden" name="save" value="db_update" /> 258 258 <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ) ?>" /> 259 259 260 <?php wp_nonce_field( 'bpwizard_db_update' ) ?> 260 </div> 261 262 </div> 263 261 264 <?php 262 265 } … … 319 322 <input type="hidden" name="save" value="ms_update" /> 320 323 <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ) ?>" /> 324 321 325 <?php wp_nonce_field( 'bpwizard_ms_update' ) ?> 326 322 327 </div> 323 328 … … 327 332 }); 328 333 </script> 334 329 335 <?php 330 336 } 331 332 337 333 338 function step_components() { … … 455 460 $disabled_components = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) ); 456 461 457 / * Check for defined slugs */462 // Check for defined slugs 458 463 if ( defined( 'BP_MEMBERS_SLUG' ) ) 459 464 $members_slug = constant( 'BP_MEMBERS_SLUG' ); … … 628 633 629 634 if ( !got_mod_rewrite() && !iis7_supports_permalinks() ) 630 $prefix = '/index.php'; 631 ?> 635 $prefix = '/index.php'; ?> 632 636 633 637 <p><?php _e( "To make sure the pages we created in the previous step work correctly, you will need to enable permalink support on your site.", 'buddypress' ) ?></p> … … 654 658 <input type="hidden" name="save" value="permalinks" /> 655 659 <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ) ?>" /> 660 656 661 <?php wp_nonce_field( 'bpwizard_permalinks' ) ?> 662 657 663 </div> 658 664 <?php … … 665 671 require_once( ABSPATH . WPINC . '/plugin.php' ); 666 672 $installed_plugins = get_plugins(); 667 $installed_themes = get_themes();673 $installed_themes = get_themes(); 668 674 669 675 $template_pack_installed = false; 670 $bp_autotheme_installed = false;671 $bp_theme_installed = false;676 $bp_autotheme_installed = false; 677 $bp_theme_installed = false; 672 678 673 679 foreach ( (array)$installed_plugins as $plugin ) { … … 700 706 </td> 701 707 </tr> 708 702 709 <?php /* 703 710 <tr> … … 714 721 </tr> 715 722 */ ?> 723 716 724 <tr> 717 725 <th> … … 732 740 </td> 733 741 </tr> 742 734 743 <tr> 735 744 <th> … … 774 783 }); 775 784 </script> 785 776 786 <?php 777 787 } … … 811 821 } 812 822 813 / * Save Step Methods */823 // Save Step Methods 814 824 815 825 function step_db_update_save() { … … 837 847 // Transfer important settings from blog options to site options 838 848 $options = array( 839 'bp-db-version' => $this->current_version,849 'bp-db-version' => $this->current_version, 840 850 'bp-deactivated-components' => $disabled, 841 'avatar-default' => get_option( 'avatar-default' )851 'avatar-default' => get_option( 'avatar-default' ) 842 852 ); 843 853 bp_core_activate_site_options( $options ); … … 853 863 854 864 $existing_pages = get_option( 'bp-pages' ); 855 856 $bp_pages = $this->setup_pages( (array)$_POST['bp_pages'] ); 857 858 $bp_pages = array_merge( (array)$existing_pages, (array)$bp_pages ); 865 $bp_pages = $this->setup_pages( (array)$_POST['bp_pages'] ); 866 $bp_pages = array_merge( (array)$existing_pages, (array)$bp_pages ); 859 867 860 868 update_option( 'bp-pages', $bp_pages ); … … 942 950 if ( !empty($permalink_structure) ) 943 951 $permalink_structure = preg_replace( '#/+#', '/', '/' . $_POST['permalink_structure'] ); 952 944 953 if ( ( defined( 'VHOST' ) && constant( 'VHOST' ) == 'no' ) && $permalink_structure != '' && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) 945 954 $permalink_structure = '/blog' . $permalink_structure; … … 965 974 if ( $iis7_permalinks || ( !$usingpi && !$writable ) ) { 966 975 function _bp_core_wizard_step_permalinks_message() { 967 global $wp_rewrite; 968 969 ?><div id="message" class="updated fade"><p> 976 global $wp_rewrite; ?> 977 978 <div id="message" class="updated fade"><p> 979 970 980 <?php 971 981 _e( 'Oops, there was a problem creating a configuration file. ', 'buddypress' ); … … 982 992 } 983 993 ?> 994 984 995 <br /><br /> 996 985 997 <?php 986 998 if ( empty( $iis7_permalinks ) ) 987 999 _e( 'Paste all these rules into a new <code>.htaccess</code> file in the root of your WordPress installation and save the file. Once you\'re done, please hit the "Save and Next" button to continue.', 'buddypress' ); 988 1000 ?> 989 </p></div><?php 1001 1002 </p></div> 1003 1004 <?php 990 1005 } 991 1006 add_action( 'bp_admin_notices', '_bp_core_wizard_step_permalinks_message' ); … … 1078 1093 } 1079 1094 1080 / * Database update methods based on version numbers */1095 // Database update methods based on version numbers 1081 1096 function update_1_3() { 1082 1097 // Run the schema install to update tables … … 1085 1100 // Delete old database version options 1086 1101 delete_site_option( 'bp-activity-db-version' ); 1087 delete_site_option( 'bp-blogs-db-version' );1088 delete_site_option( 'bp-friends-db-version' );1089 delete_site_option( 'bp-groups-db-version' );1102 delete_site_option( 'bp-blogs-db-version' ); 1103 delete_site_option( 'bp-friends-db-version' ); 1104 delete_site_option( 'bp-groups-db-version' ); 1090 1105 delete_site_option( 'bp-messages-db-version' ); 1091 1106 delete_site_option( 'bp-xprofile-db-version' ); … … 1216 1231 $message = __( 'Installation was successful. The available options have now been updated, please continue with your selection.', 'buddypress' ); 1217 1232 else 1218 return false; 1219 ?> 1233 return false; ?> 1234 1220 1235 <div id="message" class="updated"> 1221 1236 <p><?php echo esc_attr( $message ) ?></p> 1222 1237 </div> 1238 1223 1239 <?php 1224 1240 } 1225 1241 add_action( 'bp_admin_notices', 'bp_core_wizard_message' ); 1226 1242 1227 /* Alter thickbox screens so the entire plugin download and install interface is contained within. */ 1243 // Alter thickbox screens so the entire plugin download and install 1244 // interface is contained within. 1228 1245 function bp_core_wizard_thickbox() { 1229 1246 $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' ) ); ?> … … 1242 1259 } 1243 1260 </script> 1261 1244 1262 <?php 1245 1263 } … … 1247 1265 1248 1266 /** 1249 * bp_core_add_admin_menu()1250 *1251 1267 * Adds the "BuddyPress" admin submenu item to the Site Admin tab. 1252 1268 * … … 1291 1307 1292 1308 wp_enqueue_script( 'thickbox' ); 1293 wp_enqueue_style( 'thickbox' ); 1294 ?> 1309 wp_enqueue_style( 'thickbox' ); ?> 1310 1295 1311 <style type="text/css"> 1296 1312 /* Wizard Icon */ … … 1310 1326 } 1311 1327 </style> 1328 1312 1329 <?php 1313 1330 } 1314 1331 add_action( 'admin_head', 'bp_core_add_admin_menu_styles' ); 1332 1315 1333 ?>
Note: See TracChangeset
for help on using the changeset viewer.