ATutor 2.0
[atutor.git] / themes / default15 / include / header.tmpl.php
1 <?php
2 if (!defined('AT_INCLUDE_PATH')) { exit; }
3
4 /* available header.tmpl.php variables:
5  * $this->lang_code                     the ISO language code
6  * SITE_NAME                            the site name from the config file
7  * $this->page_title            the name of this page to use in the <title>
8  * $this->lang_charset          the ISO language character set
9  * $this->content_base_href     the <base href> to use for this page
10  * $this->base_path                     the absolute path to this atutor installation
11  * $this->rtl_css                       if set, the path to the RTL style sheet
12  * $this->banner_style          -deprecated-
13  * $this->theme                         the directory name of the current theme
14  * $this->base_href                     the full url to this atutor installation
15  * $this->onload                        javascript onload() calls
16  * $this->img                           the absolute path to this theme's images/ directory
17  * $this->sequence_links        associative array of 'previous', 'next', and/or 'resume' links
18  * $this->path                          associative array of path to this page: aka bread crumbs
19  * $this->rel_url                       the relative url from the installation root to this page
20  * $this->nav_courses           associative array of this user's enrolled courses
21  * $this->section_title         the title of this section (course, public, admin, my start page)
22  * $this->top_level_pages       associative array of the top level navigation
23  * $this->current_top_level_page        the full path to the current top level page with file name
24  * $this->sub_level_pages                       associate array of sub level navigation
25  * $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)
26  * $this->current_sub_level_page        the full path to the current sub level page with file name
27  * $this->guide                         the full path and file name to the guide page
28  * ======================================
29  * top_level_pages           array(array('url', 'title'))     the top level pages. ATutor default creates tabs.
30  * section_title             string                           the name of the current section. either name of the course, administration, my start page, etc.
31  * page_title                string                           the title of the current page.
32  * path                      array(array('url', 'title'))     the path to the current page.
33  * back_to_page              array('url', 'title')            the link back to the part of the current page, if needed.
34  * current_top_level_page    string                           full url to the current top level page in "top_leve_pages"
35  * current_sub_level_page    string                           full url to the current sub level page in the "sub_level_pages"
36  * sub_level_pages           array(array('url', 'title'))     the sub level pages.
37  */
38
39 // will have to be moved to the header.inc.php
40 global $system_courses;
41
42 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
43 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="<?php echo $this->lang_code; ?>">
44 <head>
45         <title><?php echo SITE_NAME; ?> : <?php echo $this->page_title; ?></title>
46         <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $this->lang_charset; ?>" />
47         <meta name="Generator" content="ATutor - Copyright 2007 by http://atutor.ca" />
48         <base href="<?php echo $this->content_base_href; ?>" />
49         <link rel="shortcut icon" href="<?php echo $this->base_path; ?>favicon.ico" type="image/x-icon" />
50         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/print.css" type="text/css" media="print" />
51         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/styles.css" type="text/css" />
52         <!--[if IE]>
53           <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/ie_styles.css" type="text/css" />
54         <![endif]-->
55         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/forms.css" type="text/css" />
56         <?php echo $this->rtl_css; ?>
57         <?php if ($system_courses[$_SESSION['course_id']]['rss']): ?>
58         <link rel="alternate" type="application/rss+xml" title="<?php echo SITE_NAME; ?> - RSS 2.0" href="<?php echo $this->base_path; ?>get_rss.php?<?php echo $_SESSION['course_id']; ?>-2" />
59         <link rel="alternate" type="application/rss+xml" title="<?php echo SITE_NAME; ?> - RSS 1.0" href="<?php echo $this->base_path; ?>get_rss.php?<?php echo $_SESSION['course_id']; ?>-1" />
60         <?php endif; ?>
61         <script src="<?php echo $this->base_path; ?>jscripts/infusion/InfusionAll.js" type="text/javascript"></script>
62     <script src="<?php echo $this->base_path; ?>jscripts/ATutor.js" type="text/javascript"></script>   
63     <script language="javascript" type="text/javascript">
64     //<!--
65     jQuery.noConflict();
66     //-->
67     </script>
68     <?php echo $this->custom_css; ?>
69     <style id="pref_style" type="text/css"></style> 
70 </head>
71 <body onload="<?php echo $this->onload; ?>">
72 <div id="member-links" style="float: right;">
73         <!-- hidden direct link to content -->
74         <a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES); ?>#content" style="border: 0px;" accesskey="c"><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>
75         <a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES); ?>#menu" style="border: 0px;" 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>
76
77         <?php if ($_SESSION['is_super_admin']): ?>
78                 <a href="<?php echo $this->base_path; ?>bounce.php?admin"><?php echo _AT('return_to_admin_area'); ?></a> | 
79         <?php endif; ?>
80
81         <?php if ($_SESSION['valid_user']): ?>
82                 <img src="<?php echo $this->img;?>user-star.gif" style="vertical-align: middle;" class="img-size-star" alt="" /><strong><?php echo get_display_name($_SESSION['member_id']); ?></strong>  |
83                 <?php if ($_SESSION['course_id'] > -1): ?>
84                         <?php if (get_num_new_messages()): ?>
85                                 <strong><a href="<?php echo $this->base_path; ?>inbox/index.php"><?php echo _AT('inbox'); ?> - <?php echo get_num_new_messages(); ?></a></strong> | 
86                         <?php else: ?>
87                                 <a href="<?php echo $this->base_path; ?>inbox/index.php"><?php echo _AT('inbox'); ?></a> | 
88                         <?php endif; ?>
89                 <?php endif; ?>
90                 <a href="<?php echo $this->base_path; ?>search.php"><?php echo _AT('search'); ?></a> |
91                 <a href="<?php echo $this->base_path; ?>help/index.php"><?php echo _AT('help'); ?></a> |
92                 <a href="<?php echo $this->base_path; ?>logout.php"><?php echo _AT('logout'); ?></a>
93         <?php elseif ($_SESSION['course_id'] == -1): ?>
94                 <img src="<?php echo $this->img;?>user-star.gif" style="vertical-align: middle;" class="img-size-star" alt="" /><strong><?php echo get_display_name($_SESSION['member_id']); ?></strong>  |
95                 <a href="<?php echo $this->base_path; ?>search.php"><?php echo _AT('search'); ?></a> |
96                 <a href="<?php echo $this->base_path; ?>help/index.php"><?php echo _AT('help'); ?></a> |
97                 <a href="<?php echo $this->base_path; ?>logout.php"><?php echo _AT('logout'); ?></a>
98         <?php else: ?>
99                 <a href="<?php echo $this->base_path; ?>browse.php"><?php echo _AT('browse_courses'); ?></a> | 
100                 <a href="<?php echo $this->base_path; ?>login.php?course=<?php echo $_SESSION['course_id']; ?>"><?php echo _AT('login'); ?></a> | 
101                 <a href="<?php echo $this->base_path; ?>search.php"><?php echo _AT('search'); ?></a> | 
102                 <a href="<?php echo $this->base_path; ?>help/index.php"><?php echo _AT('help'); ?></a>
103         <?php endif; ?>
104 </div>
105
106 <div style="float: right;">
107         <?php if (isset($_SESSION['member_id']) && $_SESSION['member_id']): ?>
108                 <!-- start the jump menu -->
109                 <?php if (empty($_GET)): ?>
110                         <form method="post" action="<?php echo $this->base_path; ?>bounce.php?p=<?php echo urlencode($this->rel_url); ?>" target="_top">
111                 <?php else: ?>
112                         <form method="post" action="<?php echo $this->base_path; ?>bounce.php" target="_top">
113                 <?php endif; ?>
114                 <label for="jumpmenu" accesskey="j"></label>
115                 <select name="course" id="jumpmenu" title="<?php echo _AT('jump'); ?>:  Alt-j">                                                 
116                         <option value="0" id="start-page"><?php echo _AT('my_start_page'); ?></option>
117                         <optgroup label="<?php echo _AT('courses_below'); ?>">
118                                 <?php foreach ($this->nav_courses as $this_course_id => $this_course_title): ?>
119                                         <option value="<?php echo $this_course_id; ?>"><?php echo $this_course_title; ?></option>
120                                 <?php endforeach; ?>
121                         </optgroup>
122                 </select> <input type="submit" name="jump" value="<?php echo _AT('jump'); ?>" id="jump-button" /></form>
123                 <!-- /end the jump menu -->
124         <?php endif; ?>
125 </div>
126
127 <?php if ($_SESSION["prefs"]["PREF_SHOW_BREAD_CRUMBS"]) { ?>
128 <div id="breadcrumbs">
129         <span style="white-space:nowrap;font-size:smaller;padding-top:150px;">
130         <?php foreach ($this->path as $page): ?>
131                 <a href="<?php echo $page['url']; ?>" title="<?php echo _AT('back_to').' '.$page['title']; ?>"><?php echo htmlspecialchars($page['title'], ENT_COMPAT, "UTF-8"); ?></a> &raquo; 
132         <?php endforeach; ?> <?php echo $this->page_title; ?>
133 </div>
134 <?php } ?>
135
136 <div class="header">
137         <!-- section title -->  
138         <?php if ($_SESSION['valid_user']): 
139                 echo '<span style="font-size:small;font-weight:bold;padding-left:5px;">'.stripslashes(SITE_NAME).'</span>'; 
140         else:
141                 echo '<br />';  
142         endif; ?>
143         <h1><?php echo $this->section_title; ?>
144         <?php if (($_SESSION['course_id'] > 0) && ($_SESSION['enroll'] == AT_ENROLL_NO)) : ?>
145                 - <small><a href="<?php echo $this->base_path; ?>enroll.php?course=<?php echo $_SESSION['course_id']; ?>"><?php echo _AT('enroll_me'); ?></a></small>
146         <?php endif; ?></h1>
147
148         <div id="topnavlistcontainer">
149                 <!-- the main navigation. in our case, tabs -->
150                 <ul id="topnavlist">
151                         <?php foreach ($this->top_level_pages as $page): ?>
152                                 <?php ++$accesscounter; $accesscounter = ($accesscounter == 10 ? 0 : $accesscounter); ?>
153                                 <?php $accesskey_text = ($accesscounter < 10 ? 'accesskey="'.$accesscounter.'"' : ''); ?>
154                                 <?php $accesskey_title = ($accesscounter < 10 ? ' Alt+'.$accesscounter : ''); ?>
155                                 <?php if ($page['url'] == $this->current_top_level_page): ?>
156                                         <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>
157                                 <?php else: ?>
158                                         <li><a href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title'] . $accesskey_title; ?>"><?php echo $page['title']; ?></a></li>
159                                 <?php endif; ?>
160                                 <?php $accesscounter = ($accesscounter == 0 ? 11 : $accesscounter); ?>
161                         <?php endforeach; ?>
162                 </ul>
163         </div>
164 </div>
165
166 <!-- the sub navigation -->
167 <div style="text-align: right; padding-top: 5px; padding-right: 5px;"><small><?php echo $this->current_date; ?></small></div>
168 <?php if ($this->sub_level_pages && !(count($this->sub_level_pages) == 1 && $this->sub_level_pages[0]['url'] == $this->current_sub_level_page)): ?>
169         <div id="sub-navigation">
170                 <?php if (isset($this->back_to_page)): ?>
171                         <a href="<?php echo $this->back_to_page['url']; ?>" id="back-to"><?php echo _AT('back_to'); ?> <?php echo $this->back_to_page['title']; ?></a> | 
172                 <?php endif; ?>
173
174                 <?php $num_pages = count($this->sub_level_pages); ?>
175                 <?php for($i=0; $i<$num_pages; $i++): ?>
176                         <?php if ($this->sub_level_pages[$i]['url'] == $this->current_sub_level_page): ?>
177                                 <strong><?php echo $this->sub_level_pages[$i]['title']; ?></strong>
178                         <?php else: ?>
179                                 <a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a>
180                         <?php endif; ?>
181                         <?php if ($i < $num_pages-1): ?>
182                                 | 
183                         <?php endif; ?>
184                 <?php endfor; ?>
185         </div>
186 <?php else: ?>
187         <div id="sub-navigation">
188                 &nbsp;
189         </div>
190 <?php endif; ?>
191
192 <table align="center" border="0" cellpadding="0" cellspacing="0" width="99%">
193         <tr>
194                 <?php if ($_SESSION['course_id'] > 0): ?>
195                         <td valign="top" width="100%">
196                 <?php else: ?>
197                         <td valign="top" width="100%" colspan="2">
198                 <?php endif; ?>
199
200 <!-- the page title -->
201         <div style="text-align: right; padding-bottom: 10px; padding-right: 10px; float: right; margin-top: 10px; padding-right: 5px;">
202                 <?php if ($this->guide && ($_SESSION["prefs"]["PREF_SHOW_GUIDE"] || $_SESSION["course_id"] == "-1")): ?>
203                         <a href="<?php echo $this->guide; ?>" id="guide" onclick="ATutor.poptastic('<?php echo $this->guide; ?>'); return false;" target="_new"><em><?php echo $this->page_title; ?></em></a>
204                 <?php endif; ?>
205                 <?php if ($_SESSION['course_id'] > 0 && $system_courses[$_SESSION['course_id']]['side_menu']): ?>
206         <div id="menutoggle">
207             <a accesskey="n"><img src="" title="" alt="" /></a>
208         </div>
209                 <?php endif; ?>
210         </div>
211
212         <div style="float:right;padding-top:7px;" id="sequence-links">
213         <?php if ($_SESSION["prefs"]["PREF_SHOW_NEXT_PREVIOUS_BUTTONS"]) { ?>
214                 <?php if ($this->sequence_links['resume']): ?>
215                                 <a style="color:white;" href="<?php echo $this->sequence_links['resume']['url']; ?>" accesskey="."><img src="<?php echo $this->img; ?>resume.gif" 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>
216                 <?php else:
217                         if ($this->sequence_links['previous']): ?>
218                                 <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->img; ?>previous.gif" border="0" alt="<?php echo _AT('previous_topic').': '. $this->sequence_links['previous']['title']; ?> Alt+," class="img-size-ascdesc" /></a>
219                         <?php endif;
220                         if ($this->sequence_links['next']): ?>
221                                 <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->img; ?>next.gif" border="0" alt="<?php echo _AT('next_topic').': '.$this->sequence_links['next']['title']; ?> Alt+." class="img-size-ascdesc" /></a>
222                         <?php endif; ?>
223                 <?php endif; ?>
224         <?php } ?>
225                 &nbsp;
226         </div>
227
228         <h2 class="page-title"><?php echo htmlspecialchars($this->page_title, ENT_COMPAT, "UTF-8"); ?></h2>
229
230 <a name="content"></a>
231 <?php global $msg; $msg->printAll(); ?>