"MDL-14932, accessibility imporvement, see tracker"
[moodle-linuxchix.git] / admin / roles / assign.html
blob93d8d8e5e05ce781807fc1117f3c603dc7cc243f
1 <form id="assignform" method="post" action="">
2 <div style="text-align:center;">
3 <label for="extendperiod"><?php print_string('enrolperiod') ?></label> <?php choose_from_menu($periodmenu, "extendperiod", $defaultperiod, $unlimitedperiod); ?>
4 <label for="extendbase"><?php print_string('startingfrom') ?></label> <?php choose_from_menu($basemenu, "extendbase", 3, ""); ?>
6 <input type="hidden" name="previoussearch" value="<?php p($previoussearch) ?>" />
7 <input type="hidden" name="userid" value="<?php p($userid) ?>" />
8 <input type="hidden" name="courseid" value="<?php p($courseid) ?>" />
9 <input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
10 <input type="hidden" name="contextid" value="<?php p($contextid) ?>" />
11 <input type="hidden" name="roleid" value="<?php p($roleid) ?>" />
12 <table summary="" style="margin-left:auto;margin-right:auto" border="0" cellpadding="5" cellspacing="0">
13 <tr>
14 <td valign="top">
15 <label for="removeselect"><?php print_string('existingusers', 'role', count($contextusers)); ?></label>
16 <br />
17 <select name="removeselect[]" size="20" id="removeselect" multiple="multiple"
18 onfocus="getElementById('assignform').add.disabled=true;
19 getElementById('assignform').remove.disabled=false;
20 getElementById('assignform').addselect.selectedIndex=-1;">
22 <?php
23 $i = 0;
24 foreach ($contextusers as $contextuser) {
25 $fullname = fullname($contextuser, true);
26 if ($contextuser->hidden) {
27 $hidden=' ('.get_string('hiddenassign').') ';
28 } else {
29 $hidden="";
31 echo "<option value=\"$contextuser->id\">".$fullname.", ".$contextuser->email.$hidden."</option>\n";
32 $i++;
34 if ($i==0) {
35 echo '<option/>'; // empty select breaks xhtml strict
39 </select></td>
40 <td valign="top">
41 <br />
42 <label title="<?php print_string('hiddenassign') ?>">
43 <input type="checkbox" name="hidden" value="1" />
44 <img src="<?php echo $CFG->pixpath; ?>/t/hide.gif" alt="<?php print_string('hiddenassign') ?>" class="hide-show-image" />
45 <?php helpbutton('hiddenassign', get_string('hiddenassign')); ?>
46 </label>
47 <?php check_theme_arrows(); ?>
48 <p class="arrow_button">
49 <input name="add" id="add" type="submit" value="<?php echo '&nbsp;&nbsp;&nbsp;'.$THEME->larrow.'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
50 <input name="remove" id="remove" type="submit" value="<?php echo '&nbsp;&nbsp;&nbsp;'.get_string('remove'). '&nbsp;'.$THEME->rarrow.'&nbsp;'; ?>" title="<?php print_string('remove'); ?>" />
51 </p>
52 </td>
53 <td valign="top">
54 <label for="addselect"><?php print_string('potentialusers', 'role', $usercount); ?></label>
55 <br />
56 <select name="addselect[]" size="20" id="addselect" multiple="multiple"
57 onfocus="getElementById('assignform').add.disabled=false;
58 getElementById('assignform').remove.disabled=true;
59 getElementById('assignform').removeselect.selectedIndex=-1;">
60 <?php
61 $i=0;
62 if (!empty($searchtext)) {
63 echo "<optgroup label=\"$strsearchresults (" . $usercount . ")\">\n";
64 while ($user = rs_fetch_next_record($availableusers)) {
65 $fullname = fullname($user, true);
66 echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
67 $i++;
69 echo "</optgroup>\n";
71 } else {
72 if ($usercount > MAX_USERS_PER_PAGE) {
73 echo '<optgroup label="'.get_string('toomanytoshow').'"><option></option></optgroup>'."\n"
74 .'<optgroup label="'.get_string('trysearching').'"><option></option></optgroup>'."\n";
75 } else {
76 while ($user = rs_fetch_next_record($availableusers)) {
77 $fullname = fullname($user, true);
78 echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
79 $i++;
83 if ($i==0) {
84 echo '<option/>'; // empty select breaks xhtml strict
87 </select>
88 <br />
89 <label for="searchtext" class="accesshide"><?php p($strsearch) ?></label>
90 <input type="text" name="searchtext" id="searchtext" size="30" value="<?php p($searchtext, true) ?>"
91 onfocus ="getElementById('assignform').add.disabled=true;
92 getElementById('assignform').remove.disabled=true;
93 getElementById('assignform').removeselect.selectedIndex=-1;
94 getElementById('assignform').addselect.selectedIndex=-1;"
95 onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
96 if (keyCode == 13) {
97 getElementById('assignform').previoussearch.value=1;
98 getElementById('assignform').submit();
99 } " />
100 <input name="search" id="search" type="submit" value="<?php p($strsearch) ?>" />
101 <?php
102 if (!empty($searchtext)) {
103 echo '<input name="showall" id="showall" type="submit" value="'.$strshowall.'" />'."\n";
106 </td>
107 </tr>
108 </table>
109 </div>
110 </form>