- redesign * @author Denes Nagy, principal author * @author Isthvan Mandak, several new features * @author Roan Embrechts, code improvements and refactoring * @license GNU/GPL - See Dokeos license directory for details ============================================================================== */ /** * Script */ /* ============================================================================== INIT SECTION ============================================================================== */ $_SESSION['whereami'] = 'lp/view'; if($lp_controller_touched!=1){ header('location: lp_controller.php?action=view&item_id='.$_REQUEST['item_id']); } /* ----------------------------------------------------------- Libraries ----------------------------------------------------------- */ require_once('back_compat.inc.php'); //require_once('../learnpath/learnpath_functions.inc.php'); require_once('scorm.lib.php'); require_once('learnpath.class.php'); require_once('learnpathItem.class.php'); require_once('lp_comm.common.php'); //xajax functions if ($is_allowed_in_course == false) api_not_allowed(); /* ----------------------------------------------------------- Variables ----------------------------------------------------------- */ //$charset = 'UTF-8'; $charset = 'ISO-8859-1'; $oLearnpath = false; $course_code = api_get_course_id(); $user_id = api_get_user_id(); //escape external variables /* ----------------------------------------------------------- Header ----------------------------------------------------------- */ //$htmlHeadXtra[] = ''; $htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/')."\n"; $_SESSION['oLP']->error = ''; $lp_type = $_SESSION['oLP']->get_type(); $lp_item_id = $_SESSION['oLP']->get_current_item_id(); //$lp_item_id = learnpath::escape_string($_GET['item_id']); //$_SESSION['oLP']->set_current_item($lp_item_id); // already done by lp_controller.php //Prepare variables for the test tool (just in case) - honestly, this should disappear later on $_SESSION['scorm_view_id'] = $_SESSION['oLP']->get_view_id(); $_SESSION['scorm_item_id'] = $lp_item_id; //reinit exercises variables to avoid spacename clashes (see exercise tool) api_session_unregister($exerciseResult); unset($_SESSION['objExercise']); unset($_SESSION['questionList']); /** * Get a link to the corresponding document */ $src = ''; switch($lp_type) { case 1: $_SESSION['oLP']->stop_previous_item(); $htmlHeadXtra[] = ''; $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id); if($prereq_check === true){ $src = $_SESSION['oLP']->get_link('http',$lp_item_id); $_SESSION['oLP']->start_current_item(); //starts time counter manually if asset }else{ $src = 'blank.php?error=prerequisites'; } break; case 2: //save old if asset $_SESSION['oLP']->stop_previous_item(); //save status manually if asset $htmlHeadXtra[] = ''; $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id); if($prereq_check === true){ $src = $_SESSION['oLP']->get_link('http',$lp_item_id); $_SESSION['oLP']->start_current_item(); //starts time counter manually if asset }else{ $src = 'blank.php'; } break; case 3: //aicc $_SESSION['oLP']->stop_previous_item(); //save status manually if asset $htmlHeadXtra[] = ''; $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id); if($prereq_check === true){ $src = $_SESSION['oLP']->get_link('http',$lp_item_id); $_SESSION['oLP']->start_current_item(); //starts time counter manually if asset }else{ $src = 'blank.php'; } break; case 4: break; } $_SESSION['oLP']->set_previous_item($lp_item_id); $nameTools = $_SESSION['oLP']->get_name(); $save_setting = get_setting("show_navigation_menu"); global $_setting; $_setting['show_navigation_menu'] = false; $scorm_css_header=true; $lp_theme_css=$_SESSION['oLP']->get_theme(); //sets the css theme of the LP this call is also use at the frames (toc, nav, message) if($_SESSION['oLP']->mode == 'fullscreen') { $htmlHeadXtra[] = ""; include_once('../inc/reduced_header.inc.php'); //set flag to ensure lp_header.php is loaded by this script (flag is unset in lp_header.php) $_SESSION['loaded_lp_view'] = true; ?>