diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/groups/groupprofile.php | 27 | ||||
-rw-r--r-- | mod/groups/languages/en.php | 1 | ||||
-rw-r--r-- | mod/groups/views/default/groups/closedmembership.php | 15 |
3 files changed, 38 insertions, 5 deletions
diff --git a/mod/groups/groupprofile.php b/mod/groups/groupprofile.php index 431afb235..437685313 100644 --- a/mod/groups/groupprofile.php +++ b/mod/groups/groupprofile.php @@ -19,14 +19,31 @@ $title = $group->name;
+ // Hide some items from closed groups when the user is not logged in.
+ $view_all = true;
+
+ if (
+ ((!isloggedin()) && (!$group->isPublicMembership())) ||
+ ((!$group->isMember(get_loggedin_user()) && (!$group->isPublicMembership())))
+ )
+ $view_all = false;
+
+
$area2 = elgg_view_title($title);
$area2 .= elgg_view('group/group', array('entity' => $group, 'user' => $_SESSION['user'], 'full' => true));
- //group profile 'items' - these are not real widgets, just contents to display
- $area2 .= elgg_view('groups/profileitems',array('entity' => $group));
-
- //group members
- $area3 = elgg_view('groups/members',array('entity' => $group));
+ if ($view_all) {
+ //group profile 'items' - these are not real widgets, just contents to display
+ $area2 .= elgg_view('groups/profileitems',array('entity' => $group));
+
+ //group members
+ $area3 = elgg_view('groups/members',array('entity' => $group));
+ }
+ else
+ {
+ $area2 .= elgg_view('groups/closedmembership', array('entity' => $group, 'user' => $_SESSION['user'], 'full' => true));
+
+ }
$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2, $area3);
} else { diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php index 3b678b16a..880dfcc66 100644 --- a/mod/groups/languages/en.php +++ b/mod/groups/languages/en.php @@ -64,6 +64,7 @@ 'groups:access:private' => 'Closed - Users must be invited',
'groups:access:public' => 'Open - Any user may join',
+ 'groups:closedgroup' => 'This group has a closed membership, please request to join.',
/*
Group tools
*/
diff --git a/mod/groups/views/default/groups/closedmembership.php b/mod/groups/views/default/groups/closedmembership.php new file mode 100644 index 000000000..129e20805 --- /dev/null +++ b/mod/groups/views/default/groups/closedmembership.php @@ -0,0 +1,15 @@ +<?php + /** + * Elgg groups plugin full profile view (for a closed group you haven't joined). + * + * @package ElggGroups + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider + * @copyright Curverider Ltd 2008-2009 + * @link http://elgg.com/ + */ + +?> +<div id="groups_closed_membership"> + <p><?php echo elgg_echo('groups:closedgroup'); ?></p> +</div>
\ No newline at end of file |