diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-10 13:18:17 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-10 13:18:17 +0000 |
commit | 4378b158aa61d49ce0a7c38245b34bbff1100734 (patch) | |
tree | 25b928f4facbe846d7c2cdda68d838cb78cbe454 /mod/groups/lib | |
parent | e378f5961943faf16995acda327b81a2d5a0bd05 (diff) | |
download | elgg-4378b158aa61d49ce0a7c38245b34bbff1100734.tar.gz elgg-4378b158aa61d49ce0a7c38245b34bbff1100734.tar.bz2 |
finished moving the group pages to library - forum pages next
git-svn-id: http://code.elgg.org/elgg/trunk@7868 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/lib')
-rw-r--r-- | mod/groups/lib/groups.php | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php index faedca18e..426d67c86 100644 --- a/mod/groups/lib/groups.php +++ b/mod/groups/lib/groups.php @@ -246,3 +246,78 @@ function groups_handle_activity_page($guid) { echo elgg_view_page($title, $body); } + +/** + * Invite users to a group + * + * @param int $guid Group entity GUID + */ +function groups_handle_invite_page($guid) { + gatekeeper(); + + elgg_set_page_owner_guid($guid); + + $group = get_entity($guid); + + $title = elgg_echo('groups:invite'); + + if ($group && $group->canEdit()) { + $content = elgg_view('forms/groups/invite', array('entity' => $group)); + } else { + $content .= elgg_echo('groups:noaccess'); + } + + $params = array( + 'content' => $content, + 'title' => $title, + 'buttons' => '', + 'filter' => '', + ); + $body = elgg_view_layout('content', $params); + + echo elgg_view_page($title, $body); +} + +/** + * Manage requests to join a group + * + * @param int $guid Group entity GUID + */ +function groups_handle_requests_page($guid) { + + gatekeeper(); + + elgg_set_page_owner_guid($guid); + + $group = get_entity($guid); + + $title = elgg_echo('groups:membershiprequests'); + + if ($group && $group->canEdit()) { + elgg_push_breadcrumb($group->name, $group->getURL()); + elgg_push_breadcrumb($title); + + $requests = elgg_get_entities_from_relationship(array( + 'relationship' => 'membership_request', + 'relationship_guid' => $guid, + 'inverse_relationship' => true, + )); + $content = elgg_view('groups/membershiprequests', array( + 'requests' => $requests, + 'entity' => $group, + )); + + } else { + $content = elgg_echo("groups:noaccess"); + } + + $params = array( + 'content' => $content, + 'title' => $title, + 'buttons' => '', + 'filter' => '', + ); + $body = elgg_view_layout('content', $params); + + echo elgg_view_page($title, $body); +} |