moodle/admin/mnet/enr_course_enrol.html
2008-05-31 11:41:26 +00:00

105 lines
4.7 KiB
HTML
Executable File

<form id="assignform" method="post" action="">
<div id="trustedhosts"><!-- See theme/standard/styles_layout.css #trustedhosts .generaltable for rules -->
<input type="hidden" name="previoussearch" value="<?php p($previoussearch) ?>" />
<input type="hidden" name="courseid" value="<?php p($courseid) ?>" />
<input type="hidden" name="host" value="<?php p($mnet_peer->id) ?>" />
<input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
<table class="generaltable" border="0" cellpadding="5" cellspacing="0">
<tr>
<td valign="top">
<?php print_string('existingusers', 'role', count($mnetenrolledusers)); ?>
</td>
<td></td>
<td valign="top">
<?php print_string('potentialusers', 'role', $availablecount); ?>
</td>
</tr>
<tr>
<td valign="top">
<select name="removeselect[]" size="20" id="removeselect" multiple="multiple"
onfocus="getElementById('assignform').add.disabled=true;
getElementById('assignform').remove.disabled=false;
getElementById('assignform').addselect.selectedIndex=-1;">
<?php
foreach ($mnetenrolledusers as $enrolleduser) {
$fullname = fullname($enrolleduser, true);
echo "<option value=\"$enrolleduser->id\">".s($fullname)." (".s($enrolleduser->rolename).")</option>\n";
}
?>
</select></td>
<td valign="top">
<br />
<input name="add" type="submit" id="add" value="&larr;" />
<br />
<input name="remove" type="submit" id="remove" value="&rarr;" />
<br />
</td>
<td valign="top">
<select name="addselect[]" size="20" id="addselect" multiple="multiple"
onfocus="getElementById('assignform').add.disabled=false;
getElementById('assignform').remove.disabled=true;
getElementById('assignform').removeselect.selectedIndex=-1;">
<?php
if (!empty($searchtext)) {
echo "<optgroup label=\"$strsearchresults (" . $availablecount . ")\">\n";
foreach ($availableusers as $user) {
if (!isset($enrolledusers[$user->id])) {
$fullname = fullname($user, true);
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
}
}
echo "</optgroup>\n";
} else {
if ($availablecount > MAX_USERS_PER_PAGE) {
echo '<optgroup label="'.get_string('toomanytoshow').'"><option></option></optgroup>'."\n"
.'<optgroup label="'.get_string('trysearching').'"><option></option></optgroup>'."\n";
} else {
foreach ($availableusers as $user) {
$fullname = fullname($user, true);
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
}
}
}
?>
</select>
<br />
<input type="text" name="searchtext" size="30" value="<?php p($searchtext, true) ?>"
onfocus ="getElementById('assignform').add.disabled=true;
getElementById('assignform').remove.disabled=true;
getElementById('assignform').removeselect.selectedIndex=-1;
getElementById('assignform').addselect.selectedIndex=-1;"
onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
if (keyCode == 13) {
getElementById('assignform').previoussearch.value=1;
getElementById('assignform').submit();
} " />
<input name="search" id="search" type="submit" value="<?php p($strsearch) ?>" />
<?php
if (!empty($searchusers)) {
echo '<input name="showall" id="showall" type="submit" value="'.$strshowall.'" />'."\n";
}
?>
</td>
</tr>
<tr>
<td valign="top"><?php print_string('otherenrolledusers', 'mnet'); ?>:<br />
<ul>
<?php
foreach ($remtenrolledusers as $enrolleduser) {
$fullname = fullname($enrolleduser, true);
print '<li>'
. s($fullname) . ' (' . s($enrolleduser->rolename) . ') '
. s($enrolleduser->enroltype)."</li>\n";
}
?></ul></td>
<td valign="top"></td>
<td valign="top"></td>
</tr>
</table>
</div>
</form>