<!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][4482] trunk: Introduces bp_core_do_network_admin() and bp_core_admin_hook() for better BP_ENABLE_MULTIBLOG and multinetwork admin support.</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>4482</dd>
<dt>Author</dt> <dd>boonebgorges</dd>
<dt>Date</dt> <dd>2011-06-10 15:58:53 +0000 (Fri, 10 Jun 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Introduces bp_core_do_network_admin() and bp_core_admin_hook() for better BP_ENABLE_MULTIBLOG and multinetwork admin support. Changes BP admin menu to load in slot 3, so as not to override Dashboard menu on site admin. Props wpmuguru for help testing and thinking through</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcoreadminbpcoreadminphp">trunk/bp-core/admin/bp-core-admin.php</a></li>
<li><a href="#trunkbpcoreadminbpcoreupdatephp">trunk/bp-core/admin/bp-core-update.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>
<li><a href="#trunkbpxprofilebpxprofilebuddybarphp">trunk/bp-xprofile/bp-xprofile-buddybar.php</a></li>
<li><a href="#trunkbpxprofilebpxprofilecssjsphp">trunk/bp-xprofile/bp-xprofile-cssjs.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 (4481 => 4482)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/admin/bp-core-admin.php        2011-06-09 15:22:31 UTC (rev 4481)
+++ trunk/bp-core/admin/bp-core-admin.php        2011-06-10 15:58:53 UTC (rev 4482)
</span><span class="lines">@@ -16,7 +16,11 @@
</span><span class="cx"> * @package BuddyPress Core
</span><span class="cx"> * @since {@internal Unknown}}
</span><span class="cx"> */
</span><del>-function bp_core_admin_dashboard() { ?>
</del><ins>+function bp_core_admin_dashboard() {
+        $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 );
+        ?>
</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">@@ -26,7 +30,7 @@
</span><span class="cx">
</span><span class="cx">                 <?php do_action( 'bp_admin_notices' ); ?>
</span><span class="cx">
</span><del>-                <form action="<?php echo network_admin_url( 'admin.php?page=bp-general-settings' ) ?>" method="post" id="bp-admin-form">
</del><ins>+                <form action="<?php echo $action ?>" method="post" id="bp-admin-form">
</ins><span class="cx">                         <div id="bp-admin-content">
</span><span class="cx">                                 <p>[TODO: All sorts of awesome things will go here. Latest plugins and themes, stats, version check, support topics, news, tips]</p>
</span><span class="cx">                         </div>
</span><span class="lines">@@ -193,7 +197,9 @@
</span><span class="cx">                         bp_core_update_page_meta( $directory_pages );
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                wp_redirect( network_admin_url( add_query_arg( array( 'page' => 'bp-general-settings', 'updated' => 'true' ), 'admin.php' ) ) );
</del><ins>+                $base_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' );
+
+                wp_redirect( add_query_arg( array( 'page' => 'bp-general-settings', 'updated' => 'true' ), $base_url ) );
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> add_action( 'admin_init', 'bp_core_admin_component_setup_handler' );
</span><span class="lines">@@ -356,11 +362,6 @@
</span><span class="cx"> function bp_core_admin_page_options() {
</span><span class="cx">         global $bp;
</span><span class="cx">         
</span><del>-        if ( !bp_is_root_blog() ) {
-                $bp->is_switched = 1;
-                switch_to_blog( BP_ROOT_BLOG );
-        }
-                
</del><span class="cx">         // Get the existing WP pages
</span><span class="cx">         $existing_pages = bp_core_get_page_meta();
</span><span class="cx">
</span><span class="lines">@@ -448,11 +449,6 @@
</span><span class="cx">         </table>
</span><span class="cx">
</span><span class="cx">         <?php
</span><del>-        
-        if ( isset( $bp->is_switched ) ) {
-                restore_current_blog();
-                unset( $bp->is_switched );
-        }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkbpcoreadminbpcoreupdatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/admin/bp-core-update.php (4481 => 4482)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/admin/bp-core-update.php        2011-06-09 15:22:31 UTC (rev 4481)
+++ trunk/bp-core/admin/bp-core-update.php        2011-06-10 15:58:53 UTC (rev 4482)
</span><span class="lines">@@ -145,7 +145,7 @@
</span><span class="cx">
</span><span class="cx">                                 $step_count = count( $this->steps ) - 1;
</span><span class="cx">                                 $wiz_or_set = $this->current_step >= $step_count ? 'bp-general-settings' : 'bp-wizard';
</span><del>-                                $form_action = is_multisite() ? network_admin_url( add_query_arg( array( 'page' => $wiz_or_set ), 'admin.php' ) ) : admin_url( add_query_arg( array( 'page' => $wiz_or_set ), 'admin.php' ) );
</del><ins>+                                $form_action = bp_core_update_do_network_admin() ? network_admin_url( add_query_arg( array( 'page' => $wiz_or_set ), 'admin.php' ) ) : admin_url( add_query_arg( array( 'page' => $wiz_or_set ), 'admin.php' ) );
</ins><span class="cx">                         ?>
</span><span class="cx">
</span><span class="cx">                         <form action="<?php echo $form_action; ?>" method="post" id="bp-admin-form">
</span><span class="lines">@@ -1004,7 +1004,7 @@
</span><span class="cx">                         require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-loader.php' );
</span><span class="cx">
</span><span class="cx">                         // Redirect to the BuddyPress dashboard
</span><del>-                        $redirect = is_multisite() ? add_query_arg( array( 'page' => 'bp-general-settings' ), network_admin_url( 'admin.php' ) ) : add_query_arg( array( 'page' => 'bp-general-settings' ), admin_url( 'admin.php' ) );
</del><ins>+                        $redirect = bp_core_update_do_network_admin() ? add_query_arg( array( 'page' => 'bp-general-settings' ), network_admin_url( 'admin.php' ) ) : add_query_arg( array( 'page' => 'bp-general-settings' ), admin_url( 'admin.php' ) );
</ins><span class="cx">
</span><span class="cx">                         wp_redirect( $redirect );
</span><span class="cx">
</span><span class="lines">@@ -1055,7 +1055,7 @@
</span><span class="cx">
</span><span class="cx">         $bp_wizard = new BP_Core_Setup_Wizard;
</span><span class="cx"> }
</span><del>-add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_setup_wizard_init', 7 );
</del><ins>+add_action( bp_core_update_admin_hook(), 'bp_core_setup_wizard_init', 7 );
</ins><span class="cx">
</span><span class="cx"> function bp_core_install( $active_components = false ) {
</span><span class="cx">         global $wpdb;
</span><span class="lines">@@ -1150,7 +1150,7 @@
</span><span class="cx"> // Alter thickbox screens so the entire plugin download and install
</span><span class="cx"> // interface is contained within.
</span><span class="cx"> function bp_core_wizard_thickbox() {
</span><del>-        $form_action = is_multisite() ? network_admin_url( add_query_arg( array( 'page' => 'bp-wizard', 'updated' => '1' ), 'admin.php' ) ) : admin_url( add_query_arg( array( 'page' => 'bp-wizard', 'updated' => '1' ), 'admin.php' ) ); ?>
</del><ins>+        $form_action = bp_core_update_do_network_admin() ? network_admin_url( add_query_arg( array( 'page' => 'bp-wizard', 'updated' => '1' ), 'admin.php' ) ) : admin_url( add_query_arg( array( 'page' => 'bp-wizard', 'updated' => '1' ), 'admin.php' ) ); ?>
</ins><span class="cx">
</span><span class="cx">         <script type="text/javascript">
</span><span class="cx">                 jQuery('p.action-button a').attr( 'target', '' );
</span><span class="lines">@@ -1200,7 +1200,7 @@
</span><span class="cx">         // Add a hook for css/js
</span><span class="cx">         add_action( "admin_print_styles-$hook", 'bp_core_update_add_admin_menu_styles' );
</span><span class="cx"> }
</span><del>-add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_update_add_admin_menu', 9 );
</del><ins>+add_action( bp_core_update_admin_hook(), 'bp_core_update_add_admin_menu', 9 );
</ins><span class="cx">
</span><span class="cx"> function bp_core_update_add_admin_menu_styles() {
</span><span class="cx">         if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
</span><span class="lines">@@ -1253,6 +1253,21 @@
</span><span class="cx">         return apply_filters( 'bp_core_update_get_page_meta', $blog_page_ids );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function bp_core_update_do_network_admin() {
+        $do_network_admin = false;
+        
+        if ( is_multisite() && ( !defined( 'BP_ENABLE_MULTIBLOG' ) || !BP_ENABLE_MULTIBLOG ) )
+                $do_network_admin = true;
+        
+        return apply_filters( 'bp_core_do_network_admin', $do_network_admin );
+}
+
+function bp_core_update_admin_hook() {
+        $hook = bp_core_update_do_network_admin() ? 'network_admin_menu' : 'admin_menu';
+        
+        return apply_filters( 'bp_core_admin_hook', $hook );
+}
+
</ins><span class="cx"> /**
</span><span class="cx"> * Adds an admin nag about running the BP upgrade/install wizard
</span><span class="cx"> *
</span><span class="lines">@@ -1269,7 +1284,7 @@
</span><span class="cx">         if ( 'admin.php' == $pagenow && ( empty( $_GET['page'] ) || 'bp-wizard' == $_GET['page'] ) )
</span><span class="cx">                 return;
</span><span class="cx">
</span><del>-        $url = is_multisite() ? network_admin_url( 'admin.php?page=bp-wizard' ) : admin_url( 'admin.php?page=bp-wizard' );
</del><ins>+        $url = bp_core_update_do_network_admin() ? network_admin_url( 'admin.php?page=bp-wizard' ) : admin_url( 'admin.php?page=bp-wizard' );
</ins><span class="cx">
</span><span class="cx">         switch( $bp->maintenence_mode ) {
</span><span class="cx">                 case 'update':
</span></span></pre></div>
<a id="trunkbpcorebpcorefunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-functions.php (4481 => 4482)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-functions.php        2011-06-09 15:22:31 UTC (rev 4481)
+++ trunk/bp-core/bp-core-functions.php        2011-06-10 15:58:53 UTC (rev 4482)
</span><span class="lines">@@ -159,6 +159,21 @@
</span><span class="cx">         return apply_filters( 'bp_core_component_slug_from_root_slug', $slug, $root_slug );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function bp_core_do_network_admin() {
+        $do_network_admin = false;
+        
+        if ( is_multisite() && ( !defined( 'BP_ENABLE_MULTIBLOG' ) || !BP_ENABLE_MULTIBLOG ) )
+                $do_network_admin = true;
+        
+        return apply_filters( 'bp_core_do_network_admin', $do_network_admin );
+}
+
+function bp_core_admin_hook() {
+        $hook = bp_core_do_network_admin() ? 'network_admin_menu' : 'admin_menu';
+        
+        return apply_filters( 'bp_core_admin_hook', $hook );
+}
+
</ins><span class="cx"> /**
</span><span class="cx"> * Initializes the wp-admin area "BuddyPress" menus and sub menus.
</span><span class="cx"> *
</span><span class="lines">@@ -168,10 +183,12 @@
</span><span class="cx"> function bp_core_admin_menu_init() {
</span><span class="cx">         if ( !is_super_admin() )
</span><span class="cx">                 return false;
</span><ins>+        
+        add_action( bp_core_admin_hook(), 'bp_core_add_admin_menu', 9 );
</ins><span class="cx">
</span><span class="cx">         require ( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-admin.php' );
</span><span class="cx"> }
</span><del>-add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_admin_menu_init' );
</del><ins>+add_action( 'bp_init', 'bp_core_admin_menu_init' );
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Adds the "BuddyPress" admin submenu item to the Site Admin tab.
</span><span class="lines">@@ -193,7 +210,7 @@
</span><span class="cx">         $hooks = array();
</span><span class="cx">
</span><span class="cx">         // Add the administration tab under the "Site Admin" tab for site administrators
</span><del>-        $hooks[] = add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup', '', 2 );
</del><ins>+        $hooks[] = add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup', '', 4 );
</ins><span class="cx">
</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><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="lines">@@ -202,7 +219,6 @@
</span><span class="cx">         foreach( $hooks as $hook )
</span><span class="cx">                 add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' );
</span><span class="cx"> }
</span><del>-add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_add_admin_menu', 9 );
</del><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Print admin messages to admin_notices or network_admin_notices
</span><span class="lines">@@ -224,8 +240,9 @@
</span><span class="cx">         if ( !is_super_admin() )
</span><span class="cx">                 return;
</span><span class="cx">         
</span><del>-        // On multisite installs, don't show on the Site Admin of a non-root blog
-        if ( !bp_is_root_blog() )
</del><ins>+        // On multisite installs, don't show on the Site Admin of a non-root blog, unless
+        // do_network_admin is overridden
+        if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() )
</ins><span class="cx">                 return;
</span><span class="cx">                 
</span><span class="cx">         // Show the messages
</span><span class="lines">@@ -283,9 +300,10 @@
</span><span class="cx">         // Only the super admin gets warnings
</span><span class="cx">         if ( !is_super_admin() )
</span><span class="cx">                 return;
</span><del>-        
-        // On multisite installs, don't log on a non-root blog
-        if ( !bp_is_root_blog() )
</del><ins>+                
+        // On multisite installs, don't load on a non-root blog, unless do_network_admin is
+        // overridden
+        if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() )
</ins><span class="cx">                 return;
</span><span class="cx">                 
</span><span class="cx">         // Don't show these messages during setup or upgrade
</span><span class="lines">@@ -360,8 +378,10 @@
</span><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><span class="cx">                 }
</span><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' ), network_admin_url( 'admin.php?page=bp-general-settings' ), implode( ', ', $edit_pages_links ) );
</del><ins>+                $admin_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php?page=bp-general-settings' ) : admin_url( 'admin.php?page=bp-general-settings' );
</ins><span class="cx">                 
</span><ins>+                $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 ) );
+                
</ins><span class="cx">                 bp_core_add_admin_notice( $notice );
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -403,8 +423,10 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         if ( !empty( $orphaned_components ) ) {
</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 ), network_admin_url( 'admin.php?page=bp-general-settings' ) );
</del><ins>+                $admin_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php?page=bp-general-settings' ) : admin_url( 'admin.php?page=bp-general-settings' );
</ins><span class="cx">                 
</span><ins>+                $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 );
+                
</ins><span class="cx">                 bp_core_add_admin_notice( $notice );
</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 (4481 => 4482)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-admin.php        2011-06-09 15:22:31 UTC (rev 4481)
+++ trunk/bp-forums/bp-forums-admin.php        2011-06-10 15:58:53 UTC (rev 4482)
</span><span class="lines">@@ -10,10 +10,16 @@
</span><span class="cx">         $hook = add_submenu_page( 'bp-general-settings', __( 'Forums Setup', 'buddypress' ), __( 'Forums Setup', 'buddypress' ), 'manage_options', 'bb-forums-setup', "bp_forums_bbpress_admin" );
</span><span class="cx">         add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' );
</span><span class="cx"> }
</span><del>-add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_forums_add_admin_menu' );
</del><ins>+add_action( bp_core_admin_hook(), 'bp_forums_add_admin_menu' );
</ins><span class="cx">
</span><span class="cx"> function bp_forums_bbpress_admin() {
</span><del>-        global $bp; ?>
</del><ins>+        global $bp;
+        
+        $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 );
+        
+        ?>
</ins><span class="cx">
</span><span class="cx">         <div class="wrap">
</span><span class="cx">                 <?php screen_icon( 'buddypress' ); ?>
</span><span class="lines">@@ -35,7 +41,7 @@
</span><span class="cx">
</span><span class="cx">                 else : ?>
</span><span class="cx">
</span><del>-                        <p><?php printf( __( 'bbPress forum integration in BuddyPress has been set up correctly. If you are having problems you can <a href="%s" title="Reinstall bbPress">re-install</a>', 'buddypress' ), network_admin_url( 'admin.php?page=bb-forums-setup&reinstall=1' ) ); ?>
</del><ins>+                        <p><?php printf( __( 'bbPress forum integration in BuddyPress has been set up correctly. If you are having problems you can <a href="%s" title="Reinstall bbPress">re-install</a>.', 'buddypress' ), $action ); ?>
</ins><span class="cx">                         <p><?php _e( 'NOTE: The forums directory will only work if your bbPress tables are in the same database as your WordPress tables. If you are not using an existing bbPress install you can ignore this message.', 'buddypress' ) ?></p>
</span><span class="cx">
</span><span class="cx">                 <?php endif; ?>
</span></span></pre></div>
<a id="trunkbpxprofilebpxprofilebuddybarphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile/bp-xprofile-buddybar.php (4481 => 4482)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile/bp-xprofile-buddybar.php        2011-06-09 15:22:31 UTC (rev 4481)
+++ trunk/bp-xprofile/bp-xprofile-buddybar.php        2011-06-10 15:58:53 UTC (rev 4482)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx">         $hook = add_submenu_page( 'bp-general-settings', __( 'Profile Fields', 'buddypress' ), __( 'Profile Fields', 'buddypress' ), 'manage_options', 'bp-profile-setup', 'xprofile_admin' );
</span><span class="cx">         add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' );
</span><span class="cx"> }
</span><del>-add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'xprofile_add_admin_menu' );
</del><ins>+add_action( bp_core_admin_hook(), 'xprofile_add_admin_menu' );
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Adds an admin bar menu to any profile page providing site admin options
</span></span></pre></div>
<a id="trunkbpxprofilebpxprofilecssjsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile/bp-xprofile-cssjs.php (4481 => 4482)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile/bp-xprofile-cssjs.php        2011-06-09 15:22:31 UTC (rev 4481)
+++ trunk/bp-xprofile/bp-xprofile-cssjs.php        2011-06-10 15:58:53 UTC (rev 4482)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx">                         wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . '/bp-xprofile/admin/css/admin.css', array(), BP_VERSION );
</span><span class="cx">         }
</span><span class="cx"> }
</span><del>-add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'xprofile_add_admin_css' );
</del><ins>+add_action( bp_core_admin_hook(), 'xprofile_add_admin_css' );
</ins><span class="cx">
</span><span class="cx"> function xprofile_add_admin_js() {
</span><span class="cx">         if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
</span><span class="lines">@@ -24,5 +24,5 @@
</span><span class="cx">                         wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . '/bp-xprofile/admin/js/admin.js', array( 'jquery', 'jquery-ui-sortable' ), BP_VERSION );
</span><span class="cx">         }
</span><span class="cx"> }
</span><del>-add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'xprofile_add_admin_js', 1 );
</del><ins>+add_action( bp_core_admin_hook(), 'xprofile_add_admin_js', 1 );
</ins><span class="cx"> ?>
</span><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>
</body>
</html>