(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();
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    
88   ";
89 $this->onload .= "});
90 ";
91 // open/close content menu - smartphones 
92 $this->onload .= "
93 jQuery('#content_link_phone').click(function(e) {
94   e.stopPropagation();
95   
96   jQuery('#content').slideToggle();
97   jQuery('#content-link-surround').toggleClass('content-closed');
98   jQuery('#content_link_phone').toggleClass('topnavlist-link-highlight');
99   
100   ";
101 $this->onload .= "});
102 ";
103
104 // open/close header navigational menu for smartphones
105 // jQuery('#topnavlist-link').toggleClass('topnavlist-link-highlight');
106 $this->onload .= "
107 jQuery(document).click(function () {
108 jQuery('#topnavlist').slideUp(600);}); 
109 jQuery('.topnavlist-link').click(function(e) {
110   e.stopPropagation();
111   jQuery('#topnavlist').slideToggle();
112  jQuery('#topnavlist-link').toggleClass('.topnavlist-link-highlight');
113 });
114 ";
115
116 // open/close header navigational menu for tablets
117
118 $this->onload .= "
119 jQuery(document).click(function () {
120 jQuery('#navigation-column').slideUp();}); 
121 jQuery('.topnavlist-link').click(function(e) {
122   e.stopPropagation();
123   jQuery('#navigation-column').slideToggle();
124     jQuery('#topnavlist-link').toggleClass('topnavlist-link-highlight');
125     jQuery('#topnavlist-link').toggleClass('triangle-isosceles');
126     jQuery('#topnavlist-link').toggleClass('top');
127 });
128 ";
129
130 //jQuery for Gmail dock-style "more" button that makes the subnavlist expand for more options
131 $this->onload .= "
132 jQuery(document).click(function () {
133 jQuery('.subnavlist-more').slideUp();}); 
134 jQuery('.more-button').click(function(e) {
135   e.stopPropagation();
136   jQuery('.subnavlist-more').slideToggle();
137 });
138 ";
139
140
141 //hide and show results on Browse Courses page
142
143 $this->onload .= "
144 jQuery('#results-hide-show-link').click(function(e) {
145   e.stopPropagation();
146     jQuery('#results-display').slideToggle();
147     jQuery(this).toggleClass('content-closed');
148     jQuery(this).preventDefault();
149   ";
150 $this->onload .= "});
151 ";
152
153 //hide and show results elsewhere (uses classes) 
154 $this->onload .= "
155 jQuery('.results-hide-show-link').click(function(e) {
156   e.stopPropagation();
157         jQuery(this).parent().next('.results-display').slideToggle(); 
158           jQuery(this).toggleClass('content-closed');
159   ";
160 $this->onload .= "});
161 ";
162         
163
164 // Hide the addressbar
165 $this->onload .= "
166 setTimeout(function() { window.scrollTo(0, 1) }, 100);
167 ";
168
169
170
171 ?>
172
173 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
174
175 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="<?php echo $this->lang_code; ?>"> 
176
177 <head>
178         <title><?php echo SITE_NAME; ?> : <?php echo $this->page_title; ?></title>
179         <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $this->lang_charset; ?>" />
180         <meta name="Generator" content="ATutor - Copyright 2005 by http://atutor.ca" />
181         <base href="<?php echo $this->content_base_href; ?>" />
182         <link rel="shortcut icon" href="<?php echo $this->base_path; ?>favicon.ico" type="image/x-icon" /> 
183         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/print.css" type="text/css" media="print" />
184         <!-- mobile fss -->     
185         <link rel="stylesheet" href="<?php echo $this->base_path; ?>jscripts/infusion/framework/fss/css/fss-mobile-layout.css" type="text/css"/>
186         <link rel="stylesheet" href="<?php echo $this->base_path; ?>jscripts/infusion/framework/fss/css/fss-mobile-theme-iphone.css" type="text/css"/>  
187         
188 <?php if ($this->is_mobile_device == true): ?>
189         <?php if ($this->mobile_device_type == ANDROID_DEVICE): ?>
190         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/android.css" type="text/css"/>
191         <meta name="viewport" content="user-scalable=no, width=device-width" />
192         <?php endif; ?>
193         <?php if ($this->mobile_device_type == IPOD_DEVICE || $this->mobile_device_type == IPHONE_DEVICE): ?>
194         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/iphone.css" type="text/css"/>
195         <meta name="viewport" content="user-scalable=no, width=device-width" />
196         <?php endif; ?>
197         <!-- Armin 25.08.2010: Detect BLACKBERRY_DEVICE and use blackberry.css-->
198         <?php if ($this->mobile_device_type == BLACKBERRY_DEVICE): ?>
199         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/blackberry.css" type="text/css"/>
200         <meta name="viewport" content="user-scalable=no, width=device-width" />
201         <?php endif; ?>
202         <?php if ($this->mobile_device_type == IPAD_DEVICE): ?>
203         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/tablet.css" type="text/css"/>
204         <meta name="viewport" content="width=768px, minimum-scale=1.0, maximum-scale=1.0" />
205         
206         <?php endif; ?>
207 <?php endif; ?>
208
209         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/forms.css" type="text/css" />
210                 
211         <!-- Fluid Infusion -->
212         <script src="<?php echo $this->base_path; ?>jscripts/infusion/InfusionAll.js" type="text/javascript"></script>
213         <script language="javascript" type="text/javascript">
214
215         //<!--
216         jQuery.noConflict();
217         //-->
218         </script>
219         <script src="<?php echo $this->base_path; ?>jscripts/ATutor.js" type="text/javascript"></script>   
220
221         
222 <?php echo $this->rtl_css; ?>
223 <?php if (isset($this->course_id) && $system_courses[$this->course_id]['rss']): ?>
224         <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" />
225         <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" />
226 <?php endif; ?>
227
228
229 <?php echo $this->custom_css; ?>
230 </head>
231
232
233 <?php if ($this->mobile_device_type != IPAD_DEVICE): ?><!--  smartphone theme only -->
234
235 <body onload="<?php echo $this->onload; ?>" class="fl-theme-iphone ui-mobile-viewport">
236
237 <div id="wrapper">
238 <div id="main">
239         <div id="header">
240
241                 <a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES); ?>#content">
242                 <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>          
243
244                 <div id="header-section-title">
245                         <!-- <?php if (isset($_SESSION['valid_user']) && $_SESSION['valid_user']): 
246                                         echo '<div id="site-name">'.stripslashes(SITE_NAME).'</div>'; 
247                                 endif; ?> --> 
248                         <h1 id="section-title"><?php echo $this->section_title; ?>
249                                 <?php if ((isset($this->course_id) && $this->course_id > 0) && ($_SESSION['enroll'] == AT_ENROLL_NO)) : ?> 
250                                 <!-- <small><a href="<?php echo $this->base_path; ?>enroll.php?course=<?php echo $this->course_id; ?>"><?php echo _AT('enroll_me'); ?></a></small>-->
251                                 <?php endif; ?>
252                                 </h1>
253                 </div>
254         </div> <!--  END HEADER -->
255
256
257         <div id="contentwrapper">
258
259         <!--  Note: ARIA roles cause XHTML validation errors because the XHTML DTD does not yet support ARIA. Use ARIA anyway -->
260
261         <div id="navigation-contentwrapper">
262         <div id="navigation-bar">
263                 <!--  this should be a button on its own  -->
264                         <?php if ($this->current_sub_level_page): ?>
265                         <div id="topnavlistcontainer" role="menu" aria-live="assertive" class="topnavlistcontainer" >
266                         <a class="navigation-bar-button topnavlist-link" id="topnavlist-link" href="javascript:void(0);" tabindex="1"><?php echo _AT('navigation'); ?></a>
267                                 <ul id="topnavlist"  class="fl-list-menu">
268                                         <?php $accesscounter = 0; //initialize ?>
269                                         <?php foreach ($this->top_level_pages as $page): ?>
270                                                 <?php ++$accesscounter; $accesscounter = ($accesscounter == 10 ? 0 : $accesscounter); ?>
271                                                 <?php $accesskey_text = ($accesscounter < 10 ? 'accesskey="'.$accesscounter.'"' : ''); ?>
272                                                 <?php $accesskey_title = ($accesscounter < 10 ? ' Alt+'.$accesscounter : ''); ?>
273                                                 <?php if ($page['url'] == $this->current_top_level_page): ?>
274                                                         <li role="menuitem"><a  href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title'];?>"><?php echo $page['title']; ?></a>  </li>
275                                                 <?php else: ?>
276                                                         <li role="menuitem"><a  href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title']; ?>"><?php echo $page['title']; ?></a></li>
277                                                 <?php endif; ?>
278                                 
279                                                 <?php $accesscounter = ($accesscounter == 0 ? 11 : $accesscounter); ?>
280                                         
281                                         <?php endforeach; ?>
282                                         <?php if(!$this->just_social): ?>
283                                         <li role="menuitem"><a href="<?php echo $this->base_path; ?>search.php"><?php echo _AT('search'); ?></a> </li>
284                                         <?php endif; ?> 
285                                 </ul>
286                         </div>
287                         <?php endif; ?>
288                 </div>
289
290                                 
291
292
293         <ul class="home-guide fl-tabs" id="home-guide">
294         <!--  CHECK TO SEE IF USER IS A STUDENT -->
295         <?php if($_SESSION['is_admin'] == 0 && $_SESSION['privileges'] == 0 ):?>
296                 <li><a  href="<?php echo $this->base_path; ?>users/index.php"><?php echo _AT("home"); ?></a></li> 
297         <?php endif;?>          
298         <!--  CHECK TO SEE IF USER IS AN ADMINISTRATOR -->
299         <?php //if($_SESSION['is_admin'] == 0 && $_SESSION['privileges'] == 1):
300                 if($_SESSION['is_admin'] == 0 && $_SESSION['privileges'] == AT_ADMIN_PRIV_ADMIN):?>
301                 <li><a href="<?php echo $this->base_path; ?>admin/index.php"><?php echo _AT("home"); ?></a></li> 
302         <?php endif;?>
303         <!--  CHECK TO SEE IF USER IS AN INSTRUCTOR -->
304         <?php if($_SESSION['is_admin'] == 1): ?>
305                 <li><a href="<?php echo $this->base_path; ?>users/index.php"><?php echo _AT("home"); ?></a></li> 
306         <?php endif;?>
307         
308         <?php if (isset($this->guide) && isset($_SESSION["course_id"]) && $this->guide && ($_SESSION["prefs"]["PREF_SHOW_GUIDE"] || $_SESSION["course_id"] == "-1")) : ?>
309                         <li>
310                         <div id="guide_box">
311                                         <!--    <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> -->
312                 
313                                   <a href="<?php echo $this->guide; ?>" id="guide" onclick="ATutor.poptastic('<?php echo $this->guide; ?>'); return false;" target="_new"><?php echo _AT("guide"); ?></a> 
314                         </div>
315                         </li>
316                         <?php endif; ?>
317                 </ul>
318         </div><!--  END navigation-contentwrapper -->
319         
320
321                 <div id="inner-contentwrapper" class="fl-container" >
322
323
324
325         <div id="contentcolumn">        
326                 
327
328                 <!-- the page title -->
329                 <a name="content" title="<?php echo _AT('content'); ?>"></a>
330                 <h2 class="page-title"><?php echo $this->page_title; ?></h2>
331         
332                 <?php global $msg; $msg->printAll(); $_base_href;?>
333                         <div id="content-sequence-links">
334                         <!-- ENSURE "content_link" DOESN'T APPEAR IF NOT LOGGED IN -->
335                 <?php if (isset($this->course_id) && $this->course_id > 0): ?>
336                         
337         <!-- Preserve untl a style for sequence-links is chosen.
338                         <ul class="sequence-links fl-tabs" id="sequence-links">
339                                 <?php if ($_SESSION["prefs"]["PREF_SHOW_NEXT_PREVIOUS_BUTTONS"]) { ?>
340                                         <?php if ($this->sequence_links['resume']): ?>
341                                                 <li>
342                                                         <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>
343                                                 </li>
344                                         <?php else:
345                                                 if ($this->sequence_links['previous']): ?>
346                                                 <li class="arrow back">
347                                                         <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>
348                                                 </li>
349                                         <?php endif;
350                                                 if ($this->sequence_links['next']): ?>
351                                                 <li class="arrow forward">
352                                                         <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>
353                                                 </li>
354                                         <?php endif; ?>
355                                 <?php endif; ?>
356                         <?php } ?>
357                                 &nbsp;
358                         </ul>  -->
359                 <?php endif; ?>
360         
361         
362         <?php if(isset($_SESSION['course_id']) && $_SESSION['course_id'] > 0): ?> 
363                 <!-- 
364                 <div id="content-link-container" role="navigation" aria-live="assertive" class="flc-screenNavigator-navbar ">
365                         <div id="content-link-surround"  class="content-link-surround" >
366                                 <a id="content_link_phone"  href="javascript:void(0);"><?php echo "Content"; ?></a>
367                         </div>
368                 </div>
369                  -->
370                  
371
372                 <div class="subnavcontain-contain" role="menu" aria-live="assertive">   
373                         <div class="subnavcontain">
374                                 <div class="rectangle">
375                                 <a id="content_link_phone"  href="javascript:void(0);" >View Course Content</a> 
376                                 <!-- <a href="#">content</a> -->
377                                 </div>
378                         </div>
379                                         
380                 <div id="content" style=" display: none; position: absolute; top: 9em; clear: left; clear: right; z-index: 1;">
381                         <?php $contentManager->printMainMenu(); ?>
382                                 <script language="javascript" type="text/javascript"></script>
383                 </div>
384
385         </div>
386
387
388                 
389                         <?php if (isset($this->course_id) && $this->course_id > 0): ?>
390                         
391                         <div class="subnavcontain2">
392                         <ul class="sequence-links" >
393                                 <?php if ($_SESSION["prefs"]["PREF_SHOW_NEXT_PREVIOUS_BUTTONS"]) { ?>
394                                         <?php if ($this->sequence_links['resume']): ?>
395                                                 
396                                                 <li class="rectangle2">
397                                                         <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>
398                                                 </li>
399                                                 
400                                         <?php else:
401                                                 if ($this->sequence_links['previous']): ?>
402                                         
403                                                 <li class="rectangle2 arrow back">
404                                                         <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>
405                                                 </li>
406                                                 
407                                         <?php endif;
408                                                 if ($this->sequence_links['next']): ?>
409                                                 
410                                                 <li class=" rectangle2 arrow forward">
411                                                         <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>
412                                                 </li>
413                                                 
414                                         <?php endif; ?>
415                                 <?php endif; ?>
416                         <?php } ?>
417                                 &nbsp;
418                                 </div>
419                         </ul>  
420                 <?php endif; ?>
421                         
422                         
423         </div>
424         <?php endif; ?> 
425 </div>
426                 
427                 <!-- the sub navigation -->
428                 <?php if (count($this->sub_level_pages) > 0): ?>
429                         <div id="subnavlistcontainer">
430                                 <div id="subnavbacktopage">
431                                 <?php if (isset($this->back_to_page)): ?>
432                                         <a href="<?php echo $this->back_to_page['url']; ?>">
433                                         <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;
434                                 <?php endif; ?>
435                                 </div>
436                                 <!-- id="subnavlist" -->
437                         <div class="subnavcontain-contain" role="menu" aria-live="assertive">   
438                                 <div class="subnavcontain">
439                                         <div class="rectangle">
440                                                 <?php $num_pages = count($this->sub_level_pages); ?>    
441                                                                 <?php for ($i=0; $i<$num_pages; $i++): ?>       
442                                                                         <?php if($i==0): ?>
443                                 
444                                                                         <a id="subnavlist-link" href="javascript:void(0);" style="display: block;">Topics in <?php echo $this->sub_level_pages[$i]['title']; ?></a>
445                                                                         <?php endif; ?>
446                                                                 <?php endfor;?>
447                                         </div>
448                                 </div>
449                                         <ul id="subnavlist" class="fl-list-menu" style="display: none;">
450                                         <?php $num_pages = count($this->sub_level_pages); ?>    
451                                         <?php for ($i=0; $i<$num_pages; $i++): ?>                               
452                                                 <?php if ($this->sub_level_pages[$i]['url'] == $this->current_sub_level_page): ?>
453                                                         <li><a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a></li> 
454                                                 <?php else: ?>
455                                                         <li><a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a></li>
456                                                 <?php endif; ?>
457                                         <?php if ($i < $num_pages-1): 
458                                                 echo " ";?>
459                                         <?php endif; ?>
460                                         <?php endfor; ?>
461                                         </ul>
462                                 </div>
463                         </div>  
464                 <?php endif; ?>
465                 <?php debug($this->sub_level_pages);?>
466         
467                 <!-- the sub navigation -->
468 <?php endif; ?>
469
470
471 <!--  end header template for iphone, android, blackberry -->
472 <?php if ($this->mobile_device_type == IPAD_DEVICE): ?><!-- start header template for ipad/tablets -->
473 <body onload="<?php echo $this->onload; ?>" class="fl-theme-iphone ui-mobile-viewport">
474
475 <div id="wrapper">
476 <div id="main">
477         <div id="header" role="header">
478
479         <div id="header-section-title">
480                         <!-- <?php if (isset($_SESSION['valid_user']) && $_SESSION['valid_user']): 
481                                         echo '<div id="site-name">'.stripslashes(SITE_NAME).'</div>'; 
482                                 endif; ?> --> 
483                         <h1 id="section-title"><?php echo $this->section_title; ?>
484                                 <?php if ((isset($this->course_id) && $this->course_id > 0) && ($_SESSION['enroll'] == AT_ENROLL_NO)) : ?> 
485                                 <!-- <small><a href="<?php echo $this->base_path; ?>enroll.php?course=<?php echo $this->course_id; ?>"><?php echo _AT('enroll_me'); ?></a></small>-->
486                                 <?php endif; ?>
487                                 </h1>
488                 </div>
489         <div id="navigation-contentwrapper" >
490                 
491                 
492         <ul class="home-guide fl-tabs" id="home-guide">
493         <!--  CHECK TO SEE IF USER IS A STUDENT -->
494         <?php if($_SESSION['is_admin'] == 0 && $_SESSION['privileges'] == 0 ):?>
495                 <li><a href="<?php echo $this->base_path; ?>users/index.php"><?php echo _AT("home"); ?></a></li> 
496         <?php endif;?>          
497         <!--  CHECK TO SEE IF USER IS AN ADMINISTRATOR -->
498         <?php //if($_SESSION['is_admin'] == 0 && $_SESSION['privileges'] == 1):
499                 if($_SESSION['is_admin'] == 0 && $_SESSION['privileges'] == AT_ADMIN_PRIV_ADMIN):?>
500                 <li><a href="<?php echo $this->base_path; ?>admin/index.php"><?php echo _AT("home"); ?></a></li> 
501         <?php endif;?>
502         <!--  CHECK TO SEE IF USER IS AN INSTRUCTOR -->
503         <?php if($_SESSION['is_admin'] == 1): ?>
504                 <li><a href="<?php echo $this->base_path; ?>users/index.php"><?php echo _AT("home"); ?></a></li> 
505         <?php endif;?>
506         
507         <?php if (isset($this->guide) && isset($_SESSION["course_id"]) && $this->guide && ($_SESSION["prefs"]["PREF_SHOW_GUIDE"] || $_SESSION["course_id"] == "-1")) : ?>
508                         <li>
509                         <div id="guide_box">
510                                         <!--    <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> -->
511                 
512                                   <a href="<?php echo $this->guide; ?>" id="guide" onclick="ATutor.poptastic('<?php echo $this->guide; ?>'); return false;" target="_new"><?php echo _AT("guide"); ?></a> 
513                         </div>
514                         </li>
515                         <?php endif; ?>
516                 </ul>
517         
518         <?php if (isset($this->course_id) && $this->course_id > 0): ?>
519                         
520         
521                 <ul class="sequence-links fl-tabs" id="sequence-links">
522                         <?php if ($_SESSION["prefs"]["PREF_SHOW_NEXT_PREVIOUS_BUTTONS"]) { ?>
523                                 <?php if ($this->sequence_links['resume']): ?>
524                                                 <li>
525                                                 <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>
526                                                 </li>
527                                 <?php else:
528                                         if ($this->sequence_links['previous']): ?>
529                                                 <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>
530                                                 </li>
531                                         <?php endif;
532                                         if ($this->sequence_links['next']): ?>
533                                                 <li class="arrow forward">
534                                                 <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>
535                                                 </li>
536                                         <?php endif; ?>
537                                 <?php endif; ?>
538                         <?php } ?>
539                                 &nbsp;
540                         </ul> <!-- end sequence-links -->
541                 <?php endif; ?>
542                 
543                 <?php if(isset($_SESSION['course_id']) && $_SESSION['course_id'] > 0): ?>       
544                 <div id="course-level-navigation">
545                 
546         
547                         
548                         <div id="content-link-container" role="navigation" aria-live="assertive" class="flc-screenNavigator-navbar ">
549                                 <a id="content_link" class="content_link_tablet content_link"  href="javascript:void(0);"><?php echo "Content";//_AT("content_navigation"); ?></a>      
550                         </div>  
551                 </div><!-- course-level navigation -->                          
552                                 <div id="content" style="display: none;">
553                                         <?php $contentManager->printMainMenu(); ?>
554                                         <script language="javascript" type="text/javascript"></script>
555                                 </div>
556                 
557                 
558                 <?php endif;?>
559         
560         
561                 <!--  this should be a button on its own  -->
562                         <?php if ($this->current_sub_level_page): ?>
563                         <div id="topnavlistcontainer" role="menu" aria-live="assertive" class="topnavlistcontainer fl-container" >
564                         <a class="navigation-bar-button topnavlist-link" id="topnavlist-link" href="javascript:void(0);" tabindex="1"><?php echo _AT('navigation'); ?></a>
565                         
566                                 <div id="navigation-column">
567                                 <!--  requires ARIA roles review -->
568                                 <!--  this should be a button on its own  -->
569                                 <?php if ($this->current_sub_level_page): ?>
570                                 <ul id="topnavlist-tablet"  class="fl-list-menu" role="menu">
571                                         <?php $accesscounter = 0; //initialize ?>
572                                         <?php foreach ($this->top_level_pages as $page): ?>
573                                                 <?php ++$accesscounter; $accesscounter = ($accesscounter == 10 ? 0 : $accesscounter); ?>
574                                                 <?php $accesskey_text = ($accesscounter < 10 ? 'accesskey="'.$accesscounter.'"' : ''); ?>
575                                                 <?php $accesskey_title = ($accesscounter < 10 ? ' Alt+'.$accesscounter : ''); ?>
576                                                 <?php if ($page['url'] == $this->current_top_level_page): ?>
577                                                         <!-- note bug http://issues.fluidproject.org/browse/FLUID-4313 makes class "flc-screenNavigator-backButton fl-link-hilight" not work -->
578                                                         <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>
579                                                 <?php else: ?>
580                                                         <li role="menuitem"><a  href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title']; ?>"><?php echo $page['title']; ?></a></li>
581                                                 <?php endif; ?>
582                                 
583                                                 <?php $accesscounter = ($accesscounter == 0 ? 11 : $accesscounter); ?>
584                                         
585                                         <?php endforeach; ?>
586                                          
587                                 </ul>
588                                 <?php endif; ?>
589                         </div>
590                         </div>
591                         <?php endif; ?>
592
593         
594
595         
596         </div>
597         </div> <!--  END HEADER -->
598
599 <?php if (count($this->sub_level_pages) > 0): ?>
600                                 <div id="subnavlistcontainer"> 
601                                         <div id="subnavbacktopage" >
602                                         <?php if (isset($this->back_to_page)): ?>
603                                                 <a href="<?php echo $this->back_to_page['url']; ?>">
604                                                 <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;
605                                         <?php endif; ?>
606                                         </div>
607                                 
608                                         <!-- Markup for a subnavlist styled like a Gmail dock. Clean up this code for redundancy but it works for now. -->
609                                         <!-- background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#B6C0C6), to(#F8FAFB));  -->
610                                         <ul id="subnavlist" style="text-align: center; border-bottom: 1px #B6C0C6 solid; background: #B6C0C6; ">
611                                         <?php $num_pages = count($this->sub_level_pages); ?>
612                                                 <?php for ($i=0; $i<$num_pages; $i++): ?>       
613                                                         
614                                                         <?php if($num_pages <= 5): ?>
615                                                                 <?php if($this->sub_level_pages[$i][url] == $this->current_sub_level_page): ?>
616                                                                 <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>
617                                                                 <?php else: ?> 
618                                                                 <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>
619                                                                 <?php endif; ?> 
620                                                         <?php endif; ?>
621                                                         <?php if($num_pages > 5): ?>
622                                                                 <?php if($i <= 5):?>
623                                                                         <?php if($this->sub_level_pages[$i][url] == $this->current_sub_level_page): ?>
624                                                                                 <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>
625                                                                         <?php else: ?> 
626                                                                                 <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>
627                                                                         <?php endif; ?> 
628                                                                 <?php endif;?>
629                                                                 <?php if($i== 6): ?>
630                                                                         <li class="more-button-surround" style="font-size: 14px; padding-left: .313em; padding-right: .313em"><a class="more-button" href="javascript:void(0);" tabindex="1">More</a></li>
631                                                                         <ul class="subnavlist-more">
632                                                                         <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>
633                                                                         
634                                                                 <?php endif;?>
635                                                                 <?php if($i > 6 && $i < $num_pages): ?>
636                                                                         <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>
637                                                                 <?php endif;?>
638                                                                 <?php if($i==$num_pages): ?>
639                                                                         <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>
640                                                                         </ul>
641                                                                 <?php endif; ?>
642                                                         <?php endif; ?>
643                                                 
644                                                 
645                                                         
646                                         <?php if ($i < $num_pages-1): 
647                                                 echo " ";?>
648                                         <?php endif; ?>
649                                         <?php endfor; ?>
650                                         </ul>
651
652                                 </div> <!--  end subnavlistcontainer -->                                
653                 <?php endif; ?> 
654                 
655
656
657         
658         <?php global $msg; $msg->printAll(); $_base_href;?>
659         
660                 
661         <!--  end course-level-naviagtion -->   
662                 
663         <div id="contentwrapper" class="fl-container" >
664
665
666 <?php endif; ?><!--  end header template for ipad/tablets -->