move code up one directory
[atutor.git] / include / footer.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$
13 if (!defined('AT_INCLUDE_PATH')) { exit; }
14
15 global $next_prev_links;
16 global $_base_path, $_my_uri;
17 global $_stacks, $db;
18 global $system_courses;
19
20 $side_menu = array();
21 $stack_files = array();
22
23 if (isset($_SESSION['course_id']) && $_SESSION['course_id'] > 0) {
24         $savant->assign('my_uri', $_my_uri);
25
26         $savant->assign('right_menu_open', TRUE);
27         $savant->assign('popup_help', 'MAIN_MENU');
28         $savant->assign('menu_url', '<a name="menu"></a>');
29         $savant->assign('close_menu_url', htmlspecialchars($_my_uri).'disable=PREF_MAIN_MENU');
30         $savant->assign('close_menus', _AT('close_menus'));
31
32         //copyright can be found in include/html/copyright.inc.php
33
34         $side_menu = explode('|', $system_courses[$_SESSION['course_id']]['side_menu']);
35
36         foreach ($side_menu as $side) {
37                 if (isset($_stacks[$side])) {
38                         $stack_files[] = $_stacks[$side]['file'];
39                 }
40         }
41 }
42
43 $theme_img  = $_base_path . 'themes/'. $_SESSION['prefs']['PREF_THEME'] . '/images/';
44 $savant->assign('img', $theme_img);
45
46 if (isset($err)) {
47         $err->showErrors(); // print all the errors caught on this page
48 }
49 $savant->assign('side_menu', $stack_files);
50
51 // this js is indep of the theme used:
52 ?>
53 <script language="javascript" type="text/javascript">
54 //<!--
55 var selected;
56 function rowselect(obj) {
57         obj.className = 'selected';
58         if (selected && selected != obj.id)
59                 document.getElementById(selected).className = '';
60         selected = obj.id;
61 }
62 function rowselectbox(obj, checked, handler) {
63         var functionDemo = new Function(handler + ";");
64         functionDemo();
65
66         if (checked)
67                 obj.className = 'selected';
68         else
69                 obj.className = '';
70 }
71 //-->
72 </script>
73 <?php
74
75 //TODO******************BOLOGNA***************REMOVE ME ***********************/
76
77 $popup = intval($_GET['popup']);
78 if ($framed || $popup) {
79     if(isset($tool_flag) && ($tool_flag))                    //footer for the toolmanager
80         $savant->display('include/tm_footer.tmpl.php');
81     else
82         $savant->display('include/fm_footer.tmpl.php');
83 } else {
84         $savant->display('include/footer.tmpl.php');
85 }
86
87 //Harris Timer
88   $mtime = microtime(); 
89   $mtime = explode(" ", $mtime); 
90   $mtime = $mtime[1] + $mtime[0]; 
91   $endtime = $mtime; 
92   $totaltime = ($endtime - $starttime); 
93   debug ($totaltime. ' seconds.', "TIME USED"); 
94 //Harris Timer Ends
95
96 if (defined('AT_DEVEL') && AT_DEVEL) {
97         debug(TABLE_PREFIX, 'TABLE_PREFIX');
98         debug(DB_NAME, 'DB_NAME');
99         debug(VERSION, 'VERSION');
100         debug($_SESSION);
101 }
102 ?>