diff options
Diffstat (limited to 'mod/groups')
-rw-r--r-- | mod/groups/languages/en.php | 2 | ||||
-rw-r--r-- | mod/groups/lib/groups.php | 40 | ||||
-rw-r--r-- | mod/groups/start.php | 4 | ||||
-rw-r--r-- | mod/groups/views/default/groups/sidebar/members.php | 9 |
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"), |