From b83ab22d23d5c5d5e46ce64f1e1aea3056bfabc0 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 4 Mar 2011 02:03:33 +0000 Subject: trying to make support for invisible groups a little saner git-svn-id: http://code.elgg.org/elgg/trunk@8575 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/groups/views/default/forms/groups/edit.php | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'mod/groups/views/default/forms') diff --git a/mod/groups/views/default/forms/groups/edit.php b/mod/groups/views/default/forms/groups/edit.php index 3993e750d..8b5a3c33e 100644 --- a/mod/groups/views/default/forms/groups/edit.php +++ b/mod/groups/views/default/forms/groups/edit.php @@ -8,8 +8,14 @@ // new groups default to open membership if (isset($vars['entity'])) { $membership = $vars['entity']->membership; + $access = $vars['entity']->access_id; + if ($access != ACCESS_PUBLIC || ACCESS_LOGGED_IN) { + // group only - this is done to handle access not created when group is created + $access = ACCESS_PRIVATE; + } } else { $membership = ACCESS_PUBLIC; + $access = ACCESS_PUBLIC; } ?> @@ -52,7 +58,7 @@ if ($group_profile_fields > 0) { 'membership', 'value' => $membership, - 'options' => array( + 'options_values' => array( ACCESS_PRIVATE => elgg_echo('groups:access:private'), ACCESS_PUBLIC => elgg_echo('groups:access:public') ) @@ -68,19 +74,11 @@ if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') { if (!$this_owner) { $this_owner = elgg_get_logged_in_user_guid(); } - $access = array( - ACCESS_FRIENDS => elgg_echo("access:friends:label"), + $access_options = array( + ACCESS_PRIVATE => elgg_echo('groups:access:group'), ACCESS_LOGGED_IN => elgg_echo("LOGGED_IN"), ACCESS_PUBLIC => elgg_echo("PUBLIC") ); - $collections = get_user_access_collections($vars['entity']->guid); - if (is_array($collections)) { - foreach ($collections as $c) { - $access[$c->id] = $c->name; - } - } - - $current_access = $vars['entity']->access_id ? $vars['entity']->access_id : ACCESS_PUBLIC; ?>
@@ -88,8 +86,8 @@ if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') {
'vis', - 'value' => $current_access, - 'options' => $access, + 'value' => $access, + 'options_values' => $access_options, )); ?> -- cgit v1.2.3