Changeset 4482
- Timestamp:
- 06/10/2011 03:58:53 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
bp-core/admin/bp-core-admin.php (modified) (5 diffs)
-
bp-core/admin/bp-core-update.php (modified) (7 diffs)
-
bp-core/bp-core-functions.php (modified) (8 diffs)
-
bp-forums/bp-forums-admin.php (modified) (2 diffs)
-
bp-xprofile/bp-xprofile-buddybar.php (modified) (1 diff)
-
bp-xprofile/bp-xprofile-cssjs.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-admin.php
r4466 r4482 17 17 * @since {@internal Unknown}} 18 18 */ 19 function bp_core_admin_dashboard() { ?> 19 function bp_core_admin_dashboard() { 20 $base_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ); 21 22 $action = add_query_arg( array( 'page' => 'bp-general-settings' ), $base_url ); 23 ?> 20 24 <div class="wrap" id="bp-admin"> 21 25 … … 27 31 <?php do_action( 'bp_admin_notices' ); ?> 28 32 29 <form action="<?php echo network_admin_url( 'admin.php?page=bp-general-settings' )?>" method="post" id="bp-admin-form">33 <form action="<?php echo $action ?>" method="post" id="bp-admin-form"> 30 34 <div id="bp-admin-content"> 31 35 <p>[TODO: All sorts of awesome things will go here. Latest plugins and themes, stats, version check, support topics, news, tips]</p> … … 194 198 } 195 199 196 wp_redirect( network_admin_url( add_query_arg( array( 'page' => 'bp-general-settings', 'updated' => 'true' ), 'admin.php' ) ) ); 200 $base_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ); 201 202 wp_redirect( add_query_arg( array( 'page' => 'bp-general-settings', 'updated' => 'true' ), $base_url ) ); 197 203 } 198 204 } … … 357 363 global $bp; 358 364 359 if ( !bp_is_root_blog() ) {360 $bp->is_switched = 1;361 switch_to_blog( BP_ROOT_BLOG );362 }363 364 365 // Get the existing WP pages 365 366 $existing_pages = bp_core_get_page_meta(); … … 449 450 450 451 <?php 451 452 if ( isset( $bp->is_switched ) ) {453 restore_current_blog();454 unset( $bp->is_switched );455 }456 452 } 457 453 -
trunk/bp-core/admin/bp-core-update.php
r4466 r4482 146 146 $step_count = count( $this->steps ) - 1; 147 147 $wiz_or_set = $this->current_step >= $step_count ? 'bp-general-settings' : 'bp-wizard'; 148 $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' ) );148 $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' ) ); 149 149 ?> 150 150 … … 1005 1005 1006 1006 // Redirect to the BuddyPress dashboard 1007 $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' ) );1007 $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' ) ); 1008 1008 1009 1009 wp_redirect( $redirect ); … … 1056 1056 $bp_wizard = new BP_Core_Setup_Wizard; 1057 1057 } 1058 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_setup_wizard_init', 7 );1058 add_action( bp_core_update_admin_hook(), 'bp_core_setup_wizard_init', 7 ); 1059 1059 1060 1060 function bp_core_install( $active_components = false ) { … … 1151 1151 // interface is contained within. 1152 1152 function bp_core_wizard_thickbox() { 1153 $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' ) ); ?>1153 $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' ) ); ?> 1154 1154 1155 1155 <script type="text/javascript"> … … 1201 1201 add_action( "admin_print_styles-$hook", 'bp_core_update_add_admin_menu_styles' ); 1202 1202 } 1203 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_update_add_admin_menu', 9 );1203 add_action( bp_core_update_admin_hook(), 'bp_core_update_add_admin_menu', 9 ); 1204 1204 1205 1205 function bp_core_update_add_admin_menu_styles() { … … 1254 1254 } 1255 1255 1256 function bp_core_update_do_network_admin() { 1257 $do_network_admin = false; 1258 1259 if ( is_multisite() && ( !defined( 'BP_ENABLE_MULTIBLOG' ) || !BP_ENABLE_MULTIBLOG ) ) 1260 $do_network_admin = true; 1261 1262 return apply_filters( 'bp_core_do_network_admin', $do_network_admin ); 1263 } 1264 1265 function bp_core_update_admin_hook() { 1266 $hook = bp_core_update_do_network_admin() ? 'network_admin_menu' : 'admin_menu'; 1267 1268 return apply_filters( 'bp_core_admin_hook', $hook ); 1269 } 1270 1256 1271 /** 1257 1272 * Adds an admin nag about running the BP upgrade/install wizard … … 1270 1285 return; 1271 1286 1272 $url = is_multisite() ? network_admin_url( 'admin.php?page=bp-wizard' ) : admin_url( 'admin.php?page=bp-wizard' );1287 $url = bp_core_update_do_network_admin() ? network_admin_url( 'admin.php?page=bp-wizard' ) : admin_url( 'admin.php?page=bp-wizard' ); 1273 1288 1274 1289 switch( $bp->maintenence_mode ) { -
trunk/bp-core/bp-core-functions.php
r4400 r4482 160 160 } 161 161 162 function bp_core_do_network_admin() { 163 $do_network_admin = false; 164 165 if ( is_multisite() && ( !defined( 'BP_ENABLE_MULTIBLOG' ) || !BP_ENABLE_MULTIBLOG ) ) 166 $do_network_admin = true; 167 168 return apply_filters( 'bp_core_do_network_admin', $do_network_admin ); 169 } 170 171 function bp_core_admin_hook() { 172 $hook = bp_core_do_network_admin() ? 'network_admin_menu' : 'admin_menu'; 173 174 return apply_filters( 'bp_core_admin_hook', $hook ); 175 } 176 162 177 /** 163 178 * Initializes the wp-admin area "BuddyPress" menus and sub menus. … … 169 184 if ( !is_super_admin() ) 170 185 return false; 186 187 add_action( bp_core_admin_hook(), 'bp_core_add_admin_menu', 9 ); 171 188 172 189 require ( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-admin.php' ); 173 190 } 174 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_admin_menu_init' );191 add_action( 'bp_init', 'bp_core_admin_menu_init' ); 175 192 176 193 /** … … 194 211 195 212 // Add the administration tab under the "Site Admin" tab for site administrators 196 $hooks[] = add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup', '', 2);213 $hooks[] = add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup', '', 4 ); 197 214 198 215 $hooks[] = add_submenu_page( 'bp-general-settings', __( 'Components', 'buddypress' ), __( 'Components', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup' ); … … 203 220 add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' ); 204 221 } 205 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_add_admin_menu', 9 );206 222 207 223 /** … … 225 241 return; 226 242 227 // On multisite installs, don't show on the Site Admin of a non-root blog 228 if ( !bp_is_root_blog() ) 243 // On multisite installs, don't show on the Site Admin of a non-root blog, unless 244 // do_network_admin is overridden 245 if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() ) 229 246 return; 230 247 … … 284 301 if ( !is_super_admin() ) 285 302 return; 286 287 // On multisite installs, don't log on a non-root blog 288 if ( !bp_is_root_blog() ) 303 304 // On multisite installs, don't load on a non-root blog, unless do_network_admin is 305 // overridden 306 if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() ) 289 307 return; 290 308 … … 361 379 } 362 380 363 $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 ) ); 381 $admin_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php?page=bp-general-settings' ) : admin_url( 'admin.php?page=bp-general-settings' ); 382 383 $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 ) ); 364 384 365 385 bp_core_add_admin_notice( $notice ); … … 404 424 405 425 if ( !empty( $orphaned_components ) ) { 406 $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' ) ); 426 $admin_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php?page=bp-general-settings' ) : admin_url( 'admin.php?page=bp-general-settings' ); 427 428 $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 ); 407 429 408 430 bp_core_add_admin_notice( $notice ); -
trunk/bp-forums/bp-forums-admin.php
r4421 r4482 11 11 add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' ); 12 12 } 13 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_forums_add_admin_menu' );13 add_action( bp_core_admin_hook(), 'bp_forums_add_admin_menu' ); 14 14 15 15 function bp_forums_bbpress_admin() { 16 global $bp; ?> 16 global $bp; 17 18 $base_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ); 19 20 $action = add_query_arg( array( 'page' => 'bb-forums-setup', 'reinstall' => '1' ), $base_url ); 21 22 ?> 17 23 18 24 <div class="wrap"> … … 36 42 else : ?> 37 43 38 <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' )); ?>44 <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 ); ?> 39 45 <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> 40 46 -
trunk/bp-xprofile/bp-xprofile-buddybar.php
r4400 r4482 25 25 add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' ); 26 26 } 27 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'xprofile_add_admin_menu' );27 add_action( bp_core_admin_hook(), 'xprofile_add_admin_menu' ); 28 28 29 29 /** -
trunk/bp-xprofile/bp-xprofile-cssjs.php
r3777 r4482 8 8 } 9 9 } 10 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'xprofile_add_admin_css' );10 add_action( bp_core_admin_hook(), 'xprofile_add_admin_css' ); 11 11 12 12 function xprofile_add_admin_js() { … … 25 25 } 26 26 } 27 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'xprofile_add_admin_js', 1 );27 add_action( bp_core_admin_hook(), 'xprofile_add_admin_js', 1 ); 28 28 ?>
Note: See TracChangeset
for help on using the changeset viewer.