From 5dd849742b104a6c9b2b0092d853d8171e31f151 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 7 Aug 2008 16:24:57 +0000 Subject: Added a 'member of' groups page and made it default git-svn-id: https://code.elgg.org/elgg/trunk@1766 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/groups/index.php | 2 +- mod/groups/languages/en.php | 1 + mod/groups/membership.php | 33 +++++++++++++++++++++++++++++++++ mod/groups/start.php | 12 ++++++++++-- 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 mod/groups/membership.php (limited to 'mod/groups') diff --git a/mod/groups/index.php b/mod/groups/index.php index 319de038a..f38b72211 100644 --- a/mod/groups/index.php +++ b/mod/groups/index.php @@ -14,7 +14,7 @@ $limit = get_input("limit", 10); $offset = get_input("offset", 0); - $title = sprintf(elgg_echo("groups:yours"),page_owner_entity()->name); + $title = sprintf(elgg_echo("groups:owned"),page_owner_entity()->name); // Get objects $area2 = elgg_view_title($title); diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php index 5d3181856..3ddc84340 100644 --- a/mod/groups/languages/en.php +++ b/mod/groups/languages/en.php @@ -16,6 +16,7 @@ */ 'groups' => "Groups", + 'groups:owned' => "Groups you own", 'groups:yours' => "Your groups", 'groups:user' => "%s's groups", 'groups:all' => "All groups", diff --git a/mod/groups/membership.php b/mod/groups/membership.php new file mode 100644 index 000000000..d5c40f609 --- /dev/null +++ b/mod/groups/membership.php @@ -0,0 +1,33 @@ + + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + $limit = get_input("limit", 10); + $offset = get_input("offset", 0); + + $title = sprintf(elgg_echo("groups:yours"),page_owner_entity()->name); + + // Get objects + $area2 = elgg_view_title($title); + + set_context('search'); + //$objects = list_entities("group", "", page_owner(), $limit, false); + $objects = list_entities_from_relationship('member',page_owner(),false,'group','',0,10,false); + set_context('groups'); + + $area2 .= $objects; + $body = elgg_view_layout('two_column_left_sidebar',$area1, $area2); + + // Finally draw the page + page_draw($title, $body); +?> \ No newline at end of file diff --git a/mod/groups/start.php b/mod/groups/start.php index 88cdef8d1..e97a3f2de 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -21,7 +21,7 @@ // Set up the menu for logged in users if (isloggedin()) { - add_menu(elgg_echo('groups'), $CONFIG->wwwroot . "pg/groups/owned/" . $_SESSION['user']->username,'groups'); + add_menu(elgg_echo('groups'), $CONFIG->wwwroot . "pg/groups/member/" . $_SESSION['user']->username,'groups'); add_menu(elgg_echo('groups:alldiscussion'),$CONFIG->wwwroot."mod/groups/discussions.php"); } else @@ -119,7 +119,8 @@ if (get_context() == "groups") { if ((page_owner() == $_SESSION['guid'] || !page_owner()) && isloggedin()) { add_submenu_item(elgg_echo('groups:new'), $CONFIG->wwwroot."pg/groups/new/"); - add_submenu_item(elgg_echo('groups:yours'), $CONFIG->wwwroot . "pg/groups/owned/" . $_SESSION['user']->username); + add_submenu_item(elgg_echo('groups:owned'), $CONFIG->wwwroot . "pg/groups/owned/" . $_SESSION['user']->username); + add_submenu_item(elgg_echo('groups:yours'), $CONFIG->wwwroot . "pg/groups/member/" . $_SESSION['user']->username); add_submenu_item(elgg_echo('groups:all'), $CONFIG->wwwroot . "pg/groups/world/"); } else if (page_owner()) { $page_owner = page_owner_entity(); @@ -180,6 +181,13 @@ set_input('username',$page[1]); include($CONFIG->pluginspath . "groups/index.php"); + break; + case "member" : + // User is a member of + if (isset($page[1])) + set_input('username',$page[1]); + + include($CONFIG->pluginspath . "groups/membership.php"); break; default: set_input('group_guid', $page[0]); -- cgit v1.2.3