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