123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- <?php
- $language_file = 'course_home';
- $use_anonymous = true;
- require '../../main/inc/global.inc.php';
- unset($_SESSION['oLP']);
- unset($_SESSION['lpobject']);
- $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>';
- $htmlHeadXtra[] ='<script type="text/javascript">
- $(document).ready(function() {
- $(".make_visible_and_invisible").attr("href", "javascript:void(0);");
- $("td .make_visible_and_invisible > img").click(function () {
- make_visible = "visible.gif";
- make_invisible = "invisible.gif";
- path_name = $(this).attr("src");
- list_path_name = path_name.split("/");
- image_link = list_path_name[list_path_name.length - 1];
- tool_id = $(this).attr("id");
- tool_info = tool_id.split("_");
- my_tool_id = tool_info[1];
- $.ajax({
- contentType: "application/x-www-form-urlencoded",
- beforeSend: function(objeto) {
- $(".normal-message").show();
- $("#id_confirmation_message").hide();
- },
- type: "GET",
- url: "'.api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?a=set_visibility",
- data: "id=" + my_tool_id + "&sent_http_request=1",
- success: function(data) {
- eval("var info=" + data);
- new_current_tool_image = "'.api_get_path(WEB_IMG_PATH).'" + info.image;
- new_current_view = "'.api_get_path(WEB_IMG_PATH).'" + info.view;
- //eyes
- $("#" + tool_id).attr("src", new_current_view);
- //tool
- $("#toolimage_" + my_tool_id).attr("src", new_current_tool_image);
- //clase
- $("#tooldesc_" + my_tool_id).attr("class", info.tclass);
- $("#istooldesc_" + my_tool_id).attr("class", info.tclass);
- if (image_link == "visible.gif") {
- $("#" + tool_id).attr("alt", "'.get_lang('Activate', '').'");
- $("#" + tool_id).attr("title", "'.get_lang('Activate', '').'");
- } else {
- $("#" + tool_id).attr("alt", "'.get_lang('Deactivate', '').'");
- $("#" + tool_id).attr("title", "'.get_lang('Deactivate', '').'");
- }
- if (info.message == "is_active") {
- message = "'.get_lang('ToolIsNowVisible', '').'";
- } else {
- message = "'.get_lang('ToolIsNowHidden', '').'";
- }
- $(".normal-message").hide();
- $("#id_confirmation_message").html(message);
- $("#id_confirmation_message").show();
- }
- });
- });
- });
-
- /* toogle for post-it in course home */
- $(function() {
- $(".thematic-postit-head").click(function() {
- $(".thematic-postit-center").slideToggle("normal");
- }).$(".thematic-postit-center").hide();
- });
-
- </script>';
- if (!isset($cidReq)) {
- $cidReq = api_get_course_id();
- global $error_msg,$error_no;
- $classError = "init";
- $error_no[$classError][] = "2";
- $error_level[$classError][] = "info";
- $error_msg[$classError][] = "[".__FILE__."][".__LINE__."] cidReq was Missing $cidReq take $dbname;";
- }
- if (isset($_SESSION['_gid'])) {
- unset($_SESSION['_gid']);
- }
- $this_section = SECTION_COURSES;
- include_once api_get_path(LIBRARY_PATH).'course.lib.php';
- include_once api_get_path(LIBRARY_PATH).'debug.lib.inc.php';
- define ('TOOL_PUBLIC', 'Public');
- define ('TOOL_PUBLIC_BUT_HIDDEN', 'PublicButHide');
- define ('TOOL_COURSE_ADMIN', 'courseAdmin');
- define ('TOOL_PLATFORM_ADMIN', 'platformAdmin');
- define ('TOOL_AUTHORING', 'toolauthoring');
- define ('TOOL_INTERACTION', 'toolinteraction');
- define ('TOOL_ADMIN', 'tooladmin');
- define ('TOOL_ADMIN_PLATEFORM', 'tooladminplatform');
- define ('TOOL_STUDENT_VIEW', 'toolstudentview');
- define ('TOOL_ADMIN_VISIBLE', 'tooladminvisible');
- $user_id = api_get_user_id();
- $course_code = $_course['sysCode'];
- $course_info = Database::get_course_info($course_code);
- $return_result = CourseManager::determine_course_title_from_course_info($_user['user_id'], $course_info);
- $course_title = $return_result['title'];
- $course_code = $return_result['code'];
- $_course['name'] = $course_title;
- $_course['official_code'] = $course_code;
- api_session_unregister('toolgroup');
- $is_speacialcourse = CourseManager::is_special_course($course_code);
- if ($is_speacialcourse==true){
- $autoreg=Security::remove_XSS($_GET['autoreg']);
- if ($autoreg==1){
- CourseManager::subscribe_user($user_id, $course_code, $status = STUDENT);
- }
- }
- if (!$is_allowed_in_course) {
- api_not_allowed(true);
- }
- Display::display_header('', 'Home');
- if (!isset($coursesAlreadyVisited[$_cid])) {
- event_access_course();
- $coursesAlreadyVisited[$_cid] = 1;
- api_session_register('coursesAlreadyVisited');
- }
- $tool_table = Database::get_course_table(TABLE_TOOL_LIST);
- $temps = time();
- $reqdate = "&reqdate=$temps";
- Display::display_introduction_section(TOOL_COURSE_HOMEPAGE, array(
- 'CreateDocumentWebDir' => api_get_path('WEB_COURSE_PATH').api_get_course_path().'/document/',
- 'CreateDocumentDir' => 'document/',
- 'BaseHref' => api_get_path('WEB_COURSE_PATH').api_get_course_path().'/'
- )
- );
- if (api_get_setting('homepage_view') == 'activity') {
- require 'activity.php';
- }
- elseif(api_get_setting('homepage_view') == '2column') {
- require '2column.php';
- }
- elseif(api_get_setting('homepage_view') == '3column') {
- require '3column.php';
- }
- Display::display_footer();
|