Skip to:
Content

BuddyPress.org

Changeset 26


Ignore:
Timestamp:
04/14/2008 05:54:09 AM (13 years ago)
Author:
apeatling
Message:

Moved admin settings tab under Site Admin tab.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp_messages.php

    r19 r26  
    5252function messages_add_menu()
    5353{   
    54     global $wpdb, $table_name, $wpmuBaseTablePrefix, $bp_messages;
     54    global $wpdb, $table_name, $wpmuBaseTablePrefix, $bp_messages, $userdata;
    5555    $table_name = $wpmuBaseTablePrefix . "bp_messages";
    56    
    57     /* Instantiate bp_Messages class to do the real work. */
    58     $bp_messages = new BP_Messages;
    59     $bp_messages->bp_messages();
    60    
    61     $inbox_count = $bp_messages->get_inbox_count();
    62    
    63     add_menu_page("Messages", "Messages$inbox_count", 1, basename(__FILE__), "messages_write_new");
    64     add_submenu_page(basename(__FILE__), "Write New", "Write New", 1, basename(__FILE__), "messages_write_new");
    65     add_submenu_page(basename(__FILE__), "Inbox", "Inbox$inbox_count", 1, "messages_inbox", "messages_inbox"); 
    66     add_submenu_page(basename(__FILE__), "Sentbox", "Sentbox", 1, "messages_sentbox", "messages_sentbox");
    67     add_submenu_page(basename(__FILE__), "Drafts", "Drafts", 1, "messages_drafts", "messages_drafts");
    68 
    69     /* Add the administration tab under the "Site Admin" tab for site administrators */
    70     add_submenu_page('bp_core.php', "Messages", "Messages", 1, basename(__FILE__), "messages_settings");
    71 
     56
     57    if($wpdb->blogid == $userdata->primary_blog)
     58    {   
     59        /* Instantiate bp_Messages class to do the real work. */
     60        $bp_messages = new BP_Messages;
     61        $bp_messages->bp_messages();
     62   
     63        $inbox_count = $bp_messages->get_inbox_count();
     64   
     65        add_menu_page("Messages", "Messages$inbox_count", 1, basename(__FILE__), "messages_write_new");
     66        add_submenu_page(basename(__FILE__), "Write New", "Write New", 1, basename(__FILE__), "messages_write_new");
     67        add_submenu_page(basename(__FILE__), "Inbox", "Inbox$inbox_count", 1, "messages_inbox", "messages_inbox"); 
     68        add_submenu_page(basename(__FILE__), "Sentbox", "Sentbox", 1, "messages_sentbox", "messages_sentbox");
     69        add_submenu_page(basename(__FILE__), "Drafts", "Drafts", 1, "messages_drafts", "messages_drafts");
     70
     71        /* Add the administration tab under the "Site Admin" tab for site administrators */
     72        add_submenu_page('wpmu-admin.php', "Messages", "Messages", 1, basename(__FILE__), "messages_settings");
     73
     74    }
     75   
    7276    /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    7377    if($wpdb->get_var("show tables like '%" . $table_name . "%'") == false) messages_install();
Note: See TracChangeset for help on using the changeset viewer.