aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-04-24 12:51:26 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-04-24 12:51:26 +0000
commita489cdae5b58ac27858e03921441a4f6e150a6d6 (patch)
tree8eb1d365169250aaf80c694553f288c55cd2f3a3
parentf64a66a816e3bedfb37b29ac3946e83f8c0aa087 (diff)
downloadelgg-a489cdae5b58ac27858e03921441a4f6e150a6d6.tar.gz
elgg-a489cdae5b58ac27858e03921441a4f6e150a6d6.tar.bz2
Closes #969: Admin option to allow the setting of certain access controls on a group
git-svn-id: https://code.elgg.org/elgg/trunk@3234 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/groups/actions/edit.php14
-rw-r--r--mod/groups/languages/en.php1
-rw-r--r--mod/groups/views/default/forms/groups/edit.php35
3 files changed, 47 insertions, 3 deletions
diff --git a/mod/groups/actions/edit.php b/mod/groups/actions/edit.php
index f32af9eb3..be8d250da 100644
--- a/mod/groups/actions/edit.php
+++ b/mod/groups/actions/edit.php
@@ -61,8 +61,18 @@
default: $group->membership = ACCESS_PRIVATE;
}
- // Set access - all groups are public from elgg's point of view.
- $group->access_id = 2;
+ // Set access - all groups are public from elgg's point of view, unless the override is in place
+
+ if (get_plugin_setting('hidden_groups', 'groups') == 'yes')
+ {
+ $visibility = (int)get_input('vis','',false);
+
+ $group->access_id = $visibility;
+
+ $group->access_id;
+ }
+ else
+ $group->access_id = 2;
// Set group tool options
//$group->files_enable = get_input('files_enable', 'yes');
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index f130d4256..4baf09ddb 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -78,6 +78,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. To ask to be added, click the "request membership" menu link.',
+ 'groups:visibility' => 'Who can see this group?',
/*
Group tools
diff --git a/mod/groups/views/default/forms/groups/edit.php b/mod/groups/views/default/forms/groups/edit.php
index 82dd3d71f..87d79aaf4 100644
--- a/mod/groups/views/default/forms/groups/edit.php
+++ b/mod/groups/views/default/forms/groups/edit.php
@@ -52,7 +52,40 @@
<?php echo elgg_view('input/access', array('internalname' => 'membership','value' => $vars['entity']->membership, 'options' => array( ACCESS_PRIVATE => elgg_echo('groups:access:private'), ACCESS_PUBLIC => elgg_echo('groups:access:public')))); ?>
</label>
</p>
-
+
+ <?php
+
+ if (get_plugin_setting('hidden_groups', 'groups') == 'yes')
+ {
+?>
+
+ <p>
+ <label>
+ <?php echo elgg_echo('groups:visibility'); ?><br />
+ <?php
+
+ $this_owner = $vars['entity']->owner_guid;
+ if (!$this_owner) $this_owner = get_loggedin_userid();
+
+ $access = array(ACCESS_FRIENDS => elgg_echo("access:friends:label"), 1 => elgg_echo("LOGGED_IN"), 2 => elgg_echo("PUBLIC"));
+ $collections = get_user_access_collections($this_owner);
+ if (is_array($collections))
+ {
+ foreach ($collections as $c)
+ $access[$c->id] = $c->name;
+ }
+
+ echo elgg_view('input/access', array('internalname' => 'vis', 'value' => ($vars['entity']->access_id ? $vars['entity']->access_id : ACCESS_PUBLIC), 'options' => $access));
+
+
+ ?>
+ </label>
+ </p>
+
+<?php
+ }
+
+ ?>
<?php
if (isset($vars['config']->group_tool_options)) {