(no commit message)
[atutor.git] / themes / default_classic / include / header.tmpl.php
1 <?php
2 if (!defined('AT_INCLUDE_PATH')) { exit; }
3
4 global $system_courses, $_custom_css, $_base_path;
5
6 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7 <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $this->lang_code; ?>">
8 <head>
9         <title><?php echo SITE_NAME; ?> : <?php echo $this->page_title; ?></title>
10         <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $this->lang_charset; ?>" />
11         <meta name="Generator" content="ATutor - Copyright 2005 by http://atutor.ca" />
12         <base href="<?php echo $this->content_base_href; ?>" />
13         <link rel="shortcut icon" href="<?php echo $this->base_path; ?>favicon.ico" type="image/x-icon" />
14         <link rel="stylesheet" href="<?php echo $this->base_path; ?>themes/default/print.css" type="text/css" media="print" />
15         <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/styles.css" type="text/css" />
16         <link rel="stylesheet" href="<?php echo $this->base_path; ?>themes/default/forms.css" type="text/css" />
17
18         <!--[if IE]>
19           <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/ie_styles.css" type="text/css" />
20         <![endif]-->
21
22
23         <style type="text/css"><?php echo $this->banner_style; ?></style>
24         <?php if ($system_courses[$this->course_id]['rss']): ?>
25         <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" />
26         <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" />
27         <?php endif; ?>
28         <script src="<?php echo $this->base_path; ?>jscripts/infusion/InfusionAll.js" type="text/javascript"></script>
29         <script src="<?php echo $this->base_path; ?>jscripts/infusion/jquery.autoHeight.js" type="text/javascript"></script>
30     <script language="javascript" type="text/javascript">
31     //<!--
32     jQuery.noConflict();
33     //-->
34     </script>
35     <script src="<?php echo $this->base_path; ?>jscripts/ATutor.js" type="text/javascript"></script>   
36     <?php echo $this->custom_css; ?>
37     <?php echo $this->rtl_css; ?>
38     <style id="pref_style" type="text/css"></style> 
39 </head>
40 <body onload="<?php echo $this->onload; ?>">
41 <div class="bypass">
42         <!-- hidden direct link to content -->
43         <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>
44 </div>
45 <div id="member-links">
46         <?php if ($_SESSION['is_super_admin']): ?>
47                 <a href="<?php echo $this->base_path; ?>bounce.php?admin"><?php echo _AT('return_to_admin_area'); ?></a> | 
48         <?php endif; ?>
49         <div class="logout">
50         <?php if ($_SESSION['valid_user']): ?>
51
52         <?php if (isset($this->course_id) && ($this->course_id >= 0)): ?>
53                 <!-- start the jump menu -->
54                 <?php if (empty($_GET)): ?>
55                         <form method="post" action="<?php echo $this->base_path; ?>bounce.php?p=<?php echo urlencode($this->rel_url); ?>" target="_top">
56                 <?php else: ?>
57                         <form method="post" action="<?php echo $this->base_path; ?>bounce.php" target="_top">
58                 <?php endif; ?>
59                 <label for="jumpmenu" accesskey="j"></label>
60                         <select name="course" id="jumpmenu" title="<?php echo _AT('jump'); ?>:  Alt-j">                                                 
61                                 <option value="0" id="start-page"><?php echo _AT('my_start_page'); ?></option>
62                                 <optgroup label="<?php echo _AT('courses_below'); ?>">
63                                         <?php foreach ($this->nav_courses as $this_course_id => $this_course_title): ?>
64                                                 <option value="<?php echo $this_course_id; ?>"><?php echo $this_course_title; ?></option>
65                                         <?php endforeach; ?>
66                                 </optgroup>
67                         </select> <input type="submit" name="jump" value="<?php echo _AT('jump'); ?>" id="jump-button" /></form>
68                 <!-- /end the jump menu -->
69         <?php endif; ?>
70
71 <?php     if (!admin_authenticate(AT_ADMIN_PRIV_ADMIN, AT_PRIV_RETURN) && $last_path_part != 'preferences.php') {?>
72                     <a class="pref_wiz_launcher"><img border="0" alt="<?php echo _AT('preferences').' - '._AT('new_window'); ?>" src="<?php echo $this->base_href; ?>images/wand.png" /></a> |
73                     <?php } ?> 
74                 <span style="font-weight:bold;"><?php echo get_display_name($_SESSION['member_id']); ?></span>  | 
75
76                 <?php if ($this->course_id > -1): ?>
77                         <?php if (get_num_new_messages()): ?>
78                                 <a href="<?php echo $this->base_path; ?>inbox/index.php"><?php echo _AT('inbox'); ?> - <?php echo get_num_new_messages(); ?></a> | 
79                         <?php else: ?>
80                                 <a href="<?php echo $this->base_path; ?>inbox/index.php"><?php echo _AT('inbox'); ?></a> | 
81                         <?php endif; ?>
82                 <?php endif; ?>
83                 <a href="<?php echo $this->base_path; ?>search.php"><?php echo _AT('search'); ?></a> | 
84                 <a href="<?php echo $this->base_path; ?>help/index.php"><?php echo _AT('help'); ?></a> |
85                 <a href="<?php echo $this->base_path; ?>logout.php"><?php echo _AT('logout'); ?></a>
86         <?php else: ?>
87                 <a href="<?php echo $this->base_path; ?>login.php?course=<?php echo $this->course_id; ?>"><?php echo _AT('login'); ?></a> | 
88                 <a href="<?php echo $this->base_path; ?>search.php"><?php echo _AT('search'); ?></a> | 
89                 <a href="<?php echo $this->base_path; ?>help/index.php"><?php echo _AT('help'); ?></a>
90         <?php endif; ?>
91         </div><!-- end logout div -->
92
93 <?php if ($_SESSION["prefs"]["PREF_SHOW_BREAD_CRUMBS"]) { ?>
94 <!-- the bread crumbs -->
95 <div id="breadcrumbs">
96         <?php foreach ($this->path as $page): ?>
97                 <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; 
98         <?php endforeach; ?> <?php echo $this->page_title; ?>
99
100         <?php } ?>
101   
102    </div><!-- end member-links div -->
103 </div><!-- end bredcrumbs div -->
104 <div class="header">
105     <?php if ($_SESSION['valid_user']) : 
106             echo '<span style="font-size:small;font-weight:bold;padding-left:5px;">'.stripslashes(SITE_NAME).'</span>'; 
107     endif; ?>
108     <h1 class="section-title">
109
110             <!-- section title -->
111             <?php echo $this->section_title; ?>
112             <?php if (($this->course_id > 0) && ($_SESSION['enroll'] == AT_ENROLL_NO)) : ?>
113                     - <a href="<?php echo $this->base_path; ?>enroll.php?course=<?php echo $this->course_id; ?>"><?php echo _AT('enroll_me'); ?></a></small>
114             <?php endif; ?></h1>
115
116 </div>
117
118 <div id="topnavlistcontainer">
119 <!-- the main navigation. in our case, tabs -->
120         <ul id="topnavlist">
121                 <?php foreach ($this->top_level_pages as $page): ?>
122                         <?php ++$accesscounter; $accesscounter = ($accesscounter == 10 ? 0 : $accesscounter); ?>
123                         <?php $accesskey_text = ($accesscounter < 10 ? 'accesskey="'.$accesscounter.'"' : ''); ?>
124                         <?php $accesskey_title = ($accesscounter < 10 ? ' Alt+'.$accesscounter : ''); ?>
125                         <?php if ($page['url'] == $this->current_top_level_page): ?>
126                                 <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>
127                         <?php else: ?>
128                                 <li><a href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title'] . $accesskey_title; ?>"><?php echo $page['title']; ?></a></li>
129                         <?php endif; ?>
130                         <?php $accesscounter = ($accesscounter == 0 ? 11 : $accesscounter); ?>
131                 <?php endforeach; ?>
132         </ul>
133 </div>
134
135
136 <!-- the sub navigation -->
137 <div style="text-align: right; padding-top: 5px; padding-right: 5px; float:right"><small><?php echo $this->current_date; ?></small></div>
138 <?php if ($this->sub_level_pages): ?>
139         <div id="sub-navigation">
140                 <?php if (isset($this->back_to_page)): ?>
141                         <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> | 
142                 <?php endif; ?>
143
144                 <?php $num_pages = count($this->sub_level_pages); ?>
145                 <?php for($i=0; $i<$num_pages; $i++): ?>
146                         <?php if ($this->sub_level_pages[$i]['url'] == $this->current_sub_level_page): ?>
147                                 <strong><?php echo $this->sub_level_pages[$i]['title']; ?></strong>
148                         <?php else: ?>
149                                 <a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a>
150                         <?php endif; ?>
151                         <?php if ($i < $num_pages-1): ?>
152                                 |
153                         <?php endif; ?>
154                 <?php endfor; ?>
155         </div>
156 <?php else: ?>
157         <div id="sub-navigation">
158                 &nbsp;
159         </div>
160 <?php endif; ?>
161
162 <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
163         <tr>
164                 <?php if ($this->course_id > 0): ?>
165                         <td valign="top" width="100%">
166                 <?php else: ?>
167                         <td valign="top" width="100%" colspan="2">
168                 <?php endif; ?>
169
170 <!-- the page title -->
171
172         <div  id="sequence-links">
173         <?php if ($_SESSION["prefs"]["PREF_SHOW_NEXT_PREVIOUS_BUTTONS"]) { ?>
174                 <?php if ($this->sequence_links['resume']): ?>
175                                 <a style="color:white;" href="<?php echo $this->sequence_links['resume']['url']; ?>" accesskey="."><img src="<?php echo $this->base_href; ?>themes/default_classic/images/resume.png" border="0" title="<?php echo _AT('resume').': '.$this->sequence_links['resume']['title']; ?> Alt+." alt="<?php echo $this->sequence_links['resume']['title']; ?> Alt+." /></a>
176                 <?php else:
177                         if ($this->sequence_links['previous']): ?>
178                                 <a href="<?php echo $this->sequence_links['previous']['url']; ?>" title="<?php echo _AT('previous_topic').': '. $this->sequence_links['previous']['title']; ?> Alt+," accesskey=","><img src="<?php echo $this->base_href; ?>themes/default_classic/images/previous.png" border="0" alt="<?php echo _AT('previous_topic').': '. $this->sequence_links['previous']['title']; ?> Alt+,"/></a>
179                         <?php endif;
180                         if ($this->sequence_links['next']): ?>
181                                 <a href="<?php echo $this->sequence_links['next']['url']; ?>" title="<?php echo _AT('next_topic').': '.$this->sequence_links['next']['title']; ?> Alt+." accesskey="."><img src="<?php echo $this->base_href; ?>themes/default_classic/images/next.png" border="0" alt="<?php echo _AT('next_topic').': '.$this->sequence_links['next']['title']; ?> Alt+."  /></a>
182                         <?php endif; ?>
183                 <?php endif; ?>
184         <?php } ?>
185                 &nbsp;
186         </div>
187
188                 <?php if ($this->guide && ($_SESSION["prefs"]["PREF_SHOW_GUIDE"] || $_SESSION["course_id"] == "-1")): ?>
189         <div id="guide_box">
190                         <a href="<?php echo $this->guide; ?>" id="guide" onclick="ATutor.poptastic('<?php echo $this->guide; ?>'); return false;" target="_new"><strong><?php echo $this->page_title; ?></strong></a>
191                 </div>
192           <?php endif; ?>
193
194
195
196
197       <?php if ($this->shortcuts): ?>
198       <div id="shortcuts">
199               <ul>
200                       <?php foreach ($this->shortcuts as $link): ?>
201                               <li><a href="<?php echo $link['url']; ?>"><img src="<?php echo $link['icon']; ?>" alt="<?php echo $link['title']; ?>"  title="<?php echo $link['title']; ?>" class="shortcut_icon"/><!-- <?php echo $link['title']; ?> --></a></li>
202                       <?php endforeach; ?>
203               </ul>
204       </div>
205       <?php endif; ?>
206         <h2 class="page-title"><?php echo htmlspecialchars($this->page_title, ENT_COMPAT, "UTF-8"); ?></h2>
207                 <?php if ($this->course_id > 0): ?>
208             <div id="menutoggle">
209                 <a accesskey="n"><img src="" title="" alt="" /></a>
210             </div>
211                 <?php endif; ?>
212
213 <a name="content"></a>
214 <?php global $msg; $msg->printAll(); ?>