Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/14/2011 11:49:17 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Switch verbiage from 'upgrade' to 'update' and adjust is_multisite() admin_menu/network_admin_menu action checks. Also rename bp-core-upgrade.php to bp-core-update.php.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/admin/bp-core-update.php

    r3710 r3713  
    6464
    6565        $this->new_version  = constant( 'BP_DB_VERSION' );
    66         $this->setup_type   = ( empty( $this->current_version ) && !(int)get_site_option( 'bp-core-db-version' ) ) ? 'new' : 'upgrade';
     66        $this->setup_type   = ( empty( $this->current_version ) && !(int)get_site_option( 'bp-core-db-version' ) ) ? 'new' : 'update';
    6767        $this->current_step = $this->current_step();
    6868
     
    7171            $this->save( $_POST['save'] );
    7272
    73         // Build the steps needed for upgrade or new installations
     73        // Build the steps needed for update or new installations
    7474        $this->steps = $this->add_steps();
    7575    }
     
    109109            }
    110110        } else {
    111             // Upgrade wizard steps
     111            // Update wizard steps
    112112
    113113            if ( $this->is_network_activate )
    114                 $steps[] = __( 'Multisite Upgrade', 'buddypress' );
     114                $steps[] = __( 'Multisite Update', 'buddypress' );
    115115
    116116            if ( $this->current_version < $this->new_version )
    117                 $steps[] = __( 'Database Upgrade', 'buddypress' );
     117                $steps[] = __( 'Database Update', 'buddypress' );
    118118
    119119            if ( $this->current_version < 1225 )
     
    129129        // Save any posted values
    130130        switch ( $step_name ) {
    131             case 'db_upgrade': default:
    132                 $result = $this->step_db_upgrade_save();
     131            case 'db_update': default:
     132                $result = $this->step_db_update_save();
    133133                break;
    134             case 'ms_upgrade': default:
    135                 $result = $this->step_ms_upgrade_save();
     134            case 'ms_update': default:
     135                $result = $this->step_ms_update_save();
    136136                break;
    137137            case 'ms_pages': default:
    138                 $result = $this->step_ms_upgrade_save();
     138                $result = $this->step_ms_update_save();
    139139                break;
    140140            case 'components': default:
     
    168168                <h3><?php _e( 'BuddyPress', 'buddypress' ) ?></h3>
    169169                <h4>
    170                     <?php if ( 'upgrade' == $this->setup_type ) : ?>
    171                         <?php _e( 'Upgrade', 'buddypress' ) ?>
     170                    <?php if ( 'update' == $this->setup_type ) : ?>
     171                        <?php _e( 'Update', 'buddypress' ) ?>
    172172                    <?php else : ?>
    173173                        <?php _e( 'Setup', 'buddypress' ) ?>
     
    201201                <div id="bp-admin-content">
    202202                    <?php switch ( $this->steps[$this->current_step] ) {
    203                         case __( 'Database Upgrade', 'buddypress'):
    204                             $this->step_db_upgrade();
     203                        case __( 'Database Update', 'buddypress'):
     204                            $this->step_db_update();
    205205                            break;
    206                         case __( 'Multisite Upgrade', 'buddypress'):
    207                             $this->step_ms_upgrade();
     206                        case __( 'Multisite Update', 'buddypress'):
     207                            $this->step_ms_update();
    208208                            break;
    209209                        case __( 'Blog Directory', 'buddypress'):
    210                             $this->step_ms_upgrade();
     210                            $this->step_ms_update();
    211211                            break;
    212212                        case __( 'Components', 'buddypress'):
     
    235235    /* Setup Step HTML */
    236236
    237     function step_db_upgrade() {
     237    function step_db_update() {
    238238        if ( !current_user_can( 'activate_plugins' ) )
    239239            return false;
    240240    ?>
    241241        <div class="prev-next submit clear">
    242             <p><input type="submit" value="<?php _e( 'Upgrade &amp; Next &rarr;', 'buddypress' ) ?>" name="submit" /></p>
    243         </div>
    244 
    245         <p><?php _e( 'BuddyPress has been updated! Before you can continue using BuddyPress, we have to upgrade your database to the newest version.', 'buddypress' ); ?></p>
     242            <p><input type="submit" value="<?php _e( 'Update &amp; Next &rarr;', '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>
    246246
    247247        <div class="submit clear">
    248             <p><input type="submit" value="<?php _e( 'Upgrade &amp; Next &rarr;', 'buddypress' ) ?>" name="submit" /></p>
    249 
    250             <input type="hidden" name="save" value="db_upgrade" />
     248            <p><input type="submit" value="<?php _e( 'Update &amp; Next &rarr;', 'buddypress' ) ?>" name="submit" /></p>
     249
     250            <input type="hidden" name="save" value="db_update" />
    251251            <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ) ?>" />
    252             <?php wp_nonce_field( 'bpwizard_db_upgrade' ) ?>
     252            <?php wp_nonce_field( 'bpwizard_db_update' ) ?>
    253253        </div>
    254254    <?php
    255255    }
    256256
    257     function step_ms_upgrade() {
     257    function step_ms_update() {
    258258        if ( !current_user_can( 'activate_plugins' ) )
    259259            return false;
     
    315315            <p><input type="submit" value="<?php _e( 'Save &amp; Next &rarr;', 'buddypress' ) ?>" name="submit" /></p>
    316316
    317             <input type="hidden" name="save" value="ms_upgrade" />
     317            <input type="hidden" name="save" value="ms_update" />
    318318            <input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ) ?>" />
    319             <?php wp_nonce_field( 'bpwizard_ms_upgrade' ) ?>
     319            <?php wp_nonce_field( 'bpwizard_ms_update' ) ?>
    320320        </div>
    321321
     
    717717            <tr>
    718718                <th>
    719                     <h5>Automatically Upgrade My WordPress Theme</h5>
     719                    <h5>Automatically Update My WordPress Theme</h5>
    720720                    <img src="<?php echo plugins_url( '/buddypress/bp-core/images/auto_theme.jpg' ) ?>" alt="bp-default" />
    721721                </th>
    722722                <td>
    723                     <p>The BuddyPress [plugin name] plugin will automatically upgrade 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>
    724724                    <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>
    725725                    <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>
     
    730730            <tr>
    731731                <th>
    732                     <h5><?php _e( 'Manually Upgrade My WordPress Theme', 'buddypress' ) ?>'</h5>
     732                    <h5><?php _e( 'Manually Update My WordPress Theme', 'buddypress' ) ?>'</h5>
    733733                    <img src="<?php echo plugins_url( '/buddypress/bp-core/images/manual_theme.jpg' ) ?>" alt="bp-default" />
    734734                </th>
     
    805805
    806806        <?php else :
    807             $type = __( 'upgrade', 'buddypress' ); ?>
    808 
    809             <h2>Upgrade Complete!</h2>
     807            $type = __( 'update', 'buddypress' ); ?>
     808
     809            <h2>Update Complete!</h2>
    810810
    811811        <?php endif; ?>
     
    831831    /* Save Step Methods */
    832832
    833     function step_db_upgrade_save() {
     833    function step_db_update_save() {
    834834        if ( isset( $_POST['submit'] ) ) {
    835             check_admin_referer( 'bpwizard_db_upgrade' );
     835            check_admin_referer( 'bpwizard_db_update' );
    836836
    837837            if ( $this->current_version < 1225 )
    838                 $this->upgrade_1_3();
     838                $this->update_1_3();
    839839
    840840            return true;
     
    844844    }
    845845
    846     function step_ms_upgrade_save() {
     846    function step_ms_update_save() {
    847847        global $current_blog;
    848848
    849849        if ( isset( $_POST['submit'] ) ) {
    850             check_admin_referer( 'bpwizard_ms_upgrade' );
     850            check_admin_referer( 'bpwizard_ms_update' );
    851851
    852852            if ( !$disabled = get_option( 'bp-deactivated-components' ) )
     
    10961096    }
    10971097
    1098     /* Database upgrade methods based on version numbers */
    1099     function upgrade_1_3() {
    1100         // Run the schema install to upgrade tables
     1098    /* Database update methods based on version numbers */
     1099    function update_1_3() {
     1100        // Run the schema install to update tables
    11011101        bp_core_install();
    11021102
     
    11231123    $bp_wizard = new BP_Core_Setup_Wizard;
    11241124}
    1125 is_multisite() ? add_action( 'network_admin_menu', 'bp_core_setup_wizard_init' ) : add_action( 'admin_menu', 'bp_core_setup_wizard_init' );
     1125add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_setup_wizard_init' );
    11261126   
    11271127
     
    11621162}
    11631163
    1164 function bp_core_upgrade( $disabled ) {
     1164function bp_core_update( $disabled ) {
    11651165    global $wpdb;
    11661166
     
    11681168}
    11691169
    1170 function bp_upgrade_db_stuff() {
     1170function bp_update_db_stuff() {
    11711171    // Rename the old user activity cached table if needed.
    11721172    if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$wpdb->base_prefix}bp_activity_user_activity_cached%'" ) )
     
    11911191        bp_core_add_illegal_names();
    11921192
    1193     // Upgrade and remove the message threads table if it exists
     1193    // Update and remove the message threads table if it exists
    11941194    if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$wpdb->base_prefix}bp_messages_threads%'" ) ) {
    1195         $upgrade = BP_Messages_Thread::upgrade_tables();
    1196 
    1197         if ( $upgrade )
     1195        $update = BP_Messages_Thread::update_tables();
     1196
     1197        if ( $update )
    11981198            $wpdb->query( "DROP TABLE {$wpdb->base_prefix}bp_messages_threads" );
    11991199    }
     
    12451245/* Alter thickbox screens so the entire plugin download and install interface is contained within. */
    12461246function 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
    12481249    <script type="text/javascript">
    12491250        jQuery('p.action-button a').attr( 'target', '' );
     
    12561257            jQuery('a').removeClass( 'thickbox thickbox-preview onclick' );
    12571258            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' ) ?> &rarr;</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' ) ?> &rarr;</a></p>' );
    12591260        }
    12601261    </script>
     
    12821283        $status = __( 'Setup', 'buddypress' );
    12831284    else
    1284         $status = __( 'Upgrade', 'buddypress' );
     1285        $status = __( 'Update', 'buddypress' );
    12851286
    12861287    // Add the administration tab under the "Site Admin" tab for site administrators
     
    12991300    add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' );
    13001301}
    1301 is_multisite() ? add_action( 'network_admin_menu', 'bp_core_add_admin_menu' ) : add_action( 'admin_menu', 'bp_core_add_admin_menu' );
     1302add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_add_admin_menu' );
    13021303
    13031304function bp_core_add_admin_menu_styles() {
Note: See TracChangeset for help on using the changeset viewer.