Skip to:
Content

BuddyPress.org

Changeset 6136


Ignore:
Timestamp:
06/24/2012 08:50:00 PM (13 years ago)
Author:
boonebgorges
Message:

Show the correct Site Wide Forums button text and URL during forum wizard.

Extends the changes in r6134.

See #4292

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-forums/bp-forums-admin.php

    r6134 r6136  
    112112
    113113    $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : '';
     114
     115    // The text and URL of the Site Wide Forums button differs depending on whether bbPress
     116    // is running
     117    if ( is_plugin_active( 'bbpress/bbpress.php' ) ) {
     118        // The bbPress admin page will always be on the root blog. switch_to_blog() will
     119        // pass through if we're already there.
     120        switch_to_blog( bp_get_root_blog_id() );
     121        $button_url = admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) );
     122        restore_current_blog();
     123
     124        $button_text = __( 'Configure Site Wide Forums', 'buddypress' );
     125    } else {
     126        $button_url = bp_get_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) );
     127        $button_text = __( 'Install Site Wide Forums', 'buddypress' );
     128    }
    114129
    115130    switch( $step ) {
     
    216231                    </ul>
    217232                    <div>
    218                         <a class="button thickbox button-primary" href="<?php bp_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) ); ?>"><?php _e( 'Install Site Wide Forums', 'buddypress' ) ?></a> &nbsp;
     233                        <a class="button thickbox button-primary" href="<?php echo esc_attr( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> &nbsp;
    219234                    </div>
    220235                </div>
Note: See TracChangeset for help on using the changeset viewer.