Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/13/2013 01:33:36 AM (11 years ago)
Author:
boonebgorges
Message:

Reintroduces legacy forum config tab for installations still using legacy forums

Without access to this page, it becomes impossible to regenerate the
bb-config.php file. We also lose the chance to preach the gospel of the new
bbPress plugin to users of bbPress 1.x when we don't have an admin panel for
the legacy component.

Fixes #4999

Props r-a-y

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-forums/deprecated/1.6.php

    r6581 r7213  
    1515if ( !defined( 'ABSPATH' ) ) exit;
    1616
     17/**
     18 * Outputs the markup for the bb-forums-admin panel
     19 */
    1720function bp_forums_bbpress_admin() {
     21
     22    // The text and URL of the Site Wide Forums button differs depending on whether bbPress
     23    // is running
     24    if ( is_plugin_active( 'bbpress/bbpress.php' ) ) {
     25        // The bbPress admin page will always be on the root blog. switch_to_blog() will
     26        // pass through if we're already there.
     27        switch_to_blog( bp_get_root_blog_id() );
     28        $button_url = admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) );
     29        restore_current_blog();
     30
     31        $button_text = __( 'Configure bbPress', 'buddypress' );
     32    } else {
     33        $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' ) );
     34        $button_text = __( 'Install bbPress', 'buddypress' );
     35    }
    1836
    1937    $action = bp_get_admin_url( 'admin.php?page=bb-forums-setup&reinstall=1' ); ?>
     
    3856            // Delete the bb-config.php location option
    3957            bp_delete_option( 'bb-config-location' );
     58
     59            // Now delete the bb-config.php file
     60            @unlink( ABSPATH . 'bb-config.php' );
     61
     62            // show the updated wizard
    4063            bp_forums_bbpress_install_wizard();
    4164
    4265        else : ?>
    4366
    44             <div>
    45                 <h3><?php _e( 'Forums for Groups', 'buddypress' ) ?></h3>
     67            <div style="width: 45%; float: left; margin-top: 20px;">
     68                <h3><?php _e( '(Installed)', 'buddypress' ); ?> <?php _e( 'Forums for Groups', 'buddypress' ) ?></h3>
    4669
    4770                <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p>
    48                 <p class="description"><?php _e( 'You may use an existing bbPress installation if you have one.', 'buddypress' ); ?></p>
     71
     72                <p><?php _e( 'Note: This component is retired and will not be receiving any updates in the future.  Only use this component if your current site relies on it.' , 'buddypress' ); ?></p>
    4973
    5074                <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4>
     
    5781
    5882                <div>
    59                     <a class="button button-primary" href="<?php echo $action ?>"><?php _e( 'Reinstall Group Forums', 'buddypress' ) ?></a> &nbsp;
     83                    <a class="button button-primary confirm" href="<?php echo $action ?>"><?php _e( 'Uninstall Group Forums', 'buddypress' ) ?></a> &nbsp;
     84                </div>
     85            </div>
     86
     87            <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;">
     88                <h3><?php _e( 'New! bbPress', 'buddypress' ) ?></h3>
     89                <p><?php _e( 'bbPress is a brand-new forum plugin from one of the lead developers of BuddyPress.', 'buddypress' ) ?></p>
     90
     91                <p><?php _e( 'It boasts a bunch of cool features that the BP Legacy Discussion Forums does not have including:', 'buddypress' ) ?></p>
     92
     93                <ul class="description" style="list-style: square; margin-left: 30px;">
     94                    <li><?php _e( 'Non-group specific forum creation', 'buddypress' ); ?></p></li>
     95                    <li><?php _e( 'Moderation via the WP admin dashboard', 'buddypress' ); ?></p></li>
     96                    <li><?php _e( 'Topic splitting', 'buddypress' ); ?></p></li>
     97                    <li><?php _e( 'Revisions', 'buddypress' ); ?></p></li>
     98                    <li><?php _e( 'Spam management', 'buddypress' ); ?></p></li>
     99                    <li><?php _e( 'Subscriptions', 'buddypress' ); ?></p></li>
     100                    <li><?php _e( 'And more!', 'buddypress' ); ?></p></li>
     101                </ul>
     102
     103                <p><?php printf( __( 'If you decide to use bbPress, you will need to deactivate the legacy group forum component.  For more info, <a href="%s">read this codex article</a>.', 'buddypress' ), 'http://codex.buddypress.org/user/setting-up-a-new-installation/installing-group-and-sitewide-forums/using-bbpress-2-2-with-buddypress/' ) ?></p>
     104
     105                <div>
     106                    <a class="button thickbox button-primary" href="<?php echo esc_attr( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> &nbsp;
    60107                </div>
    61108            </div>
     
    68115
    69116function bp_forums_bbpress_install_wizard() {
    70     $post_url = bp_get_admin_url( 'admin.php?page=bb-forums-setup' );
     117    $post_url                 = bp_get_admin_url( 'admin.php?page=bb-forums-setup' );
     118    $bbpress_plugin_is_active = false;
    71119
    72120    $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : '';
     121
     122    // The text and URL of the Site Wide Forums button differs depending on whether bbPress
     123    // is running
     124    if ( is_plugin_active( 'bbpress/bbpress.php' ) ) {
     125        $bbpress_plugin_is_active = true;
     126
     127        // The bbPress admin page will always be on the root blog. switch_to_blog() will
     128        // pass through if we're already there.
     129        switch_to_blog( bp_get_root_blog_id() );
     130        $button_url = admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) );
     131        restore_current_blog();
     132
     133        $button_text = __( 'Configure bbPress', 'buddypress' );
     134    } else {
     135        $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' ) );
     136        $button_text = __( 'Install bbPress', 'buddypress' );
     137    }
    73138
    74139    switch( $step ) {
     
    99164
    100165        case 'new':
    101             if ( isset( $_REQUEST['doinstall'] ) && 1 == (int) $_REQUEST['doinstall'] ) {
     166            if ( isset( $_REQUEST['doinstall'] ) && 1 == (int)$_REQUEST['doinstall'] ) {
    102167                $result = bp_forums_bbpress_install();
    103168
     
    142207            ?>
    143208
    144                 <div>
     209                <div style="width: 45%; float: left;  margin-top: 20px;">
    145210                    <h3><?php _e( 'Forums for Groups', 'buddypress' ) ?></h3>
    146211
    147212                    <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p>
    148                     <p class="description"><?php _e( 'You may use an existing bbPress installation if you have one.', 'buddypress' ); ?></p>
     213
     214                    <p><?php _e( 'Note: This component is retired and will not be receiving any updates in the future.  Only use this component if your current site relies on it.' , 'buddypress' ); ?></p>
    149215
    150216                    <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4>
     
    162228                </div>
    163229
     230                <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;">
     231                    <h3><?php _e( 'New! bbPress', 'buddypress' ) ?></h3>
     232                    <p><?php _e( 'bbPress is a brand-new forum plugin from one of the lead developers of BuddyPress.', 'buddypress' ) ?></p>
     233
     234                    <p><?php _e( 'It boasts a bunch of cool features that the BP Legacy Discussion Forums does not have including:', 'buddypress' ) ?></p>
     235
     236                    <ul class="description" style="list-style: square; margin-left: 30px;">
     237                        <li><?php _e( 'Non-group specific forum creation', 'buddypress' ); ?></p></li>
     238                        <li><?php _e( 'Moderation via the WP admin dashboard', 'buddypress' ); ?></p></li>
     239                        <li><?php _e( 'Topic splitting', 'buddypress' ); ?></p></li>
     240                        <li><?php _e( 'Revisions', 'buddypress' ); ?></p></li>
     241                        <li><?php _e( 'Spam management', 'buddypress' ); ?></p></li>
     242                        <li><?php _e( 'Subscriptions', 'buddypress' ); ?></p></li>
     243                        <li><?php _e( 'And more!', 'buddypress' ); ?></p></li>
     244                    </ul>
     245
     246                    <p><?php printf( __( 'If you decide to use bbPress, you will need to deactivate the legacy group forum component.  For more info, <a href="%s">read this codex article</a>.', 'buddypress' ), 'http://codex.buddypress.org/user/setting-up-a-new-installation/installing-group-and-sitewide-forums/using-bbpress-2-2-with-buddypress/' ) ?></p>
     247                    <div>
     248                        <a class="button button-primary <?php if ( ! $bbpress_plugin_is_active ) { echo esc_attr( 'thickbox' ); }?>" href="<?php echo esc_attr( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> &nbsp;
     249                    </div>
     250                </div>
     251
    164252            <?php }
    165253        break;
Note: See TracChangeset for help on using the changeset viewer.