<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][4662] trunk: Add bp_admin_url() function to handle site/network link creation.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://buddypress.trac.wordpress.org/changeset/4662">4662</a></dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2011-07-16 21:46:50 +0000 (Sat, 16 Jul 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add bp_admin_url() function to handle site/network link creation. Add settings tabs to admin, and split component pages into their own dedicated page/tab.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcoreadminbpcoreadminphp">trunk/bp-core/admin/bp-core-admin.php</a></li>
<li><a href="#trunkbpcorebpcorefunctionsphp">trunk/bp-core/bp-core-functions.php</a></li>
<li><a href="#trunkbpforumsbpforumsadminphp">trunk/bp-forums/bp-forums-admin.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcoreadminbpcoreadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/admin/bp-core-admin.php (4661 => 4662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/admin/bp-core-admin.php        2011-07-16 20:06:19 UTC (rev 4661)
+++ trunk/bp-core/admin/bp-core-admin.php        2011-07-16 21:46:50 UTC (rev 4662)
</span><span class="lines">@@ -17,10 +17,10 @@
</span><span class="cx"> * @since {@internal Unknown}}
</span><span class="cx"> */
</span><span class="cx"> function bp_core_admin_dashboard() {
</span><del>-        $base_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' );
-        
-        $action = add_query_arg( array( 'page' => 'bp-general-settings' ), $base_url );
</del><ins>+        $base_url = bp_get_admin_url( 'admin.php' );
+        $action = add_query_arg( array( 'page' => 'bp-general-settings' ), $base_url );
</ins><span class="cx">         ?>
</span><ins>+
</ins><span class="cx">         <div class="wrap" id="bp-admin">
</span><span class="cx">
</span><span class="cx">                 <div id="bp-admin-header">
</span><span class="lines">@@ -66,8 +66,15 @@
</span><span class="cx">
</span><span class="cx">                 <?php screen_icon( 'buddypress' ); ?>
</span><span class="cx">
</span><del>-                <h2><?php _e( 'BuddyPress General Settings', 'buddypress' ); ?></h2>
</del><ins>+                <h2 class="nav-tab-wrapper">
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-general-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Components', 'buddypress' ); ?></a>
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Pages', 'buddypress' ); ?></a>
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ); ?>" class="nav-tab nav-tab-active"><?php _e( 'Settings', 'buddypress' ); ?></a>
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup', 'reinstall' => '1' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Forum Setup', 'buddypress' ); ?></a>
</ins><span class="cx">
</span><ins>+                        <?php do_action( 'bp_admin_tabs' ); ?>
+                </h2>
+
</ins><span class="cx">                 <?php if ( isset( $_POST['bp-admin'] ) ) : ?>
</span><span class="cx">
</span><span class="cx">                         <div id="message" class="updated fade">
</span><span class="lines">@@ -189,7 +196,7 @@
</span><span class="cx">                         bp_core_update_page_meta( $directory_pages );
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                $base_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' );
</del><ins>+                $base_url = bp_get_admin_url( 'admin.php' );
</ins><span class="cx">
</span><span class="cx">                 wp_redirect( add_query_arg( array( 'page' => 'bp-general-settings', 'updated' => 'true' ), $base_url ) );
</span><span class="cx">         }
</span><span class="lines">@@ -210,8 +217,15 @@
</span><span class="cx">
</span><span class="cx">                 <?php screen_icon( 'buddypress'); ?>
</span><span class="cx">
</span><del>-                <h2><?php _e( 'BuddyPress Component Settings', 'buddypress' ); ?></h2>
</del><ins>+                <h2 class="nav-tab-wrapper">
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-general-settings' ), 'admin.php' ) ); ?>" class="nav-tab nav-tab-active"><?php _e( 'Components', 'buddypress' ); ?></a>
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Pages', 'buddypress' ); ?></a>
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Settings', 'buddypress' ); ?></a>
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup', 'reinstall' => '1' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Forum Setup', 'buddypress' ); ?></a>
</ins><span class="cx">
</span><ins>+                        <?php do_action( 'bp_admin_tabs' ); ?>
+                </h2>
+
</ins><span class="cx">                 <?php if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] ) : ?>
</span><span class="cx">
</span><span class="cx">                         <div id="message" class="updated fade">
</span><span class="lines">@@ -224,13 +238,8 @@
</span><span class="cx">
</span><span class="cx">                 <form action="" method="post" id="bp-admin-component-form">
</span><span class="cx">
</span><del>-                        <?php
</del><ins>+                        <?php bp_core_admin_component_options(); ?>
</ins><span class="cx">
</span><del>-                                bp_core_admin_component_options();
-                                bp_core_admin_page_options();
-
-                        ?>
-
</del><span class="cx">                         <p class="submit clear">
</span><span class="cx">                                 <input class="button-primary" type="submit" name="bp-admin-component-submit" id="bp-admin-component-submit" value="<?php _e( 'Save Settings', 'buddypress' ) ?>"/>
</span><span class="cx">                         </p>
</span><span class="lines">@@ -244,6 +253,55 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Renders the Component Setup admin panel.
+ *
+ * @package BuddyPress Core
+ * @since {@internal Unknown}}
+ * @uses bp_core_admin_component_options()
+ */
+function bp_core_admin_page_setup() {
+?>
+
+        <div class="wrap">
+
+                <?php screen_icon( 'buddypress'); ?>
+
+                <h2 class="nav-tab-wrapper">
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-general-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Components', 'buddypress' ); ?></a>
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ); ?>" class="nav-tab nav-tab-active"><?php _e( 'Pages', 'buddypress' ); ?></a>
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Settings', 'buddypress' ); ?></a>
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup', 'reinstall' => '1' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Forum Setup', 'buddypress' ); ?></a>
+
+                        <?php do_action( 'bp_admin_tabs' ); ?>
+                </h2>
+
+                <?php if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] ) : ?>
+
+                        <div id="message" class="updated fade">
+
+                                <p><?php _e( 'Settings Saved', 'buddypress' ); ?></p>
+
+                        </div>
+
+                <?php endif; ?>
+
+                <form action="" method="post" id="bp-admin-page-form">
+
+                        <?php bp_core_admin_page_options(); ?>
+
+                        <p class="submit clear">
+                                <input class="button-primary" type="submit" name="bp-admin-page-submit" id="bp-admin-page-submit" value="<?php _e( 'Save Settings', 'buddypress' ) ?>"/>
+                        </p>
+
+                        <?php wp_nonce_field( 'bp-admin-page-setup' ); ?>
+
+                </form>
+        </div>
+
+<?php
+}
+
+/**
</ins><span class="cx"> * Creates reusable markup for component setup on the Components and Pages dashboard panel.
</span><span class="cx"> *
</span><span class="cx"> * This markup has been abstracted so that it can be used both during the setup wizard as well as
</span><span class="lines">@@ -260,7 +318,7 @@
</span><span class="cx">         $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
</span><span class="cx">         
</span><span class="cx">         // An array of strings looped over to create component setup markup
</span><del>-        $optional_components = array(
</del><ins>+        $optional_components = apply_filters( 'bp_admin_optional_components', array(
</ins><span class="cx">                 'xprofile' => array(
</span><span class="cx">                         'title' => __( 'Extended Profiles', 'buddypress' ),
</span><span class="cx">                         'description' => __( 'Customize your community with fully editable profile fields that allow your users use to uniquely describe themselves.', 'buddypress' )
</span><span class="lines">@@ -289,8 +347,8 @@
</span><span class="cx">                         'title' => __( 'Discussion Forums', 'buddypress' ),
</span><span class="cx">                         'description' => __( 'Full powered discussion forums built directly into groups allow for more conventional in-depth conversations. NOTE: This will require an extra (but easy) setup step.', 'buddypress' )
</span><span class="cx">                 )
</span><del>-        );
-        
</del><ins>+        ) );
+
</ins><span class="cx">         if ( is_multisite() ) {
</span><span class="cx">                 $optional_components['blogs'] = array(
</span><span class="cx">                         'title'         => __( 'Site Tracking', 'buddypress' ),
</span><span class="lines">@@ -298,6 +356,18 @@
</span><span class="cx">                 );
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        // Required components
+        $required_components = apply_filters( 'bp_admin_required_components', array(
+                'core' => array(
+                        'title' => __( 'BuddyPress Core', 'buddypress' ),
+                        'description' => __( 'It&#8216;s what makes <del>time travel</del> BuddyPress possible!', 'buddypress' )
+                ),
+                'members' => array(
+                        'title' => __( 'Community Members', 'buddypress' ),
+                        'description' => __( 'Everything in BuddyPress revolves around the members. This component cannot be turned off.', 'buddypress' )
+                ),
+        ) );
+        
</ins><span class="cx">         // On new install, set all components to be active by default
</span><span class="cx">         if ( !empty( $bp_wizard ) && 'install' == $bp_wizard->setup_type && empty( $active_components ) )
</span><span class="cx">                 $active_components = $optional_components;
</span><span class="lines">@@ -309,7 +379,7 @@
</span><span class="cx">
</span><span class="cx">                 <h3><?php _e( 'Active Components', 'buddypress' ); ?></h3>
</span><span class="cx">                                 
</span><del>-                <p><?php _e( 'Choose which BuddyPress components you would like to use.', 'buddypress' ); ?></p>
</del><ins>+                <p><?php _e( 'Each component has a unique purpose, and your community may not need each one.', 'buddypress' ); ?></p>
</ins><span class="cx">
</span><span class="cx">         <?php endif ?>
</span><span class="cx">         
</span><span class="lines">@@ -325,7 +395,7 @@
</span><span class="cx">                                                 <label for="bp_components[<?php echo esc_attr( $name ); ?>]">
</span><span class="cx">                                                         <input type="checkbox" id="bp_components[<?php echo esc_attr( $name ); ?>]" name="bp_components[<?php echo esc_attr( $name ); ?>]" value="1"<?php checked( isset( $active_components[esc_attr( $name )] ) ); ?> />
</span><span class="cx">
</span><del>-                                                        <?php echo esc_html( $labels['description'] ); ?>
</del><ins>+                                                        <?php echo $labels['description']; ?>
</ins><span class="cx">
</span><span class="cx">                                                 </label>
</span><span class="cx">
</span><span class="lines">@@ -339,6 +409,40 @@
</span><span class="cx">                 </tbody>
</span><span class="cx">         </table>
</span><span class="cx">
</span><ins>+        <?php if ( empty( $bp_wizard ) ) : ?>
+
+                <h3><?php _e( 'Required Components', 'buddypress' ); ?></h3>
+
+                <p><?php _e( 'The following components are required by BuddyPress and cannot be turned off.', 'buddypress' ); ?></p>
+
+        <?php endif ?>
+
+        <table class="form-table">
+                <tbody>
+
+                        <?php foreach ( $required_components as $name => $labels ) : ?>
+
+                                <tr valign="top">
+                                        <th scope="row"><?php echo esc_html( $labels['title'] ); ?></th>
+
+                                        <td>
+                                                <label for="bp_components[<?php echo esc_attr( $name ); ?>]">
+                                                        <input type="checkbox" id="bp_components[<?php echo esc_attr( $name ); ?>]" name="" disabled="disabled" value="1"<?php checked( true ); ?> />
+
+                                                        <?php echo $labels['description']; ?>
+
+                                                </label>
+
+                                        </td>
+                                </tr>
+
+                        <?php endforeach ?>
+
+                        <?php do_action( 'bp_active_external_components' ); ?>
+
+                </tbody>
+        </table>
+
</ins><span class="cx">         <input type="hidden" name="bp_components[members]" value="1" />
</span><span class="cx">
</span><span class="cx">         <?php
</span><span class="lines">@@ -370,9 +474,9 @@
</span><span class="cx">         if ( is_multisite() )
</span><span class="cx">                 $directory_pages['blogs'] = __( "Site Directory", 'buddypress' ); ?>
</span><span class="cx">         
</span><del>-        <h3><?php _e( 'Directory Pages', 'buddypress' ); ?></h3>
</del><ins>+        <h3><?php _e( 'Directories', 'buddypress' ); ?></h3>
</ins><span class="cx">         
</span><del>-        <p><?php _e( 'Choose a WordPress Page to associate with each BuddyPress component directory. Deactivated components should be set to "None".', 'buddypress' ); ?></p>
</del><ins>+        <p><?php _e( 'Choose a WordPress Page to associate with each available BuddyPress Component directory.', 'buddypress' ); ?></p>
</ins><span class="cx">
</span><span class="cx">         <table class="form-table">
</span><span class="cx">                 <tbody>
</span><span class="lines">@@ -414,9 +518,9 @@
</span><span class="cx">                 'activate' => __( 'Activation Page', 'buddypress' ),
</span><span class="cx">         ); ?>
</span><span class="cx">
</span><del>-        <h3><?php _e( 'Other Pages', 'buddypress' ); ?></h3>
</del><ins>+        <h3><?php _e( 'Registration', 'buddypress' ); ?></h3>
</ins><span class="cx">
</span><del>-        <p><?php _e( 'Associate WordPress Pages with the following BuddyPress pages. Setting to "None" will render that page inaccessible.', 'buddypress' ); ?></p>
</del><ins>+        <p><?php _e( 'Associate WordPress Pages with the following BuddyPress Registration pages.', 'buddypress' ); ?></p>
</ins><span class="cx">
</span><span class="cx">         <table class="form-table">
</span><span class="cx">                 <tbody>
</span></span></pre></div>
<a id="trunkbpcorebpcorefunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-functions.php (4661 => 4662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-functions.php        2011-07-16 20:06:19 UTC (rev 4661)
+++ trunk/bp-core/bp-core-functions.php        2011-07-16 21:46:50 UTC (rev 4662)
</span><span class="lines">@@ -238,6 +238,7 @@
</span><span class="cx">         // Add the administration tab under the "Site Admin" tab for site administrators
</span><span class="cx">         $hooks[] = add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup', '' );
</span><span class="cx">         $hooks[] = add_submenu_page( 'bp-general-settings', __( 'Components', 'buddypress' ), __( 'Components', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup' );
</span><ins>+        $hooks[] = add_submenu_page( 'bp-general-settings', __( 'Pages', 'buddypress' ), __( 'Pages', 'buddypress' ), 'manage_options', 'bp-page-settings', 'bp_core_admin_page_setup' );
</ins><span class="cx">         $hooks[] = add_submenu_page( 'bp-general-settings', __( 'Settings', 'buddypress' ), __( 'Settings', 'buddypress' ), 'manage_options', 'bp-settings', 'bp_core_admin_settings' );
</span><span class="cx">
</span><span class="cx">         // Add a hook for css/js
</span><span class="lines">@@ -399,14 +400,12 @@
</span><span class="cx">
</span><span class="cx">                 // Create the string of links to the Edit Page screen for the pages
</span><span class="cx">                 $edit_pages_links = array();
</span><del>-                foreach( $orphaned_pages as $op ) {
</del><ins>+                foreach( $orphaned_pages as $op )
</ins><span class="cx">                         $edit_pages_links[] = sprintf( '<a href="%1$s">%2$s</a>', admin_url( 'post.php?action=edit&post=' . $op['id'] ), $op['title'] );
</span><del>-                }
</del><span class="cx">
</span><del>-                $admin_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php?page=bp-general-settings' ) : admin_url( 'admin.php?page=bp-general-settings' );
</del><ins>+                $admin_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) );
+                $notice = sprintf( __( 'Some of your WordPress pages are linked to BuddyPress Components that are disabled: %2$s. <a href="%1$s" class="button-secondary">Repair</a>', 'buddypress' ), $admin_url, '<strong>' . implode( '</strong>, <strong>', $edit_pages_links ) . '</strong>' );
</ins><span class="cx">
</span><del>-                $notice = sprintf( __( 'Some of your WordPress pages are linked to BuddyPress components that have been disabled. These pages may continue to show up in your site navigation. Consider <a href="%1$s">reactivating the components</a>, or unpublishing the pages: <strong>%2$s</strong>', 'buddypress' ), $admin_url, implode( ', ', $edit_pages_links ) );
-
</del><span class="cx">                 bp_core_add_admin_notice( $notice );
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -448,10 +447,9 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         if ( !empty( $orphaned_components ) ) {
</span><del>-                $admin_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php?page=bp-general-settings' ) : admin_url( 'admin.php?page=bp-general-settings' );
</del><ins>+                $admin_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) );
+                $notice = sprintf( __( 'The following BuddyPress Components do not have associated WordPress Pages: %2$s. <a href="%1$s" class="button-secondary">Repair</a>', 'buddypress' ), $admin_url, '<strong>' . implode( '</strong>, <strong>', $orphaned_components ) . '</strong>' );
</ins><span class="cx">
</span><del>-                $notice = sprintf( __( 'Some BuddyPress components must be associated with WordPress pages for your site to work properly. The following components are missing their required WP pages: <strong>%1$s</strong>. Visit the <a href="%2$s">BuddyPress Components</a> panel, where you can either deactivate unused components or complete the page setup.', 'buddypress' ), implode( ', ', $orphaned_components ), $admin_url );
-
</del><span class="cx">                 bp_core_add_admin_notice( $notice );
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -1253,6 +1251,46 @@
</span><span class="cx">         return apply_filters( 'bp_use_wp_admin_bar', defined( 'BP_USE_WP_ADMIN_BAR' ) && BP_USE_WP_ADMIN_BAR );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Output the correct URL based on BuddyPress and WordPress configuration
+ *
+ * @package BuddyPress
+ * @since 1.3
+ *
+ * @param string $path
+ * @param string $scheme
+ *
+ * @uses bp_get_admin_url()
+ */
+function bp_admin_url( $path = '', $scheme = 'admin' ) {
+        echo bp_get_admin_url( $path, $scheme );
+}
+        /**
+         * Return the correct URL based on BuddyPress and WordPress configuration
+         *
+         * @package BuddyPress
+         * @since 1.3
+         *
+         * @param string $path
+         * @param string $scheme
+         *
+         * @uses bp_core_do_network_admin()
+         * @uses network_admin_url()
+         * @uses admin_url()
+         */
+        function bp_get_admin_url( $path = '', $scheme = 'admin' ) {
+
+                // Links belong in network admin
+                if ( bp_core_do_network_admin() )
+                        $url = network_admin_url( $path, $scheme );
+
+                // Links belong in site admin
+                else
+                        $url = admin_url( $path, $scheme );
+
+                return $url;
+        }
+
</ins><span class="cx"> /** Global Manipulators *******************************************************/
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkbpforumsbpforumsadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums/bp-forums-admin.php (4661 => 4662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-admin.php        2011-07-16 20:06:19 UTC (rev 4661)
+++ trunk/bp-forums/bp-forums-admin.php        2011-07-16 21:46:50 UTC (rev 4662)
</span><span class="lines">@@ -15,16 +15,22 @@
</span><span class="cx"> function bp_forums_bbpress_admin() {
</span><span class="cx">         global $bp;
</span><span class="cx">         
</span><del>-        $base_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' );
-        
-        $action = add_query_arg( array( 'page' => 'bb-forums-setup', 'reinstall' => '1' ), $base_url );
-        
</del><ins>+        $base_url = bp_get_admin_url( array( 'page' => 'bb-forums-setup', 'reinstall' => '1' ), 'admin.php' );
+
</ins><span class="cx">         ?>
</span><span class="cx">
</span><span class="cx">         <div class="wrap">
</span><span class="cx">                 <?php screen_icon( 'buddypress' ); ?>
</span><del>-                <h2><?php _e( 'Forums Setup', 'buddypress' ) ?></h2>
</del><span class="cx">
</span><ins>+                <h2 class="nav-tab-wrapper">
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-general-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Components', 'buddypress' ); ?></a>
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Pages', 'buddypress' ); ?></a>
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Settings', 'buddypress' ); ?></a>
+                        <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup', 'reinstall' => '1' ), 'admin.php' ) ); ?>" class="nav-tab nav-tab-active"><?php _e( 'Forum Setup', 'buddypress' ); ?></a>
+
+                        <?php do_action( 'bp_admin_tabs' ); ?>
+                </h2>
+
</ins><span class="cx">                 <?php if ( isset( $_POST['submit'] ) ) : ?>
</span><span class="cx">
</span><span class="cx">                         <div id="message" class="updated fade">
</span></span></pre>
</div>
</div>
</body>
</html>