made a copy
[atutor.git] / documentation / common / body_header.inc.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: body_header.inc.php 6230 2006-05-26 21:35:34Z greg $
14
15 require(dirname(__FILE__) . '/vitals.inc.php');
16
17 $missing_lang = FALSE;
18 if ($req_lang != 'en') {
19         $file_name = basename($_SERVER['PHP_SELF']);
20
21         $lang_file = $req_lang . '/' . $file_name;
22
23         if (file_exists($lang_file)) {
24                 header('Location: '.$lang_file.'?r');
25                 exit;
26         } else if (!isset($_GET['r'])) {
27                 $missing_lang = TRUE;
28                 $lang = 'en';
29         }
30 }
31
32 if (strpos(@ini_get('arg_separator.input'), ';') !== false) {
33         define('SEP', ';');
34 } else {
35         define('SEP', '&');
36 }
37
38 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
39 <html lang="<?php if ($missing_lang) { echo 'en'; } else { echo $req_lang; } ?>">
40 <head>
41         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
42         <title><?php get_text('atutor_documentation'); ?></title>
43         <link rel="stylesheet" href="<?php echo $rel_path; ?>common/styles.css" type="text/css" />
44 </head>
45
46 <body onload="doparent();">
47 <script type="text/javascript">
48 // <!--
49 function doparent() {
50         if (parent.toc && parent.toc.highlight) parent.toc.highlight('id<?php echo $this_page; ?>');
51 }
52 // -->
53 </script>
54 <?php
55 require(dirname(__FILE__).'/../'.$section.'/pages.inc.php');
56 if (($req_lang != 'en') && (file_exists(dirname(__FILE__).'/../'.$section.'/'.$req_lang.'/pages.inc.php'))) {
57         require(dirname(__FILE__).'/../'.$section.'/'.$req_lang.'/pages.inc.php');
58 }
59
60 while (current($_pages) !== FALSE) {
61         if (key($_pages) == $this_page) {
62                 next($_pages);
63                 $next_page = key($_pages);
64                 break;
65         }
66         $previous_page = key($_pages);
67         next($_pages);
68 }
69 ?>
70 <div class="seq">
71         <?php if (isset($previous_page)): ?>
72                 <?php get_text('previous_chapter'); ?>: <a href="<?php echo $rel_path; ?><?php echo $section; ?>/<?php echo $previous_page; ?>?<?php echo $req_lang; ?>" accesskey="," title="<?php echo $_pages[$previous_page]; ?> Alt+,"><?php echo $_pages[$previous_page]; ?></a><br />
73         <?php endif; ?>
74
75         <?php if (isset($next_page)): ?>
76                 <?php get_text('next_chapter'); ?>: <a href="<?php echo $rel_path; ?><?php echo $section; ?>/<?php echo $next_page; ?>?<?php echo $req_lang; ?>" accesskey="." title="<?php echo $_pages[$next_page]; ?> Alt+."><?php echo $_pages[$next_page]; ?></a>
77         <?php endif; ?>
78 </div>
79
80 <?php if ($missing_lang): ?>
81         <div style="margin: 20px auto; border: 1px solid #aaf; padding: 4px; text-align: center; background-color: #eef;">
82                 <?php get_text('page_not_translated'); ?>
83         </div>
84 <?php endif; ?>
85
86 <?php if (isset($_GET['noted'])): ?>
87         <div style="margin: 20px auto; border: 1px solid #aaf; padding: 4px; text-align: center; background-color: #eef;">
88                 <?php get_text('note_added'); ?>
89         </div>
90 <?php endif; ?>