Skip to:
Content

BuddyPress.org

Changeset 5717


Ignore:
Timestamp:
02/11/2012 06:03:19 AM (8 years ago)
Author:
johnjamesjacoby
Message:

Fix selected page ID's appearing incorrectly in the update wizard. Fixes #3995.

File:
1 edited

Legend:

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

    r5683 r5717  
    369369                   
    370370                    <?php if ( $page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . $existing_blog_page ) ) : ?>                 
     371
    371372                        <p><input type="radio" name="bp_pages[blogs]" value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?><?php echo $page_dropdown ?></p>
     373
    372374                    <?php endif ?>
    373375                </td>
     
    487489                    <p><label><input type="radio" name="bp_pages[members]" <?php checked( empty( $existing_pages['members'] ) ); ?>  value="<?php echo $members_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ) ?> <?php echo home_url( $members_slug ); ?>/</label></p>
    488490                   
    489                     <?php if ( $members_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . $existing_pages['members'] ) ) : ?>
     491                    <?php if ( $members_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['members']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
     492
    490493                        <p><label><input type="radio" name="bp_pages[members]" <?php checked( !empty( $existing_pages['members'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $members_page_dropdown ?></label></p>
     494
    491495                    <?php endif ?>
    492496                </td>
     
    503507                        <p><label><input type="radio" name="bp_pages[activity]" <?php checked( empty( $existing_pages['activity'] ) ); ?>  value="<?php echo $activity_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $activity_slug ); ?>/</label></p>
    504508                       
    505                         <?php if ( $activity_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . $existing_pages['activity'] ) ) : ?>
     509                        <?php if ( $activity_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['activity']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
    506510                            <p><label><input type="radio" name="bp_pages[activity]" <?php checked( !empty( $existing_pages['activity'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $activity_page_dropdown ?></label></p>
    507511                        <?php endif ?>
     
    521525                        <p><label><input type="radio" name="bp_pages[groups]" <?php checked( empty( $existing_pages['groups'] ) ); ?>  value="<?php echo $groups_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $groups_slug ); ?>/</label></p>
    522526                       
    523                         <?php if ( $groups_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . $existing_pages['groups'] ) ) : ?>
     527                        <?php if ( $groups_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['groups']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
    524528                            <p><label><input type="radio" name="bp_pages[groups]" <?php checked( !empty( $existing_pages['groups'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $groups_page_dropdown ?></label></p>
    525529                        <?php endif ?>
     
    539543                        <p><label><input type="radio" name="bp_pages[forums]" <?php checked( empty( $existing_pages['forums'] ) ); ?>  value="<?php echo $forums_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $forums_slug ); ?>/</label></p>
    540544                       
    541                         <?php if ( $forums_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . $existing_pages['forums'] ) ) : ?>
     545                        <?php if ( $forums_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['forums']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
    542546                            <p><label><input type="radio" name="bp_pages[forums]" <?php checked( !empty( $existing_pages['forums'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $forums_page_dropdown ?></label></p>
    543547                        <?php endif ?>
     
    558562                        <p><label><input type="radio" name="bp_pages[blogs]" <?php checked( empty( $existing_pages['blogs'] ) ); ?>  value="<?php echo $blogs_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $blogs_slug ); ?>/</label></p>
    559563                       
    560                         <?php if ( $blogs_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . $existing_pages['blogs'] ) ) : ?>
     564                        <?php if ( $blogs_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['blogs']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
    561565                            <p><label><input type="radio" name="bp_pages[blogs]" <?php checked( !empty( $existing_pages['blogs'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $blogs_page_dropdown ?></label></p>
    562566                        <?php endif ?>
     
    574578                    <p><label><input type="radio" name="bp_pages[register]" <?php checked( empty( $existing_pages['register'] ) ); ?>  value="<?php echo $register_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ) ?> <?php echo home_url( $register_slug ) ?>/</label></p>
    575579                   
    576                     <?php if ( $register_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . $existing_pages['register'] ) ) : ?>
     580                    <?php if ( $register_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['register']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
    577581                        <p><label><input type="radio" name="bp_pages[register]" <?php checked( !empty( $existing_pages['register'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $register_page_dropdown ?></label></p>
    578582                    <?php endif ?>
     
    588592                    <p><label><input type="radio" name="bp_pages[activate]" <?php checked( empty( $existing_pages['activate'] ) ); ?>  value="<?php echo $activation_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $activation_slug ); ?>/</label></p>
    589593                   
    590                     <?php if ( $activate_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . $existing_pages['activate'] ) ) : ?>
     594                    <?php if ( $activate_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['activate']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
    591595                        <p><label><input type="radio" name="bp_pages[activate]" <?php checked( !empty( $existing_pages['activate'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $activate_page_dropdown ?></label></p>
    592596                    <?php endif ?>
     
    614618        $prefix              = '';
    615619        $permalink_structure = get_option( 'permalink_structure' );
    616         $using_permalinks    = ( !empty( $permalink_structure ) ) ? true : false;
    617620        $structures          = array( '', $prefix . '/%year%/%monthnum%/%day%/%postname%/', $prefix . '/%year%/%monthnum%/%postname%/', $prefix . '/archives/%post_id%' );
    618621
    619622        // If we're using permalinks already, adjust text accordingly
    620         if ( $permalink_structure )
     623        if ( !empty( $permalink_structure ) )
    621624            $permalink_setup_text = __( 'Congratulations! You are already using pretty permalinks, which BuddyPress requires. If you\'d like to change your settings, you may do so now. If you\'re happy with your current settings, click Save &amp; Next to continue.', 'buddypress' );
    622625        else
     
    667670        $installed_plugins = get_plugins();
    668671        $installed_themes  = get_themes();
     672        $bp_themes         = array();
    669673
    670674        $template_pack_installed = false;
    671         $bp_autotheme_installed  = false;
    672675        $bp_theme_installed      = false;
    673676
     
    692695        $themes        = get_themes();
    693696
    694         if ( !empty( $themes[$current_theme]['Screenshot'] ) )
     697        if ( !empty( $themes[$current_theme]['Screenshot'] ) ) {
    695698            $screenshot = trailingslashit( get_stylesheet_directory_uri() ) . $themes[$current_theme]['Screenshot'];
    696     ?>
     699        } ?>
    697700
    698701        <script type="text/javascript">
     
    918921
    919922    function step_components_save() {
     923
    920924        if ( isset( $_POST['submit'] ) && isset( $_POST['bp_components'] ) ) {
     925
    921926            check_admin_referer( 'bpwizard_components' );
    922927
     
    924929
    925930            // Settings form submitted, now save the settings.
    926             foreach ( (array)$_POST['bp_components'] as $key => $value )
     931            foreach ( (array) $_POST['bp_components'] as $key => $value ) {
    927932                $active_components[$key] = 1;
     933            }
    928934
    929935            bp_update_option( 'bp-active-components', $active_components );
     
    951957            $existing_pages = bp_core_update_get_page_meta( 'bp-pages' );
    952958
    953             foreach ( (array)$existing_pages as $page_id )
     959            foreach ( (array) $existing_pages as $page_id ) {
    954960                wp_delete_post( $page_id, true );
     961            }
    955962
    956963            $blog_pages   = $this->setup_pages( (array)$_POST['bp_pages'] );
     
    13641371        wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', plugins_url( '/buddypress' ) . '/bp-core/css/admin.css' ), array(), '20110723' );
    13651372        wp_enqueue_script( 'bp-update-js', apply_filters( 'bp_core_update_js', plugins_url( '/buddypress' ) . '/bp-core/js/update.js' ), array( 'jquery' ), '20110723' );
    1366 
    13671373    }
    13681374
Note: See TracChangeset for help on using the changeset viewer.