Changeset 5073
- Timestamp:
- 08/31/2011 02:24:17 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-admin.php
r5037 r5073 14 14 15 15 /** 16 * Output the tabs in the admin area 17 * 18 * @since 1.5 19 * @param string $active_tab Name of the tab that is active 20 */ 21 function bp_core_admin_tabs( $active_tab = '' ) { 22 23 // Declare local variables 24 $tabs_html = ''; 25 $idle_class = 'nav-tab'; 26 $active_class = 'nav-tab nav-tab-active'; 27 28 // Setup core admin tabs 29 $tabs = array( 30 '0' => array( 31 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-general-settings' ), 'admin.php' ) ), 32 'name' => __( 'Components', 'buddypress' ) 33 ), 34 '1' => array( 35 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ), 36 'name' => __( 'Pages', 'buddypress' ) 37 ), 38 '2' => array( 39 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ), 40 'name' => __( 'Settings', 'buddypress' ) 41 ) 42 ); 43 44 // If forums component is active, add additional tab 45 if ( bp_is_active( 'forums' ) ) { 46 $tabs['3'] = array( 47 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup' ), 'admin.php' ) ), 48 'name' => __( 'Forums', 'buddypress' ) 49 ); 50 } 51 52 // Loop through tabs and build navigation 53 foreach( $tabs as $tab_id => $tab_data ) { 54 $is_current = (bool) ( $tab_data['name'] == $active_tab ); 55 $tab_class = $is_current ? $active_class : $idle_class; 56 $tabs_html .= '<a href="' . $tab_data['href'] . '" class="' . $tab_class . '">' . $tab_data['name'] . '</a>'; 57 } 58 59 // Output the tabs 60 echo $tabs_html; 61 62 // Do other fun things 63 do_action( 'bp_admin_tabs' ); 64 } 65 66 /** 16 67 * Renders the Settings admin panel. 17 68 * … … 38 89 <?php screen_icon( 'buddypress' ); ?> 39 90 40 <h2 class="nav-tab-wrapper"> 41 <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-general-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Components', 'buddypress' ); ?></a> 42 <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Pages', 'buddypress' ); ?></a> 43 <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> 44 <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Forum Setup', 'buddypress' ); ?></a> 45 46 <?php do_action( 'bp_admin_tabs' ); ?> 47 </h2> 91 <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Settings', 'buddypress' ) ); ?></h2> 48 92 49 93 <?php if ( isset( $_POST['bp-admin'] ) ) : ?> … … 205 249 <?php screen_icon( 'buddypress'); ?> 206 250 207 <h2 class="nav-tab-wrapper"> 208 <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> 209 <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Pages', 'buddypress' ); ?></a> 210 <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Settings', 'buddypress' ); ?></a> 211 <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Forum Setup', 'buddypress' ); ?></a> 212 213 <?php do_action( 'bp_admin_tabs' ); ?> 214 </h2> 251 <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Components', 'buddypress' ) ); ?></h2> 215 252 216 253 <?php if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] ) : ?> … … 254 291 <?php screen_icon( 'buddypress'); ?> 255 292 256 <h2 class="nav-tab-wrapper"> 257 <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-general-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Components', 'buddypress' ); ?></a> 258 <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> 259 <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Settings', 'buddypress' ); ?></a> 260 <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Forum Setup', 'buddypress' ); ?></a> 261 262 <?php do_action( 'bp_admin_tabs' ); ?> 263 </h2> 293 <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Pages', 'buddypress' ) ); ?></h2> 264 294 265 295 <?php if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] ) : ?> -
trunk/bp-forums/bp-forums-admin.php
r5002 r5073 24 24 <?php screen_icon( 'buddypress' ); ?> 25 25 26 <h2 class="nav-tab-wrapper"> 27 <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-general-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Components', 'buddypress' ); ?></a> 28 <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Pages', 'buddypress' ); ?></a> 29 <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ); ?>" class="nav-tab"><?php _e( 'Settings', 'buddypress' ); ?></a> 30 <a href="<?php bp_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup' ), 'admin.php' ) ); ?>" class="nav-tab nav-tab-active"><?php _e( 'Forum Setup', 'buddypress' ); ?></a> 31 32 <?php do_action( 'bp_admin_tabs' ); ?> 33 </h2> 26 <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Forums', 'buddypress' ) ); ?></h2> 34 27 35 28 <?php if ( isset( $_POST['submit'] ) ) : ?>
Note: See TracChangeset
for help on using the changeset viewer.