made a copy
[atutor.git] / include / side_menu.inc.php
1 <?php
2 /************************************************************************/
3 /* ATutor                                                                                                                               */
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg & Heidi Hazelton*/
6 /* Adaptive Technology Resource Centre / University of Toronto                  */
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: footer.inc.php 6614 2006-09-27 19:32:29Z joel $
14 if (!defined('AT_INCLUDE_PATH')) { exit; }
15
16 global $next_prev_links;
17 global $_base_path, $_my_uri;
18 global $_stacks, $db;
19 global $system_courses;
20 global $savant;
21 global $course_id;
22
23 // $course_id is set when a guest accessing a public course. 
24 // This is to solve the issue that the google indexing fails as the session vars are lost.
25 global $course_id;
26 if (isset($_SESSION['course_id'])) $course_id = $_SESSION['course_id'];
27
28 $savant->assign('course_id', $course_id);
29
30 $side_menu = array();
31 $stack_files = array();
32
33 if ($course_id > 0) {
34         $savant->assign('my_uri', $_my_uri);
35
36         $savant->assign('right_menu_open', TRUE);
37         $savant->assign('popup_help', 'MAIN_MENU');
38         $savant->assign('menu_url', '<a name="menu"></a>');
39         $savant->assign('close_menu_url', htmlspecialchars($_my_uri).'disable='.PREF_MAIN_MENU);
40         $savant->assign('close_menus', _AT('close_menus'));
41
42         //copyright can be found in include/html/copyright.inc.php
43
44         $side_menu = explode('|', $system_courses[$course_id]['side_menu']);
45
46         foreach ($side_menu as $side) {
47                 if (isset($_stacks[$side])) {
48                         $stack_files[] = $_stacks[$side]['file'];
49                 }
50         }
51 }
52
53 $savant->assign('side_menu', $stack_files);
54 $savant->display('include/side_menu.tmpl.php'); ?>