ATutor 2.0
[atutor.git] / mods / _standard / sitemap / sitemap.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                                                                               */
4 /****************************************************************/
5 /* Copyright (c) 2002-2010                                      */
6 /* Inclusive Design Institute                                   */
7 /* http://atutor.ca                                                                                             */
8 /*                                                              */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License  */
11 /* as published by the Free Software Foundation.                                */
12 /****************************************************************/
13 // $Id: sitemap.php 9081 2010-01-13 20:26:03Z cindy $
14
15 $page = 'sitemap';
16 define('AT_INCLUDE_PATH', '../../../include/');
17 require(AT_INCLUDE_PATH.'vitals.inc.php');
18 require(AT_INCLUDE_PATH.'../mods/_standard/forums/lib/forums.inc.php');
19
20 require(AT_INCLUDE_PATH.'header.inc.php');
21 ?>
22 <div id="container" style="padding:2em; width:90%;">
23 <?php
24 echo '<p><a href="index.php">'._AT('home').'</a>';
25
26 $_current_modules = array_slice($_pages[AT_NAV_COURSE], 1);
27 $_current_modules = array_merge((array) $_current_modules, array_diff($_pages[AT_NAV_HOME],$_pages[AT_NAV_COURSE]));
28
29 foreach ($_current_modules as $module) {
30         echo '<br />';
31         echo '<img src="images/'.$rtl.'tree/tree_split.gif" alt="" class="img-size-tree" />  <a href="'.url_rewrite($module).'">' . _AT($_pages[$module]['title_var']) . '</a>';
32
33         if (substr($module, -14) == 'forum/list.php') {
34                 $forums = get_forums($_SESSION['course_id']);
35                 if (is_array($forums)) {
36                         foreach ($forums as $state=>$rows) {
37                                 $count = 0;
38                                 $num_forums = count($rows);
39                                 foreach ($rows as $row) {
40                                         $count++;
41                                         echo '<br />';
42                                         echo '<img src="images/'.$rtl.'tree/tree_vertline.gif" alt="" class="img-size-tree" />';
43                                         if ($count < $num_forums) {
44                                                 echo '<img src="images/'.$rtl.'tree/tree_split.gif" alt="" class="img-size-tree" />';
45                                         } else {
46                                                 echo '<img src="images/'.$rtl.'tree/tree_end.gif" alt="" class="img-size-tree" />';
47                                         }
48                                         echo '<img src="images/'.$rtl.'tree/tree_horizontal.gif" alt="" class="img-size-tree" />';
49                                         echo ' <a href="'.url_rewrite('mods/_standard/forums/forum/index.php?fid='.$row['forum_id']).'">'.AT_print($row['title'], 'forums.title').'</a>';
50                                 }
51                         } 
52                 } else {
53                         echo '<br />';
54                         echo '<img src="images/'.$rtl.'tree/tree_vertline.gif" alt="" class="img-size-tree" />';
55                         echo '<img src="images/'.$rtl.'tree/tree_vertline.gif" alt="" class="img-size-tree" />';
56                         echo '<img src="images/'.$rtl.'tree/tree_end.gif" alt="" class="img-size-tree" />';
57                         echo _AT('no_forums');
58                 }
59         }
60 }
61
62 echo '<br /><img src="images/'.$rtl.'tree/tree_split.gif" alt="" class="img-size-tree" /> <a href="'.url_rewrite('search.php').'">'._AT('search').'</a><br />';
63 echo '<img src="images/'.$rtl.'tree/tree_split.gif" alt="" class="img-size-tree" /> <a href="help/">'._AT('help').'</a><br />';
64 echo '<img src="images/'.$rtl.'tree/tree_end.gif" alt="" class="img-size-tree" /> '._AT('content').'<br />';
65
66 $contentManager->printSiteMapMenu();
67
68 echo '</p>';
69 ?>
70 </div>
71
72 <?php
73 require(AT_INCLUDE_PATH.'footer.inc.php');
74 ?>