2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
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 /************************************************************************/
13 if (!defined('AT_INCLUDE_PATH')) { exit; }
16 global $system_courses;
19 5 sections: public, my_start_page, course, admin, home
21 if (isset($_pages[AT_NAV_ADMIN])) {
22 array_unshift($_pages[AT_NAV_ADMIN], 'admin/index.php', 'mods/_core/modules/index.php');
25 if($_config['allow_browse'] && $_config['just_social'] != "1") {
26 if($_SESSION['valid_user']){
27 $browse_tab = "users/browse.php";
29 $browse_tab = "browse.php";
32 if($_config['allow_registration']) {
33 $reg_tab = "registration.php";
36 if($_config['just_social']) {
38 $_pages[AT_NAV_START] = array_merge(array('users/profile.php', 'users/preferences.php'), (isset($_pages[AT_NAV_START]) ? (array) $_pages[AT_NAV_START] : array()));
42 $_pages[AT_NAV_START] = array_merge(array('users/index.php' , $browse_tab, 'users/profile.php', 'users/preferences.php'), (isset($_pages[AT_NAV_START]) ? (array) $_pages[AT_NAV_START] : array()));
45 $_pages[AT_NAV_PUBLIC] = array_merge(array('login.php',$reg_tab,$browse_tab), (isset($_pages[AT_NAV_PUBLIC]) ? $_pages[AT_NAV_PUBLIC] : array()));
48 //$_pages[AT_NAV_START] = array_merge(array($my_tab , 'users/profile.php', 'users/preferences.php'), (isset($_pages[AT_NAV_START]) ? (array) $_pages[AT_NAV_START] : array()));
49 //The following line is needed to add MyCourses to the main nav tabs, but other adaptations are needed to have this function properly
50 //$_pages[AT_NAV_COURSE] = array('users/index.php','index.php');
51 $_pages[AT_NAV_COURSE] = array('index.php');
52 $_pages[AT_NAV_HOME] = array();
54 if (isset($_SESSION['course_id']) && $_SESSION['course_id'] > 0) {
55 $main_links = $home_links = $side_menu = array();
57 if ($system_courses[$_SESSION['course_id']]['main_links']) {
58 $main_links = explode('|', $system_courses[$_SESSION['course_id']]['main_links']);
59 foreach ($main_links as $link) {
60 if (isset($_pages[$link])) {
61 $_pages[$link]['parent'] = AT_NAV_COURSE;
64 $_pages[AT_NAV_COURSE] = array_merge($_pages[AT_NAV_COURSE], $main_links);
67 if ($system_courses[$_SESSION['course_id']]['home_links']) {
68 $home_links = explode('|', $system_courses[$_SESSION['course_id']]['home_links']);
69 foreach ($home_links as $link) {
70 if (isset($_pages[$link])) {
71 $_pages[AT_NAV_HOME][] = $link;
76 if (authenticate(AT_PRIV_ADMIN, AT_PRIV_RETURN)) {
77 $_pages[AT_NAV_COURSE][] = 'tools/index.php';
78 } else if ($_SESSION['privileges']) {
81 * the loop and all this module priv checking is done to hide the Manage tab
82 * when this student has privileges, but no items linked from the Manage tab.
83 * Example: the File Storage privilege does not have a Manage tab item.
84 * In the best case it stops after the first found link.
85 * In the worst case it goes through all the modules and doesn't find a link.
87 $module_list = $moduleFactory->getModules(AT_MODULE_STATUS_ENABLED, 0, TRUE);
88 $keys = array_keys($module_list);
90 foreach ($keys as $module_name) {
91 $module =& $module_list[$module_name];
92 if ($module->getPrivilege() && authenticate($module->getPrivilege(), AT_PRIV_RETURN) && ($module->getChildPage('tools/index.php'))) {
93 $_pages[AT_NAV_COURSE][] = 'tools/index.php';
98 } else if (isset($_SESSION['course_id']) && $_SESSION['course_id'] == -1) {
100 $_pages['admin/index.php']['title_var'] = 'admin_home';
101 $_pages['admin/index.php']['parent'] = AT_NAV_ADMIN;
102 $_pages['admin/index.php']['guide'] = 'admin/?p=configuration.php';
103 $_pages['admin/index.php']['children'] = array_merge(array('mods/_core/users/admins/my_edit.php', 'mods/_core/users/admins/my_password.php'), isset($_pages['mods/_core/users/index.php']['children']) ? $_pages['admin/index.php']['children'] : array());
105 $_pages['mods/_core/users/admins/my_edit.php']['title_var'] = 'my_account';
106 $_pages['mods/_core/users/admins/my_edit.php']['parent'] = 'admin/index.php';
107 $_pages['mods/_core/users/admins/my_edit.php']['guide'] = 'admin/?p=my_account.php';
109 $_pages['mods/_core/users/admins/my_password.php']['title_var'] = 'change_password';
110 $_pages['mods/_core/users/admins/my_password.php']['parent'] = 'admin/index.php';
112 if (admin_authenticate(AT_ADMIN_PRIV_ADMIN, AT_PRIV_RETURN)) {
113 //hide system preference from non-super admins
114 $_pages[AT_NAV_ADMIN][] = 'admin/config_edit.php';
116 $_pages['admin/config_edit.php']['title_var'] = 'system_preferences';
117 $_pages['admin/config_edit.php']['parent'] = AT_NAV_ADMIN;
118 $_pages['admin/config_edit.php']['guide'] = 'admin/?p=system_preferences.php';
119 $_pages['admin/config_edit.php']['children'] = array_merge((array) $_pages['admin/config_edit.php']['children'], array('admin/error_logging.php','mods/_standard/social/index_admin.php'));
121 $_pages['admin/fix_content.php']['title_var'] = 'fix_content_ordering';
122 $_pages['admin/fix_content.php']['parent'] = 'admin/index.php';
124 $_pages['admin/error_logging.php']['title_var'] = 'error_logging';
125 $_pages['admin/error_logging.php']['parent'] = 'admin/config_edit.php';
126 $_pages['admin/error_logging.php']['guide'] = 'admin/?p=error_logging.php';
127 $_pages['admin/error_logging.php']['children'] = array_merge(array('admin/error_logging_bundle.php', 'admin/error_logging_reset.php'), isset($_pages['admin/error_logging.php']['children']) ? $_pages['admin/error_logging.php']['children'] : array());
129 $_pages['admin/error_logging_reset.php']['title_var'] = 'reset_log';
130 $_pages['admin/error_logging_reset.php']['parent'] = 'admin/error_logging.php';
132 $_pages['admin/error_logging_bundle.php']['title_var'] = 'report_errors';
133 $_pages['admin/error_logging_bundle.php']['parent'] = 'admin/error_logging.php';
135 $_pages['admin/error_logging_details.php']['title_var'] = 'viewing_profile_bugs';
136 $_pages['admin/error_logging_details.php']['parent'] = 'admin/error_logging.php';
138 $_pages['admin/error_logging_view.php']['title_var'] = 'viewing_errors';
139 $_pages['admin/error_logging_view.php']['parent'] = 'admin/error_logging_details.php';
141 if (admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {
142 // hide modules from non-super admins
144 $_pages['mods/_core/modules/index.php']['title_var'] = 'modules';
145 $_pages['mods/_core/modules/index.php']['parent'] = AT_NAV_ADMIN;
146 $_pages['mods/_core/modules/index.php']['guide'] = 'admin/?p=modules.php';
147 $_pages['mods/_core/modules/index.php']['children'] = array('mods/_core/modules/install_modules.php');
149 $_pages['mods/_core/modules/details.php']['title_var'] = 'details';
150 $_pages['mods/_core/modules/details.php']['parent'] = 'mods/_core/modules/index.php';
152 $_pages['mods/_core/modules/module_uninstall_step_1.php']['title_var'] = 'module_uninstall';
153 $_pages['mods/_core/modules/module_uninstall_step_1.php']['parent'] = 'mods/_core/modules/index.php';
155 $_pages['mods/_core/modules/module_uninstall_step_2.php']['title_var'] = 'module_uninstall';
156 $_pages['mods/_core/modules/module_uninstall_step_2.php']['parent'] = 'mods/_core/modules/index.php';
158 $_pages['mods/_core/modules/module_uninstall_step_3.php']['title_var'] = 'module_uninstall';
159 $_pages['mods/_core/modules/module_uninstall_step_3.php']['parent'] = 'mods/_core/modules/index.php';
161 $_pages['mods/_core/modules/install_modules.php']['title_var'] = 'install_modules';
162 $_pages['mods/_core/modules/install_modules.php']['parent'] = 'mods/_core/modules/index.php';
163 $_pages['mods/_core/modules/install_modules.php']['guide'] = 'admin/?p=modules.php';
165 $_pages['mods/_core/modules/version_history.php']['title_var'] = 'version_history';
166 $_pages['mods/_core/modules/version_history.php']['parent'] = 'mods/_core/modules/install_modules.php';
168 $_pages['mods/_core/modules/module_install_step_1.php']['title_var'] = 'details';
169 $_pages['mods/_core/modules/module_install_step_1.php']['parent'] = 'mods/_core/modules/install_modules.php';
171 $_pages['mods/_core/modules/module_install_step_2.php']['title_var'] = 'details';
172 $_pages['mods/_core/modules/module_install_step_2.php']['parent'] = 'mods/_core/modules/install_modules.php';
174 $_pages['mods/_core/modules/module_install_step_3.php']['title_var'] = 'details';
175 $_pages['mods/_core/modules/module_install_step_3.php']['parent'] = 'mods/_core/modules/install_modules.php';
177 $_pages['mods/_core/modules/confirm.php']['title_var'] = 'confirm';
178 $_pages['mods/_core/modules/confirm.php']['parent'] = 'mods/_core/modules/add_new.php';
180 $_pages['admin/cron_config.php']['title_var'] = 'cron_config';
181 $_pages['admin/cron_config.php']['parent'] = 'admin/config_edit.php';
182 $_pages['admin/cron_config.php']['guide'] = 'admin/?p=cron_setup.php';
183 $_pages['admin/config_edit.php']['children'] = array_merge((array) $_pages['admin/config_edit.php']['children'], array('admin/cron_config.php'));
185 $_pages['admin/auto_enroll.php']['title_var'] = 'auto_enroll';
186 $_pages['admin/auto_enroll.php']['parent'] = 'admin/config_edit.php';
187 $_pages['admin/auto_enroll.php']['guide'] = 'admin/?p=auto_enroll.php';
188 $_pages['admin/auto_enroll.php']['children'] = array_merge(array('admin/auto_enroll_edit.php'));
189 $_pages['admin/config_edit.php']['children'] = array_merge((array) $_pages['admin/config_edit.php']['children'], array('admin/auto_enroll.php'));
191 $_pages['admin/auto_enroll_edit.php']['title_var'] = 'auto_enroll_edit';
192 $_pages['admin/auto_enroll_edit.php']['parent'] = 'admin/auto_enroll.php';
193 $_pages['admin/auto_enroll_edit.php']['guide'] = 'admin/?p=auto_enroll.php';
195 $_pages['admin/auto_enroll_delete.php']['title_var'] = 'auto_enroll_delete';
196 $_pages['admin/auto_enroll_delete.php']['parent'] = 'admin/auto_enroll.php';
202 $_pages['about.php']['title_var'] = 'about_atutor';
204 $_pages['404.php']['title_var'] = '404';
206 $_pages['help/index.php']['title_var'] = 'help';
207 $_pages['help/index.php']['children'] = array_merge(array('help/accessibility.php', 'help/contact_support.php'), isset($_pages['help/index.php']['children']) ? $_pages['help/index.php']['children'] : array());
209 $_pages['help/accessibility.php']['title_var'] = 'accessibility';
210 $_pages['help/accessibility.php']['parent'] = 'help/index.php';
212 $_pages['help/contact_support.php']['title_var'] = 'contact_support';
213 $_pages['help/contact_support.php']['parent'] = 'help/index.php';
216 $_pages['contact_instructor.php']['title_var'] = 'contact_instructor';
220 $_pages['registration.php']['title_var'] = 'register';
221 $_pages['registration.php']['parent'] = AT_NAV_PUBLIC;
222 $_pages['registration.php']['children'] = isset($_pages['browse.php']['children']) ? $_pages['browse.php']['children'] : array();
223 $_pages['registration.php']['guide'] = 'general/?p=register.php';
225 $_pages['browse.php']['title_var'] = 'browse_courses';
226 $_pages['browse.php']['parent'] = AT_NAV_PUBLIC;
227 $_pages['browse.php']['children'] = isset($_pages['browse.php']['children']) ? $_pages['browse.php']['children'] : array();
228 $_pages['browse.php']['guide'] = 'general/?p=browse_courses.php';
230 $_pages['login.php']['title_var'] = 'login';
231 $_pages['login.php']['parent'] = AT_NAV_PUBLIC;
232 $_pages['login.php']['children'] = array_merge(array('password_reminder.php'), isset($_pages['login.php']['children']) ? $_pages['login.php']['children'] : array());
233 $_pages['login.php']['guide'] = 'general/?p=login.php';
235 $_pages['confirm.php']['title_var'] = 'confirm';
236 $_pages['confirm.php']['parent'] = AT_NAV_PUBLIC;
238 $_pages['password_reminder.php']['title_var'] = 'password_reminder';
239 $_pages['password_reminder.php']['parent'] = 'login.php';
240 $_pages['password_reminder.php']['guide'] = 'general/?p=password_reminder.php';
242 $_pages['logout.php']['title_var'] = 'logout';
243 $_pages['logout.php']['parent'] = AT_NAV_PUBLIC;
245 /* my start page pages */
246 $_pages['users/index.php']['title_var'] = 'my_courses';
247 $_pages['users/index.php']['parent'] = AT_NAV_START;
248 $_pages['users/index.php']['guide'] = 'general/?p=my_courses.php';
249 if (isset($_SESSION['member_id']) && $_SESSION['member_id'] && (!isset($_SESSION['course_id']) || !$_SESSION['course_id'])) {
250 //$_pages['users/index.php']['children'] = array_merge(array('mods/_core/courses/users/create_course.php'), isset($_pages['users/index.php']['children']) ? $_pages['users/index.php']['children'] : array());
252 $_pages['users/browse.php']['title_var'] = 'browse_courses';
253 //$_pages['users/browse.php']['parent'] = 'users/index.php';
254 $_pages['users/browse.php']['parent'] = AT_NAV_START;
255 $_pages['users/browse.php']['guide'] = 'general/?p=browse_courses.php';
258 if (isset($_SESSION['member_id']) && get_instructor_status() === TRUE)
260 $_pages['mods/_core/courses/users/create_course.php']['title_var'] = 'create_course';
261 $_pages['mods/_core/courses/users/create_course.php']['parent'] = 'users/index.php';
262 $_pages['mods/_core/courses/users/create_course.php']['guide'] = 'instructor/?p=creating_courses.php';
263 $_pages['users/index.php']['children'] = array_merge(array('mods/_core/courses/users/create_course.php'), isset($_pages['users/index.php']['children']) ? $_pages['users/index.php']['children'] : array());
266 else if (isset($_SESSION['member_id']) && ALLOW_INSTRUCTOR_REQUESTS)
269 $_pages['mods/_core/courses/users/create_course.php']['title_var'] = 'request_instructor_priv';
270 $_pages['mods/_core/courses/users/create_course.php']['parent'] = 'users/index.php';
271 $_pages['mods/_core/courses/users/create_course.php']['guide'] = 'instructor/?p=creating_courses.php';
272 $_pages['users/index.php']['children'] = array_merge(array('mods/_core/courses/users/create_course.php'), isset($_pages['users/index.php']['children']) ? $_pages['users/index.php']['children'] : array());
276 $_pages['users/private_enroll.php']['title_var'] = 'enroll';
277 $_pages['users/private_enroll.php']['parent'] = 'users/index.php';
279 $_pages['users/remove_course.php']['title_var'] = 'unenroll';
280 $_pages['users/remove_course.php']['parent'] = 'users/index.php';
282 $_pages['mods/_standard/profile_pictures/profile_picture.php']['title_var'] = 'picture';
284 $_pages['users/profile.php']['title_var'] = 'profile';
285 $_pages['users/profile.php']['parent'] = AT_NAV_START;
286 $_pages['users/profile.php']['guide'] = 'general/?p=profile.php';
287 //$_pages['users/profile.php']['children'] = array_merge(array('users/password_change.php', 'users/email_change.php','mods/_standard/profile_pictures/profile_picture.php'), (array) $_pages['users/profile.php']['children']);
288 $_pages['users/profile.php']['children'] = array_merge(array('users/password_change.php', 'users/email_change.php','mods/_standard/profile_pictures/profile_picture.php'), (array) $_pages['users/profile.php']['children']);
290 $_pages['users/password_change.php']['title_var'] = 'change_password';
291 $_pages['users/password_change.php']['parent'] = 'users/profile.php';
292 //$_pages['users/password_change.php']['guide'] = 'instructor/?p=creating_courses.php';
294 $_pages['users/email_change.php']['title_var'] = 'change_email';
295 $_pages['users/email_change.php']['parent'] = 'users/profile.php';
297 $_pages['users/preferences.php']['title_var'] = 'preferences';
298 $_pages['users/preferences.php']['parent'] = AT_NAV_START;
299 $_pages['users/preferences.php']['guide'] = 'general/?p=preferences.php';
301 $_pages['users/pref_wizard/index.php']['title_var'] = 'preferences';
302 $_pages['users/pref_wizard/index.php']['parent'] = AT_NAV_START;
307 $_pages['index.php']['title_var'] = 'course_home';
308 $_pages['index.php']['parent'] = AT_NAV_COURSE;
310 $_pages['enroll.php']['title_var'] = 'enroll';
311 $_pages['enroll.php']['parent'] = AT_NAV_COURSE;
313 /* instructor pages: */
314 $_pages['tools/index.php']['title_var'] = 'manage';
315 $_pages['tools/index.php']['parent'] = AT_NAV_COURSE;
317 $_pages['inbox/index.php']['title_var'] = 'inbox';
318 $_pages['inbox/index.php']['children'] = array_merge(array('inbox/sent_messages.php', 'inbox/send_message.php', 'inbox/export.php'), isset($_pages['inbox/index.php']['children']) ? $_pages['inbox/index.php']['children'] : array());
320 $_pages['inbox/sent_messages.php']['title_var'] = 'sent_messages';
321 $_pages['inbox/sent_messages.php']['parent'] = 'inbox/index.php';
323 $_pages['inbox/send_message.php']['title_var'] = 'send_message';
324 $_pages['inbox/send_message.php']['parent'] = 'inbox/index.php';
326 $_pages['inbox/export.php']['title_var'] = 'export';
327 $_pages['inbox/export.php']['parent'] = 'inbox/index.php';
329 $_pages['profile.php']['title_var'] = 'profile';
330 $_pages['profile.php']['parent'] = 'index.php';
333 $current_page = substr($_SERVER['PHP_SELF'], strlen($_base_path));
335 function get_num_new_messages() {
337 static $num_messages;
339 if (isset($num_messages)) {
340 return $num_messages;
342 $sql = "SELECT COUNT(*) AS cnt FROM ".TABLE_PREFIX."messages WHERE to_member_id=$_SESSION[member_id] AND new=1";
343 $result = mysql_query($sql, $db);
344 $row = mysql_fetch_assoc($result);
345 $num_messages = $row['cnt'];
347 return $num_messages;
350 //TODO****************BOLOGNA*******************REMOVE ME**********************/
351 function get_main_navigation($current_page) {
352 global $_pages, $_base_path, $_tool;
354 $parent_page = $_pages[$current_page]['parent'];
355 $_top_level_pages = array();
357 $tool_file= $table = '';
359 if (isset($parent_page) && defined($parent_page)) {
360 foreach($_pages[$parent_page] as $page) {
361 if (isset($_pages[$page])) {
362 if (isset($_pages[$page]['title'])) {
363 $_page_title = $_pages[$page]['title'];
365 $_page_title = _AT($_pages[$page]['title_var']);
368 if(isset($_tool[$_pages[$page]['title_var']])){ //viene prelevato il file nel caso in cui lo strumento sia valodo per essere inserito nella toolbar in fase di editing dei conenuti del corso
369 $tool_file = $_tool[$_pages[$page]['title_var']]['file'];
370 $table = $_tool[$_pages[$page]['title_var']]['table'];
376 $_top_level_pages[] = array('url' => $_base_path . url_rewrite($page), 'title' => $_page_title, 'img' => $_base_path.$_pages[$page]['img'], 'tool_file' => $tool_file, 'table' => $table);
379 } else if (isset($parent_page)) {
380 return get_main_navigation($parent_page);
383 return $_top_level_pages;
386 function get_current_main_page($current_page) {
387 global $_pages, $_base_path;
388 $parent_page = $_pages[$current_page]['parent'];
390 if (isset($parent_page) && defined($parent_page)) {
391 return $_base_path . url_rewrite($current_page);
392 } else if (isset($parent_page)) {
393 return get_current_main_page($parent_page);
397 function get_sub_navigation($current_page) {
398 global $_pages, $_base_path;
400 if (isset($current_page) && defined($current_page)) {
403 } else if (isset($_pages[$current_page]['children'])) {
404 if (isset($_pages[$current_page]['title'])) {
405 $_page_title = $_pages[$current_page]['title'];
407 $_page_title = _AT($_pages[$current_page]['title_var']);
410 $_sub_level_pages[] = array('url' => $_base_path . $current_page, 'title' => $_page_title);
411 foreach ($_pages[$current_page]['children'] as $child) {
413 if (isset($_pages[$child]['title'])) {
414 $_page_title = $_pages[$child]['title'];
416 $_page_title = _AT($_pages[$child]['title_var']);
419 $_sub_level_pages[] = array('url' => $_base_path . $child, 'title' => $_page_title, 'has_children' => isset($_pages[$child]['children']));
421 } else if (isset($_pages[$current_page]['parent'])) {
424 $parent_page = $_pages[$current_page]['parent'];
425 return get_sub_navigation($parent_page);
428 return $_sub_level_pages;
431 function get_current_sub_navigation_page($current_page) {
432 global $_pages, $_base_path;
433 $parent_page = $_pages[$current_page]['parent'];
435 if (isset($parent_page) && defined($parent_page)) {
436 return $_base_path . $current_page;
438 return $_base_path . $current_page;
442 function get_path($current_page) {
443 global $_pages, $_base_path;
445 $parent_page = $_pages[$current_page]['parent'];
447 if (isset($_pages[$current_page]['title'])) {
448 $_page_title = $_pages[$current_page]['title'];
450 $_page_title = _AT($_pages[$current_page]['title_var']);
453 if (isset($parent_page) && defined($parent_page)) {
454 $path[] = array('url' => $_base_path . url_rewrite($current_page), 'title' => $_page_title);
456 } else if (isset($parent_page)) {
457 $path[] = array('url' => $_base_path . url_rewrite($current_page), 'title' => $_page_title);
458 $path = array_merge((array) $path, get_path($parent_page));
460 $path[] = array('url' => $_base_path . url_rewrite($current_page), 'title' => $_page_title);
466 //TODO****************BOLOGNA*********************REMOVE ME*****************/
467 function get_home_navigation($home_array='') {
468 global $_pages, $_list, $_base_path, $_tool;
470 // set default home_array to course index navigation array
471 if (!is_array($home_array)) $home_array = $_pages[AT_NAV_HOME];
473 $home_links = array();
474 foreach ($home_array as $child) { //esecuzione del ciclo fin quando non saranno terminati i moduli presenti nella home-page del corso
475 if (isset($_pages[$child])) {
477 $title = $icon = $sub_file = $image = $text = $tool_file = $table ='';
479 if (isset($_pages[$child]['title'])) { //viene prelevato il titolo che dovr� poi essere utilizzato nella visualizzazione
480 $title = $_pages[$child]['title'];
482 $title = _AT($_pages[$child]['title_var']);
484 if(isset($_pages[$child]['icon'])) { //si controlla se è presente l'icona inserita nel modulo di rifrimento. si ricorda che l'icona � inserita solo per i moduli che prevedono possibili sottocontenuti.
485 $icon = $_base_path.$_pages[$child]['icon']; //in caso positivo viene prelevata e inserita in una variabile di appoggio che poi sar� a sua volta inserita all'interno dell'array finale home_links[]
487 if(isset($_pages[$child]['text'])) { //nel caso in cui non sia presente un' icona associata si controlla se � stato settata il testo (per moduli privi di sottocontenuti).
488 $text = $_pages[$child]['text']; //il testo viene inserito in una variabile d'appoggio e successivamente nell'array.
491 if (isset($_list[$_pages[$child]['title_var']])) //viene prelevato il path del file che dovr� poi essere richiamato nella visualizzazione dei sottocontenuti. solo i moduli che prevedono sottocontenuti avranno un file di riferimento.
492 $sub_file = $_list[$_pages[$child]['title_var']]['file'];
494 if(isset($_tool[$_pages[$child]['title_var']])){ //viene prelevato il file nel caso in cui lo strumento sia valido per essere inserito nella toolbar in fase di editing dei conenuti del corso
495 $tool_file = $_tool[$_pages[$child]['title_var']]['file'];
496 $table = $_tool[$_pages[$child]['title_var']]['table'];
499 $real_image_in_theme = AT_INCLUDE_PATH.'../themes/'.$_SESSION['prefs']['PREF_THEME'].'/'.$_pages[$child]['img'];
500 $image_in_theme = $_base_path.'themes/'.$_SESSION['prefs']['PREF_THEME'].'/'.$_pages[$child]['img'];
502 // look for images in theme folder. If not exists, use images relative to ATutor root folder
503 if (file_exists($real_image_in_theme))
504 $image = $image_in_theme;
506 $image = $_base_path.$_pages[$child]['img'];
508 // inclusion of all data necessary for displaying the modules on the home-page. Set by default to check the visible because the modules will be loaded all visible in the home.
509 $home_links[] = array('url' => $_base_path . url_rewrite($child), 'title' => $title, 'img' => $image, 'icon' => $icon, 'text' => $text, 'sub_file' => $sub_file, 'tool_file' => $tool_file, 'table' => $table);