remove old readme
[atutor.git] / include / side_menu.inc.php
1 <?php
2 /************************************************************************/
3 /* ATutor                                                                                                                               */
4 /************************************************************************/
5 /* Copyright (c) 2002-2010                                              */
6 /* Inclusive Design Institute                                           */
7 /* http://atutor.ca                                                     */
8 /* This program is free software. You can redistribute it and/or        */
9 /* modify it under the terms of the GNU General Public License          */
10 /* as published by the Free Software Foundation.                        */
11 /************************************************************************/
12 // $Id: footer.inc.php 6614 2006-09-27 19:32:29Z joel $
13
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
22 // $_course_id is set when a guest accessing a public course. 
23 // This is to solve the issue that the google indexing fails as the session vars are lost.
24 global $_course_id;
25 if (isset($_SESSION['course_id'])) $_course_id = $_SESSION['course_id'];
26
27 $savant->assign('course_id', $_course_id);
28
29 $side_menu = array();
30 $stack_files = array();
31
32 if ($_course_id > 0) {
33         $savant->assign('my_uri', $_my_uri);
34
35         $savant->assign('right_menu_open', TRUE);
36         $savant->assign('popup_help', 'MAIN_MENU');
37         $savant->assign('menu_url', '<a name="menu"></a>');
38         $savant->assign('close_menu_url', htmlspecialchars($_my_uri).'disable='.PREF_MAIN_MENU);
39         $savant->assign('close_menus', _AT('close_menus'));
40
41         //copyright can be found in include/html/copyright.inc.php
42
43         $side_menu = explode('|', $system_courses[$_course_id]['side_menu']);
44
45         foreach ($side_menu as $side) {
46                 if (isset($_stacks[$side])) {
47                         $stack_files[] = $_stacks[$side]['file'];
48                 }
49         }
50 }
51
52 $savant->assign('side_menu', $stack_files);
53 $savant->display('include/side_menu.tmpl.php'); ?>