aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)) {