Commits

Anonymous committed c52904a

Invisible group since creation.

  • Participants
  • Parent commits 5696b11

Comments (0)

Files changed (3)

File elgg/mod/groups/actions/edit.php

 		$group->membership = ACCESS_PRIVATE;
 }
 
-// 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;
-} else {
-	$group->access_id = ACCESS_PUBLIC;
-}
-
 // Set group tool options
 //$group->files_enable = get_input('files_enable', 'yes');
 //$group->pages_enable = get_input('pages_enable', 'yes');
 $group->container_guid = $container_guid;
 $group->save();
 
+// 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==ACCESS_PRIVATE ? $group->guid : $visibility;//echo $group->access_id;exit();
+	$group->save();
+}
+
 // group creator needs to be member of new group
 if ($new_group_flag) {
 	$group->join($user);

File elgg/mod/groups/languages/en.php

 			'groups:closedgroup' => 'This group has a closed membership.',
 			'groups:closedgroup:request' => 'To ask to be added, click the "request membership" menu link.',
 			'groups:visibility' => 'Who can see this group?',
+			'groups:access:invisible' => 'Invisible',
 
 			/*
 			   Group tools

File elgg/mod/groups/views/default/forms/groups/edit.php

 ?>
 
 	<p>
-		<label for="vis"><?php echo elgg_echo('groups:visibility'); ?></label>
+		<label for="vis"><?php echo elgg_echo('groups:visibility'); ?></label><br />
 			<?php 
 			
 			$this_owner = $vars['entity']->owner_guid;
 			*/
 			$current_access = ($vars['entity']->access_id ? $vars['entity']->access_id : ACCESS_PUBLIC);
 			$access = get_write_access_array();
-			unset($access[ACCESS_PRIVATE]);
+			$access[ACCESS_PRIVATE] = elgg_echo('groups:access:invisible');
 			echo elgg_view('input/access', array('internalname' => 'vis', 
 												'value' =>  $current_access,
 												'options' => $access));