aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/groups/index.php2
-rw-r--r--mod/groups/languages/en.php1
-rw-r--r--mod/groups/membership.php33
-rw-r--r--mod/groups/start.php12
4 files changed, 45 insertions, 3 deletions
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 @@
+<?php
+
+ /**
+ * Elgg groups 'member of' page
+ *
+ * @package ElggGroups
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Ben Werdmuller <ben@elgg.com>
+ * @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]);