da9b3fc9dd48f53b41cdaa3f614363391872c1b7
[atutor.git] / docs / themes / default / admin / courses / privileges.tmpl.php
1 hi I'm an administrator
2
3 <?php global $moduleFactory;?>
4 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
5 <input type="hidden" name="course_id" value="<?php echo $this->course_id; ?>"/>
6 <div class="input-form">
7
8         <div class="row">
9                 <h3><?php echo $this->student_row['login']; ?></h3>
10         </div>
11
12         <div class="row">
13                 <?php echo _AT('privileges'); ?><br />
14                         <table width="100%" border="0" cellspacing="5" cellpadding="0" summary="">
15                         <tr>
16                         <?php           
17                         $count =0;
18                         $this->student_row['privileges'] = intval($this->student_row['privileges']);
19                         $module_list = $moduleFactory->getModules(AT_MODULE_STATUS_ENABLED, 0, TRUE);
20                         $keys = array_keys($module_list);
21                         foreach ($keys as $module_name) {
22                                 $module =& $module_list[$module_name];
23                                 if (!($module->getPrivilege() > 1)) {
24                                         continue;
25                                 }
26                                 $count++;
27                                 echo '<td><label><input type="checkbox" name="privs['.$k.'][]" value="'.$module->getPrivilege().'" ';
28
29                                 if (query_bit($this->student_row['privileges'], $module->getPrivilege())) { 
30                                         echo 'checked="checked"';
31                                 } 
32
33                                 echo ' />'.$module->getName().'</label></td>';
34
35                                 if (!($count % $this->num_cols)) {
36                                         echo '</tr><tr>';
37                                 }
38                         }
39                         if ($count % $this->num_cols) {
40                                 echo '<td colspan="'.($this->num_cols-($count % $this->num_cols)).'">&nbsp;</td>';
41                         } else {
42                                 echo '<td colspan="'.$this->num_cols.'">&nbsp;</td>';
43                         }
44                         ?>
45                         </tr>
46                         </table>
47                 </div>
48 <?php 
49         }//end for
50 ?>
51         <div class="row buttons">
52                 <input type="submit" name="submit" value="<?php echo _AT('save');  ?>" accesskey="s" /> 
53                 <input type="submit" name="cancel" value="<?php echo _AT('cancel');  ?>" />
54         </div>
55 </div>
56 </form>