540d84119fa55e265062621897f7400cc8982609
[atutor.git] / docs / themes / default / users / browse.tmpl.php
1 <?php require(AT_INCLUDE_PATH.'header.inc.php'); ?>\r
2 <div class="input-form" style="width:90%;">\r
3 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('filter'); ?></legend>\r
4         <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">\r
5                 \r
6                         <div class="row">\r
7                                 <h3><?php echo _AT('results_found', $this->num_results); ?></h3>\r
8                         </div>\r
9                         <div class="row">\r
10                                 <?php echo _AT('access'); ?><br />\r
11                                 <input type="radio" name="access" value="private" id="s1" <?php if ($_GET['access'] == 'private') { echo 'checked="checked"'; } ?> /><label for="s1"><?php echo _AT('private'); ?></label> \r
12 \r
13                                 <input type="radio" name="access" value="protected" id="s2" <?php if ($_GET['access'] == 'protected') { echo 'checked="checked"'; } ?> /><label for="s2"><?php echo _AT('protected'); ?></label>\r
14 \r
15                                 <input type="radio" name="access" value="public" id="s3" <?php if ($_GET['access'] == 'public') { echo 'checked="checked"'; } ?> /><label for="s3"><?php echo _AT('public'); ?></label>\r
16 \r
17                                 <input type="radio" name="access" value="" id="s" <?php if ($_GET['access'] == '') { echo 'checked="checked"'; } ?> /><label for="s"><?php echo _AT('all'); ?></label>\r
18                         </div>\r
19 \r
20                 <?php if ($this->has_categories): ?>\r
21                         <div class="row">\r
22                                 <label for="category"><?php echo _AT('category'); ?></label><br/>\r
23                                 <select name="category" id="category">\r
24                                         <option value="-1">- - - <?php echo _AT('cats_all'); ?> - - -</option>\r
25                                         <option value="0" <?php if ($_GET['category'] == 0) { echo 'selected="selected"'; } ?>>- - - <?php echo _AT('cats_uncategorized'); ?> - - -</option>\r
26                                         <?php echo $this->categories_select; ?>\r
27                                 </select>\r
28                         </div>\r
29                 <?php endif; ?>\r
30 \r
31                         <div class="row">\r
32                                 <label for="search"><?php echo _AT('search'); ?> (<?php echo _AT('title').', '._AT('description'); ?>)</label><br />\r
33 \r
34                                 <input type="text" name="search" id="search" size="40" value="<?php echo htmlspecialchars($_GET['search']); ?>" />\r
35                                 <br/>\r
36                                 <?php echo _AT('search_match'); ?>:\r
37                                 <input type="radio" name="include" value="all" id="match_all" <?php echo $this->checked_include_all; ?> /><label for="match_all"><?php echo _AT('search_all_words'); ?></label> \r
38                                 <input type="radio" name="include" value="one" id="match_one" <?php echo $this->checked_include_one; ?> /><label for="match_one"><?php echo _AT('search_any_word'); ?></label>\r
39                         </div>\r
40 \r
41                         <div class="row buttons">\r
42                                 <input type="submit" name="filter" value="<?php echo _AT('filter'); ?>"/>\r
43                                 <input type="submit" name="reset_filter" value="<?php echo _AT('reset_filter'); ?>"/>\r
44                         </div>\r
45                 \r
46         </form>\r
47 </fieldset>\r
48 </div>\r
49 <div class="container" style="width:95%; margin:auto;">\r
50 <table class="data">\r
51 <tr>\r
52 <th>&nbsp;</th>\r
53 <th><?php echo _AT('title'); ?></th>\r
54 <th><?php echo _AT('description'); ?></th>\r
55 <th><?php echo _AT('category'); ?></th>\r
56 <th><?php echo _AT('instructor'); ?></th>\r
57 <th><?php echo _AT('access'); ?></th>\r
58 <th><?php echo _AT('shortcuts'); ?></th>\r
59 </tr>\r
60 <?php if (is_array($this->courses_rows)){ ?>\r
61         <?php foreach ($this->courses_rows as $row){ ?>\r
62             <?php  $counter++; ?>\r
63                  <tr class="<?php if ($counter %2) { echo 'odd'; } else { echo 'even'; } ?>">\r
64                  <td>\r
65                 \r
66                       <?php if ($row['icon']) { // if a course icon is available, display it here.  \r
67                               $style_for_title = 'style="height: 1.5em;"'; \r
68 \r
69                               //Check if this is a custom icon, if so, use get_course_icon.php to get it\r
70                               //Otherwise, simply link it from the images/\r
71                               $path = AT_CONTENT_DIR.$row['course_id']."/custom_icons/";\r
72                             if (file_exists($path.$row['icon'])) {\r
73                                       if (defined('AT_FORCE_GET_FILE') && AT_FORCE_GET_FILE) {\r
74                                               $course_icon = 'get_course_icon.php/?id='.$row['course_id'];\r
75                                       } else {\r
76                                               $course_icon = 'content/' . $row['course_id'] . '/';\r
77                                       }\r
78                               } else {\r
79                                       $course_icon = 'images/courses/'.$row['icon'];\r
80                               }\r
81                       ?>\r
82                               <a href="<?php echo url_rewrite('bounce.php?course='.$row['course_id'], true); ?>"><img src="<?php echo $course_icon; ?>" class="headicon" alt="<?php echo  htmlentities_utf8($row['title']); ?>" style="float:left;margin-right:.5em;"/></a>\r
83                       <?php } ?>\r
84                 </td>\r
85                 <td>\r
86                                 <h3><a href="<?php echo url_rewrite('bounce.php?course='.$row['course_id'], true); ?>"><?php echo htmlentities_utf8($row['title']); ?></a></h3>\r
87                 </td>\r
88                 <td>\r
89                         <?php if ($row['description']): ?>\r
90                                 <div style="height:6.4em;" title="<?php echo htmlentities_utf8($row['description']);?>"><?php echo substr(htmlentities_utf8($row['description'], true),0,150); \r
91                                 if(strlen($row['description']) > 150){\r
92                                 echo "...";\r
93                                 }\r
94                                 ?>&nbsp;</div>\r
95                         <?php else: ?>\r
96                                 <div style="height:6.4em;clear:right;" title="<?php echo htmlentities_utf8($row['description']);?>">&nbsp;</div>\r
97                         <?php endif; ?>\r
98                 </td>\r
99                 <td>\r
100                         <?php if (is_array($this->cats) && $row['cat_id'] != 0): ?>\r
101                                 <a href="<?php echo $_SERVER['PHP_SELF'].'?'.$page_string.SEP; ?>category=<?php echo $row['cat_id']; ?>"><?php echo $this->cats[$row['cat_id']]; ?></a>\r
102                         <?php endif; ?>\r
103                 </td>\r
104                 <td>\r
105                                 <a href="<?php echo AT_BASE_HREF; ?>contact_instructor.php?id=<?php echo $row['course_id']; ?>"><?php echo get_display_name($row['member_id']); ?></a>\r
106                 </td>\r
107                 <td>\r
108                         <?php echo _AT($row['access']); ?>\r
109                 </td>\r
110                 <td>\r
111                  <?php\r
112                     // insert enrolment link if allowed\r
113                     if (isset($row['enroll_link'])) : ?> \r
114                         - <small><?php echo $row['enroll_link']; ?></small>\r
115                 <?php endif; ?>\r
116                 </td>\r
117                 </tr>\r
118               \r
119         <?php } // end foreach ?>\r
120 <?php } // end if ?>\r
121 </table>\r
122 </div>\r
123 \r
124 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>