2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
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 /************************************************************************/
13 if (!defined('TR_INCLUDE_PATH')) { exit; }
15 //Timer, to display "Time Spent" in footer, debug information
17 $mtime = explode(' ', $mtime);
18 $mtime = $mtime[1] + $mtime[0];
29 global $framed, $popup;
30 global $_current_user, $_course_id, $_sequence_links, $_tool_shortcuts;
31 global $validate_content;
32 global $contentManager;
33 global $course_base_href, $content_base_href;
35 include_once(TR_INCLUDE_PATH.'classes/Menu.class.php');
38 $_top_level_pages = $menu->getTopPages();
40 $_all_pages = $menu->getAllPages();
42 $_current_root_page = $menu->getRootPage();
44 $_breadcrumb_path = $menu->getPath();
46 $current_page = $menu->getCurrentPage();
48 $_sub_menus = $menu->getSubMenus();
49 $back_to_page = $menu->getBackToPage();
50 $_pages = $menu->getAllPages(); // add "param" element into $_pages items
52 //debug($_base_path.$current_page);
53 //debug($back_to_page);
57 //debug($_top_level_pages);
59 //debug($_current_root_page);
60 //debug($_current_page);
62 $savant->assign('path', $_breadcrumb_path);
63 $savant->assign('top_level_pages', $_top_level_pages);
64 $savant->assign('current_top_level_page', $_current_root_page);
65 $savant->assign('sub_menus', $_sub_menus);
66 if ($back_to_page <> '') $savant->assign('back_to_page', $back_to_page);
67 $savant->assign('current_page', $_base_path.$current_page);
69 if (isset($_pages[$current_page]['title'])) {
70 $_page_title = $_all_pages[$current_page]['title'];
72 $_page_title = _AT($_all_pages[$current_page]['title_var']);
74 $savant->assign('page_title', htmlspecialchars($_page_title, ENT_COMPAT, "UTF-8"));
76 if ($_course_id > 0) {
77 $sequence_links = $contentManager->generateSequenceCrumbs($_content_id);
78 $savant->assign('sequence_links', $sequence_links);
81 if (isset($_current_user))
83 $savant->assign('user_name', $_current_user->getUserName());
84 if ($_course_id > 0) $savant->assign('isAuthor', $_current_user->isAuthor($_course_id));
87 if ($myLang->isRTL()) {
88 $savant->assign('rtl_css', '<link rel="stylesheet" href="'.$_base_path.'themes/'.$_SESSION['prefs']['PREF_THEME'].'/rtl.css" type="text/css" />');
90 $savant->assign('rtl_css', '');
93 $_tmp_base_href = TR_BASE_HREF;
94 if (isset($course_base_href) || isset($content_base_href)) {
95 $_tmp_base_href .= $course_base_href;
96 if ($content_base_href) {
97 $_tmp_base_href .= $content_base_href;
101 // Setup array of content tools for shortcuts tool bar.
102 $savant->assign('tool_shortcuts', $_tool_shortcuts); // array of content tools for shortcuts tool bar.
104 $savant->assign('content_base_href', $_tmp_base_href);
105 $savant->assign('lang_code', $_SESSION['lang']);
106 $savant->assign('lang_charset', $myLang->getCharacterSet());
107 $savant->assign('base_path', $_base_path);
108 $savant->assign('theme', $_SESSION['prefs']['PREF_THEME']);
110 $theme_img = $_base_path . 'themes/'. $_SESSION['prefs']['PREF_THEME'] . '/images/';
111 $savant->assign('img', $theme_img);
113 // course categories for search tool
114 require_once(TR_INCLUDE_PATH.'classes/DAO/CourseCategoriesDAO.class.php');
115 $courseCategoriesDAO = new CourseCategoriesDAO();
116 $savant->assign('categories', $courseCategoriesDAO->getAll());
120 if (isset($_custom_css)) {
121 $custom_css = '<link rel="stylesheet" href="'.$_custom_css.'" type="text/css" />';
124 if (isset($_custom_head)) {
129 if (isset($_pages[$current_page]['guide']))
131 $script_name = substr($_SERVER['PHP_SELF'], strlen($_base_path));
132 $savant->assign('guide', TR_GUIDES_PATH .'index.php?p='. htmlentities_utf8($script_name));
135 $savant->assign('custom_css', $custom_css);
137 if ($onload) $savant->assign('onload', $onload);
138 $savant->assign('course_id', $_course_id);
140 if ($framed || $popup) {
141 $savant->assign('framed', 1);
142 $savant->assign('popup', 1);
144 $savant->display('include/fm_header.tmpl.php');
147 $savant->display('include/header.tmpl.php');