Changeset 6581 for trunk/bp-core/bp-core-admin.php
- Timestamp:
- 12/10/2012 08:25:00 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-admin.php
r6579 r6581 50 50 public $js_url = ''; 51 51 52 53 52 /** Methods ***************************************************************/ 54 53 … … 75 74 */ 76 75 private function setup_globals() { 77 $bp = buddypress(); 76 $bp = buddypress(); 77 78 // Paths and URLs 78 79 $this->admin_dir = trailingslashit( $bp->plugin_dir . 'bp-core/admin' ); // Admin path 79 80 $this->admin_url = trailingslashit( $bp->plugin_url . 'bp-core/admin' ); // Admin url … … 81 82 $this->css_url = trailingslashit( $this->admin_url . 'css' ); // Admin css URL 82 83 $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'; 83 87 } 84 88 … … 164 168 165 169 $hooks = array(); 166 $page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';167 170 168 171 // Changed in BP 1.6 . See bp_core_admin_backpat_menu() … … 187 190 // Add the option pages 188 191 $hooks[] = add_submenu_page( 189 $ page,192 $this->settings_page, 190 193 __( 'BuddyPress Components', 'buddypress' ), 191 194 __( 'BuddyPress', 'buddypress' ), … … 196 199 197 200 $hooks[] = add_submenu_page( 198 $ page,201 $this->settings_page, 199 202 __( 'BuddyPress Pages', 'buddypress' ), 200 203 __( 'BuddyPress Pages', 'buddypress' ), … … 205 208 206 209 $hooks[] = add_submenu_page( 207 $ page,210 $this->settings_page, 208 211 __( 'BuddyPress Settings', 'buddypress' ), 209 212 __( 'BuddyPress Settings', 'buddypress' ), … … 279 282 /** Forums ************************************************************/ 280 283 281 if ( bp_is_active( 'forums' ) && bp_forums_is_installed_correctly()) {284 if ( bp_is_active( 'forums' ) ) { 282 285 283 286 // 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' ); 285 288 286 289 // Allow subscriptions setting … … 323 326 return $links; 324 327 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 329 328 // Add a few links to the existing links array 330 329 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>' 333 332 ) ); 334 333 } … … 340 339 */ 341 340 public function admin_head() { 342 $settings_page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';343 341 344 342 // 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' ); 348 345 349 346 // About and Credits pages … … 374 371 */ 375 372 public function about_screen() { 376 377 // Switch page to use for settings378 $settings_page = bp_is_network_activated() ? 'settings.php' : 'options-general.php';379 373 380 374 list( $display_version ) = explode( '-', bp_get_version() ); ?> … … 462 456 */ 463 457 public function credits_screen() { 464 465 // Switch page to use for settings466 $settings_page = bp_is_network_activated() ? 'settings.php' : 'options-general.php';467 458 468 459 list( $display_version ) = explode( '-', bp_get_version() ); ?> … … 578 569 579 570 <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> 581 572 </div> 582 573
Note: See TracChangeset
for help on using the changeset viewer.