diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-04 13:00:58 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-04 13:00:58 +0000 |
commit | f361fa6d7a3e990ed6bcb05cf634ef9cfae0fe4d (patch) | |
tree | d1df74baeeea97aebb59be6a3bf06e7fc7d0bc89 /mod/groups/start.php | |
parent | f783b09dc80ee4ee2af8749e6cf8cf62923b07e2 (diff) | |
download | elgg-f361fa6d7a3e990ed6bcb05cf634ef9cfae0fe4d.tar.gz elgg-f361fa6d7a3e990ed6bcb05cf634ef9cfae0fe4d.tar.bz2 |
Refs #109 - Basic profile layout
git-svn-id: https://code.elgg.org/elgg/trunk@1292 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/start.php')
-rw-r--r-- | mod/groups/start.php | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/mod/groups/start.php b/mod/groups/start.php index b6b49b32c..f577b096c 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -21,9 +21,9 @@ if (isloggedin()) { add_menu(elgg_echo('groups'), $CONFIG->wwwroot . "pg/groups/" . $_SESSION['user']->username,array( - menu_item(elgg_echo('groups:new'), $CONFIG->wwwroot."pg/groups/" . $_SESSION['user']->username . "/new/"), - menu_item(elgg_echo('groups:yours'), $CONFIG->wwwroot . "pg/groups/" . $_SESSION['user']->username), - menu_item(elgg_echo('groups:all'), $CONFIG->wwwroot . "pg/groups/" . $_SESSION['user']->username . "/world/"), + menu_item(elgg_echo('groups:new'), $CONFIG->wwwroot."pg/groups/new/"), + menu_item(elgg_echo('groups:yours'), $CONFIG->wwwroot . "pg/groups/owned/" . $_SESSION['user']->username), + menu_item(elgg_echo('groups:all'), $CONFIG->wwwroot . "pg/groups/world/"), ),'groups'); } else @@ -50,6 +50,8 @@ register_action("groups/addtogroup",false, $CONFIG->pluginspath . "groups/actions/addtogroup.php"); + // Use group widgets + use_widgets('groups'); // For now, we'll hard code the groups profile items as follows: // TODO make this user configurable @@ -80,27 +82,31 @@ { global $CONFIG; - // The username should be the file we're getting - if (isset($page[0])) { - set_input('username',$page[0]); - } - if (isset($page[1])) + if (isset($page[0])) { - switch($page[1]) - { - case "new": - include($CONFIG->pluginspath . "groups/new.php"); + // See what context we're using + switch($page[0]) + { + case "new" : + include($CONFIG->pluginspath . "groups/new.php"); break; case "world": include($CONFIG->pluginspath . "groups/all.php"); break; - } - } - else - { - // Include the standard profile index - include($CONFIG->pluginspath . "groups/index.php"); + case "owned" : + // Owned by a user + if (isset($page[1])) + set_input('username',$page[1]); + + include($CONFIG->pluginspath . "groups/index.php"); + break; + + default: + set_input('group_guid', $page[0]); + include($CONFIG->pluginspath . "groups/groupprofile.php"); + break; + } } } @@ -115,7 +121,9 @@ global $CONFIG; - return $CONFIG->url . "pg/view/" . $entity->getGUID() . "/"; + $title = friendly_title($entity->title); + + return $CONFIG->url . "pg/groups/{$entity->guid}/$title/"; } |