tagging as ATutor 1.5.4-release
[atutor.git] / include / footer.inc.php
1 <?php
2 /************************************************************************/
3 /* ATutor                                                                                                                               */
4 /************************************************************************/
5 /* Copyright (c) 2002-2006 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$
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
21 $side_menu = array();
22 $stack_files = array();
23
24 if ($_SESSION['course_id'] > 0) {
25         $savant->assign('my_uri', $_my_uri);
26
27         $savant->assign('right_menu_open', TRUE);
28         $savant->assign('popup_help', 'MAIN_MENU');
29         $savant->assign('menu_url', '<a name="menu"></a>');
30         $savant->assign('close_menu_url', htmlspecialchars($_my_uri).'disable='.PREF_MAIN_MENU);
31         $savant->assign('close_menus', _AT('close_menus'));
32
33         //copyright can be found in include/html/copyright.inc.php
34
35         $side_menu = explode('|', $system_courses[$_SESSION['course_id']]['side_menu']);
36
37         foreach ($side_menu as $side) {
38                 if (isset($_stacks[$side])) {
39                         $stack_files[] = $_stacks[$side]['file'];
40                 }
41         }
42 }
43
44 $theme_img  = $_base_path . 'themes/'. $_SESSION['prefs']['PREF_THEME'] . '/images/';
45 $savant->assign('img', $theme_img);
46
47 if (isset($err)) {
48         $err->showErrors(); // print all the errors caught on this page
49 }
50 $savant->assign('side_menu', $stack_files);
51
52 // this js is indep of the theme used:
53 ?>
54 <script language="javascript" type="text/javascript">
55 //<!--
56 var selected;
57 function rowselect(obj) {
58         obj.className = 'selected';
59         if (selected && selected != obj.id)
60                 document.getElementById(selected).className = '';
61         selected = obj.id;
62 }
63 function rowselectbox(obj, checked, handler) {
64         var functionDemo = new Function(handler + ";");
65         functionDemo();
66
67         if (checked)
68                 obj.className = 'selected';
69         else
70                 obj.className = '';
71 }
72 //-->
73 </script>
74 <?php
75
76 if ($framed || $popup) {
77         $savant->display('include/fm_footer.tmpl.php');
78 } else {
79         $savant->display('include/footer.tmpl.php');
80 }
81
82 if (defined('AT_DEVEL') && AT_DEVEL) {
83         debug(TABLE_PREFIX, 'TABLE_PREFIX');
84         debug(DB_NAME, 'DB_NAME');
85         debug(VERSION, 'VERSION');
86         debug($_SESSION);
87 }
88
89 ?>