aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-22 22:22:33 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-22 22:22:33 +0000
commit24378b3ecc07eb568e383823967a0ae6378120d6 (patch)
tree58883ec4eca3aa6c73e17da5267efc4dc3315238 /mod
parent1c1956e48cc29e358563e24dc73a18bf84e50889 (diff)
downloadelgg-24378b3ecc07eb568e383823967a0ae6378120d6.tar.gz
elgg-24378b3ecc07eb568e383823967a0ae6378120d6.tar.bz2
Fixes #2295 added a group member list page
git-svn-id: http://code.elgg.org/elgg/trunk@7906 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r--mod/groups/languages/en.php2
-rw-r--r--mod/groups/lib/groups.php40
-rw-r--r--mod/groups/start.php4
-rw-r--r--mod/groups/views/default/groups/sidebar/members.php9
4 files changed, 54 insertions, 1 deletions
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index e5db5d0c5..7ea83bcee 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -29,6 +29,8 @@ $english = array(
'groups:interests' => 'Tags',
'groups:website' => 'Website',
'groups:members' => 'Group members',
+ 'groups:members:title' => 'Members of %s',
+ 'groups:members:more' => "View all members",
'groups:membership' => "Group membership permissions",
'groups:access' => "Access permissions",
'groups:owner' => "Owner",
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php
index 426d67c86..cb9daf8e9 100644
--- a/mod/groups/lib/groups.php
+++ b/mod/groups/lib/groups.php
@@ -248,6 +248,46 @@ function groups_handle_activity_page($guid) {
}
/**
+ * Group members page
+ *
+ * @param int $guid Group entity GUID
+ */
+function groups_handle_members_page($guid) {
+
+ elgg_set_page_owner_guid($guid);
+
+ $group = get_entity($guid);
+ if (!$group || !elgg_instanceof($group, 'group')) {
+ forward();
+ }
+
+ group_gatekeeper();
+
+ $title = elgg_echo('groups:members:title', array($group->name));
+
+ elgg_push_breadcrumb($group->name, $group->getURL());
+ elgg_push_breadcrumb(elgg_echo('groups:members:'));
+
+ $content = elgg_list_entities_from_relationship(array(
+ 'relationship' => 'member',
+ 'relationship_guid' => $group->guid,
+ 'inverse_relationship' => true,
+ 'types' => 'user',
+ 'limit' => 20,
+ ));
+
+ $params = array(
+ 'content' => $content,
+ 'title' => $title,
+ 'buttons' => '',
+ 'filter' => '',
+ );
+ $body = elgg_view_layout('content', $params);
+
+ echo elgg_view_page($title, $body);
+}
+
+/**
* Invite users to a group
*
* @param int $guid Group entity GUID
diff --git a/mod/groups/start.php b/mod/groups/start.php
index d782c745f..92416a205 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -172,6 +172,7 @@ function groups_page_owner_handler() {
* Invite to group: pg/groups/invite/<guid>
* Membership requests: pg/groups/requests/<guid>
* Group activity: pg/groups/activity/<guid>
+ * Group members: pg/groups/members/<guid>
*
* @param array $page Array of url segments for routing
*/
@@ -209,6 +210,9 @@ function groups_page_handler($page) {
case 'activity':
groups_handle_activity_page($page[1]);
break;
+ case 'members':
+ groups_handle_members_page($page[1]);
+ break;
case 'invite':
groups_handle_invite_page($page[1]);
break;
diff --git a/mod/groups/views/default/groups/sidebar/members.php b/mod/groups/views/default/groups/sidebar/members.php
index b4e9199af..a8c2ffd3f 100644
--- a/mod/groups/views/default/groups/sidebar/members.php
+++ b/mod/groups/views/default/groups/sidebar/members.php
@@ -5,11 +5,18 @@
* @package ElggGroups
*/
-$body = '';
+$all_link = elgg_view('output/url', array(
+ 'href' => 'pg/groups/members/' . $vars['entity']->guid,
+ 'text' => elgg_echo('groups:members:more'),
+));
+
+$body = '<div class="clearfix">';
$members = $vars['entity']->getMembers(10);
foreach ($members as $mem) {
$body .= "<div class='member_icon'><a href=\"" . $mem->getURL() . "\">" . elgg_view("profile/icon", array('entity' => $mem, 'size' => 'tiny', 'override' => 'true')) . "</a></div>";
}
+$body .= '</div>';
+$body .= "<div class='center mts'>$all_link</div>";
echo elgg_view('layout/objects/module', array(
'title' => elgg_echo("groups:members"),