move code up one directory
[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                                                                                                 'auto_enroll.php',
86                                                                                                 'themes.php' => array(
87                                                                                                                                                 'importing_themes.php',
88                                                                                                                                                 'managing_existing_themes.php',
89                                                                                                                                                 'creating_themes.php'
90                                                                                                                                                 ),
91                                                                                                 'error_logging.php',
92                                                                                                 'feeds.php',
93                                                                                                 'google_key.php',
94                                                                                                 'cron_setup.php'
95                                                                                                 ),
96                                 'enrollment.php' => array(
97                                                                         'enrollment_privileges.php',
98                                                                         ),
99                                 'users.php' => array(
100                                                                                 'instructor_requests.php',
101                                                                                 'master_student_list.php',
102                                                                                 'email_users.php',
103                                                                                 'administrators.php'
104                                                                                 ),
105                                 'courses.php' => array(
106                                                                                 'forums.php',
107                                                                                 'creating_courses.php',
108                                                                                 'default_student_tools.php',
109                                                                                 'default_side_menu.php',
110                                                                                 'backups.php',
111                                                                                 'categories.php'
112                                                                                 ),
113                                 'modules.php',
114                                 'basiclti_external_tools.php',
115                                 'patcher.php' => array(
116                                                                                 'create_patches.php'
117                                                                                 ),
118                                 'troubleshooting.php',
119                         );
120
121         hb_print_toc($pages, 'admin');
122
123 } else if ($section == 'instructor'){
124         $pages = array(
125                         'introduction.php' => array('creating_courses.php','student_tools.php', 'fha_student_tools.php','side_menu.php'),
126                         'announcements.php',
127                         'assignments.php',
128                         'backups.php' => array(
129                                                                         'creating_restoring.php',
130                                                                         'downloading_uploading.php',
131                                                                         'editing_deleting.php'
132                                                                         ),
133                         'chat.php',
134                         'content.php' => array(
135                                                                         'creating_editing_content.php' => array(
136                                 'content_edit.php',
137                                 'content_properties.php',                                                               'glossary_terms.php',
138                                 'content_preview.php',
139                                 'arrange_content.php',
140                                 'content_alternatives.php',                                                             'accessibility.php',
141                                         'content_tests.php'     
142                                                                                                         ),
143                                                                         'content_packages.php',
144                                                                         'content_usage.php',
145                                                                         'tile_repository.php',
146                                                                         'scorm_packages.php'
147                                                                         ),
148                         'course_email.php',
149                         'enrollment.php' => array(
150                                                                         'enrollment_privileges.php',
151                                                                         'enrollment_alumni.php',
152                                                                         'enrollment_course_list.php'
153                                                                                 ),
154                         'file_manager.php' => array(
155                                                                         'managing_files_folders.php',
156                                                                         'extracting_zip_archives.php'
157                                                                         ),
158                         'forums.php' => array(                          'managing_threads.php' =>                                                                       array('managing_posts.php'),
159                                                                         'forum_export.php'
160                                                                         ),
161                         'faq.php',
162                         'glossary.php',
163                         'groups.php',
164                         'links.php',
165                         'polls.php',
166                         'properties.php' => array('authenticated_access.php', 'delete_course.php'),
167                         'reading_list.php',
168                         'statistics.php',
169                         'tests_surveys.php' => array(
170                                                                                         'creating_tests_surveys.php',
171                                                                                         'question_database.php' => array('creating_questions.php'),
172                                                                                         'question_categories.php',
173                                                                                         'edit_delete_tests.php',
174                                                                                         'preview.php',
175                                                                                         'add_questions.php',
176                                                                                         'student_submissions.php',
177                                                                                         'test_statistics.php'
178                                                                                         ),
179                         'feeds.php',
180                         'gradebook.php' => array(
181                                                         'gradebook_add.php',    
182                                                         'gradebook_update.php', 
183                                                         'gradebook_external_marks.php', 
184                                                         'gradebook_edit_marks.php',     
185                                                         'gradebook_scales.php'  
186                                                         ),
187                         'web_search.php',
188                         );
189         hb_print_toc($pages, 'instructor');
190 } else { 
191
192         $pages = array(
193                                 'introduction.php',
194                                 'login.php',
195                                 'register.php',
196                                 'browse_courses.php',
197                                 'password_reminder.php',
198                                 'my_start_page.php' => array(
199                                                                                                 'my_courses.php' => array('create_course.php'),
200                                                                                                 'profile.php',
201                                                                                                 'preferences.php',
202                                                                                                 'inbox.php'
203                                                                                                 ),
204                                 'inside_course.php' => array(
205                                                                                                 'export_content.php',
206                                                                                                 'packages.php',
207                                                                                                 'tile.php',
208                                                                                                 'file_storage.php',
209                                                                                                 'fs_new_file.php'
210                                                                                                 ),
211                                 'my_network.php' => array(                                      
212                                                                                         'my_contacts.php',                      
213                                                                                         'my_groups.php',                        
214                                                                                         'my_profile.php',                       
215                                                                                         'my_gadgets.php',                       
216                                                                                         'my_settings.php'       
217                                                                                         ),
218                                 'pa_index.php' => array(
219                                                                                         'pa_albums.php',
220                                                                                         'pa_photo.php',
221                                                                                         'pa_comments.php'
222                                                                                         )
223                         );
224         hb_print_toc($pages, 'general');
225 } ?>
226
227 </body>
228 </html>