Skip to:
Content

BuddyPress.org

Changeset 516


Ignore:
Timestamp:
11/08/2008 11:59:41 AM (18 years ago)
Author:
apeatling
Message:

Added site admin settings for BuddyPress including ability to turn off admin bar for logged out users.

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r511 r516  
    4747/* Functions to handle and display the member and blog directory pages */
    4848require_once( 'bp-core/directories/bp-core-directory-members.php' );
     49
     50/* Functions to handle and display BuddyPress administration menus */
     51require_once( 'bp-core/bp-core-admin.php' );
    4952
    5053
     
    203206}
    204207add_action( 'admin_menu', 'bp_core_check_installed' );
     208
     209
     210function bp_core_add_admin_menu() {
     211        global $wpdb, $bp;
     212       
     213        if ( is_site_admin() ) {
     214                /* Add the administration tab under the "Site Admin" tab for site administrators */
     215                add_submenu_page( 'wpmu-admin.php', __("BuddyPress", 'buddypress'), __("BuddyPress", 'buddypress'), 1, "bp_core_admin_settings", "bp_core_admin_settings" );
     216        }
     217}
     218add_action( 'admin_menu', 'bp_core_add_admin_menu' );
     219
    205220
    206221/**
  • trunk/bp-core/bp-core-adminbar.php

    r508 r516  
    33function bp_core_admin_bar() {
    44        global $bp, $wpdb, $current_blog;
     5       
     6        if ( !(int)get_site_option( 'show-loggedout-adminbar' ) && !is_user_logged_in() )
     7                return false;
    58
    69        echo '<div id="wp-admin-bar">';
  • trunk/bp-core/bp-core-cssjs.php

    r508 r516  
    4040 */
    4141function bp_core_add_css() {
    42         wp_enqueue_style( 'bp-admin-bar', site_url() . '/wp-content/mu-plugins/bp-core/css/admin-bar.css' );
     42        if ( !(int)get_site_option( 'show-loggedout-adminbar' ) && is_user_logged_in() )
     43                wp_enqueue_style( 'bp-admin-bar', site_url() . '/wp-content/mu-plugins/bp-core/css/admin-bar.css' );
    4344
    4445        /* If you want custom css styles, include a custom-styles.css file in /bp-core/css/custom-styles.css */
  • trunk/bp-core/bp-core-templatetags.php

    r498 r516  
    5454       
    5555        /* Always add a log out list item to the end of the navigation */
    56         echo '<li><a id="wp-logout" href="' . site_url() . '/wp-login.php?action=logout&amp;redirect_to=' . site_url() . '">Log Out</a><li>';
     56        echo '<li><a id="wp-logout" href="' . site_url() . '/wp-login.php?action=logout&amp;redirect_to=' . site_url() . $_SERVER['REQUEST_URI'] . '">Log Out</a><li>';
    5757}
    5858
Note: See TracChangeset for help on using the changeset viewer.