Changeset 399

Show
Ignore:
Timestamp:
06/14/06 21:09:21 (2 years ago)
Author:
ben
Message:

Community membership request pages now have appropriate menu items.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/_communities/requests.php

    r296 r399  
    1313 
    1414        define("context", "network"); 
     15        templates_page_setup(); 
    1516         
    1617    // Whose friends are we looking at? 
  • devel/mod/community/lib.php

    r373 r399  
    88 
    99    $page_owner = $profile_id; 
     10     
     11    $usertype = run("users:type:get", $page_owner); 
    1012 
    11     if (context == "network") { 
    12          
    13         if (run("users:type:get", $page_owner) == "person") { 
    14  
    15             $PAGE->menu_sub[] = array( 'name' => 'community', 
    16                                        'html' => a_hrefg("{$CFG->wwwroot}_communities/?owner=$page_owner" , 
    17                                                           "Communities"));  
    18                              
    19             $PAGE->menu_sub[] = array( 'name' => 'community:owned', 
    20                                        'html' => a_hrefg("{$CFG->wwwroot}_communities/owned.php?owner=$page_owner" , 
    21                                                           "Owned Communities")); 
    22  
    23         } else if (run("users:type:get", $page_owner) == "community") { 
     13    if ($usertype == "community") { 
    2414             
    25             $PAGE->menu_sub[] = array( 'name' => 'community:members', 
    26                                        'html' => a_hrefg("{$CFG->wwwroot}_communities/members.php?owner=$page_owne" , 
    27                                                           "Community Members")); 
    28             $PAGE->menu_sub[] = array( 'name' => 'community:requests', 
    29                                        'html' => a_hrefg("{$CFG->wwwroot}_communities/requests.php?profile_id=$page_owner", 
    30                                                          "View membership requests")); 
    31         } 
    32          
    33     } 
    34     if (context == "profile" && run("users:type:get", $page_owner) == "community") { 
    35          
    36         if (run("permissions:check", "profile")) { 
     15        if (context == "profile") { 
    3716             
    3817            $PAGE->menu_sub[] = array( 'name' => 'profile:edit',  
    3918                                       'html' => '<a href="'.$CFG->wwwroot.'profile/edit.php?profile_id='.$page_owner.'">' 
    4019                                       . gettext("Edit this profile") . '</a>'); 
     20             
     21        } 
     22         
     23        /*$PAGE->menu_sub[] = array( 'name' => 'community:members', 
     24                                   'html' => a_hrefg("{$CFG->wwwroot}_communities/members.php?owner=$page_owner" , 
     25                                                      "Community Members"));*/ 
     26                                                       
     27        if (run("permissions:check", "profile")) { 
    4128             
    4229            $PAGE->menu_sub[] = array( 'name' => 'community:pic', 
     
    5138                                       'html' => a_hrefg("{$CFG->wwwroot}_communities/requests.php?profile_id=$page_owner", 
    5239                                                         "View membership requests")); 
     40 
     41        } 
     42         
     43    } else if ($usertype == "person") { 
     44     
     45        if (context == "network") { 
     46     
     47            $PAGE->menu_sub[] = array( 'name' => 'community', 
     48                                       'html' => a_hrefg("{$CFG->wwwroot}_communities/?owner=$page_owner" , 
     49                                                          "Communities"));  
     50                             
     51            $PAGE->menu_sub[] = array( 'name' => 'community:owned', 
     52                                       'html' => a_hrefg("{$CFG->wwwroot}_communities/owned.php?owner=$page_owner" , 
     53                                                          "Owned Communities")); 
     54 
    5355        } 
    5456