|
@@ -61,14 +61,12 @@ if (empty($_SESSION['oLP'])) {
|
|
|
}
|
|
|
|
|
|
$debug = 0;
|
|
|
+/** @var learnpath $learnPath */
|
|
|
+$learnPath = $_SESSION['oLP'];
|
|
|
|
|
|
-if ($debug) {
|
|
|
- error_log('------ Entering lp_view.php -------');
|
|
|
-}
|
|
|
-
|
|
|
-$_SESSION['oLP']->error = '';
|
|
|
-$lp_item_id = $_SESSION['oLP']->get_current_item_id();
|
|
|
-$lp_type = $_SESSION['oLP']->get_type();
|
|
|
+$learnPath->setError(null);
|
|
|
+$lp_item_id = $learnPath->get_current_item_id();
|
|
|
+$lp_type = $learnPath->get_type();
|
|
|
|
|
|
$course_code = api_get_course_id();
|
|
|
$course_id = api_get_course_int_id();
|
|
@@ -76,35 +74,26 @@ $user_id = api_get_user_id();
|
|
|
$platform_theme = api_get_setting('stylesheets');
|
|
|
$my_style = $platform_theme;
|
|
|
|
|
|
-//$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/lp_minipanel/jquery.lp_minipanel.js" type="text/javascript"></script>';
|
|
|
-$htmlHeadXtra[] = $app['template']->fetch('default/javascript/newscorm/minipanel.tpl');
|
|
|
-$htmlHeadXtra[] = '<script>
|
|
|
-$(document).ready(function(){
|
|
|
- $("div#log_content_cleaner").bind("click", function() {
|
|
|
- $("div#log_content").empty();
|
|
|
- });
|
|
|
-});
|
|
|
-var chamilo_xajax_handler = window.oxajax;
|
|
|
-</script>';
|
|
|
-
|
|
|
+//$htmlHeadXtra[] = $app['template']->fetch('default/javascript/newscorm/minipanel.tpl');
|
|
|
+/*
|
|
|
if ($_SESSION['oLP']->mode == 'embedframe' || $_SESSION['oLP']->get_hide_toc_frame() == 1) {
|
|
|
$htmlHeadXtra[] = '<script>
|
|
|
$(document).ready(function(){
|
|
|
toogle_minipanel();
|
|
|
});
|
|
|
</script>';
|
|
|
-}
|
|
|
+}*/
|
|
|
|
|
|
-//Impress js
|
|
|
-if ($_SESSION['oLP']->mode == 'impress') {
|
|
|
- $lp_id = $_SESSION['oLP']->get_id();
|
|
|
- $url = api_get_path(WEB_CODE_PATH)."newscorm/lp_impress.php?lp_id=$lp_id&".api_get_cidreq();
|
|
|
+// Impress js
|
|
|
+$lpId = $learnPath->get_id();
|
|
|
+if ($learnPath->mode == 'impress') {
|
|
|
+ $url = api_get_path(WEB_CODE_PATH)."newscorm/lp_impress.php?lp_id=$lpId&".api_get_cidreq();
|
|
|
header("Location: $url");
|
|
|
exit;
|
|
|
}
|
|
|
|
|
|
// 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_view_id'] = $learnPath->get_view_id();
|
|
|
$_SESSION['scorm_item_id'] = $lp_item_id;
|
|
|
|
|
|
// Reinit exercises variables to avoid spacename clashes (see exercise tool)
|
|
@@ -114,26 +103,13 @@ if (isset($exerciseResult) || isset($_SESSION['exerciseResult'])) {
|
|
|
unset($_SESSION['objExercise']);
|
|
|
unset($_SESSION['questionList']);
|
|
|
|
|
|
-// additional APIs
|
|
|
-$htmlHeadXtra[] = '<script>
|
|
|
-chamilo_courseCode = "'.$course_code.'";
|
|
|
-</script>';
|
|
|
-// Document API
|
|
|
-$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_CODE_PATH).'newscorm/js/documentapi.js" type="text/javascript"></script>';
|
|
|
-// Storage API
|
|
|
-$htmlHeadXtra[] = '<script>
|
|
|
-var sv_user = \''.api_get_user_id().'\';
|
|
|
-var sv_course = chamilo_courseCode;
|
|
|
-var sv_sco = \''.intval($_REQUEST['lp_id']).'\';
|
|
|
-</script>'; // FIXME fetch sco and userid from a more reliable source directly in sotrageapi.js
|
|
|
-$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_CODE_PATH).'newscorm/js/storageapi.js"></script>';
|
|
|
-
|
|
|
-if ($debug) {
|
|
|
- error_log(" src: $src ");
|
|
|
- error_log(" lp_type: $lp_type ");
|
|
|
-}
|
|
|
+/** @var Template $template */
|
|
|
+
|
|
|
+$template = $app['template'];
|
|
|
+$template->assign('course_code', $course_code);
|
|
|
|
|
|
-$get_toc_list = $_SESSION['oLP']->get_toc();
|
|
|
+$template->assign('lp_id', $lpId);
|
|
|
+$get_toc_list = $learnPath->get_toc();
|
|
|
$type_quiz = false;
|
|
|
|
|
|
foreach ($get_toc_list as $toc) {
|
|
@@ -146,44 +122,43 @@ if (!isset($src)) {
|
|
|
$src = null;
|
|
|
switch ($lp_type) {
|
|
|
case 1:
|
|
|
- $_SESSION['oLP']->stop_previous_item();
|
|
|
+ $learnPath->stop_previous_item();
|
|
|
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_CODE_PATH).'newscorm/scorm_api.php" type="text/javascript"></script>';
|
|
|
- $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
|
|
|
+ $prereq_check = $learnPath->prerequisites_match($lp_item_id);
|
|
|
if ($prereq_check === true) {
|
|
|
- $src = $_SESSION['oLP']->get_link('http', $lp_item_id, $get_toc_list);
|
|
|
+ $src = $learnPath->get_link('http', $lp_item_id, $get_toc_list);
|
|
|
|
|
|
- //Prevents FF 3.6 + Adobe Reader 9 bug see BT#794 when calling a pdf file in a LP.
|
|
|
+ // Prevents FF 3.6 + Adobe Reader 9 bug see BT#794 when calling a pdf file in a LP.
|
|
|
$file_info = parse_url($src);
|
|
|
$file_info = pathinfo($file_info['path']);
|
|
|
if (isset($file_info['extension']) && api_strtolower(substr($file_info['extension'], 0, 3) == 'pdf')) {
|
|
|
$src = api_get_path(WEB_CODE_PATH).'newscorm/lp_view_item.php?lp_item_id='.$lp_item_id;
|
|
|
}
|
|
|
- $_SESSION['oLP']->start_current_item(); // starts time counter manually if asset
|
|
|
+ $learnPath->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
|
|
|
+ $learnPath->stop_previous_item(); // save status manually if asset
|
|
|
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_CODE_PATH).'newscorm/scorm_api.php" type="text/javascript" language="javascript"></script>';
|
|
|
- $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
|
|
|
+ $prereq_check = $learnPath->prerequisites_match($lp_item_id);
|
|
|
if ($prereq_check === true) {
|
|
|
- $src = $_SESSION['oLP']->get_link('http', $lp_item_id, $get_toc_list);
|
|
|
- $_SESSION['oLP']->start_current_item(); // starts time counter manually if asset
|
|
|
+ $src = $learnPath->get_link('http', $lp_item_id, $get_toc_list);
|
|
|
+ $learnPath->start_current_item(); // starts time counter manually if asset
|
|
|
} else {
|
|
|
$src = 'blank.php?error=prerequisites';
|
|
|
}
|
|
|
break;
|
|
|
case 3:
|
|
|
// aicc
|
|
|
- $_SESSION['oLP']->stop_previous_item(); // save status manually if asset
|
|
|
- $htmlHeadXtra[] = '<script src="'.$_SESSION['oLP']->get_js_lib(
|
|
|
- ).'" type="text/javascript" language="javascript"></script>';
|
|
|
- $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
|
|
|
+ $learnPath->stop_previous_item(); // save status manually if asset
|
|
|
+ $htmlHeadXtra[] = '<script src="'.$learnPath->get_js_lib().'" type="text/javascript" language="javascript"></script>';
|
|
|
+ $prereq_check = $learnPath->prerequisites_match($lp_item_id);
|
|
|
if ($prereq_check === true) {
|
|
|
- $src = $_SESSION['oLP']->get_link('http', $lp_item_id, $get_toc_list);
|
|
|
- $_SESSION['oLP']->start_current_item(); // starts time counter manually if asset
|
|
|
+ $src = $learnPath->get_link('http', $lp_item_id, $get_toc_list);
|
|
|
+ $learnPath->start_current_item(); // starts time counter manually if asset
|
|
|
} else {
|
|
|
$src = 'blank.php';
|
|
|
}
|
|
@@ -194,23 +169,15 @@ if (!isset($src)) {
|
|
|
}
|
|
|
|
|
|
$autostart = 'true';
|
|
|
-// Update status, total_time from lp_item_view table when you finish the exercises in learning path.
|
|
|
-
|
|
|
-if ($debug) {
|
|
|
- error_log('$type_quiz: '.$type_quiz);
|
|
|
- error_log('$_REQUEST[exeId]: '.intval($_REQUEST['exeId']));
|
|
|
- error_log('$lp_id: '.$lp_id);
|
|
|
- error_log('$_GET[lp_item_id]: '.intval($_GET['lp_item_id']));
|
|
|
-}
|
|
|
|
|
|
-if (!$_SESSION['oLP']->check_attempts()) {
|
|
|
+if (!$learnPath->check_attempts()) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
|
|
|
if ($type_quiz && !empty($_REQUEST['exeId']) && isset($lp_id) && isset($_GET['lp_item_id'])) {
|
|
|
global $src;
|
|
|
|
|
|
- $_SESSION['oLP']->items[$_SESSION['oLP']->current]->write_to_db();
|
|
|
+ $learnPath->items[$learnPath->current]->write_to_db();
|
|
|
|
|
|
$TBL_TRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
|
|
|
$TBL_LP_ITEM_VIEW = Database::get_course_table(TABLE_LP_ITEM_VIEW);
|
|
@@ -241,7 +208,7 @@ if ($type_quiz && !empty($_REQUEST['exeId']) && isset($lp_id) && isset($_GET['lp
|
|
|
}
|
|
|
Database::query($sql_upd_max_score);
|
|
|
|
|
|
- $sql_last_attempt = "SELECT id FROM $TBL_LP_ITEM_VIEW WHERE c_id = $course_id AND lp_item_id = '$safe_item_id' AND lp_view_id = '".$_SESSION['oLP']->lp_view_id."' order by id desc limit 1";
|
|
|
+ $sql_last_attempt = "SELECT id FROM $TBL_LP_ITEM_VIEW WHERE c_id = $course_id AND lp_item_id = '$safe_item_id' AND lp_view_id = '".$learnPath->lp_view_id."' order by id desc limit 1";
|
|
|
$res_last_attempt = Database::query($sql_last_attempt);
|
|
|
if ($debug) {
|
|
|
error_log($sql_last_attempt);
|
|
@@ -274,23 +241,15 @@ if ($type_quiz && !empty($_REQUEST['exeId']) && isset($lp_id) && isset($_GET['lp
|
|
|
$autostart = 'false';
|
|
|
}
|
|
|
|
|
|
-$_SESSION['oLP']->set_previous_item($lp_item_id);
|
|
|
-$nameTools = Security :: remove_XSS($_SESSION['oLP']->get_name());
|
|
|
+$learnPath->set_previous_item($lp_item_id);
|
|
|
+$lpName = Security::remove_XSS($learnPath->get_name());
|
|
|
|
|
|
$save_setting = api_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[] = "<script>window.open('$src','content_id','toolbar=0,location=0,status=0,scrollbars=1,resizable=1');</script>";
|
|
|
-}
|
|
|
-
|
|
|
-// Not in fullscreen mode.
|
|
|
-
|
|
|
-Display::display_reduced_header($nameTools);
|
|
|
+// Sets the css theme of the LP this call is also use at the frames (toc, nav, message).
|
|
|
+$lp_theme_css = $learnPath->get_theme();
|
|
|
|
|
|
// Check if audio recorder needs to be in studentview.
|
|
|
if (isset($_SESSION['status']) && $_SESSION['status'][$course_code] == 5) {
|
|
@@ -305,11 +264,11 @@ $_SESSION['loaded_lp_view'] = true;
|
|
|
$display_none = '';
|
|
|
$margin_left = '305px';
|
|
|
|
|
|
-//Media player code
|
|
|
+// Media player code
|
|
|
|
|
|
-$display_mode = $_SESSION['oLP']->mode;
|
|
|
+$display_mode = $learnPath->mode;
|
|
|
$scorm_css_header = true;
|
|
|
-$lp_theme_css = $_SESSION['oLP']->get_theme();
|
|
|
+$lp_theme_css = $learnPath->get_theme();
|
|
|
|
|
|
// Setting up the CSS theme if exists.
|
|
|
if (!empty ($lp_theme_css) && !empty ($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
|
|
@@ -318,14 +277,14 @@ if (!empty ($lp_theme_css) && !empty ($mycourselptheme) && $mycourselptheme != -
|
|
|
$lp_theme_css = $my_style;
|
|
|
}
|
|
|
|
|
|
-$progress_bar = $_SESSION['oLP']->get_progress_bar('', -1, '', true);
|
|
|
-$navigation_bar = $_SESSION['oLP']->get_navigation_bar();
|
|
|
-$mediaplayer = $_SESSION['oLP']->get_mediaplayer($autostart);
|
|
|
+$progress_bar = $learnPath->get_progress_bar('', -1, '', true);
|
|
|
+$navigation_bar = $learnPath->get_navigation_bar();
|
|
|
+$mediaplayer = $learnPath->get_mediaplayer($autostart);
|
|
|
|
|
|
$tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
|
|
|
$show_audioplayer = false;
|
|
|
// Getting all the information about the item.
|
|
|
-$sql = "SELECT audio FROM ".$tbl_lp_item." WHERE c_id = $course_id AND lp_id = '".$_SESSION['oLP']->lp_id."'";
|
|
|
+$sql = "SELECT audio FROM ".$tbl_lp_item." WHERE c_id = $course_id AND lp_id = '".$learnPath->lp_id."'";
|
|
|
$res_media = Database::query($sql);
|
|
|
|
|
|
if (Database::num_rows($res_media) > 0) {
|
|
@@ -337,212 +296,59 @@ if (Database::num_rows($res_media) > 0) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-echo '<div id="learning_path_main">';
|
|
|
-$is_allowed_to_edit = api_is_allowed_to_edit(null, true, false, false);
|
|
|
+$template->assign('api_is_allowed_to_edit', api_is_allowed_to_edit(null, true, false, false));
|
|
|
if ($is_allowed_to_edit) {
|
|
|
- echo '<div class="row">';
|
|
|
- echo '<div id="learning_path_breadcrumb_zone" class="col-md-12">';
|
|
|
- global $interbreadcrumb;
|
|
|
- $interbreadcrumb[] = array(
|
|
|
- 'url' => 'lp_controller.php?action=list&isStudentView=false',
|
|
|
- 'name' => get_lang('LearningPaths')
|
|
|
- );
|
|
|
- $interbreadcrumb[] = array(
|
|
|
- 'url' => api_get_self()."?action=add_item&type=step&lp_id=".$_SESSION['oLP']->lp_id."&isStudentView=false",
|
|
|
- 'name' => $_SESSION['oLP']->get_name()
|
|
|
- );
|
|
|
- $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Preview'));
|
|
|
- echo $app['template']->returnBreadcrumb($interbreadcrumb, null, null);
|
|
|
- echo '</div>';
|
|
|
- echo '</div>';
|
|
|
+ global $interbreadcrumb;
|
|
|
+ $interbreadcrumb[] = array(
|
|
|
+ 'url' => 'lp_controller.php?action=list&isStudentView=false',
|
|
|
+ 'name' => get_lang('LearningPaths')
|
|
|
+ );
|
|
|
+ $interbreadcrumb[] = array(
|
|
|
+ 'url' => api_get_self()."?action=add_item&type=step&lp_id=".$learnPath->lp_id."&isStudentView=false",
|
|
|
+ 'name' => $learnPath->get_name()
|
|
|
+ );
|
|
|
+ $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Preview'));
|
|
|
+ $template->assign('breadcrumb', $app['template']->returnBreadcrumb($interbreadcrumb, null, null));
|
|
|
}
|
|
|
-echo '<div class="row">';
|
|
|
-
|
|
|
-echo '<div id="learning_path_left_zone" class="col-md-2" style="'.$display_none.'"> ';
|
|
|
-echo '<div id="header">
|
|
|
- <table>
|
|
|
- <tr>
|
|
|
- <td>';
|
|
|
-echo '<a href="lp_controller.php?action=return_to_course_homepage&'.api_get_cidreq().'" target="_self" onclick="javascript: window.parent.API.save_asset();">
|
|
|
- '.Display::return_icon('lp_arrow.gif').'
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- <td>';
|
|
|
-if ($is_allowed_to_edit) {
|
|
|
- echo '<a class="link no-border" href="lp_controller.php?isStudentView=false&action=return_to_course_homepage&'.api_get_cidreq(
|
|
|
- ).'" target="_self" onclick="javascript: window.parent.API.save_asset();">';
|
|
|
+
|
|
|
+if ($learnPath->get_preview_image() != '') {
|
|
|
+ $picture = getimagesize(api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$learnPath->get_preview_image());
|
|
|
+ $style = null;
|
|
|
+ if ($picture['1'] < 96) {
|
|
|
+ $style = ' style="padding-top:'.((94 - $picture['1']) / 2).'px;" ';
|
|
|
+ }
|
|
|
+ $size = ($picture['0'] > 104 && $picture['1'] > 96) ? ' width="104" height="96" ' : $style;
|
|
|
+ $my_path = $learnPath->get_preview_image_path();
|
|
|
+ $picture = $my_path;
|
|
|
} else {
|
|
|
- echo '<a class="link no-border" href="lp_controller.php?action=return_to_course_homepage&'.api_get_cidreq(
|
|
|
- ).'" target="_self" onclick="javascript: window.parent.API.save_asset();">';
|
|
|
+ $picture = Display::return_icon('unknown_250_100.jpg', null, array(), ICON_SIZE_SMALL, false, true);
|
|
|
}
|
|
|
-echo get_lang('CourseHomepageLink').'
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- </div>';
|
|
|
-?>
|
|
|
-<!-- end header -->
|
|
|
-
|
|
|
-<!-- Author image preview -->
|
|
|
-<div id="author_image">
|
|
|
- <div id="author_icon">
|
|
|
- <?php
|
|
|
- if ($_SESSION['oLP']->get_preview_image() != '') {
|
|
|
- $picture = getimagesize(
|
|
|
- api_get_path(SYS_COURSE_PATH).api_get_course_path(
|
|
|
- ).'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image()
|
|
|
- );
|
|
|
- $style = null;
|
|
|
- if ($picture['1'] < 96) {
|
|
|
- $style = ' style="padding-top:'.((94 - $picture['1']) / 2).'px;" ';
|
|
|
- }
|
|
|
- $size = ($picture['0'] > 104 && $picture['1'] > 96) ? ' width="104" height="96" ' : $style;
|
|
|
- $my_path = $_SESSION['oLP']->get_preview_image_path();
|
|
|
- echo '<img src="'.$my_path.'">';
|
|
|
- } else {
|
|
|
- echo Display :: display_icon('unknown_250_100.jpg');
|
|
|
- }
|
|
|
- ?>
|
|
|
- </div>
|
|
|
- <div id="lp_navigation_elem">
|
|
|
- <?php echo $navigation_bar; ?>
|
|
|
- <div id="progress_bar">
|
|
|
- <?php echo $progress_bar; ?>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-</div>
|
|
|
-<!-- end image preview Layout -->
|
|
|
-
|
|
|
-<div id="author_name">
|
|
|
- <?php echo $_SESSION['oLP']->get_author(); ?>
|
|
|
-</div>
|
|
|
-
|
|
|
-<!-- media player layout -->
|
|
|
-<?php
|
|
|
-if ($show_audioplayer) {
|
|
|
- echo '<div id="lp_media_file">';
|
|
|
- echo $mediaplayer;
|
|
|
- echo '</div>';
|
|
|
-}
|
|
|
-?>
|
|
|
-<!-- end media player layout -->
|
|
|
-
|
|
|
-<!-- TOC layout -->
|
|
|
-<div id="toc_id" name="toc_name" style="overflow: auto; padding:0;margin-top:0px;width:100%;float:left">
|
|
|
- <div id="learning_path_toc">
|
|
|
- <?php echo $_SESSION['oLP']->get_html_toc($get_toc_list); ?>
|
|
|
- </div>
|
|
|
-</div>
|
|
|
-<!-- end TOC layout -->
|
|
|
-</div>
|
|
|
-<!-- end left zone -->
|
|
|
-
|
|
|
-<!-- right zone -->
|
|
|
-<div id="learning_path_right_zone" class="col-md-9" style="margin-left:<?php echo $margin_left;?>;height:100%">
|
|
|
- <?php
|
|
|
- // hub 26-05-2010 Fullscreen or not fullscreen
|
|
|
- $height = '100%';
|
|
|
- if ($_SESSION['oLP']->mode == 'fullscreen') {
|
|
|
- echo '<iframe id="content_id_blank" name="content_name_blank" src="blank.php" border="0" frameborder="0" style="width:100%;height:'.$height.'" allowFullScreen></iframe>';
|
|
|
- } else {
|
|
|
- echo '<iframe id="content_id" name="content_name" src="'.$src.'" border="0" frameborder="0" style="display: block; width:100%;height:'.$height.'" allowFullScreen></iframe>';
|
|
|
- }
|
|
|
- ?>
|
|
|
-</div>
|
|
|
-<!-- end right Zone -->
|
|
|
-</div>
|
|
|
-</div>
|
|
|
-
|
|
|
-
|
|
|
-<script>
|
|
|
- // Resize right and left pane to full height (HUB 20-05-2010).
|
|
|
- function updateContentHeight() {
|
|
|
- document.body.style.overflow = 'hidden';
|
|
|
- var IE = window.navigator.appName.match(/microsoft/i);
|
|
|
- var hauteurHeader = document.getElementById('header').offsetHeight;
|
|
|
- var hauteurAuthorImg = document.getElementById('author_image').offsetHeight;
|
|
|
- var hauteurAuthorName = document.getElementById('author_name').offsetHeight;
|
|
|
-
|
|
|
- var hauteurMedia = 0;
|
|
|
- if ($("#lp_media_file").length != 0) {
|
|
|
- hauteurMedia = document.getElementById('lp_media_file').offsetHeight;
|
|
|
- }
|
|
|
|
|
|
- var hauteurTitre = document.getElementById('scorm_title').offsetHeight;
|
|
|
- var hauteurAction = 0;
|
|
|
- if (document.getElementById('actions_lp')) hauteurAction = document.getElementById('actions_lp').offsetHeight;
|
|
|
- var hauteurHaut = hauteurHeader + hauteurAuthorImg + hauteurAuthorName + hauteurMedia + hauteurTitre + hauteurAction;
|
|
|
- var innerHauteur = (IE) ? document.body.clientHeight : window.innerHeight;
|
|
|
- var debugsize = 0;
|
|
|
- // -40 is a static adjustement for margin, spaces on the page
|
|
|
- <?php if (!empty($_SESSION['oLP']->scorm_debug)) {
|
|
|
- echo 'debugsize = 150;';
|
|
|
- } ?>
|
|
|
- document.getElementById('inner_lp_toc').style.height = innerHauteur - hauteurHaut - 40 - debugsize + "px";
|
|
|
- if (document.getElementById('content_id')) {
|
|
|
- document.getElementById('content_id').style.height = innerHauteur + 'px';
|
|
|
- }
|
|
|
+$app['template']->assign('course_url', api_get_cidreq());
|
|
|
+$app['template']->assign('picture', $picture);
|
|
|
+$app['template']->assign('navigation_bar', $navigation_bar);
|
|
|
+$app['template']->assign('progress_bar', $progress_bar);
|
|
|
+$app['template']->assign('author', $learnPath->get_author());
|
|
|
+$app['template']->assign('mediaplayer', $mediaplayer);
|
|
|
+$app['template']->assign('table_of_contents', $learnPath->get_html_toc($get_toc_list));
|
|
|
+$app['template']->assign('lp_name', $lpName);
|
|
|
+
|
|
|
+// hub 26-05-2010 Fullscreen or not fullscreen
|
|
|
+$height = '100%';
|
|
|
+if ($learnPath->mode == 'fullscreen') {
|
|
|
+ $iframe = '<iframe id="content_id_blank" name="content_name_blank" src="blank.php" border="0" frameborder="0" style="width:100%;height:'.$height.'" allowFullScreen></iframe>';
|
|
|
+} else {
|
|
|
+ $iframe = '<iframe id="content_id" name="content_name" src="'.$src.'" border="0" frameborder="0" style="display: block; width:100%; height:'.$height.'" allowFullScreen></iframe>';
|
|
|
+}
|
|
|
+$app['template']->assign('iframe', $iframe);
|
|
|
+$app['template']->assign('show_glossary', api_get_setting('show_glossary_in_extra_tools'));
|
|
|
+$app['template']->assign('glossary_type', api_get_setting('show_glossary_in_documents'));
|
|
|
|
|
|
- // Loads the glossary library.
|
|
|
- <?php
|
|
|
- if (api_get_setting('show_glossary_in_extra_tools') == 'true') {
|
|
|
- if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
|
|
|
- ?>
|
|
|
- $.frameReady(function () {
|
|
|
- // $("<div>I am a div courses</div>").prependTo("body");
|
|
|
- }, "top.content_name",
|
|
|
- { load:[
|
|
|
- {type:"script", id:"_fr1", src:"<?php echo api_get_path(
|
|
|
- WEB_LIBRARY_PATH
|
|
|
- ); ?>javascript/jquery.js"},
|
|
|
- {type:"script", id:"_fr4", src:"<?php echo api_get_path(
|
|
|
- WEB_LIBRARY_PATH
|
|
|
- ); ?>javascript/jquery-ui/js/jquery-ui.custom.js"},
|
|
|
- {type:"stylesheet", id:"_fr5", src:"<?php echo api_get_path(
|
|
|
- WEB_LIBRARY_PATH
|
|
|
- ); ?>javascript/jquery-ui/css/smoothness/jquery-ui.custom.min.css"},
|
|
|
- {type:"script", id:"_fr2", src:"<?php echo api_get_path(
|
|
|
- WEB_LIBRARY_PATH
|
|
|
- ); ?>javascript/jquery.highlight.js"}
|
|
|
-
|
|
|
- ] }
|
|
|
- );
|
|
|
- <?php
|
|
|
- } elseif (api_get_setting('show_glossary_in_documents') == 'isautomatic') {
|
|
|
- ?>
|
|
|
- $.frameReady(function () {
|
|
|
- // $("<div>I am a div courses</div>").prependTo("body");
|
|
|
- }, "top.content_name",
|
|
|
- { load:[
|
|
|
- {type:"script", id:"_fr1", src:"<?php echo api_get_path(
|
|
|
- WEB_LIBRARY_PATH
|
|
|
- ); ?>javascript/jquery.js"},
|
|
|
- {type:"script", id:"_fr4", src:"<?php echo api_get_path(
|
|
|
- WEB_LIBRARY_PATH
|
|
|
- ); ?>javascript/jquery-ui/js/jquery-ui.custom.js"},
|
|
|
- {type:"stylesheet", id:"_fr5", src:"<?php echo api_get_path(
|
|
|
- WEB_LIBRARY_PATH
|
|
|
- ); ?>javascript/jquery-ui/css/smoothness/jquery-ui-custom.css"},
|
|
|
- {type:"script", id:"_fr2", src:"<?php echo api_get_path(
|
|
|
- WEB_LIBRARY_PATH
|
|
|
- ); ?>javascript/jquery.highlight.js"}
|
|
|
-
|
|
|
- ] }
|
|
|
- );
|
|
|
- <?php
|
|
|
- }
|
|
|
- }
|
|
|
- ?>
|
|
|
- }
|
|
|
- window.onload = updateContentHeight;
|
|
|
- window.onresize = updateContentHeight;
|
|
|
-</script>
|
|
|
-<?php
|
|
|
// Restore a global setting.
|
|
|
$_setting['show_navigation_menu'] = $save_setting;
|
|
|
|
|
|
-if ($debug) {
|
|
|
- error_log(' ------- end lp_view.php ------');
|
|
|
-}
|
|
|
-Display::display_footer();
|
|
|
+//$content = $app['template']->fetch('default/javascript/newscorm/lp.tpl');
|
|
|
+$app['template.show_footer'] = false;
|
|
|
+$app['template.show_header'] = false;
|
|
|
+
|
|
|
+$app['default_layout'] = 'default/learnpath/lp.tpl';
|