tagging as ATutor 1.5.4-release
[atutor.git] / documentation / common / frame_toc.php
1 <?php
2 require(dirname(__FILE__) . '/vitals.inc.php');
3
4 /**
5  * handbook toc printer
6  * prints an unordered html list representation of the multidimensional array.
7  * $pages    the array of items to print.
8  * $section  the directory name of the files.
9  */
10 function hb_print_toc($pages, $section) {
11         global $_pages, $req_lang;
12         echo '<ul>';
13         foreach ($pages as $page_key => $page_value) {
14                 echo '<li>';
15                 if (is_array($page_value)) {
16                         echo '<a href="../'.$section.'/'.$page_key.'?'.$req_lang.'" id="id'.$page_key.'" class="tree">'.$_pages[$page_key].'</a>';
17                         hb_print_toc($page_value, $section);
18                 } else {
19                         echo '<a href="../'.$section.'/'.$page_value.'?'.$req_lang.'" id="id'.$page_value.'" class="leaf">'.$_pages[$page_value].'</a>';
20                 }
21                 echo '</li>';
22         }
23         echo '</ul>';
24 }
25 ?>
26 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
27 <html lang="<?php if ($missing_lang) { echo 'en'; } else { echo $req_lang; } ?>">
28 <head>
29         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30         <title><?php get_text('handbook_toc'); ?></title>
31         <base target="body" />
32 <style type="text/css">
33 body { font-family: Verdana,Arial,sans-serif; font-size: x-small; margin: 0px; padding: 0px; background: #f4f4f4; margin-left: -5px; }
34 ul { list-style: none; padding-left: 0px; margin-left: -15px; }
35 li { margin-left: 19pt; padding-top: 2px; }
36 a { background-repeat: no-repeat; background-position: 0px 1px; padding-left: 12px; text-decoration: none; }
37 a.tree { background-image: url('folder.gif'); }
38 a.leaf { background-image: url('paper.gif'); }
39 a:link, a:visited { color: #006699; }
40 a:hover { color: #66AECC; }
41 </style>
42 <script type="text/javascript">
43 // <!--
44 function highlight(page) {
45         if (page == false) {
46                 if (parent.header.currentPage) {
47                         var toc = parent.toc.document.getElementById(parent.header.currentPage);
48                         toc.style.color = 'blue';
49                         toc.style.fontWeight = 'bold';
50                 }
51         } else {
52                 if (parent.header.currentPage) {
53                         var toc = parent.toc.document.getElementById(parent.header.currentPage);
54                         toc.style.color = '';
55                         toc.style.fontWeight = '';
56                 }
57         
58                 var toc = parent.toc.document.getElementById(page);
59                 toc.style.color = 'blue';
60                 toc.style.fontWeight = 'bold';
61                 parent.header.currentPage = page;
62         }
63 }
64 // -->
65 </script>
66 </head>
67 <body onload="highlight(false);">
68 <?php
69 require(dirname(__FILE__).'/../'.$section.'/pages.inc.php');
70 if (($req_lang != 'en') && (file_exists(dirname(__FILE__).'/../'.$section.'/'.$req_lang.'/pages.inc.php'))) {
71         require(dirname(__FILE__).'/../'.$section.'/'.$req_lang.'/pages.inc.php');
72 }
73 if ($section == 'admin'){
74         $pages = array(
75                                 'introduction.php',
76                                 'installation.php' => array(
77                                                                                         'requirements_recommendations.php',
78                                                                                         'new_installation.php',
79                                                                                         'upgrading.php'
80                                                                                         ),
81                                 'configuration.php' => array('my_account.php'),
82                                 'system_preferences.php' => array(
83                                                                                                 'default_preferences.php',
84                                                                                                 'languages.php',
85                                                                                                 'themes.php' => array(
86                                                                                                                                                 'importing_themes.php',
87                                                                                                                                                 'managing_existing_themes.php',
88                                                                                                                                                 'creating_themes.php'
89                                                                                                                                                 ),
90                                                                                                 'error_logging.php',
91                                                                                                 'feeds.php',
92                                                                                                 'google_key.php',
93                                                                                                 'cron_setup.php'
94                                                                                                 ),
95                                 'enrollment.php' => array(
96                                                                         'enrollment_privileges.php',
97                                                                         ),
98                                 'users.php' => array(
99                                                                                 'instructor_requests.php',
100                                                                                 'master_student_list.php',
101                                                                                 'email_users.php',
102                                                                                 'administrators.php'
103                                                                                 ),
104                                 'courses.php' => array(
105                                                                                 'forums.php',
106                                                                                 'creating_courses.php',
107                                                                                 'default_student_tools.php',
108                                                                                 'default_side_menu.php',
109                                                                                 'backups.php',
110                                                                                 'categories.php'
111                                                                                 ),
112                                 'modules.php',
113                                 'troubleshooting.php',
114                         );
115
116         hb_print_toc($pages, 'admin');
117
118 } else if ($section == 'instructor'){
119         $pages = array(
120                         'introduction.php' => array('creating_courses.php'),
121                         'announcements.php',
122                         'assignments.php',
123                         'backups.php' => array(
124                                                                         'creating_restoring.php',
125                                                                         'downloading_uploading.php',
126                                                                         'editing_deleting.php'
127                                                                         ),
128                         'chat.php',
129                         'content.php' => array(
130                                                                         'creating_editing_content.php' => array(
131                                                                                                                                                         'content_edit.php',
132                                                                                                                                                         'content_properties.php',
133                                                                                                                                                         'glossary_terms.php',
134                                                                                                                                                         'content_preview.php',
135                                                                                                                                                         'accessibility.php'
136                                                                                                                                                         ),
137                                                                         'content_packages.php',
138                                                                         'content_usage.php',
139                                                                         'tile_repository.php',
140                                                                         'scorm_packages.php'
141                                                                         ),
142                         'course_email.php',
143                         'enrollment.php' => array(
144                                                                         'enrollment_privileges.php',
145                                                                         'enrollment_alumni.php',
146                                                                         'enrollment_course_list.php'
147                                                                                 ),
148                         'file_manager.php' => array(
149                                                                         'managing_files_folders.php',
150                                                                         'extracting_zip_archives.php'
151                                                                         ),
152                         'forums.php' => array(
153                                                                         'managing_threads.php' => array('managing_posts.php')
154                                                                         ),
155                         'faq.php',
156                         'glossary.php',
157                         'groups.php',
158                         'links.php',
159                         'polls.php',
160                         'properties.php' => array('authenticated_access.php', 'delete_course.php'),
161                         'reading_list.php',
162                         'statistics.php',
163                         'student_tools.php' => array('side_menu.php'),
164                         'tests_surveys.php' => array(
165                                                                                         'creating_tests_surveys.php',
166                                                                                         'question_database.php' => array('creating_questions.php'),
167                                                                                         'question_categories.php',
168                                                                                         'edit_delete_tests.php',
169                                                                                         'preview.php',
170                                                                                         'add_questions.php',
171                                                                                         'student_submissions.php',
172                                                                                         'test_statistics.php'
173                                                                                         ),
174                         'feeds.php',
175                         'web_search.php',
176                         );
177         hb_print_toc($pages, 'instructor');
178 } else { 
179
180         $pages = array(
181                                 'introduction.php',
182                                 'login.php',
183                                 'register.php',
184                                 'browse_courses.php',
185                                 'password_reminder.php',
186                                 'my_start_page.php' => array(
187                                                                                                 'my_courses.php' => array('create_course.php'),
188                                                                                                 'profile.php',
189                                                                                                 'preferences.php',
190                                                                                                 'inbox.php'
191                                                                                                 ),
192                                 'inside_course.php' => array(
193                                                                                                 'export_content.php',
194                                                                                                 'packages.php',
195                                                                                                 'tile.php',
196                                                                                                 'file_storage.php'
197                                                                                                 )
198                         );
199         hb_print_toc($pages, 'general');
200 } ?>
201
202 </body>
203 </html>