2 <form id=
"assignform" method=
"post" action=
"">
3 <div id=
"trustedhosts"><!-- See theme/standard/styles_layout.css #trustedhosts .generaltable for rules -->
4 <input type=
"hidden" name=
"previoussearch" value=
"<?php p($previoussearch) ?>" />
5 <input type
="hidden" name
="courseid" value
="<?php p($courseid) ?>" />
6 <input type
="hidden" name
="host" value
="<?php p($mnet_peer->id) ?>" />
7 <input type
="hidden" name
="sesskey" value
="<?php p(sesskey()) ?>" />
8 <table
class="generaltable" border
="0" cellpadding
="5" cellspacing
="0">
11 <?php
print_string('existingusers', 'role', count($mnetenrolledusers)); ?>
15 <?php print_string('potentialusers', 'role', $availableusers->_numOfRows
); ?>
20 <select name=
"removeselect[]" size=
"20" id=
"removeselect" multiple=
"multiple"
21 onfocus=
"getElementById('assignform').add.disabled=true;
22 getElementById('assignform').remove.disabled=false;
23 getElementById('assignform').addselect.selectedIndex=-1;">
25 foreach ($mnetenrolledusers as $enrolleduser) {
26 $fullname = fullname($enrolleduser, true);
27 echo "<option value=\"$enrolleduser->id\">".s($fullname)." (".s($enrolleduser->rolename
).")</option>\n";
34 <input name=
"add" type=
"submit" id=
"add" value=
"←" />
36 <input name=
"remove" type=
"submit" id=
"remove" value=
"→" />
40 <select name=
"addselect[]" size=
"20" id=
"addselect" multiple=
"multiple"
41 onfocus=
"getElementById('assignform').add.disabled=false;
42 getElementById('assignform').remove.disabled=true;
43 getElementById('assignform').removeselect.selectedIndex=-1;">
46 if (!empty($searchtext)) {
47 echo "<optgroup label=\"$strsearchresults (" . $availableusers->_numOfRows
. ")\">\n";
48 while ($user = rs_fetch_next_record($availableusers)) {
49 if (!isset($enrolledusers[$user->id
])) {
50 $fullname = fullname($user, true);
51 echo "<option value=\"$user->id\">".$fullname.", ".$user->email
."</option>\n";
57 if ($availableusers->_numOfRows
> MAX_USERS_PER_PAGE
) {
58 echo '<optgroup label="'.get_string('toomanytoshow').'"><option></option></optgroup>'."\n"
59 .'<optgroup label="'.get_string('trysearching').'"><option></option></optgroup>'."\n";
61 while ($user = rs_fetch_next_record($availableusers)) {
62 $fullname = fullname($user, true);
63 echo "<option value=\"$user->id\">".$fullname.", ".$user->email
."</option>\n";
70 <input type=
"text" name=
"searchtext" size=
"30" value=
"<?php p($searchtext, true) ?>"
71 onfocus
="getElementById('assignform').add.disabled=true;
72 getElementById('assignform').remove.disabled=true;
73 getElementById('assignform').removeselect.selectedIndex=-1;
74 getElementById('assignform').addselect.selectedIndex=-1;"
75 onkeydown
= "var keyCode = event.which ? event.which : event.keyCode;
77 getElementById('assignform').previoussearch.value=1;
78 getElementById('assignform').submit();
80 <input name
="search" id
="search" type
="submit" value
="<?php p($strsearch) ?>" />
82 if (!empty($searchusers)) {
83 echo '<input name="showall" id="showall" type="submit" value="'.$strshowall.'" />'."\n";
89 <td valign=
"top"><?php print_string('otherenrolledusers', 'mnet'); ?>:
<br />
92 foreach ($remtenrolledusers as $enrolleduser) {
93 $fullname = fullname($enrolleduser, true);
95 . s($fullname) . ' (' . s($enrolleduser->rolename
) . ') '
96 . s($enrolleduser->enroltype
)."</li>\n";
99 <td valign=
"top"></td>
100 <td valign=
"top"></td>