Location: PHPKode > projects > Community Learning Network > cln/lib/CLN/interfaces/selectGroups.html
<?php

// set title
// should support multiple languages
$GLOBALS['CLN_PAGE_TITLE'] = 'Select More Groups';

$groups = $this->loadAllGroups();
includeLangFile("lib/CLN/lang/Permission-Process");
?>

<form name="editPermission" action="<?php echo appendToURL(cleanURL($GLOBALS['path']), 'editKoId=' . $this->koId . '&amp;editProcess=selectGroups'); ?>" method="post">

<table>
	<tr>
		<td colspan="3"><p>Select the group(s) you want to add to the Roles on your Block. When you have selected all the groups you want to add, click continue and you will be returned to the Edit Roles form to set the permissions for the groups.</p></td>
	</tr>
<!--:ONEDAY: should we make an easy way to see who is in a group (e.g. a popup window)?-->
<?php
// Loop through, making a list of groups with checkboxes
foreach($groups as $groupId => $groupName) {
	$group = & new $GLOBALS['classes']['group']['classname']($groupId);
	
	echo " <tr>\n";
	echo '  <td><input type="checkbox" name="group[' . $groupId . ']" value="' . $group->name . '" /></td>' . "\n";
	echo "  <td>" . $group->name . "</td>\n";

	// Groups Public and Registered Users should not be editable, 
	// nor if the user isn't allowed to edit them
	if ($groupId != CLN_GROUPID_PUBLIC && $groupId != CLN_GROUPID_REGISTERED
	    && ((in_array(CLN_SUPERUSER_GROUPID,$_SESSION['User']->groupList)) 
	       || (isset($group->users[$_SESSION['User']->userId])
	   		    && $group->users[$_SESSION['User']->userId]['editor']))) {
		$url = appendToURL(cleanURL($GLOBALS['path']), 'editKoId=' . $this->koId . '&amp;editProcess=selectGroups&amp;editGroupId=' . $groupId);
		echo "  <td><a href=\"" . $url . "\">Edit this Group</a></td>\n";
	}
	else {
		echo "<td>&nbsp;</td>\n";
	}
	echo " </tr>\n";
}

?>

</table>

<span class="clnFormLine">
	<label class="clnFormLabel"  for="selectedGroups"></label>
	<input class="clnFormInput" type="submit" id="selectedGroups" name="selectedGroups" value="Select and Return" />
	<?php
	// Only show the "Add Group" link if they're allowed to
	if (in_array(CLN_SUPERUSER_GROUPID,$_SESSION['User']->groupList) || 
		in_array(CLN_GROUPID_GROUPCREATORS,$_SESSION['User']->groupList)) {
	?>
	<input class="clnFormInput" type="submit" name="addGroup" value="Add a new group" />
	<?php
	}
	?>
</span>

</form>
Return current item: Community Learning Network