5b041ada360dd428c6f7044ebbaa2eb07805327a
[atutor.git] / docs / documentation / index.php
1 <?php
2 /************************************************************************/
3 /* ATutor                                                                                                                               */
4 /************************************************************************/
5 /* Copyright (c) 2002-2010                                              */
6 /* Inclusive Design Institute                                           */
7 /* http://atutor.ca                                                     */
8 /* This program is free software. You can redistribute it and/or        */
9 /* modify it under the terms of the GNU General Public License          */
10 /* as published by the Free Software Foundation.                        */
11 /************************************************************************/
12 // $Id: menu_pages.php 4799 2005-06-06 13:19:09Z heidi $
13
14
15 $parts = pathinfo($_SERVER['PHP_SELF']);
16 if (substr($parts['dirname'], -5) == 'admin') {
17         $section = 'admin';
18 } else if (substr($parts['dirname'], -10) == 'instructor') {
19         $section = 'instructor';
20 } else if (substr($parts['dirname'], -7) == 'general') {
21         $section = 'general';
22 } else {
23         header('Location: index/index.php');
24         exit;
25 }
26
27 if ( get_magic_quotes_gpc() == 1 ) {
28         $addslashes = 'my_add_null_slashes';
29 } else {
30         $addslashes = 'mysql_real_escape_string';
31 }
32
33 $req_lang = 'en';
34 if (!empty($_GET)) {
35         $req_lang = key($_GET);
36 }
37
38 $path = '../common/';
39 ?>
40 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
41 <html lang="en">
42         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
43         <title>ATutor Handbook</title>
44
45 <head>
46 <script type="text/javascript">
47
48 var i = 0;
49
50 function show2() {
51         var fs = document.getElementById('frameset1');
52         if (fs) {
53                 i += 5;
54                 if (i > 28) {
55                         i = 28;
56                 }
57                 fs.cols = i + '%, *';
58         }
59         if (i < 28) {
60                 window.setTimeout('show2()', 1);
61         }
62         return true;
63 }
64 function show() {
65         i = 0;
66         window.setTimeout('show2()', 1);
67         return true;
68 }
69
70 function hide2() {
71         var fs = document.getElementById('frameset1');
72         if (fs) {
73                 i -= 5;
74                 if (i < 0) {
75                         i =0;
76                 }
77                 fs.cols = i + '%, *';
78         }
79         if (i > 0) {
80                 window.setTimeout('hide2()', 1);
81         }
82         return false;
83 }
84
85 function hide() {
86         i= 28;
87         window.setTimeout('hide2()', 1);
88         return false;
89 }
90 </script>
91 </head>
92
93 <?php 
94 if (isset($_GET['p'])) {
95         include($section.'/pages.inc.php');
96         $body = htmlentities($_GET['p']);
97         $accessible_pages = $_pages;
98         if (!isset($accessible_pages[$body]))
99         {
100 ?>
101 <div style="width: 50%;
102         margin-left: auto;
103         margin-right: auto;
104         margin-top: 15px;
105         margin-bottom: 15px;
106         border: 1px solid #DD0000;
107         padding: 5px;
108         background-color: #F4DCDC;
109         color: #A50707;
110         background-color: #F4DCDC;
111         padding-left: 25px;
112         font-weight: bold;">
113         INACCESSIBLE PAGE
114 </div>
115
116 <?php exit;
117         }
118 } else {
119         $body = 'introduction.php';
120
121 ?>
122
123 <frameset rows="24,*">
124         <frame src="<?php echo $path; ?>frame_header.php?<?php echo $section; ?>&amp;<?php echo $req_lang; ?>" frameborder="0" name="header" title="header" scrolling="no" noresize="noresize">
125         <frameset cols="22%, *" id="frameset1">
126                 <frame frameborder="0" scrolling="auto" marginwidth="0" marginheight="0" src="<?php echo $path; ?>frame_toc.php?<?php echo $section; ?>&amp;<?php echo $req_lang; ?>" name="toc" id="toc" title="Table of Contents">
127                 <frame frameborder="0" src="<?php echo $body.'?'.$req_lang; ?>" name="body" title="Content">
128         </frameset>
129
130         <noframes>
131                 <h1>Administrator Documentation</h1>
132                 <p><a href="frame_toc.html">Table of Contents</a></p>
133          </noframes>
134 </frameset>
135
136 </html>