template is extended to support a tablet user
[atutor.git] / docs / themes / mobile / admin / courses / courses.tmpl.php
1 <?php if ($this->mobile_device_type != IPAD_DEVICE): ?>
2 <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
3         <div class="input-form">
4                 
5                         <h3><?php echo _AT('results_found', $this->num_results); ?></h3>
6                 <div id="results-hide-show-simple-content" class="hide-show-container-surround">                
7                         <a id="results-hide-show-link" class="content-expand" href="javascript:void(0);" tabindex="1">Refine Results</a>
8                 </div>
9         
10                 
11         <div id="results-hide-show" role="search"  aria-live="assertive">
12         <div id="results-display">
13         
14                 <div class="row">
15                 <fieldset>
16                         <legend><?php echo _AT('access'); ?></legend>
17
18                         <input type="radio" name="access" value="0" id="s0" <?php if ($_GET['access'] == 0) { echo 'checked="checked"'; } ?> /><label for="s0"><?php echo _AT('public'); ?></label> 
19
20                         <input type="radio" name="access" value="1" id="s1" <?php if ($_GET['access'] == 1) { echo 'checked="checked"'; } ?> /><label for="s1"><?php echo _AT('protected'); ?></label> 
21
22                         <input type="radio" name="access" value="2" id="s2" <?php if ($_GET['access'] == 2) { echo 'checked="checked"'; } ?> /><label for="s2"><?php echo _AT('private'); ?></label>
23
24                         <input type="radio" name="access" value="" id="s" <?php if ($_GET['access'] == '') { echo 'checked="checked"'; } ?> /><label for="s"><?php echo _AT('all'); ?></label>
25                 </fieldset>
26                 </div>
27
28                 <div class="row">
29                         <label for="search"><?php echo _AT('search'); ?> (<?php echo _AT('title').', '._AT('description'); ?>)</label><br />
30                         <input type="text" name="search" id="search" size="20" value="<?php echo htmlspecialchars($_GET['search']); ?>" />
31                 </div>
32
33                 <div class="row buttons">
34                         <input type="submit" name="filter" value="<?php echo _AT('filter'); ?>" />
35                         <input type="submit" name="reset_filter" value="<?php echo _AT('reset_filter'); ?>" />
36                 </div>
37         </div>
38         </div> <!-- end #results-display -->
39         </div> <!-- end #results-hide-show -->
40 </form>
41
42 <?php print_paginator($this->page, $this->num_results, $this->page_string . SEP . $this->order .'='. $col, $this->results_per_page); ?>
43
44 <form name="form" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
45 <div class="table-surround">
46 <table class="data" summary="Course title, instructor, and enrollment." >
47 <colgroup>
48         <?php if ($col == 'title'): ?>
49                 <col />
50                 <col class="sort" />
51                 <col span="6" />
52         <?php elseif($col == 'login'): ?>
53                 <col span="2" />
54                 <col class="sort" />
55                 <col span="5" />
56         <?php// elseif($col == 'access'): ?>
57                 <!-- REMOVED FOR MOBILE <col span="3" />
58                 <col class="sort" />
59                 <col span="4" /> -->
60         <?php //elseif($col == 'created_date'): ?>
61                 <!-- REMOVED FOR MOBILE<col span="4" />
62                 <col class="sort" />
63                 <col span="3" />-->
64         <?php //elseif($col == 'cat_name'): ?> 
65                 <!-- REMOVED FOR MOBILE<col span="5" />
66                 <col class="sort" />
67                 <col span="2" /> -->
68         <?php endif; ?>
69 </colgroup>
70 <thead>
71 <tr>
72         <th scope="col">&nbsp;</th>
73         <th scope="col"><a href="mods/_core/courses/admin/courses.php?<?php echo $this->orders[$this->order]; ?>=title<?php echo $page_string; ?>"><?php echo _AT('title');               ?></a></th>
74         <th scope="col"><a href="mods/_core/courses/admin/courses.php?<?php echo $this->orders[$this->order]; ?>=login<?php echo $page_string; ?>"><?php echo _AT('Instructor');          ?></a></th>
75 <!-- REMOVEED FOR MOBILE        <th scope="col"><a href="mods/_core/courses/admin/courses.php?<?php // echo $this->orders[$this->order]; ?>=access<?php echo $page_string; ?>"><?php echo _AT('access');             ?></a></th> -->
76 <!--    <th scope="col"><a href="mods/_core/courses/admin/courses.php?<?php //echo $this->orders[$this->order]; ?>=created_date<?php //echo $page_string; ?>"><?php // echo _AT('created_date'); ?></a></th> -->
77 <!--    <th scope="col"><a href="mods/_core/courses/admin/courses.php?<?php //echo $this->orders[$this->order]; ?>=cat_name<?php //echo $page_string; ?>"><?php //echo _AT('category'); ?></a></th> -->
78         <th scope="col"><?php echo _AT('enrolled'); ?></th>
79 <!--    <th scope="col"><?php //echo _AT('alumni'); ?></th> -->
80 </tr>
81 </thead>
82 <tfoot>
83 <tr>
84         <td colspan="8"><input type="submit" name="view" value="<?php echo _AT('view'); ?>" /> 
85                                         <input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" /> 
86                                         <input type="submit" name="backups" value="<?php echo _AT('backups'); ?>" /> 
87                                         <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" /></td>
88 </tr>
89 </tfoot>
90 <tbody>
91 <?php if ($this->num_rows): ?>
92         <?php while ($row = mysql_fetch_assoc($this->result)): ?>
93                 <tr onkeydown="document.form['m<?php echo $row['course_id']; ?>'].checked = true; rowselect(this);" onmousedown="document.form['m<?php echo $row['course_id']; ?>'].checked = true; rowselect(this);" id="r_<?php echo $row['course_id']; ?>">
94                         <td><input type="radio" name="id" value="<?php echo $row['course_id']; ?>" id="m<?php echo $row['course_id']; ?>" /></td>
95                         <td><label for="m<?php echo $row['course_id']; ?>"><?php echo AT_print($row['title'], 'courses.title'); ?></label></td>
96                         <td><?php echo AT_print($row['login'],'members.login'); ?></td>
97                 <!-- REMOVED FOR MOBILE <td><?php //echo _AT($row['access']); ?></td> -->
98                 <!--    <td><?php //echo AT_date($startend_date_long_format, $row['created_date'], AT_DATE_UNIX_TIMESTAMP); ?></td> -->
99                 <!--    <td><?php //echo ($row['cat_name'] ? $row['cat_name'] : '-')?></td>-->
100                         <td><?php echo ($this->enrolled[$row['course_id']]['y'] ? $this->enrolled[$row['course_id']]['y'] : 0); ?></td>
101                 <!--    <td><?php //echo ($this->enrolled[$row['course_id']]['a'] ? $this->enrolled[$row['course_id']]['a'] : 0); ?></td> -->
102                 </tr>
103         <?php endwhile; ?>
104 <?php else: ?>
105         <tr>
106                 <td colspan="8"><?php echo _AT('none_found'); ?></td>
107         </tr>
108 <?php endif; ?>
109 </tbody>
110 </table>
111 </div>
112 </form>
113 <?php endif; ?> <!--  end template for smartphone -->
114 <?php if ($this->mobile_device_type == IPAD_DEVICE): ?> 
115
116 <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
117         <div class="input-form">
118                 
119                         <h3><?php echo _AT('results_found', $this->num_results); ?></h3>
120                 <div id="hide-show-container">          
121                         <a id="results-hide-show-link" class="content-expand" href="javascript:void(0);" tabindex="1">Refine Results</a>
122                 </div>
123         
124                 
125         <div id="results-hide-show" role="search"  aria-live="assertive">
126         <div id="results-display">
127         
128                 <div class="row">
129                 <fieldset>
130                         <legend><?php echo _AT('access'); ?></legend>
131
132                         <input type="radio" name="access" value="0" id="s0" <?php if ($_GET['access'] == 0) { echo 'checked="checked"'; } ?> /><label for="s0"><?php echo _AT('public'); ?></label> 
133
134                         <input type="radio" name="access" value="1" id="s1" <?php if ($_GET['access'] == 1) { echo 'checked="checked"'; } ?> /><label for="s1"><?php echo _AT('protected'); ?></label> 
135
136                         <input type="radio" name="access" value="2" id="s2" <?php if ($_GET['access'] == 2) { echo 'checked="checked"'; } ?> /><label for="s2"><?php echo _AT('private'); ?></label>
137
138                         <input type="radio" name="access" value="" id="s" <?php if ($_GET['access'] == '') { echo 'checked="checked"'; } ?> /><label for="s"><?php echo _AT('all'); ?></label>
139                 </fieldset>
140                 </div>
141
142                 <div class="row">
143                         <label for="search"><?php echo _AT('search'); ?> (<?php echo _AT('title').', '._AT('description'); ?>)</label><br />
144                         <input type="text" name="search" id="search" size="20" value="<?php echo htmlspecialchars($_GET['search']); ?>" />
145                 </div>
146
147                 <div class="row buttons">
148                         <input type="submit" name="filter" value="<?php echo _AT('filter'); ?>" />
149                         <input type="submit" name="reset_filter" value="<?php echo _AT('reset_filter'); ?>" />
150                 </div>
151         </div>
152         </div> <!-- end #results-display -->
153         </div> <!-- end #results-hide-show -->
154 </form>
155
156 <?php print_paginator($this->page, $this->num_results, $this->page_string . SEP . $this->order .'='. $col, $this->results_per_page); ?>
157
158 <form name="form" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
159 <div class="table-surround">
160 <table class="data" summary="Course title, instructor, and enrollment." >
161 <colgroup>
162         <?php if ($col == 'title'): ?>
163                 <col />
164                 <col class="sort" />
165                 <col span="6" />
166         <?php elseif($col == 'login'): ?>
167                 <col span="2" />
168                 <col class="sort" />
169                 <col span="5" />
170         <?php// elseif($col == 'access'): ?>
171                 <!-- REMOVED FOR MOBILE <col span="3" />
172                 <col class="sort" />
173                 <col span="4" /> -->
174         <?php //elseif($col == 'created_date'): ?>
175                 <!-- REMOVED FOR MOBILE<col span="4" />
176                 <col class="sort" />
177                 <col span="3" />-->
178         <?php //elseif($col == 'cat_name'): ?> 
179                 <!-- REMOVED FOR MOBILE<col span="5" />
180                 <col class="sort" />
181                 <col span="2" /> -->
182         <?php endif; ?>
183 </colgroup>
184 <thead>
185 <tr>
186         <th scope="col">&nbsp;</th>
187         <th scope="col"><a href="mods/_core/courses/admin/courses.php?<?php echo $this->orders[$this->order]; ?>=title<?php echo $page_string; ?>"><?php echo _AT('title');               ?></a></th>
188         <th scope="col"><a href="mods/_core/courses/admin/courses.php?<?php echo $this->orders[$this->order]; ?>=login<?php echo $page_string; ?>"><?php echo _AT('Instructor');          ?></a></th>
189 <!-- REMOVEED FOR MOBILE        <th scope="col"><a href="mods/_core/courses/admin/courses.php?<?php // echo $this->orders[$this->order]; ?>=access<?php echo $page_string; ?>"><?php echo _AT('access');             ?></a></th> -->
190 <!--    <th scope="col"><a href="mods/_core/courses/admin/courses.php?<?php //echo $this->orders[$this->order]; ?>=created_date<?php //echo $page_string; ?>"><?php // echo _AT('created_date'); ?></a></th> -->
191 <!--    <th scope="col"><a href="mods/_core/courses/admin/courses.php?<?php //echo $this->orders[$this->order]; ?>=cat_name<?php //echo $page_string; ?>"><?php //echo _AT('category'); ?></a></th> -->
192         <th scope="col"><?php echo _AT('enrolled'); ?></th>
193 <!--    <th scope="col"><?php //echo _AT('alumni'); ?></th> -->
194 </tr>
195 </thead>
196 <tfoot>
197 <tr>
198         <td colspan="8"><input type="submit" name="view" value="<?php echo _AT('view'); ?>" /> 
199                                         <input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" /> 
200                                         <input type="submit" name="backups" value="<?php echo _AT('backups'); ?>" /> 
201                                         <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" /></td>
202 </tr>
203 </tfoot>
204 <tbody>
205 <?php if ($this->num_rows): ?>
206         <?php while ($row = mysql_fetch_assoc($this->result)): ?>
207                 <tr onkeydown="document.form['m<?php echo $row['course_id']; ?>'].checked = true; rowselect(this);" onmousedown="document.form['m<?php echo $row['course_id']; ?>'].checked = true; rowselect(this);" id="r_<?php echo $row['course_id']; ?>">
208                         <td><input type="radio" name="id" value="<?php echo $row['course_id']; ?>" id="m<?php echo $row['course_id']; ?>" /></td>
209                         <td><label for="m<?php echo $row['course_id']; ?>"><?php echo AT_print($row['title'], 'courses.title'); ?></label></td>
210                         <td><?php echo AT_print($row['login'],'members.login'); ?></td>
211                 <!-- REMOVED FOR MOBILE <td><?php //echo _AT($row['access']); ?></td> -->
212                 <!--    <td><?php //echo AT_date($startend_date_long_format, $row['created_date'], AT_DATE_UNIX_TIMESTAMP); ?></td> -->
213                 <!--    <td><?php //echo ($row['cat_name'] ? $row['cat_name'] : '-')?></td>-->
214                         <td><?php echo ($this->enrolled[$row['course_id']]['y'] ? $this->enrolled[$row['course_id']]['y'] : 0); ?></td>
215                 <!--    <td><?php //echo ($this->enrolled[$row['course_id']]['a'] ? $this->enrolled[$row['course_id']]['a'] : 0); ?></td> -->
216                 </tr>
217         <?php endwhile; ?>
218 <?php else: ?>
219         <tr>
220                 <td colspan="8"><?php echo _AT('none_found'); ?></td>
221         </tr>
222 <?php endif; ?>
223 </tbody>
224 </table>
225 </div>
226 </form>
227 <?php endif; ?> <!--  end template for tablet -->