$(document).ready(function() { $(".document_preview_container").hide(); $(".document_preview").click(function() { var my_id = this.id; var course_id = my_id.split("_")[2]; var session_id = my_id.split("_")[3]; //showing div $(".document_preview_container").hide(); $("#document_result_" +course_id+"_" + session_id).show(); //Loading var image = $("img", this); image.attr("src", "'.$close_icon.'"); $.ajax({ url: "'.$url.'", data: "course_id="+course_id+"&session_id="+session_id, success: function(return_value) { image.attr("src", "'.$folder_icon.'"); $("#document_result_" +course_id+"_" + session_id).html(return_value); } }); }); }); '; } // @todo : replace $_configuration with setting parameter $displayMyCourseViewbySessionLink = (isset($_configuration['my_courses_view_by_session']) && $_configuration['my_courses_view_by_session']); if ($displayMyCourseViewbySessionLink) { $htmlHeadXtra[] = ' '; } /* Sniffing system */ //store posts to sessions /* if (isset($_SESSION['sniff_navigator']) && $_SESSION['sniff_navigator']!="checked") { $_SESSION['sniff_navigator']=Security::remove_XSS($_POST['sniff_navigator']); $_SESSION['sniff_screen_size_w']=Security::remove_XSS($_POST['sniff_navigator_screen_size_w']); $_SESSION['sniff__screen_size_h']=Security::remove_XSS($_POST['sniff_navigator_screen_size_h']); $_SESSION['sniff_type_mimetypes']=Security::remove_XSS($_POST['sniff_navigator_type_mimetypes']); $_SESSION['sniff_suffixes_mimetypes']=Security::remove_XSS($_POST['sniff_navigator_suffixes_mimetypes']); $_SESSION['sniff_list_plugins']=Security::remove_XSS($_POST['sniff_navigator_list_plugins']); $_SESSION['sniff_check_some_activex']=Security::remove_XSS($_POST['sniff_navigator_check_some_activex']); $_SESSION['sniff_check_some_plugins']=Security::remove_XSS($_POST['sniff_navigator_check_some_plugins']); $_SESSION['sniff_java']=Security::remove_XSS($_POST['sniff_navigator_java']); $_SESSION['sniff_java_sun_ver']=Security::remove_XSS($_POST['sniff_navigator_java_sun_ver']); } */ /* MAIN CODE */ $controller = new IndexManager(get_lang('MyCourses')); // Main courses and session list if (isset($_COOKIE['defaultMyCourseView'.$user_id]) && $_COOKIE['defaultMyCourseView'.$user_id] == IndexManager::VIEW_BY_SESSION && $displayMyCourseViewbySessionLink) { $courses_and_sessions = $controller->returnCoursesAndSessionsViewBySession($user_id); IndexManager::setDefaultMyCourseView(IndexManager::VIEW_BY_SESSION, $user_id); } else { $courses_and_sessions = $controller->return_courses_and_sessions($user_id); IndexManager::setDefaultMyCourseView(IndexManager::VIEW_BY_DEFAULT, $user_id); } // if teacher, session coach or admin, display the button to change te course view // @todo : replace $_configuration with setting parameter if ($displayMyCourseViewbySessionLink && (api_is_drh() || api_is_course_coach() || api_is_platform_admin() || api_is_session_admin() || api_is_teacher())) { $courses_and_sessions = "
".$courses_and_sessions; } //Show the chamilo mascot if (empty($courses_and_sessions) && !isset($_GET['history'])) { $controller->tpl->assign('welcome_to_course_block', $controller->return_welcome_to_course_block()); } $controller->tpl->assign('content', $courses_and_sessions); if (api_get_setting('allow_browser_sniffer') == 'true') { if ($_SESSION['sniff_navigator']!="checked") { $controller->tpl->assign('show_sniff', 1); } else { $controller->tpl->assign('show_sniff', 0); } } // Display the Site Use Cookie Warning Validation $useCookieValidation = api_get_configuration_value('cookie_warning'); if ($useCookieValidation) { if (isset($_POST['acceptCookies'])) { api_set_site_use_cookie_warning_cookie(); } else { if (!api_site_use_cookie_warning_cookie_exist()) { if (Template::isToolBarDisplayedForUser()) { $controller->tpl->assign('toolBarDisplayed', true); } else { $controller->tpl->assign('toolBarDisplayed', false); } $controller->tpl->assign('displayCookieUsageWarning', true); } } } //check for flash and message $sniff_notification = ''; $some_activex = isset($_SESSION['sniff_check_some_activex']) ? $_SESSION['sniff_check_some_activex'] : null; $some_plugins = isset($_SESSION['sniff_check_some_plugins']) ? $_SESSION['sniff_check_some_plugins'] : null; if(!empty($some_activex) || !empty($some_plugins)){ if (! preg_match("/flash_yes/", $some_activex) && ! preg_match("/flash_yes/", $some_plugins)) { $sniff_notification = Display::return_message(get_lang('NoFlash'), 'warning', true); //js verification - To annoying of redirecting every time the page $controller->tpl->assign('sniff_notification', $sniff_notification); } } $controller->tpl->assign('profile_block', $controller->return_profile_block()); $controller->tpl->assign('user_image_block', $controller->return_user_image_block()); $controller->tpl->assign('course_block', $controller->return_course_block()); $controller->tpl->assign('navigation_course_links', $controller->return_navigation_links()); $controller->tpl->assign('reservation_block', $controller->return_reservation_block()); $controller->tpl->assign('search_block', $controller->return_search_block()); $controller->tpl->assign('classes_block', $controller->return_classes_block()); //if (api_is_platform_admin() || api_is_drh()) { $controller->tpl->assign('skills_block', $controller->return_skills_links()); //} $controller->tpl->display_two_col_template(); // Deleting the session_id. Session::erase('session_id');