mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 14:03:52 +01:00
97 lines
4.0 KiB
HTML
97 lines
4.0 KiB
HTML
|
|
<form name="studentform" id="studentform" method="post" action="student.php">
|
|
<input type="hidden" name="previoussearch" value="<?php echo $previoussearch ?>" />
|
|
<input type="hidden" name="sesskey" value="<?php echo $sesskey ?>" />
|
|
<input type="hidden" name="id" value="<?php echo $id?>" />
|
|
<table align="center" border="0" cellpadding="5" cellspacing="0">
|
|
<tr>
|
|
<td valign="top">
|
|
<?php
|
|
$a->count = count($students);
|
|
$a->items = $strexistingstudents;
|
|
print_string('counteditems', '', $a);
|
|
?>
|
|
</td>
|
|
<td></td>
|
|
<td valign="top">
|
|
<?php
|
|
$a->count = $usercount;
|
|
$a->items = $strpotentialstudents;
|
|
print_string('counteditems', '', $a);
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">
|
|
<select name="removeselect[]" size="20" id="removeselect" multiple
|
|
onFocus="document.studentform.add.disabled=true;
|
|
document.studentform.remove.disabled=false;
|
|
document.studentform.addselect.selectedIndex=-1;" />
|
|
<?php
|
|
foreach ($students as $student) {
|
|
$fullname = fullname($student, true);
|
|
echo "<option value=\"$student->id\">".$fullname.", ".$student->email."</option>\n";
|
|
}
|
|
?>
|
|
|
|
</select></td>
|
|
<td valign="top">
|
|
<br />
|
|
<input name="add" type="submit" id="add" value="←" />
|
|
<br />
|
|
<input name="remove" type="submit" id="remove" value="→" />
|
|
<br />
|
|
</td>
|
|
<td valign="top">
|
|
<select name="addselect[]" size="20" id="addselect" multiple
|
|
onFocus="document.studentform.add.disabled=false;
|
|
document.studentform.remove.disabled=true;
|
|
document.studentform.removeselect.selectedIndex=-1;">
|
|
<?php
|
|
|
|
if (!empty($searchusers)) {
|
|
echo "<optgroup label=\"$strsearchresults (" . count($searchusers) . ")\">\n";
|
|
foreach ($searchusers as $user) {
|
|
$fullname = fullname($user, true);
|
|
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
|
|
}
|
|
echo "</optgroup>\n";
|
|
}
|
|
else {
|
|
if ($usercount > 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 ($users 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 echo $searchtext ?>"
|
|
onFocus ="document.studentform.add.disabled=true;
|
|
document.studentform.remove.disabled=true;
|
|
document.studentform.removeselect.selectedIndex=-1;
|
|
document.studentform.addselect.selectedIndex=-1;"
|
|
onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
|
|
if (keyCode == 13) {
|
|
document.studentform.previoussearch.value=1;
|
|
document.studentform.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>
|
|
</table>
|
|
</form>
|
|
|
|
|