(no commit message)
[atutor.git] / docs / themes / mobile / include / header.tmpl.php
1 <?php
2 /************************************************************************/
3 /* ATutor                                                                                                                               */
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg & Heidi Hazelton*/
6 /* Adaptive Technology Resource Centre / University of Toronto                  */
7 /* http://atutor.ca                                                                                                             */
8 /*                                                                                                                                              */
9 /* This program is free software. You can redistribute it and/or                */
10 /* modify it under the terms of the GNU General Public License                  */
11 /* as published by the Free Software Foundation.                                                */
12 /************************************************************************/
13 // $Id: header.tmpl.php 3825 2005-03-11 15:35:51 joel $
14 if (!defined('AT_INCLUDE_PATH')) { exit; }
15 /* available header.tmpl.php variables:
16  * $this->lang_code                     the ISO language code
17  * SITE_NAME                            the site name from the config file
18  * $this->page_title            the name of this page to use in the <title>
19  * $this->lang_charset          the ISO language character set
20  * $this->content_base_href     the <base href> to use for this page
21  * $this->base_path                     the absolute path to this atutor installation
22  * $this->rtl_css                       if set, the path to the RTL style sheet
23  * $this->icon                  the path to a course icon
24  * $this->banner_style          -deprecated-
25  * $this->theme                         the directory name of the current theme
26  * $this->base_href                     the full url to this atutor installation
27  * $this->onload                        javascript onload() calls
28  * $this->img                           the absolute path to this theme's images/ directory
29  * $this->sequence_links        associative array of 'previous', 'next', and/or 'resume' links
30  * $this->path                          associative array of path to this page: aka bread crumbs
31  * $this->rel_url                       the relative url from the installation root to this page
32  * $this->nav_courses           associative array of this user's enrolled courses
33  * $this->section_title         the title of this section (course, public, admin, my start page)
34  * $this->current_top_level_page        the full path to the current top level page with file name
35  * $this->sub_level_pages                       associate array of sub level navigation
36  * $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)
37  * $this->current_sub_level_page        the full path to the current sub level page with file name
38  * $this->guide                         the full path and file name to the guide page
39  * ======================================
40  * top_level_pages           array(array('url', 'title'))     the top level pages. ATutor default creates tabs.
41  * section_title             string                           the name of the current section. either name of the course, administration, my start page, etc.
42  * page_title                string                           the title of the current page.
43  * path                      array(array('url', 'title'))     the path to the current page.
44  * back_to_page              array('url', 'title')            the link back to the part of the current page, if needed.
45  * current_top_level_page    string                           full url to the current top level page in "top_leve_pages"
46  * current_sub_level_page    string                           full url to the current sub level page in the "sub_level_pages"
47  * sub_level_pages           array(array('url', 'title'))     the sub level pages.
48  * is_mobile_device          true or false                    the request is from a mobile device or a desktop device
49  * mobile_device_type        One of the constants: IPOD_DEVICE, BLACKBERRY_DEVICE, ANDROID_DEVICE, UNKNOWN_DEVICE (@see include/lib/constants.inc.php)
50  */
51  
52
53 // will have to be moved to the header.inc.php
54 global $system_courses, $_custom_css, $db, $_base_path, $contentManager;
55
56 // 1. any click on the page closes the content menu but the link "content_link" itself
57 // 2. the click on link "content_link" opens the content menu
58
59
60 require ('TeraWurflRemoteClient.php');
61 $wurflObj = new TeraWurflRemoteClient('http://wurfl.thesedays.com/webservice.php');
62 $capabilities = array("product_info");
63 $data_format = TeraWurflRemoteClient::$FORMAT_JSON;
64 $wurflObj->getCapabilitiesFromAgent(null, $capabilities, $data_format);
65
66 // open/close content menu
67 $this->onload .= "
68 jQuery('#content_link').click(function(e) {
69   e.stopPropagation();
70   
71   jQuery('#content').slideToggle(0);
72   jQuery('#content_link').toggleClass('content_link_tablet_highlight');
73   jQuery('#content_link').toggleClass('triangle-isosceles'); 
74   jQuery('#content_link').toggleClass('top'); 
75   jQuery('#content_link').toggleClass('right');    
76   ";
77 $this->onload .= "});
78 ";
79
80 //open/close subnavlist in smartphones 
81
82 $this->onload .= "
83 jQuery('#subnavlist-link').click(function(e) {
84   e.stopPropagation();
85   
86   jQuery('#subnavlist').slideToggle();
87   jQuery('#subnavlist-link').toggleClass('content-closed');
88   jQuery('fl-theme-iphone').toggleClass('subnavcontain2');
89   
90
91
92    
93   ";
94 $this->onload .= "});
95 ";
96 // open/close content menu - smartphones 
97 $this->onload .= "
98 jQuery('#content_link_phone').click(function(e) {
99   e.stopPropagation();
100   
101   jQuery('#content').slideToggle();
102  
103   jQuery('#content_link_phone').toggleClass('topnavlist-link-highlight');
104   jQuery('#content_link_phone').toggleClass('content-closed'); 
105   ";
106 $this->onload .= "});
107 ";
108
109 // open/close header navigational menu for smartphones
110 // jQuery('#topnavlist-link').toggleClass('topnavlist-link-highlight');
111 $this->onload .= "
112 jQuery(document).click(function () {
113 jQuery('#topnavlist').slideUp(600);}); 
114 jQuery('.topnavlist-link').click(function(e) {
115   e.stopPropagation();
116   jQuery('#topnavlist').slideToggle();
117  jQuery('#topnavlist-link').toggleClass('.topnavlist-link-highlight');
118 });
119 ";
120
121 // open/close header navigational menu for tablets
122
123 $this->onload .= "
124 jQuery(document).click(function () {
125 jQuery('#navigation-column').slideUp(200);}); 
126 jQuery('.topnavlist-link').click(function(e) {
127   e.stopPropagation();
128   jQuery('#navigation-column').slideToggle(0);
129     jQuery('#topnavlist-link').toggleClass('topnavlist-link-highlight');
130     jQuery('#topnavlist-link').toggleClass('triangle-isosceles');
131     jQuery('#topnavlist-link').toggleClass('top');
132 });
133 ";
134
135 //jQuery for Gmail dock-style "more" button that makes the subnavlist expand for more options
136 $this->onload .= "
137
138 jQuery('.more-button').click(function(e) {
139   e.stopPropagation();
140   jQuery('.subnavlist-more').slideToggle();
141   jQuery('#switch').attr('src', 'images/hidemenu.gif'); 
142   jQuery('#switch').attr('title', 'less menu items'); 
143   jQuery('#switch').attr('alt', 'less menu items'); 
144
145 });
146 ";
147
148
149 //hide and show results on Browse Courses page
150
151 $this->onload .= "
152 jQuery('#results-hide-show-link').click(function(e) {
153   e.stopPropagation();
154     jQuery('#results-display').slideToggle();
155     jQuery(this).toggleClass('content-closed');
156     jQuery(this).preventDefault();
157   ";
158 $this->onload .= "});
159 ";
160
161 //hide and show results elsewhere (uses classes) 
162 $this->onload .= "
163 jQuery('.results-hide-show-link').click(function(e) {
164   e.stopPropagation();
165         jQuery(this).parent().next('.results-display').slideToggle(); 
166           jQuery(this).toggleClass('content-closed');
167   ";
168 $this->onload .= "});
169 ";
170         
171
172 // Hide the addressbar
173 $this->onload .= "
174 setTimeout(function() { window.scrollTo(0, 1) }, 100);
175 ";
176
177
178
179 ?>
180
181 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
182
183 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="<?php echo $this->lang_code; ?>"> 
184
185 <head>
186         <title><?php echo SITE_NAME; ?> : <?php echo $this->page_title; ?></title>
187         <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $this->lang_charset; ?>" />
188         <meta name="Generator" content="ATutor - Copyright 2005 by http://atutor.ca" />
189         <base href="<?php echo $this->content_base_href; ?>" />
190         <link rel="shortcut icon" href="<?php echo $this->base_path; ?>favicon.ico" type="image/x-icon" /> 
191         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/print.css" type="text/css" media="print" />
192         <!-- mobile fss -->     
193         <link rel="stylesheet" href="<?php echo $this->base_path; ?>jscripts/infusion/framework/fss/css/fss-mobile-layout.css" type="text/css"/>
194         <link rel="stylesheet" href="<?php echo $this->base_path; ?>jscripts/infusion/framework/fss/css/fss-mobile-theme-iphone.css" type="text/css"/>  
195         
196 <?php if ($this->is_mobile_device == true): ?>
197         <?php if ($this->mobile_device_type == ANDROID_DEVICE): ?>
198         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/mobile.css" type="text/css"/>
199         <meta name="viewport" content="user-scalable=no, width=device-width" />
200         <?php endif; ?>
201         <?php if ($this->mobile_device_type == IPOD_DEVICE || $this->mobile_device_type == IPHONE_DEVICE): ?>
202         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/mobile.css" type="text/css"/>
203         <meta name="viewport" content="user-scalable=no, width=device-width" />
204         <?php endif; ?>
205         <!-- Armin 25.08.2010: Detect BLACKBERRY_DEVICE and use blackberry.css-->
206         <?php if ($this->mobile_device_type == BLACKBERRY_DEVICE): ?>
207         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/blackberry.css" type="text/css"/>
208         <meta name="viewport" content="user-scalable=no, width=device-width" />
209         <?php endif; ?>
210         <?php if ($this->mobile_device_type == IPAD_DEVICE): ?>
211         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/tablet.css" type="text/css"/>
212         <meta name="viewport" content="width=768px, minimum-scale=1.0, maximum-scale=1.0" />
213         
214         <?php endif; ?>
215 <?php endif; ?>
216
217         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/forms.css" type="text/css" />
218         <!-- Fluid Infusion mobile fss extension.. remove when it is committed to Mobile FSS -->
219         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/moz.css" type="text/css" /> 
220         <!-- Fluid Infusion -->
221         <script src="<?php echo $this->base_path; ?>jscripts/infusion/InfusionAll.js" type="text/javascript"></script>
222         <script language="javascript" type="text/javascript">
223
224         //<!--
225         jQuery.noConflict();
226         //-->
227         </script>
228         <script src="<?php echo $this->base_path; ?>jscripts/ATutor.js" type="text/javascript"></script>   
229
230         
231 <?php echo $this->rtl_css; ?>
232 <?php if (isset($this->course_id) && $system_courses[$this->course_id]['rss']): ?>
233         <link rel="alternate" type="application/rss+xml" title="<?php echo SITE_NAME; ?> - RSS 2.0" href="<?php echo $this->base_href; ?>get_rss.php?<?php echo $this->course_id; ?>-2" />
234         <link rel="alternate" type="application/rss+xml" title="<?php echo SITE_NAME; ?> - RSS 1.0" href="<?php echo $this->base_href; ?>get_rss.php?<?php echo $this->course_id; ?>-1" />
235 <?php endif; ?>
236
237
238 <?php echo $this->custom_css; ?>
239 </head>
240
241
242 <?php if ($this->mobile_device_type != IPAD_DEVICE): ?><!--  smartphone theme only -->
243
244 <body onload="<?php echo $this->onload; ?>" class="fl-theme-iphone ui-mobile-viewport">
245
246 <div id="wrapper">
247 <div id="main">
248         <div id="header">
249
250                 <a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES); ?>#content">
251                 <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>          
252
253                 <div id="header-section-title">
254                         <!-- <?php if (isset($_SESSION['valid_user']) && $_SESSION['valid_user']): 
255                                         echo '<div id="site-name">'.stripslashes(SITE_NAME).'</div>'; 
256                                 endif; ?> --> 
257                         <h1 id="section-title"><?php echo $this->section_title; ?>
258                                 <?php if ((isset($this->course_id) && $this->course_id > 0) && ($_SESSION['enroll'] == AT_ENROLL_NO)) : ?> 
259                                 <!-- <small><a href="<?php echo $this->base_path; ?>enroll.php?course=<?php echo $this->course_id; ?>"><?php echo _AT('enroll_me'); ?></a></small>-->
260                                 <?php endif; ?>
261                                 </h1>
262                 </div>
263         </div> <!--  END HEADER -->
264
265
266         <div id="contentwrapper">
267
268         <!--  Note: ARIA roles cause XHTML validation errors because the XHTML DTD does not yet support ARIA. Use ARIA anyway -->
269
270         <div id="navigation-contentwrapper">
271         <div id="navigation-bar">
272                 <!--  this should be a button on its own  -->
273                         <?php if ($this->current_sub_level_page): ?>
274                         <div id="topnavlistcontainer" role="menu" aria-live="assertive" class="topnavlistcontainer" >
275                         <a class="navigation-bar-button topnavlist-link" id="topnavlist-link" href="javascript:void(0);" tabindex="1"><?php echo _AT('navigation'); ?></a>
276                                 <ul id="topnavlist"  class="fl-list-menu" role="menu">
277                                         <?php $accesscounter = 0; //initialize ?>
278                                         <?php foreach ($this->top_level_pages as $page): ?>
279                                                 <?php ++$accesscounter; $accesscounter = ($accesscounter == 10 ? 0 : $accesscounter); ?>
280                                                 <?php $accesskey_text = ($accesscounter < 10 ? 'accesskey="'.$accesscounter.'"' : ''); ?>
281                                                 <?php $accesskey_title = ($accesscounter < 10 ? ' Alt+'.$accesscounter : ''); ?>
282                                                 <?php if ($page['url'] == $this->current_top_level_page): ?>
283                                                         <li role="menuitem"><a  href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title'];?>"><?php echo $page['title']; ?></a>  </li>
284                                                 <?php else: ?>
285                                                         <li role="menuitem"><a  href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title']; ?>"><?php echo $page['title']; ?></a></li>
286                                                 <?php endif; ?>
287                                 
288                                                 <?php $accesscounter = ($accesscounter == 0 ? 11 : $accesscounter); ?>
289                                         
290                                         <?php endforeach; ?>
291                                         <?php if(!$this->just_social): ?>
292                                         <li role="menuitem"><a href="<?php echo $this->base_path; ?>search.php"><?php echo _AT('search'); ?></a> </li>
293                                         <?php endif; ?> 
294                                 </ul>
295                         </div>
296                         <?php endif; ?>
297                 </div>
298
299                                 
300
301
302         <ul class="home-guide fl-tabs" id="home-guide" role="menu">
303         <!--  CHECK TO SEE IF USER IS A STUDENT -->
304         <?php if($_SESSION['is_admin'] == 0 && $_SESSION['privileges'] == 0 ):?>
305                 <li role="menuitem"><a  href="<?php echo $this->base_path; ?>users/index.php"><?php echo _AT("home"); ?></a></li> 
306         <?php endif;?>          
307         <!--  CHECK TO SEE IF USER IS AN ADMINISTRATOR -->
308         <?php //if($_SESSION['is_admin'] == 0 && $_SESSION['privileges'] == 1):
309                 if($_SESSION['is_admin'] == 0 && $_SESSION['privileges'] == AT_ADMIN_PRIV_ADMIN):?>
310                 <li role="menuitem"><a href="<?php echo $this->base_path; ?>admin/index.php"><?php echo _AT("home"); ?></a></li> 
311         <?php endif;?>
312         <!--  CHECK TO SEE IF USER IS AN INSTRUCTOR -->
313         <?php if($_SESSION['is_admin'] == 1): ?>
314                 <li role="menuitem"><a href="<?php echo $this->base_path; ?>users/index.php"><?php echo _AT("home"); ?></a></li> 
315         <?php endif;?>
316         
317         <?php if (isset($this->guide) && isset($_SESSION["course_id"]) && $this->guide && ($_SESSION["prefs"]["PREF_SHOW_GUIDE"] || $_SESSION["course_id"] == "-1")) : ?>
318                         <li role="menuitem">
319                         <div id="guide_box">
320                                         <!--    <a href="<?php echo $this->guide; ?>" id="guide" onclick="ATutor.poptastic('<?php echo $this->guide; ?>'); return false;" target="_new"><img src="<?php echo $this->img; ?>guide-icon.png" width="30" height="30" title="guide: <?php echo $this->page_title; ?>"alt="guide: <?php echo $this->page_title; ?>"></img></a> -->
321                 
322                                   <a href="<?php echo $this->guide; ?>" id="guide" onclick="ATutor.poptastic('<?php echo $this->guide; ?>'); return false;" target="_new"><?php echo _AT("guide"); ?></a> 
323                         </div>
324                         </li>
325                         <?php endif; ?>
326                 </ul>
327         </div><!--  END navigation-contentwrapper -->
328         
329
330                 <div id="inner-contentwrapper" class="fl-container" >
331
332         
333                         
334                 <!-- the sub navigation -->
335                 <div id="subnavbacktopage">
336                 <?php if (count($this->sub_level_pages) > 0): ?>
337                         
338                         <div id="subnavlistcontainer">
339                                 
340                                 <!-- id="subnavlist" -->
341                         <div class="subnavcontain-contain" role="menu" aria-live="assertive">   
342                                 <div class="subnavcontain">
343                                         <div class="rectangle">
344                                                 <?php $num_pages = count($this->sub_level_pages); ?>    
345                                                                 <?php for ($i=0; $i<$num_pages; $i++): ?>       
346                                                                         <?php if($i==0): ?>
347                                 
348                                                                         <a id="subnavlist-link" class="content-expand" href="javascript:void(0);"> Topics in <?php echo $this->sub_level_pages[$i]['title']; ?></a>
349                                                                         <?php endif; ?>
350                                                                 <?php endfor;?>
351                                         </div>
352                                 </div>
353                                         <ul id="subnavlist" class="fl-list-menu">
354                                         <?php $num_pages = count($this->sub_level_pages); ?>    
355                                         <?php for ($i=0; $i<$num_pages; $i++): ?>                               
356                                                 <?php if ($this->sub_level_pages[$i]['url'] == $this->current_sub_level_page): ?>
357                                                         <li><a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a></li> 
358                                                 <?php else: ?>
359                                                         <li><a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a></li>
360                                                 <?php endif; ?>
361                                         <?php if ($i < $num_pages-1): 
362                                                 echo " ";?>
363                                         <?php endif; ?>
364                                         <?php endfor; ?>
365                                         </ul>
366                                 </div>
367                         </div>  
368                 <?php endif; ?>
369         </div> <!--  end subnavbacktopage->     
370
371         <div id="contentcolumn">        
372                 
373
374                 <!-- the page title -->
375                 <div id="page-title-back-to-page">
376                 <a name="content" title="<?php echo _AT('content'); ?>"></a>
377                 <h2 class="page-title"><?php echo $this->page_title; ?></h2>
378                         <div id="back-to-page">
379                                 <?php if (isset($this->back_to_page)): ?>
380                                         <a href="<?php echo $this->back_to_page['url']; ?>">
381                                         <img border="0" width="10" height="11" alt="<?php echo _AT('back_to').' '.$this->back_to_page['title']; ?>" src="<?php echo $this->base_href; ?>images/arrowicon.gif" style="float:left;"/></a>&nbsp;
382                                 <?php endif; ?>
383                 </div>          
384                 </div><!--  end page-title-back-to-page -->
385         
386                 <?php global $msg; $msg->printAll(); $_base_href;?>
387                         <div id="content-sequence-links">
388                         <!-- ENSURE "content_link" DOESN'T APPEAR IF NOT LOGGED IN -->
389                 <?php if (isset($this->course_id) && $this->course_id > 0): ?>
390         
391                 <?php endif; ?>
392         
393         
394         <?php if(isset($_SESSION['course_id']) && $_SESSION['course_id'] > 0): ?> 
395                 
396                 <div class="subnavcontain-contain" role="menu" aria-live="assertive">   
397                         <div class="subnavcontain">
398                                 <div class="rectangle">
399                                 <a id="content_link_phone"  class="content-expand" href="javascript:void(0);" >View Course Content</a> 
400                                 <!-- <a href="#">content</a> -->
401                                 </div>
402                         </div>
403                                         
404                 <div id="content">
405                         <?php $contentManager->printMainMenu(); ?>
406                                 <script language="javascript" type="text/javascript"></script>
407                 </div>
408
409         </div>
410
411
412                 
413                         <?php if (isset($this->course_id) && $this->course_id > 0): ?>
414                         
415                         <div class="subnavcontain2">
416                         <ul class="sequence-links">
417                                 <?php if ($_SESSION["prefs"]["PREF_SHOW_NEXT_PREVIOUS_BUTTONS"]) { ?>
418                                         <?php if ($this->sequence_links['resume']): ?>
419                                                 
420                                                 <li class="rectangle2">
421                                                         <a href="<?php echo $this->sequence_links['resume']['url']; ?>" class="previous-next resume" title="<?php echo _AT('resume').': '.$this->sequence_links['resume']['title']; ?>"><?php echo _AT('resume'); ?></a>
422                                                 </li>
423                                                 
424                                         <?php else:
425                                                 if ($this->sequence_links['previous']): ?>
426                                         
427                                                 <li class="rectangle2 arrow back">
428                                                         <a  href="<?php echo $this->sequence_links['previous']['url']; ?>" class="arrow back" title="<?php echo _AT('previous_topic').': '. $this->sequence_links['previous']['title']; ?>"> <?php echo "Previous"; ?> </a>
429                                                 </li>
430                                                 
431                                         <?php endif;
432                                                 if ($this->sequence_links['next']): ?>
433                                                 
434                                                 <li class=" rectangle2 arrow forward">
435                                                         <a  href="<?php echo $this->sequence_links['next']['url']; ?>" class=""  title="<?php echo _AT('next_topic').': '.$this->sequence_links['next']['title']; ?>"> <?php echo "Next"; ?></a>
436                                                 </li>
437                                                 
438                                         <?php endif; ?>
439                                 <?php endif; ?>
440                         <?php } ?>
441                                 &nbsp;
442                                 </div>
443                         </ul>  
444                 <?php endif; ?>
445                         
446                         
447         </div>
448         <?php endif; ?> 
449
450
451         
452                 <!-- the sub navigation -->
453 <?php endif; ?>
454
455
456
457 <!--  end header template for iphone, android, blackberry -->
458 <?php if ($this->mobile_device_type == IPAD_DEVICE): ?><!-- start header template for ipad/tablets -->
459 <body onload="<?php echo $this->onload; ?>" class="fl-theme-iphone ui-mobile-viewport">
460
461 <div id="wrapper">
462 <div id="main">
463         
464         <div id="header" role="header">
465         
466         <div class="bypass">
467                 <a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES); ?>#page-title" accesskey="c">
468                 <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>          
469 </div>  
470         
471         
472         <div id="header-section-title">
473                         <h1 id="section-title"><?php echo $this->section_title; ?></h1>
474                 </div>
475
476         
477         <div id="navigation-contentwrapper" role="menubar" >
478         
479                         <?php if ($this->current_sub_level_page): ?>
480                         <div id="topnavlistcontainer" role="navigation" aria-live="assertive" class="topnavlistcontainer fl-container" >
481                         <a class="navigation-bar-button topnavlist-link" id="topnavlist-link" href="javascript:void(0);" tabindex="1"><?php echo _AT('navigation'); ?></a>
482                         
483                                 <div id="navigation-column">
484                                 <?php if ($this->current_sub_level_page): ?>
485                                 <ul id="topnavlist-tablet"  class="fl-list-menu" role="menu">
486                                         <?php $accesscounter = 0; //initialize ?>
487                                         <?php foreach ($this->top_level_pages as $page): ?>
488                                                 <?php ++$accesscounter; $accesscounter = ($accesscounter == 10 ? 0 : $accesscounter); ?>
489                                                 <?php $accesskey_text = ($accesscounter < 10 ? 'accesskey="'.$accesscounter.'"' : ''); ?>
490                                                 <?php $accesskey_title = ($accesscounter < 10 ? ' Alt+'.$accesscounter : ''); ?>
491                                                 <?php if ($page['url'] == $this->current_top_level_page): ?>
492                                                         <!-- note bug http://issues.fluidproject.org/browse/FLUID-4313 makes class "flc-screenNavigator-backButton fl-link-hilight" not work -->
493                                                         <li role="menuitem"><a  href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> class="flc-screenNavigator-backButton fl-link-hilight" title="<?php echo $page['title'];?>"><?php echo $page['title']; ?></a>  </li>
494                                                 <?php else: ?>
495                                                         <li role="menuitem"><a  href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title']; ?>"><?php echo $page['title']; ?></a></li>
496                                                 <?php endif; ?>
497                                 
498                                                 <?php $accesscounter = ($accesscounter == 0 ? 11 : $accesscounter); ?>
499                                         
500                                         <?php endforeach; ?>
501                                          
502                                 </ul>
503                                 <?php endif; ?>
504                         </div>
505                         </div>
506                         <?php endif; ?> 
507                 
508         <ul class="home-guide fl-tabs" id="home-guide" role="menu">
509         <!--  CHECK TO SEE IF USER IS A STUDENT -->
510         <?php if($_SESSION['is_admin'] == 0 && $_SESSION['privileges'] == 0 ):?>
511                 <li role="menuitem"><a href="<?php echo $this->base_path; ?>users/index.php"><?php echo _AT("home"); ?></a></li> 
512         <?php endif;?>          
513         <!--  CHECK TO SEE IF USER IS AN ADMINISTRATOR -->
514         <?php //if($_SESSION['is_admin'] == 0 && $_SESSION['privileges'] == 1):
515                 if($_SESSION['is_admin'] == 0 && $_SESSION['privileges'] == AT_ADMIN_PRIV_ADMIN):?>
516                 <li role="menuitem"><a href="<?php echo $this->base_path; ?>admin/index.php"><?php echo _AT("home"); ?></a></li> 
517         <?php endif;?>
518         <!--  CHECK TO SEE IF USER IS AN INSTRUCTOR -->
519         <?php if($_SESSION['is_admin'] == 1): ?>
520                 <li role="menuitem"><a href="<?php echo $this->base_path; ?>users/index.php"><?php echo _AT("home"); ?></a></li> 
521         <?php endif;?>
522         
523         <?php if (isset($this->guide) && isset($_SESSION["course_id"]) && $this->guide && ($_SESSION["prefs"]["PREF_SHOW_GUIDE"] || $_SESSION["course_id"] == "-1")) : ?>
524                         <li>
525                         <div id="guide_box">
526                                         <!--    <a href="<?php echo $this->guide; ?>" id="guide" onclick="ATutor.poptastic('<?php echo $this->guide; ?>'); return false;" target="_new"><img src="<?php echo $this->img; ?>guide-icon.png" width="30" height="30" title="guide: <?php echo $this->page_title; ?>"alt="guide: <?php echo $this->page_title; ?>"></img></a> -->
527                 
528                                   <a href="<?php echo $this->guide; ?>" id="guide" onclick="ATutor.poptastic('<?php echo $this->guide; ?>'); return false;" target="_new"><?php echo _AT("guide"); ?></a> 
529                         </div>
530                         </li>
531                         <?php endif; ?>
532                 </ul>
533         
534         <?php if (isset($this->course_id) && $this->course_id > 0): ?>
535                         
536 <div id="sequence-links-course-navigation">     
537                 <ul class="sequence-links fl-tabs" id="sequence-links" >
538                         <?php if ($_SESSION["prefs"]["PREF_SHOW_NEXT_PREVIOUS_BUTTONS"]) { ?>
539                                 <?php if ($this->sequence_links['resume']): ?>
540                                                 <li >
541                                                 <a href="<?php echo $this->sequence_links['resume']['url']; ?>" class="previous-next" title="<?php echo _AT('resume').': '.$this->sequence_links['resume']['title']; ?>"><?php echo _AT('resume'); ?></a>
542                                                 </li>
543                                 <?php else:
544                                         if ($this->sequence_links['previous']): ?>
545                                                 <li  class="arrow back"><a  href="<?php echo $this->sequence_links['previous']['url']; ?>" class="arrow back" title="<?php echo _AT('previous_topic').': '. $this->sequence_links['previous']['title']; ?>"> <?php echo "Previous"; ?> </a>
546                                                 </li>
547                                         <?php endif;
548                                         if ($this->sequence_links['next']): ?>
549                                                 <li class="arrow forward">
550                                                 <a href="<?php echo $this->sequence_links['next']['url']; ?>" class=""  title="<?php echo _AT('next_topic').': '.$this->sequence_links['next']['title']; ?>"> <?php echo "Next"; ?></a>
551                                                 </li>
552                                         <?php endif; ?>
553                                 <?php endif; ?>
554                         <?php } ?>
555                                 &nbsp;
556                         </ul> <!-- end sequence-links -->
557                 <?php endif; ?>
558                 
559                 <?php if(isset($_SESSION['course_id']) && $_SESSION['course_id'] > 0): ?>       
560                 <div id="course-level-navigation">
561                 
562         
563                         
564                         <div id="content-link-container" role="navigation" aria-live="assertive" class="flc-screenNavigator-navbar ">
565                                 <a id="content_link" class="content_link_tablet content_link"  href="javascript:void(0);"><?php echo "Content";//_AT("content_navigation"); ?></a>      
566                         </div>  
567                         </div><!-- course-level navigation -->                          
568                                 <div id="content">
569                                         <?php $contentManager->printMainMenu(); ?>
570                                         <script language="javascript" type="text/javascript"></script>
571                                 </div>
572                 
573                 </div> <!-- end sequence-links-course-navigation -->
574                 <?php endif;?>
575         
576         
577                 
578
579         
580
581         
582         </div>
583         </div> <!--  END HEADER -->
584
585 <?php if (count($this->sub_level_pages) > 0): ?>
586                                 <div id="subnavlistcontainer" role="navigation" aria-live="assertive" > 
587                                 
588                                         <!-- Markup for a subnavlist styled like a Gmail dock. Clean up this code for redundancy but it works for now. -->
589                                         <!-- background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#B6C0C6), to(#F8FAFB));  -->
590                                         <ul id="subnavlist" style="text-decoration: none; text-align: center; border-bottom: 1px #B6C0C6 solid; background: #B6C0C6; ">
591                                         <?php $num_pages = count($this->sub_level_pages); ?>
592                                                 <?php for ($i=0; $i<$num_pages; $i++): ?>       
593                                                         
594                                                         <?php if($num_pages <= 5): ?>
595                                                                 <?php if($this->sub_level_pages[$i][url] == $this->current_sub_level_page): ?>
596                                                                 <li class="selected" style="font-size: 14px; padding-left: .313em; padding-right: .313em;"><a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a></li>
597                                                                 <?php else: ?> 
598                                                                 <li style="font-size: 14px; padding-left: .313em; padding-right: .313em"><a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a></li>
599                                                                 <?php endif; ?> 
600                                                         <?php endif; ?>
601                                                         <?php if($num_pages > 5): ?>
602                                                                 <?php if($i <= 5):?>
603                                                                         <?php if($this->sub_level_pages[$i][url] == $this->current_sub_level_page): ?>
604                                                                                 <li class="selected" style="font-size: 14px; padding-left: .313em; padding-right: .313em;"><a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a></li>
605                                                                         <?php else: ?> 
606                                                                                 <li style="font-size: 14px; padding-left: .313em; padding-right: .313em"><a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a></li>
607                                                                         <?php endif; ?> 
608                                                                 <?php endif;?>
609                                                                 <?php if($i== 6): ?>
610                                                                         <li class="more-button-surround" style="font-size: 14px; padding-left: .313em; padding-right: .313em; position: relative; top: .313em;"><a class="more-button" href="javascript:void(0);" tabindex="1"><img id="switch" border="" width="20" height="20" alt="More menu items" title="More menu items" src="<?php echo $this->base_href; ?>images/showmenu.gif"/></a></li>
611                                                                         <li>
612                                                                         <ul class="subnavlist-more">
613                                                                         <li class="more-item" style="font-size: 14px; list-style-type: bullet"><a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a></li>
614                                                                         
615                                                                 <?php endif;?>
616                                                                 <?php if($i > 6 && $i < $num_pages): ?>
617                                                                         <li style="font-size: 14px; list-style-type: bullet"><a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a></li>
618                                                                 <?php endif;?>
619                                                                 <?php if($i==$num_pages): ?>
620                                                                         <li style="font-size: 14px; list-style-type: bullet"><a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a></li>
621                                                                         </ul>
622                                                                         </li>
623                                                                 <?php endif; ?>
624                                                         <?php endif; ?>
625                                                 
626                                                 
627                                                         
628                                         <?php if ($i < $num_pages-1): 
629                                                 echo " ";?>
630                                         <?php endif; ?>
631                                         <?php endfor; ?>
632                                         </ul>
633
634                                 </div> <!--  end subnavlistcontainer -->                                
635                 <?php endif; ?> 
636         
637         <?php global $msg; $msg->printAll(); $_base_href;?>
638         
639         
640         <!-- </div>end #main -->
641                 <div id="contentwrapper" class="fl-container" >
642                 <a name="page-title" id="page-title"></a>
643                 <h2 class="page-title" ><?php echo $this->page_title; ?></h2>
644                 <div id="subnavbacktopage" >
645                                         <?php if (isset($this->back_to_page)): ?>
646                                                 <a href="<?php echo $this->back_to_page['url']; ?>">
647                                                 <img border="0" width="10" height="11" alt="<?php echo _AT('back_to').' '.$this->back_to_page['title']; ?>" src="<?php echo $this->base_href; ?>images/arrowicon.gif" style="float:left;"/></a>&nbsp;
648                                         <?php endif; ?>
649                                 </div>
650         
651         <!--  check if a user is logged-into a course and if so display breadcrumbs.  -->       
652                 <?php if(isset($_SESSION['course_id']) && $_SESSION['course_id'] > 0): ?>               
653                 <?php if (isset($_SESSION["prefs"]["PREF_SHOW_BREAD_CRUMBS"]) && $_SESSION["prefs"]["PREF_SHOW_BREAD_CRUMBS"]) { ?>
654                  
655                         <div class="crumbcontainer">
656                           <div id="breadcrumbs">
657                           <?php foreach ($this->path as $page): ?>
658                                   <a href="<?php echo $page['url']; ?>"><?php echo htmlspecialchars($page['title'], ENT_COMPAT, "UTF-8"); ?></a> > 
659                           <?php endforeach; ?> <?php echo $this->page_title; ?>
660                           </div>
661                         </div>
662           <?php } ?>
663          <?php endif; ?> 
664                                 
665 <?php endif; ?><!--  end header template for ipad/tablets -->