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