PageRenderTime 53ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 1ms

/themes/default15/include/header.tmpl.php

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