Skip to:
Content

BuddyPress.org

Changeset 3713


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.

Location:
trunk
Files:
8 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r3712 r3713  
    299299    require ( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-admin.php' );
    300300}
    301 is_multisite() ? add_action( 'network_admin_menu', 'bp_core_admin_menu_init' ) : add_action( 'admin_menu', 'bp_core_admin_menu_init' );
     301add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_admin_menu_init' );
    302302
    303303/**
     
    331331    add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' );
    332332}
    333 is_multisite() ? add_action( 'network_admin_menu', 'bp_core_add_admin_menu' ) : add_action( 'admin_menu', 'bp_core_add_admin_menu' );
     333add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_add_admin_menu' );
    334334
    335335/**
     
    19741974        if ( !defined( 'BP_SILENCE_THEME_NOTICE' ) && !in_array( 'buddypress', (array)$ct->tags ) ) { ?>
    19751975            <div id="message" class="updated fade">
    1976                 <p style="line-height: 150%"><?php printf( __( "<strong>BuddyPress is ready</strong>. You'll need to <a href='%s'>activate a BuddyPress compatible theme</a> to take advantage of all of the features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>upgrade your existing WordPress theme</a>.", 'buddypress' ), admin_url( 'themes.php' ), admin_url( 'theme-install.php?type=tag&s=buddypress&tab=search' ), admin_url( 'plugin-install.php?type=term&tab=search&s=%22bp-template-pack%22' ) ) ?></p>
     1976                <p style="line-height: 150%"><?php printf( __( "<strong>BuddyPress is ready</strong>. You'll need to <a href='%s'>activate a BuddyPress compatible theme</a> to take advantage of all of the features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>update your existing WordPress theme</a>.", 'buddypress' ), admin_url( 'themes.php' ), admin_url( 'theme-install.php?type=tag&s=buddypress&tab=search' ), admin_url( 'plugin-install.php?type=term&tab=search&s=%22bp-template-pack%22' ) ) ?></p>
    19771977            </div><?php
    19781978        }
  • 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() {
  • trunk/bp-forums.php

    r3709 r3713  
    137137    add_submenu_page( 'bp-general-settings', __( 'Forums Setup', 'buddypress' ), __( 'Forums Setup', 'buddypress' ), 'manage_options', 'bb-forums-setup', "bp_forums_bbpress_admin" );
    138138}
    139 is_multisite() ? add_action( 'network_admin_menu', 'bp_forums_add_admin_menu' ) : add_action( 'admin_menu', 'bp_forums_add_admin_menu' );
     139add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_forums_add_admin_menu' );
    140140
    141141/* Forum Functions */
  • trunk/bp-forums/bp-forums-bbpress.php

    r3369 r3713  
    6565    /* This must be loaded before functionss.bb-admin.php otherwise we get a function conflict. */
    6666    if ( !$tables_installed = (boolean) $bbdb->get_results( 'DESCRIBE `' . $bbdb->forums . '`;', ARRAY_A ) )
    67         require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
     67        require_once( ABSPATH . 'wp-admin/includes/update.php' );
    6868
    6969    require_once( BB_PATH . 'bb-admin/includes/functions.bb-admin.php' );
     
    9797        dbDelta( str_replace( ' IF NOT EXISTS', '', str_replace( '`', '', $bb_queries ) ) );
    9898
    99         require_once( BB_PATH . 'bb-admin/includes/functions.bb-upgrade.php' );
     99        require_once( BB_PATH . 'bb-admin/includes/functions.bb-update.php' );
    100100        bb_update_db_version();
    101101
  • trunk/bp-loader.php

    r3592 r3713  
    1919/***
    2020 * Check if this is the first time BuddyPress has been loaded, or the first time
    21  * since an upgrade. If so, load the install/upgrade routine only.
     21 * since an update. If so, load the install/update routine only.
    2222 */
    2323if ( get_site_option( 'bp-db-version' ) < constant( 'BP_DB_VERSION' ) ) {
    24     require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-upgrade.php' );
     24    require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
    2525
    2626/***
    27  * If the install or upgrade routine is completed and everything is up to date
     27 * If the install or update routine is completed and everything is up to date
    2828 * continue loading BuddyPress as normal.
    2929 */
  • trunk/bp-messages/bp-messages-classes.php

    r3542 r3713  
    206206    }
    207207
    208     /* Upgrade Functions */
    209 
    210     function upgrade_tables() {
     208    /* Update Functions */
     209
     210    function update_tables() {
    211211        global $wpdb, $bp;
    212212
     
    214214        $threads = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->base_prefix}bp_messages_threads" ) );
    215215
    216         /* Nothing to upgrade, just return true to remove the table */
     216        /* Nothing to update, just return true to remove the table */
    217217        if ( empty( $threads ) )
    218218            return true;
  • trunk/bp-themes/bp-default/style.css

    r3681 r3713  
    1212** IMPORTANT - DO NOT COPY THIS THEME **
    1313If you want to make a custom theme based on this theme, DO NOT copy and edit it. By
    14 doing this you will make upgrades and maintainence much harder for yourself.
     14doing this you will make updates and maintainence much harder for yourself.
    1515Instead, please read this codex page on how to build a BuddyPress child theme:
    1616
  • trunk/bp-xprofile.php

    r3709 r3713  
    7676    add_submenu_page( 'bp-general-settings', __( 'Profile Field Setup', 'buddypress' ), __( 'Profile Field Setup', 'buddypress' ), 'manage_options', 'bp-profile-setup', 'xprofile_admin' );
    7777}
    78 is_multisite() ? add_action( 'network_admin_menu', 'xprofile_add_admin_menu' ) : add_action( 'admin_menu', 'xprofile_add_admin_menu' );
     78add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'xprofile_add_admin_menu' );
    7979
    8080/**
  • trunk/bp-xprofile/bp-xprofile-cssjs.php

    r3709 r3713  
    88    }
    99}
    10 is_multisite() ? add_action( 'network_admin_menu', 'xprofile_add_admin_css' ) : add_action( 'admin_menu', 'xprofile_add_admin_css' );
     10add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'xprofile_add_admin_css' );
    1111
    1212function xprofile_add_admin_js() {
     
    2525    }
    2626}
    27 is_multisite() ? add_action( 'network_admin_menu', 'xprofile_add_admin_js' ) : add_action( 'admin_menu', 'xprofile_add_admin_js', 1 );
     27add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'xprofile_add_admin_js', 1 );
    2828?>
Note: See TracChangeset for help on using the changeset viewer.