File: admin.html

package info (click to toggle)
moodle 1.6.3-2%2Betch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 37,172 kB
  • ctags: 51,688
  • sloc: php: 231,916; sql: 5,631; xml: 2,688; sh: 1,185; perl: 638; makefile: 48; pascal: 36
file content (103 lines) | stat: -rw-r--r-- 4,352 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

<form name="adminform" id="adminform" method="post" action="admin.php">
<input type="hidden" name="previoussearch" value="<?php echo $previoussearch ?>">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">
  <table align="center" border="0" cellpadding="5" cellspacing="0">
    <tr>
      <td valign="top">
          <?php
              $a->count = count($admins);
              $a->items = $strexistingadmins;
              print_string('counteditems', '', $a);
          ?>
      </td>
      <td></td>
      <td valign="top">
          <?php
              $a->count = $usercount;
              $a->items = $strpotentialadmins;
              print_string('counteditems', '', $a);
          ?>
      </td>
    </tr>
    <tr>
      <td valign="top">
          <select name="removeselect[]" size="20" id="removeselect" multiple
                  onFocus="document.adminform.add.disabled=true;
                           document.adminform.remove.disabled=false;
                           document.adminform.addselect.selectedIndex=-1;">
          <?php 
              if (count($admins) == 1) {
                  $disabled = 'disabled';
                  $removebuttontype = 'hidden';
              } else {
                  $disabled = '';
                  $removebuttontype = 'submit';
              }

              foreach ($admins as $admin) {
                  $fullname = fullname($admin, true);
                  echo "<option value=\"$admin->id\" $disabled>".$fullname.", ".$admin->email."</option>\n";
              }
          ?>
          
          </select></td>
      <td valign="top">
        <br />
        <input name="add" type="submit" id="add" value="&larr;" />
        <br />
        <input name="remove" type="<?php echo $removebuttontype ?>" id="remove" value="&rarr;" />
        <br />
      </td>
      <td valign="top">
          <select name="addselect[]" size="20" id="addselect" multiple
                  onFocus="document.adminform.add.disabled=false;
                           document.adminform.remove.disabled=true;
                           document.adminform.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 {
                      if (!empty($users)) {
                          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 p($searchtext, true) ?>" 
                  onFocus ="document.adminform.add.disabled=true;
                            document.adminform.remove.disabled=true;
                            document.adminform.removeselect.selectedIndex=-1;
                            document.adminform.addselect.selectedIndex=-1;"
                  onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
                               if (keyCode == 13) {
                                   document.adminform.previoussearch.value=1;
                                   document.adminform.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>