ca16834f88935e3f0e3e1a6ce2ee717903dc5706
[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.'themes/'.$this->theme; ?>/forms.css" type="text/css" />
79         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/styles.css" type="text/css" />
80         <!--[if IE]>
81           <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/ie_styles.css" type="text/css" />
82         <![endif]-->
83 <?php echo $this->rtl_css; ?>
84         <script src="<?php echo $this->base_path; ?>include/jscripts/infusion/InfusionAll.js" type="text/javascript"></script>
85         <script src="<?php echo $this->base_path; ?>include/jscripts/infusion/jquery.autoHeight.js" type="text/javascript"></script>
86         <script src="<?php echo $this->base_path; ?>include/jscripts/flowplayer/flowplayer-3.1.2.min.js" type="text/javascript"></script>
87         <script src="<?php echo $this->base_path; ?>include/jscripts/handleAjaxResponse.js" type="text/javascript"></script>
88         <script src="<?php echo $this->base_path; ?>include/jscripts/transformable.js" type="text/javascript"></script>
89 <?php echo $this->custom_css; ?>
90 </head>
91
92 <body onload="<?php echo $this->onload; ?>">
93
94 <div id="liquid-round">
95   
96  <div class="center-content">
97 <a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES); ?>#content" accesskey="c">
98         <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>          
99
100         <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>
101         <span id="logininfo">
102         <?php
103         if (isset($this->user_name))
104         {
105           echo _AT('logged_in_as'). ' '.$this->user_name;
106         ?>
107                                 &nbsp;&nbsp;
108                                 <a href="<?php echo TR_BASE_HREF; ?>logout.php" ><?php echo _AT('logout'); ?></a>
109         <?php
110         }
111         else
112         {
113         ?>
114                                 <a href="<?php echo TR_BASE_HREF; ?>login.php" ><?php echo _AT('login'); ?></a>
115                                 &nbsp;&nbsp;
116                                 <a href="<?php echo TR_BASE_HREF; ?>register.php" ><?php echo _AT('register'); ?></a>
117         <?php
118         }
119         ?>
120   </span>
121   <div id="banner">
122  
123   </div>
124
125   <div class="topnavlistcontainer">
126   <!-- the main navigation. in our case, tabs -->
127     <ul class="navigation">
128 <?php 
129 foreach ($this->top_level_pages as $page) {
130         if (strpos($page['url'], '?') > 0)  {
131                 $url_without_param = substr($page['url'], 0, strpos($page['url'], '?'));
132         } else {
133                 $url_without_param = $page['url'];
134         }
135         if ($url_without_param == $this->current_top_level_page) { 
136 ?>
137       <li class="navigation"><a href="<?php echo $page['url']; ?>" title="<?php echo $page['title']; ?>" class="active"><?php echo $page['title']; ?></a></li>
138 <?php } else { ?>
139       <li class="navigation"><a href="<?php echo $page['url']; ?>"  title="<?php echo $page['title']; ?>"><?php echo $page['title']; ?></a></li>
140 <?php } // endif
141 } //endforeach ?>
142     </ul>
143   </div>
144
145 <!--
146   <div class="topnavlistcontainer">
147     <ul class="topnavlist">
148     <?php foreach ($this->top_level_pages as $page): ?>
149     <?php if ($page['url'] == $this->current_top_level_page): ?>
150       <li><a href="<?php echo $page['url']; ?>" title="<?php echo $page['title']; ?>" class="active"><?php echo $page['title']; ?></a></li>
151     <?php else: ?>
152       <li><a href="<?php echo $page['url']; ?>"  title="<?php echo $page['title']; ?>"><?php echo $page['title']; ?></a></li>
153     <?php endif; ?>
154     <?php endforeach; ?>
155     </ul>
156   </div>
157 -->
158
159
160         <!-- the sub navigation and guide -->
161   <div id="sub-menu">
162    
163       <div class="search_top">
164       <form target="_top" action="<?php echo TR_BASE_HREF; ?>home/search.php" method="get">
165         <input type="text" name="search_text" id="search_text_at_header" value="<?php if (isset($_GET['search_text'])) echo htmlentities($_GET['search_text'], ENT_QUOTES, 'UTF-8'); ?>" size="25" />
166       
167 <?php if (is_array($this->categories)) { // print category dropdown list box?>
168         <select name="catid">
169           <option value="" <?php if (!isset($_GET['catid']) || $_GET['catid'] == '') echo 'selected="selected"'; ?>><?php echo _AT('all_categories'); ?></option>
170           <option value=""></option>
171 <?php foreach ($this->categories as $category) {?>
172           <option value="<?php echo $category['category_id']; ?>" <?php if ($_GET['catid'] == $category['category_id']) echo 'selected'; ?> title="<?php echo $category['category_name']; ?>">
173             <?php echo Utility::validateLength($category['category_name'], TR_MAX_LAN_CATEGORY_NAME, 1); ?>
174           </option>
175 <?php }?>
176           <option value="0" <?php if ($_GET['catid'] == 0 && $_GET['catid'] <> '') echo 'selected'; ?>><?php echo _AT('cats_uncategorized'); ?></option>
177         </select>
178 <?php }?>
179         <input type="submit" name="search" value="<?php echo _AT("search"); ?>" />
180       </form>
181       </div>
182   </div>
183 <!-- 
184 <div>
185         <div id="breadcrumbs">
186                 <?php if (is_array($this->path)) {?>
187                 <?php foreach ($this->path as $page){ ?>
188                         <a href="<?php echo $page['url']; ?>"><?php echo $page['title']; ?></a> > 
189                 <?php }} echo $this->page_title; ?>
190         </div>
191
192         <?php if (isset($this->guide)) {?>
193                 <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>
194         <?php } ?>
195 </div>
196 !-->
197
198   <div id="ajax-msg">
199   </div>
200
201   <div id="sequence-links">
202     <?php //if ($_SESSION["prefs"]["PREF_SHOW_NEXT_PREVIOUS_BUTTONS"]) { ?>
203     <?php if ($this->sequence_links['resume']): ?>
204     <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>
205     <?php else:
206           if ($this->sequence_links['previous']): ?>
207     <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>
208     <?php endif;
209           if ($this->sequence_links['next']): ?>
210     <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>
211     <?php endif; ?>
212     <?php endif; ?>
213 <?php // } ?>
214     &nbsp;
215   </div>
216
217   <!-- guide -->
218   <?php if (isset($this->guide)) {  ?>
219     <div id="guide_box" title="<?php echo _AT('handbook_for').' '.$this->page_title; ?>">
220     <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;
221   </div>
222   <?php }?>
223
224   <?php if (is_array($this->tool_shortcuts) ||isset($this->course_id) && $this->course_id > 0){ ?>
225   <div class="shortcuts">
226     <ul>
227   <?php if (is_array($this->tool_shortcuts)){ ?>
228       <?php foreach ($this->tool_shortcuts as $link){ ?>
229         <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>
230       <?php } ?>
231     <?php } ?>
232   <?php } ?>
233   <?php if (isset($this->course_id) && $this->course_id > 0) {?>
234     <!--  <div id="course-tools">-->
235       <?php if ($this->isAuthor) { // only for authors ?>
236       <li><a href="<?php echo $this->base_path; ?>home/course/course_property.php?_course_id=<?php echo $this->course_id; ?>">
237         <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"/>
238         </a>
239       </li>
240       <li><a href="<?php echo $this->base_path; ?>home/editor/arrange_content.php?_course_id=<?php echo $this->course_id; ?>">
241         <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"/>
242         </a>
243       </li>
244       <li><a href="<?php echo $this->base_path; ?>home/editor/import_export_content.php?_course_id=<?php echo $this->course_id; ?>">
245         <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"/>
246         </a>
247       </li>
248       <li><a href="<?php echo $this->base_path; ?>home/course/del_course.php?_course_id=<?php echo $this->course_id; ?>">
249         <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"/>
250         </a>
251       </li>
252       <?php }?>
253       <li><a href="<?php echo $this->base_path; ?>home/index.php">
254         <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"/>
255         </a>
256       </li>
257   </ul>
258  </div>
259     <?php }?>
260
261 <?php //if ($this->course_id > 0) { ?>
262   <div id="contentwrapper">
263     <?php //if ((isset($this->course_id) && $this->course_id > 0)): ?>
264     <div id="leftcolumn">
265       <script type="text/javascript">
266       //<![CDATA[
267       var state = trans.utility.getcookie("side-menu");
268       if (state && (state == 'none')) {
269           document.writeln('<a name="menu"></a><div style="display:none;" id="side-menu">');
270       } else {
271           document.writeln('<a name="menu"></a><div id="side-menu">');
272       }
273       //]]>
274       </script>
275       <?php require(TR_INCLUDE_PATH.'side_menu.inc.php'); ?>
276       <script type="text/javascript">
277       //<![CDATA[
278       document.writeln('</div>');
279       //]]>
280       </script>
281     </div>
282         <?php //endif; ?>
283
284     <div id="contentcolumn"
285     <?php if (isset($this->course_id) && $this->course_id <= 0): ?>
286       style="margin-left:0.5em;width:99%;"
287     <?php endif; ?>
288     >
289
290     <?php //if (isset($this->course_id) && $this->course_id > 0): ?>
291       <div id="menutoggle">
292         <?php //if ($this->course_id > 0): ?>
293         <script type="text/javascript" language="javascript">
294         //<![CDATA[
295         var state = trans.utility.getcookie("side-menu");
296         if (state && (state == 'none')) {
297                 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");
298         } else {
299             document.getElementById('contentcolumn').id="contentcolumn_shiftright";
300             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");
301         }
302         //]]>
303         </script>
304         <?php //endif; ?>
305       </div>
306     <?php //endif; ?>
307
308       <!-- the page title -->
309       <a name="content" title="<?php echo _AT('content'); ?>"></a>
310       <h2 class="page-title"><?php echo $this->page_title; ?></h2>
311       <div id="server-msg">
312       <?php global $msg; $msg->printAll(); ?>
313       </div>
314
315       <?php if (count($this->sub_level_pages) > 0): ?>
316
317 <!-- <div id="topnavlistcontainer">
318         <ul id="topnavlist">
319                 <?php $accesscounter = 0; //initialize ?>
320                 <?php foreach ($this->top_level_pages as $page): ?>
321                         <?php ++$accesscounter; $accesscounter = ($accesscounter == 10 ? 0 : $accesscounter); ?>
322                         <?php $accesskey_text = ($accesscounter < 10 ? 'accesskey="'.$accesscounter.'"' : ''); ?>
323                         <?php $accesskey_title = ($accesscounter < 10 ? ' Alt+'.$accesscounter : ''); ?>
324                         <?php if ($page['url'] == $this->current_top_level_page): ?>
325                                 <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>
326                         <?php else: ?>
327                                 <li><a href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title'] . $accesskey_title; ?>"><?php echo $page['title']; ?></a></li>
328                         <?php endif; ?>
329                         <?php $accesscounter = ($accesscounter == 0 ? 11 : $accesscounter); ?>
330                 <?php endforeach; ?>
331         </ul>
332 </div> -->
333    
334 <?php endif; ?>
335 <!-- the main navigation. in our case, tabs -->
336
337 <?php 
338 //} // end of else
339 ?>
340  <!-- the sub navigation -->
341 <?php if (is_array($this->sub_menus) && count($this->sub_menus) > 0): ?>
342 <div id="subnavlistcontainer">
343     <div id="sub-navigation">
344           <?php if (isset($this->back_to_page)): ?>
345             <div id="subnavbacktopage">   
346               <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> 
347             </div>
348           <?php endif; ?>
349         <ul id="subnavlist">
350       <?php $num_pages = count($this->sub_menus); ?>
351       <?php for ($i=0; $i<$num_pages; $i++): ?>
352           <?php list($sub_menu_url, $param) = Utility::separateURLAndParam($this->sub_menus[$i]['url']);
353       if ($sub_menu_url == $this->current_page): ?>
354         <li class="active"><strong><?php echo $this->sub_menus[$i]['title']; ?></strong></li>
355       <?php else: ?>
356         <li><a href="<?php echo $this->sub_menus[$i]['url']; ?>"><?php echo $this->sub_menus[$i]['title']; ?></a></li>
357       <?php endif; ?>
358       <?php if ($i < $num_pages-1): ?>
359       <?php endif; ?>
360       <?php endfor; ?>
361       <?php else: ?>
362       &nbsp;
363
364       <?php endif; ?>
365       <?php if (is_array($this->sub_menus) && count($this->sub_menus) > 0): ?>
366       </ul>
367     </div>
368 </div>
369 <?php endif; ?>