Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/10/2012 08:25:00 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Legacy Group Forums:

  • Retire bbPress 1.1 group forums component.
  • Creates new "Retired" components group, where old components go to die.
  • Deprecate "Forums" settings tab; use Legacy Forums Setting instead.
  • Remove associated code for old forums admin UI.
  • See #4493.
  • Fixes #3598.
File:
1 edited

Legend:

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

    r6579 r6581  
    5050    public $js_url = '';
    5151
    52 
    5352    /** Methods ***************************************************************/
    5453
     
    7574     */
    7675    private function setup_globals() {
    77         $bp               = buddypress();
     76        $bp = buddypress();
     77
     78        // Paths and URLs
    7879        $this->admin_dir  = trailingslashit( $bp->plugin_dir  . 'bp-core/admin' ); // Admin path
    7980        $this->admin_url  = trailingslashit( $bp->plugin_url  . 'bp-core/admin' ); // Admin url
     
    8182        $this->css_url    = trailingslashit( $this->admin_url . 'css'           ); // Admin css URL
    8283        $this->js_url     = trailingslashit( $this->admin_url . 'js'            ); // Admin css URL
     84
     85        // Main settings page
     86        $this->settings_page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
    8387    }
    8488
     
    164168
    165169        $hooks = array();
    166         $page  = bp_core_do_network_admin()  ? 'settings.php' : 'options-general.php';
    167170
    168171        // Changed in BP 1.6 . See bp_core_admin_backpat_menu()
     
    187190        // Add the option pages
    188191        $hooks[] = add_submenu_page(
    189             $page,
     192            $this->settings_page,
    190193            __( 'BuddyPress Components', 'buddypress' ),
    191194            __( 'BuddyPress', 'buddypress' ),
     
    196199
    197200        $hooks[] = add_submenu_page(
    198             $page,
     201            $this->settings_page,
    199202            __( 'BuddyPress Pages', 'buddypress' ),
    200203            __( 'BuddyPress Pages', 'buddypress' ),
     
    205208
    206209        $hooks[] = add_submenu_page(
    207             $page,
     210            $this->settings_page,
    208211            __( 'BuddyPress Settings', 'buddypress' ),
    209212            __( 'BuddyPress Settings', 'buddypress' ),
     
    279282        /** Forums ************************************************************/
    280283
    281         if ( bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) {
     284        if ( bp_is_active( 'forums' ) ) {
    282285
    283286            // Add the main section
    284             add_settings_section( 'bp_forums',        __( 'Forums Settings',       'buddypress' ), 'bp_admin_setting_callback_bbpress_section',       'buddypress'              );
     287            add_settings_section( 'bp_forums',        __( 'Legacy Group Forums',       'buddypress' ), 'bp_admin_setting_callback_bbpress_section',       'buddypress'              );
    285288
    286289            // Allow subscriptions setting
     
    323326            return $links;
    324327
    325         $page = 'bp-components';
    326         $text = __( 'Settings', 'buddypress' );
    327         $url  = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
    328 
    329328        // Add a few links to the existing links array
    330329        return array_merge( $links, array(
    331             'settings' => '<a href="' . add_query_arg( array( 'page' => $page      ), $url                      ) . '">' . $text                              . '</a>',
    332             'about'    => '<a href="' . add_query_arg( array( 'page' => 'bp-about' ), admin_url( 'index.php'  ) ) . '">' . esc_html__( 'About', 'buddypress' ) . '</a>'
     330            'settings' => '<a href="' . add_query_arg( array( 'page' => 'bp-components' ), bp_get_admin_url( $this->settings_page ) ) . '">' . esc_html__( 'Settings', 'buddypress' ) . '</a>',
     331            'about'    => '<a href="' . add_query_arg( array( 'page' => 'bp-about'      ), bp_get_admin_url( 'index.php'          ) ) . '">' . esc_html__( 'About',    'buddypress' ) . '</a>'
    333332        ) );
    334333    }
     
    340339     */
    341340    public function admin_head() {
    342         $settings_page  = bp_core_do_network_admin()  ? 'settings.php' : 'options-general.php';
    343341
    344342        // Settings pages
    345         remove_submenu_page( $settings_page, 'bb-forums-setup'  );
    346         remove_submenu_page( $settings_page, 'bp-page-settings' );
    347         remove_submenu_page( $settings_page, 'bp-settings'      );
     343        remove_submenu_page( $this->settings_page, 'bp-page-settings' );
     344        remove_submenu_page( $this->settings_page, 'bp-settings'      );
    348345
    349346        // About and Credits pages
     
    374371     */
    375372    public function about_screen() {
    376 
    377         // Switch page to use for settings
    378         $settings_page = bp_is_network_activated() ? 'settings.php' : 'options-general.php';
    379373
    380374        list( $display_version ) = explode( '-', bp_get_version() ); ?>
     
    462456     */
    463457    public function credits_screen() {
    464 
    465         // Switch page to use for settings
    466         $settings_page = bp_is_network_activated() ? 'settings.php' : 'options-general.php';
    467458
    468459        list( $display_version ) = explode( '-', bp_get_version() ); ?>
     
    578569
    579570            <div class="return-to-dashboard">
    580                 <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $settings_page ) ) ); ?>"><?php _e( 'Go to Community Settings' ); ?></a>
     571                <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) ); ?>"><?php _e( 'Go to Community Settings' ); ?></a>
    581572            </div>
    582573
Note: See TracChangeset for help on using the changeset viewer.