Skip to:
Content

BuddyPress.org

Ticket #4603: settings-link-fix.patch

File settings-link-fix.patch, 1.5 KB (added by apeatling, 14 years ago)

Fix the settings link pre-wizard.

  • bp-core/bp-core-admin.php

     
    360360         * @return array Processed links
    361361         */
    362362        public function add_settings_link( $links, $file ) {
     363                if ( buddypress()->basename == $file ) {
     364                        $mode = bp_get_maintenance_mode();
    363365
    364                 if ( buddypress()->basename == $file ) {
    365                         $url           = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
    366                         $settings_link = '<a href="' . add_query_arg( array( 'page' => 'bp-components' ), $url ) . '">' . __( 'Settings', 'buddypress' ) . '</a>';
     366                        // If we're in install mode then the link needs to show "Wizard" and link
     367                        // to the wizard. Otherwise we can show the BuddyPress settings page link.
     368                        if ( 'install' == $mode ) {
     369                                $url                    = bp_core_do_network_admin() ? network_admin_url( 'admin.php?page=bp-wizard' ) : admin_url( 'index.php?page=bp-wizard' );
     370                                $settings_link  = '<a href="' . add_query_arg( array( 'page' => 'bp-wizard' ), $url ) . '">' . __( 'Wizard', 'buddypress' ) . '</a>';
     371                        } else {
     372                                $url                    = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
     373                                $settings_link  = '<a href="' . add_query_arg( array( 'page' => 'bp-components' ), $url ) . '">' . __( 'Settings', 'buddypress' ) . '</a>';
     374                        }
     375
    367376                        array_unshift( $links, $settings_link );
    368377                }
    369378