dde10d6e77cd7624c98d0e2cc2decdcab5c6c52b
[acontent.git] / docs / themes / default / include / header.tmpl.php
1 <?php
2 /************************************************************************/
3 /* AContent                                                             */
4 /************************************************************************/
5 /* Copyright (c) 2010                                                   */
6 /* Inclusive Design Institute                                           */
7 /*                                                                      */
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
13 if (!defined('TR_INCLUDE_PATH')) { exit; }
14 /* available header.tmpl.php variables:
15  * $this->lang_code                     the ISO language code
16  * SITE_NAME                            the site name from the config file
17  * $this->page_title            the name of this page to use in the <title>
18  * top_level_pages           array(array('url', 'title'))     the top level pages. AContent default creates tabs.
19  * current_top_level_page    string                           full url to the current top level page in "top_leve_pages"
20  * path                      array(array('url', 'title'))     the breadcrumb path to the current page.
21  * sub_menus                 array(array('url', 'title'))     the sub level menus.
22  * current_page              string                           full url to the current sub level page in the "sub_level_pages"
23  * section_title             string                           the name of the current section. either name of the course, administration, my start page, etc.
24  * page_title                string                           the title of the current page.
25  * user_name                 string                           name of login user
26  * $this->lang_charset          the ISO language character set
27  * $this->base_path                     the absolute path to this AContent installation
28  * $this->theme                         the directory name of the current theme
29  * $this->custom_head           the custom head script used in <head> section
30  * $this->$onload                       the html body onload event
31  * $this->shortcuts             array of editor tools available title:url:icon
32  * $this->content_base_href     the <base href> to use for this page
33  * $this->rtl_css                       if set, the path to the RTL style sheet
34  * $this->icon                  the path to a course icon
35  * $this->banner_style          -deprecated-
36  * $this->base_href                     the full url to this AContent installation
37  * $this->onload                        javascript onload() calls
38  * $this->img                           the absolute path to this theme's images/ directory
39  * $this->sequence_links        associative array of 'previous', 'next', and/or 'resume' links
40  * $this->path                          associative array of path to this page: aka bread crumbs
41  * $this->rel_url                       the relative url from the installation root to this page
42  * $this->nav_courses           associative array of this user's enrolled courses
43  * $this->section_title         the title of this section (course, public, admin, my start page)
44  * $this->top_level_pages       associative array of the top level navigation
45  * $this->current_top_level_page        the full path to the current top level page with file name
46  * $this->sub_level_pages                       associate array of sub level navigation
47  * $this->back_to_page                          if set, the path and file name to the part of this page (if parent is not a top level nav)
48  * $this->current_sub_level_page        the full path to the current sub level page with file name
49  * $this->guide                         the full path and file name to the guide page
50  * $this->user_name                     string, the name of the current login user
51  * $this->isAuthor                      boolean, whether the current login user is the author of the selected course. Only passed in when there is login user and selected course
52  * ======================================
53  * back_to_page              array('url', 'title')            the link back to the part of the current page, if needed.
54  */
55 include_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
56 $lang_charset = "UTF-8";
57 //Timer
58 $mtime = microtime(); 
59 $mtime = explode(' ', $mtime); 
60 $mtime = $mtime[1] + $mtime[0]; 
61 $starttime = $mtime; 
62 //Timer Ends
63
64 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
65
66 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo DEFAULT_LANGUAGE_CODE; ?>" lang="<?php echo DEFAULT_LANGUAGE_CODE; ?>"> 
67
68 <head>
69         <title><?php echo SITE_NAME; ?> : <?php echo $this->page_title; ?></title>
70         <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $this->lang_charset; ?>" />
71         <meta name="Generator" content="AContent - Copyright 2010 by IDRC/IDI http://inclusivedesign.ca/" />
72         <meta name="keywords" content="AContent, free, open source, elearning, authoring, common cartridge, content package, QTI, AccessForAll, AFA, repository" />
73         <meta name="description" content="AContent is a standards compliant Web-based elearning content authoring tool and repository that can be used with any system that supports IMS content interoperability standards." />
74         <base href="<?php echo $this->content_base_href; ?>" />
75
76         <!-- <link href='http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold' rel='stylesheet' type='text/css' /> -->
77         <link rel="icon" href="<?php echo $this->base_path; ?>favicon.ico" type="image/x-icon" /> 
78         <link rel="stylesheet" href="<?php echo $this->base_path.'include/jscripts/infusion/framework/fss/css/fss-layout.css'; ?>" type="text/css" />
79         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/forms.css" type="text/css" />
80         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/styles.css" type="text/css" />
81         <!--[if IE]>
82           <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/ie_styles.css" type="text/css" />
83         <![endif]-->
84 <?php echo $this->rtl_css; ?>
85         <script src="<?php echo $this->base_path; ?>include/jscripts/infusion/InfusionAll.js" type="text/javascript"></script>
86         <script src="<?php echo $this->base_href; ?>include/jscripts/infusion/framework/enhancement/js/ProgressiveEnhancement.js" type="text/javascript"></script>
87         <script src="<?php echo $this->base_path; ?>include/jscripts/infusion/jquery.autoHeight.js" type="text/javascript"></script>
88         <script src="<?php echo $this->base_path; ?>include/jscripts/flowplayer/flowplayer-3.2.4.min.js" type="text/javascript"></script>
89         <script src="<?php echo $this->base_path; ?>include/jscripts/handleAjaxResponse.js" type="text/javascript"></script>
90         <script src="<?php echo $this->base_path; ?>include/jscripts/transformable.js" type="text/javascript"></script>
91 <?php echo $this->custom_css; ?>
92 </head>
93
94 <body onload="<?php echo $this->onload; ?>">
95
96 <div id="liquid-round">
97   
98  <div class="center-content">
99 <a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES); ?>#content" accesskey="c">
100         <img src="<?php echo $this->base_path; ?>images/clr.gif" height="1" width="1" border="0" alt="<?php echo _AT('goto_content'); ?> ALT+c" /></a>          
101
102         <a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES); ?>#menu<?php echo $_REQUEST['cid']  ?>"  accesskey="m"><img src="<?php echo $this->base_path; ?>images/clr.gif" height="1" width="1" border="0" alt="<?php echo _AT('goto_menu'); ?> ALT+m" /></a>
103         <span id="logininfo">
104         <?php
105         if (isset($this->user_name))
106         {
107           echo _AT('logged_in_as'). ' '.$this->user_name;
108         ?>
109                                 &nbsp;&nbsp;
110                                 <a href="<?php echo TR_BASE_HREF; ?>logout.php" ><?php echo _AT('logout'); ?></a>
111         <?php
112         }
113         else
114         {
115         ?>
116                                 <a href="<?php echo TR_BASE_HREF; ?>login.php" ><?php echo _AT('login'); ?></a>
117                                 &nbsp;&nbsp;
118                                 <a href="<?php echo TR_BASE_HREF; ?>register.php" ><?php echo _AT('register'); ?></a>
119         <?php
120         }
121         ?>
122   </span>
123   <div id="banner">
124  
125   </div>
126
127   <div class="topnavlistcontainer">
128   <!-- the main navigation. in our case, tabs -->
129     <ul class="navigation">
130 <?php 
131 foreach ($this->top_level_pages as $page) {
132         if (strpos($page['url'], '?') > 0)  {
133                 $url_without_param = substr($page['url'], 0, strpos($page['url'], '?'));
134         } else {
135                 $url_without_param = $page['url'];
136         }
137         if ($url_without_param == $this->current_top_level_page) { 
138 ?>
139       <li class="navigation"><a href="<?php echo $page['url']; ?>" title="<?php echo $page['title']; ?>" class="active"><?php echo $page['title']; ?></a></li>
140 <?php } else { ?>
141       <li class="navigation"><a href="<?php echo $page['url']; ?>"  title="<?php echo $page['title']; ?>"><?php echo $page['title']; ?></a></li>
142 <?php } // endif
143 } //endforeach ?>
144     </ul>
145   </div>
146
147 <!--
148   <div class="topnavlistcontainer">
149     <ul class="topnavlist">
150     <?php foreach ($this->top_level_pages as $page): ?>
151     <?php if ($page['url'] == $this->current_top_level_page): ?>
152       <li><a href="<?php echo $page['url']; ?>" title="<?php echo $page['title']; ?>" class="active"><?php echo $page['title']; ?></a></li>
153     <?php else: ?>
154       <li><a href="<?php echo $page['url']; ?>"  title="<?php echo $page['title']; ?>"><?php echo $page['title']; ?></a></li>
155     <?php endif; ?>
156     <?php endforeach; ?>
157     </ul>
158   </div>
159 -->
160
161
162         <!-- the sub navigation and guide -->
163   <div id="sub-menu">
164    
165       <div class="search_top">
166       <form target="_top" action="<?php echo TR_BASE_HREF; ?>home/search.php" method="get">
167         <input type="text" name="search_text" id="search_text_at_header" value="<?php if (isset($_GET['search_text'])) echo htmlentities_utf8($_GET['search_text'], ENT_QUOTES, 'UTF-8'); ?>" size="25" />
168       
169 <?php if (is_array($this->categories)) { // print category dropdown list box?>
170         <select name="catid">
171           <option value="" <?php if (!isset($_GET['catid']) || $_GET['catid'] == '') echo 'selected="selected"'; ?>><?php echo _AT('all_categories'); ?></option>
172           <option value=""></option>
173 <?php foreach ($this->categories as $category) {?>
174           <option value="<?php echo $category['category_id']; ?>" <?php if ($_GET['catid'] == $category['category_id']) echo 'selected'; ?> title="<?php echo $category['category_name']; ?>">
175             <?php echo Utility::validateLength($category['category_name'], TR_MAX_LAN_CATEGORY_NAME, 1); ?>
176           </option>
177 <?php }?>
178           <option value="0" <?php if ($_GET['catid'] == 0 && $_GET['catid'] <> '') echo 'selected'; ?>><?php echo _AT('cats_uncategorized'); ?></option>
179         </select>
180 <?php }?>
181         <input type="submit" name="search" value="<?php echo _AT("search"); ?>" />
182       </form>
183       </div>
184   </div>
185 <!-- 
186 <div>
187         <div id="breadcrumbs">
188                 <?php if (is_array($this->path)) {?>
189                 <?php foreach ($this->path as $page){ ?>
190                         <a href="<?php echo $page['url']; ?>"><?php echo $page['title']; ?></a> > 
191                 <?php }} echo $this->page_title; ?>
192         </div>
193
194         <?php if (isset($this->guide)) {?>
195                 <a href="<?php echo $this->guide; ?>" id="guide" onclick="trans.utility.poptastic('<?php echo $this->guide; ?>'); return false;"><em><?php echo $this->page_title; ?></em></a>
196         <?php } ?>
197 </div>
198 !-->
199
200   <div id="ajax-msg">
201   </div>
202
203   <div id="sequence-links">
204     <?php //if ($_SESSION["prefs"]["PREF_SHOW_NEXT_PREVIOUS_BUTTONS"]) { ?>
205     <?php if ($this->sequence_links['resume']): ?>
206     <a style="color:white;" href="<?php echo $this->sequence_links['resume']['url']; ?>" accesskey="."><img src="<?php echo $this->base_path.'themes/'.$this->theme; ?>/images/resume.png" border="0" title="<?php echo _AT('resume').': '.$this->sequence_links['resume']['title']; ?> Alt+." alt="<?php echo $this->sequence_links['resume']['title']; ?> Alt+." class="img-size-ascdesc" /></a>
207     <?php else:
208           if ($this->sequence_links['previous']): ?>
209     <a href="<?php echo $this->sequence_links['previous']['url']; ?>" title="<?php echo _AT('previous_topic').': '. $this->sequence_links['previous']['title']; ?> Alt+," accesskey=","><img src="<?php echo $this->base_path.'themes/'.$this->theme; ?>/images/previous.png" border="0" alt="<?php echo _AT('previous_topic').': '. $this->sequence_links['previous']['title']; ?> Alt+," class="img-size-ascdesc" /></a>
210     <?php endif;
211           if ($this->sequence_links['next']): ?>
212     <a href="<?php echo $this->sequence_links['next']['url']; ?>" title="<?php echo _AT('next_topic').': '.$this->sequence_links['next']['title']; ?> Alt+." accesskey="."><img src="<?php echo $this->base_path.'themes/'.$this->theme; ?>/images/next.png" border="0" alt="<?php echo _AT('next_topic').': '.$this->sequence_links['next']['title']; ?> Alt+." class="img-size-ascdesc" /></a>
213     <?php endif; ?>
214     <?php endif; ?>
215 <?php // } ?>
216     &nbsp;
217   </div>
218
219   <!-- guide -->
220   <?php if (isset($this->guide)) {  ?>
221     <div id="guide_box" title="<?php echo _AT('handbook_for').' '.$this->page_title; ?>">
222     <a href="<?php echo $this->guide; ?>" onclick="trans.utility.poptastic('<?php echo $this->guide; ?>'); return false;" id="guide" target="_new"><em><?php echo $this->page_title; ?></em></a>&nbsp;
223   </div>
224   <?php }?>
225
226   <?php if (is_array($this->tool_shortcuts) ||isset($this->course_id) && $this->course_id > 0){ ?>
227   <div class="shortcuts">
228     <ul>
229   <?php if (is_array($this->tool_shortcuts)){ ?>
230       <?php foreach ($this->tool_shortcuts as $link){ ?>
231         <li><a href="<?php echo $link['url']; ?>"><img src="<?php echo $link['icon']; ?>" alt="<?php echo $link['title']; ?>"  title="<?php echo $link['title']; ?>" class="shortcut_icon"/><!-- <?php echo $link['title']; ?> --></a></li>
232       <?php } ?>
233     <?php } ?>
234   <?php } ?>
235   <?php if (isset($this->course_id) && $this->course_id > 0) {?>
236     <!--  <div id="course-tools">-->
237       <?php if ($this->isAuthor) { // only for authors ?>
238       <li><a href="<?php echo $this->base_path; ?>home/course/course_property.php?_course_id=<?php echo $this->course_id; ?>">
239         <img src="<?php echo $this->base_path. "themes/".$this->theme."/images/course_property.png"; ?>" title="<?php echo _AT('course_property'); ?>" alt="<?php echo _AT('course_property'); ?>" border="0"  class="shortcut_icon"/>
240         </a>
241       </li>
242       <li><a href="<?php echo $this->base_path; ?>home/editor/arrange_content.php?_course_id=<?php echo $this->course_id; ?>">
243         <img src="<?php echo $this->base_path. "themes/".$this->theme."/images/arrange_content.gif"; ?>" title="<?php echo _AT('arrange_content'); ?>" alt="<?php echo _AT('arrange_content'); ?>" border="0"  class="shortcut_icon"/>
244         </a>
245       </li>
246       <li><a href="<?php echo $this->base_path; ?>home/editor/import_export_content.php?_course_id=<?php echo $this->course_id; ?>">
247         <img src="<?php echo $this->base_path. "themes/".$this->theme."/images/import_export.png"; ?>" title="<?php echo _AT('content_packaging'); ?>" alt="<?php echo _AT('content_packaging'); ?>" border="0"  class="shortcut_icon"/>
248         </a>
249       </li>
250       <li><a href="<?php echo $this->base_path; ?>home/course/del_course.php?_course_id=<?php echo $this->course_id; ?>">
251         <img src="<?php echo $this->base_path. "themes/".$this->theme."/images/delete.gif"; ?>" title="<?php echo _AT('del_course'); ?>" alt="<?php echo _AT('del_course'); ?>" border="0"  class="shortcut_icon"/>
252         </a>
253       </li>
254       <?php }?>
255       <li><a href="<?php echo $this->base_path; ?>home/index.php">
256         <img src="<?php echo $this->base_path. "themes/".$this->theme."/images/exit.png"; ?>" title="<?php echo _AT('exit_course'); ?>" alt="<?php echo _AT('exit_course'); ?>" border="0"  class="shortcut_icon"/>
257         </a>
258       </li>
259   </ul>
260  </div>
261     <?php }?>
262
263 <?php //if ($this->course_id > 0) { ?>
264   <div id="contentwrapper">
265     <?php //if ((isset($this->course_id) && $this->course_id > 0)): ?>
266     <div id="leftcolumn">
267       <script type="text/javascript">
268       //<![CDATA[
269       var state = trans.utility.getcookie("side-menu");
270       if (state && (state == 'none')) {
271           document.writeln('<a name="menu"></a><div style="display:none;" id="side-menu">');
272       } else {
273           document.writeln('<a name="menu"></a><div id="side-menu">');
274       }
275       //]]>
276       </script>
277       <?php require(TR_INCLUDE_PATH.'side_menu.inc.php'); ?>
278       <script type="text/javascript">
279       //<![CDATA[
280       document.writeln('</div>');
281       //]]>
282       </script>
283     </div>
284         <?php //endif; ?>
285
286     <div id="contentcolumn"
287     <?php if (isset($this->course_id) && $this->course_id <= 0): ?>
288       style="margin-left:0.5em;width:99%;"
289     <?php endif; ?>
290     >
291
292     <?php //if (isset($this->course_id) && $this->course_id > 0): ?>
293       <div id="menutoggle">
294         <?php //if ($this->course_id > 0): ?>
295         <script type="text/javascript" language="javascript">
296         //<![CDATA[
297         var state = trans.utility.getcookie("side-menu");
298         if (state && (state == 'none')) {
299                 trans.utility.showTocToggle("side-menu", "<img src=\"<?php echo $this->base_path; ?>themes/default/images/showmenu.gif.png\" alt=\'<?php echo _AT('show'); ?>\' title=\"<?php echo _AT('show'); ?>\" />","<img src=\"<?php echo $this->base_path; ?>themes/default/images/hidemenu.gif.png\" alt=\'<?php echo _AT('hide'); ?>\' title=\"<?php echo _AT('hide'); ?>\" />", "", "show");
300         } else {
301             document.getElementById('contentcolumn').id="contentcolumn_shiftright";
302             trans.utility.showTocToggle("side-menu", "<img src=\"<?php echo $this->base_path; ?>themes/default/images/showmenu.gif.png\" alt=\'<?php echo _AT('show'); ?>\' title=\"<?php echo _AT('show'); ?>\" />","<img src=\"<?php echo $this->base_path; ?>themes/default/images/hidemenu.gif.png\" alt=\'<?php echo _AT('hide'); ?>\' title=\"<?php echo _AT('hide'); ?>\" />", "", "hide");
303         }
304         //]]>
305         </script>
306         <?php //endif; ?>
307       </div>
308     <?php //endif; ?>
309
310       <!-- the page title -->
311       <a name="content" title="<?php echo _AT('content'); ?>"></a>
312       <h2 class="page-title"><?php echo $this->page_title; ?></h2>
313       <div id="server-msg">
314       <?php global $msg; $msg->printAll(); ?>
315       </div>
316
317       <?php if (count($this->sub_level_pages) > 0): ?>
318
319 <!-- <div id="topnavlistcontainer">
320         <ul id="topnavlist">
321                 <?php $accesscounter = 0; //initialize ?>
322                 <?php foreach ($this->top_level_pages as $page): ?>
323                         <?php ++$accesscounter; $accesscounter = ($accesscounter == 10 ? 0 : $accesscounter); ?>
324                         <?php $accesskey_text = ($accesscounter < 10 ? 'accesskey="'.$accesscounter.'"' : ''); ?>
325                         <?php $accesskey_title = ($accesscounter < 10 ? ' Alt+'.$accesscounter : ''); ?>
326                         <?php if ($page['url'] == $this->current_top_level_page): ?>
327                                 <li><a href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title'] . $accesskey_title; ?>" class="active"><?php echo $page['title']; ?></a></li>
328                         <?php else: ?>
329                                 <li><a href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title'] . $accesskey_title; ?>"><?php echo $page['title']; ?></a></li>
330                         <?php endif; ?>
331                         <?php $accesscounter = ($accesscounter == 0 ? 11 : $accesscounter); ?>
332                 <?php endforeach; ?>
333         </ul>
334 </div> -->
335    
336 <?php endif; ?>
337 <!-- the main navigation. in our case, tabs -->
338
339 <?php 
340 //} // end of else
341 ?>
342  <!-- the sub navigation -->
343 <?php if (is_array($this->sub_menus) && count($this->sub_menus) > 0): ?>
344 <div id="subnavlistcontainer">
345     <div id="sub-navigation">
346           <?php if (isset($this->back_to_page)): ?>
347             <div id="subnavbacktopage">   
348               <a href="<?php echo $this->back_to_page['url']; ?>" id="back-to"><?php echo '<img src="'.TR_BASE_HREF.'images/arrowicon.png"  alt="'._AT('back_to').':'.$this->back_to_page['title'].'" title="'._AT('back_to').':'.$this->back_to_page['title'].'" style="vertical-align:center;" />'; ?></a> 
349             </div>
350           <?php endif; ?>
351         <ul id="subnavlist">
352       <?php $num_pages = count($this->sub_menus); ?>
353       <?php for ($i=0; $i<$num_pages; $i++): ?>
354           <?php list($sub_menu_url, $param) = Utility::separateURLAndParam($this->sub_menus[$i]['url']);
355       if ($sub_menu_url == $this->current_page): ?>
356         <li class="active"><strong><?php echo $this->sub_menus[$i]['title']; ?></strong></li>
357       <?php else: ?>
358         <li><a href="<?php echo $this->sub_menus[$i]['url']; ?>"><?php echo $this->sub_menus[$i]['title']; ?></a></li>
359       <?php endif; ?>
360       <?php if ($i < $num_pages-1): ?>
361       <?php endif; ?>
362       <?php endfor; ?>
363       <?php else: ?>
364       &nbsp;
365
366       <?php endif; ?>
367       <?php if (is_array($this->sub_menus) && count($this->sub_menus) > 0): ?>
368       </ul>
369     </div>
370 </div>
371 <?php endif; ?>