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">
15 <label
for="removeselect"><?php
print_string('existingusers', 'role', count($contextusers)); ?></label>
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;">
24 foreach ($contextusers as $contextuser) {
25 $fullname = fullname($contextuser, true);
26 if ($contextuser->hidden
) {
27 $hidden=' ('.get_string('hiddenassign').') ';
31 echo "<option value=\"$contextuser->id\">".$fullname.", ".$contextuser->email
.$hidden."</option>\n";
35 echo '<option/>'; // empty select breaks xhtml strict
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')); ?>
47 <?php check_theme_arrows(); ?>
48 <p class=
"arrow_button">
49 <input name=
"add" id=
"add" type=
"submit" value=
"<?php echo ' '.$THEME->larrow.' '.get_string('add'); ?>" title
="<?php print_string('add'); ?>" />
51 <input name
="remove" id
="remove" type
="submit" value
="<?php echo ' '.$THEME->rarrow.' '.get_string('remove'); ?>" title
="<?php print_string('remove'); ?>" />
55 <label
for="addselect"><?php
print_string('potentialusers', 'role', $usercount); ?></label>
57 <select name=
"addselect[]" size=
"20" id=
"addselect" multiple=
"multiple"
58 onfocus=
"getElementById('assignform').add.disabled=false;
59 getElementById('assignform').remove.disabled=true;
60 getElementById('assignform').removeselect.selectedIndex=-1;">
63 if (!empty($searchtext)) {
64 echo "<optgroup label=\"$strsearchresults (" . $availableusers->_numOfRows
. ")\">\n";
65 while ($user = rs_fetch_next_record($availableusers)) {
66 if (!isset($contextusers[$user->id
])) {
67 $fullname = fullname($user, true);
68 echo "<option value=\"$user->id\">".$fullname.", ".$user->email
."</option>\n";
75 if ($usercount > MAX_USERS_PER_PAGE
) {
76 echo '<optgroup label="'.get_string('toomanytoshow').'"><option></option></optgroup>'."\n"
77 .'<optgroup label="'.get_string('trysearching').'"><option></option></optgroup>'."\n";
79 while ($user = rs_fetch_next_record($availableusers)) {
80 if (!isset($contextusers[$user->id
])) {
81 $fullname = fullname($user, true);
82 echo "<option value=\"$user->id\">".$fullname.", ".$user->email
."</option>\n";
89 echo '<option/>'; // empty select breaks xhtml strict
94 <label for=
"searchtext" class=
"accesshide"><?php p($strsearch) ?></label>
95 <input type=
"text" name=
"searchtext" id=
"searchtext" size=
"30" value=
"<?php p($searchtext, true) ?>"
96 onfocus
="getElementById('assignform').add.disabled=true;
97 getElementById('assignform').remove.disabled=true;
98 getElementById('assignform').removeselect.selectedIndex=-1;
99 getElementById('assignform').addselect.selectedIndex=-1;"
100 onkeydown
= "var keyCode = event.which ? event.which : event.keyCode;
102 getElementById('assignform').previoussearch.value=1;
103 getElementById('assignform').submit();
105 <input name
="search" id
="search" type
="submit" value
="<?php p($strsearch) ?>" />
107 if (!empty($searchtext)) {
108 echo '<input name="showall" id="showall" type="submit" value="'.$strshowall.'" />'."\n";