Changeset 6584
- Timestamp:
- 12/10/2012 09:02:49 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-functions.php
r6581 r6584 89 89 90 90 <div class="wrap"> 91 <?php screen_icon( 'buddypress' ); ?>91 <?php screen_icon( 'buddypress' ); ?> 92 92 <h2><?php _e( 'Why have all my BuddyPress menus disappeared?', 'buddypress' ); ?></h2> 93 93 … … 96 96 </div> 97 97 98 <?php98 <?php 99 99 } 100 100 … … 127 127 // Show the messages 128 128 if ( !empty( $bp->admin->notices ) ) { 129 ?>129 ?> 130 130 <div id="message" class="updated fade"> 131 <?php foreach( $bp->admin->notices as $notice ) : ?>131 <?php foreach ( $bp->admin->notices as $notice ) : ?> 132 132 <p><?php echo $notice ?></p> 133 133 <?php endforeach ?> 134 134 </div> 135 <?php135 <?php 136 136 } 137 137 } … … 180 180 181 181 // Bail if no activation redirect 182 182 if ( ! get_transient( '_bp_activation_redirect' ) ) 183 183 return; 184 184 … … 212 212 $tabs = array( 213 213 '0' => array( 214 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' 214 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), 'admin.php' ) ), 215 215 'name' => __( 'Components', 'buddypress' ) 216 216 ), … … 220 220 ), 221 221 '2' => array( 222 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' 223 'name' => __( 'Settings', 222 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ), 223 'name' => __( 'Settings', 'buddypress' ) 224 224 ) 225 225 ); 226 226 227 227 // Loop through tabs and build navigation 228 foreach ( array_values( $tabs ) as $tab_data ) {228 foreach ( array_values( $tabs ) as $tab_data ) { 229 229 $is_current = (bool) ( $tab_data['name'] == $active_tab ); 230 230 $tab_class = $is_current ? $active_class : $idle_class; … … 238 238 do_action( 'bp_admin_tabs' ); 239 239 } 240 241 /** Help **********************************************************************/ 242 243 /** 244 * adds contextual help to BuddyPress admin pages 245 * 246 * @since BuddyPress (1.7) 247 * @todo Make this part of the BP_Component class and split into each component 248 */ 249 function bp_core_add_contextual_help( $screen = '' ) { 250 251 $screen = get_current_screen(); 252 253 switch ( $screen->id ) { 254 255 // Compontent page 256 case 'settings_page_bp-components' : 257 258 // help tabs 259 $screen->add_help_tab( array( 260 'id' => 'bp-comp-overview', 261 'title' => __( 'Overview' ), 262 'content' => bp_core_add_contextual_help_content( 'bp-comp-overview' ), 263 ) ); 264 265 // help panel - sidebar links 266 $screen->set_help_sidebar( 267 '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . 268 '<p>' . __( '<a href="http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-components">Managing Components</a>', 'buddypress' ) . '</p>' . 269 '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' 270 ); 271 break; 272 273 // Pages page 274 case 'settings_page_bp-page-settings' : 275 276 // Help tabs 277 $screen->add_help_tab( array( 278 'id' => 'bp-page-overview', 279 'title' => __( 'Overview' ), 280 'content' => bp_core_add_contextual_help_content( 'bp-page-overview' ), 281 ) ); 282 283 // Help panel - sidebar links 284 $screen->set_help_sidebar( 285 '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . 286 '<p>' . __( '<a href="http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-pages">Managing Pages</a>', 'buddypress' ) . '</p>' . 287 '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' 288 ); 289 290 break; 291 292 // Settings page 293 case 'settings_page_bp-settings' : 294 295 // Help tabs 296 $screen->add_help_tab( array( 297 'id' => 'bp-settings-overview', 298 'title' => __( 'Overview' ), 299 'content' => bp_core_add_contextual_help_content( 'bp-settings-overview' ), 300 ) ); 301 302 // Help panel - sidebar links 303 $screen->set_help_sidebar( 304 '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . 305 '<p>' . __( '<a href="http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-settings">Managing Settings</a>', 'buddypress' ) . '</p>' . 306 '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' 307 ); 308 309 break; 310 311 // Profile fields page 312 case 'users_page_bp-profile-overview' : 313 314 // Help tabs 315 $screen->add_help_tab( array( 316 'id' => 'bp-profile-overview', 317 'title' => __( 'Overview' ), 318 'content' => bp_core_add_contextual_help_content( 'bp-profile-overview' ), 319 ) ); 320 321 // Help panel - sidebar links 322 $screen->set_help_sidebar( 323 '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . 324 '<p>' . __( '<a href="http://codex.buddypress.org/getting-started/configure-buddypress-components/#users-profile-fields">Managing Profile Fields</a>', 'buddypress' ) . '</p>' . 325 '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' 326 ); 327 328 break; 329 } 330 } 331 add_action( 'contextual_help', 'bp_core_add_contextual_help' ); 332 333 /** 334 * renders contextual help content to contextual help tabs 335 * 336 * @since BuddyPress (1.7) 337 */ 338 function bp_core_add_contextual_help_content( $tab = '' ) { 339 340 switch ( $tab ) { 341 case 'bp-comp-overview' : 342 return '<p>' . __( 'By default, all BuddyPress components are enabled. You can selectively disable any of the components by using the form. Your BuddyPress installation will continue to function. However, the features of the disabled components will no longer be accessible to anyone using the site.', 'buddypress' ) . '</p>'; 343 break; 344 345 case'bp-page-overview' : 346 return '<p>' . __( 'BuddyPress Components use WordPress Pages for their root directory/archive pages. Here you can change the page associations for each active component.', 'buddypress' ) . '</p>'; 347 break; 348 349 case 'bp-settings-overview' : 350 return '<p>' . __( 'Extra configuration settings.', 'buddypress' ) . '</p>'; 351 break; 352 353 case 'bp-profile-overview' : 354 return '<p>' . __( 'Your users will distinguish themselves through their profile page. Create relevant profile fields that will show on each users profile.</br></br>Note: Any fields in the first group will appear on the signup page.', 'buddypress' ) . '</p>'; 355 break; 356 357 default: 358 return false; 359 break; 360 } 361 }
Note: See TracChangeset
for help on using the changeset viewer.