$(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); } }); }); }); '; } /* 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')); $user_id = api_get_user_id(); // Main courses and session list $courses_and_sessions = $controller->return_courses_and_sessions($user_id); //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); } } //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');