lp_view.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. <?php // $Id: lp_view.php,v 1.33 2006/09/12 10:20:46 yannoo Exp $
  2. /**
  3. ==============================================================================
  4. * This file was origially the copy of document.php, but many modifications happened since then ;
  5. * the direct file view is not needed anymore, if the user uploads a scorm zip file, a directory
  6. * will be automatically created for it, and the files will be uncompressed there for example ;
  7. *
  8. * @package dokeos.learnpath
  9. * @author Yannick Warnier <ywarnier@beeznest.org> - redesign
  10. * @author Denes Nagy, principal author
  11. * @author Isthvan Mandak, several new features
  12. * @author Roan Embrechts, code improvements and refactoring
  13. * @license GNU/GPL - See Dokeos license directory for details
  14. ==============================================================================
  15. */
  16. /**
  17. * Script
  18. */
  19. /*
  20. ==============================================================================
  21. INIT SECTION
  22. ==============================================================================
  23. */
  24. $_SESSION['whereami'] = 'lp/view';
  25. $this_section=SECTION_COURSES;
  26. if($lp_controller_touched!=1){
  27. header('location: lp_controller.php?action=view&item_id='.$_REQUEST['item_id']);
  28. }
  29. /*
  30. -----------------------------------------------------------
  31. Libraries
  32. -----------------------------------------------------------
  33. */
  34. require_once('back_compat.inc.php');
  35. //require_once('../learnpath/learnpath_functions.inc.php');
  36. require_once('scorm.lib.php');
  37. require_once('learnpath.class.php');
  38. require_once('learnpathItem.class.php');
  39. //require_once('lp_comm.common.php'); //xajax functions
  40. if ($is_allowed_in_course == false) api_not_allowed();
  41. /*
  42. -----------------------------------------------------------
  43. Variables
  44. -----------------------------------------------------------
  45. */
  46. //$charset = 'UTF-8';
  47. //$charset = 'ISO-8859-1';
  48. $charset = api_get_system_encoding();
  49. $oLearnpath = false;
  50. $course_code = api_get_course_id();
  51. $user_id = api_get_user_id();
  52. $platform_theme = api_get_setting('stylesheets'); // plataform's css
  53. $my_style=$platform_theme;
  54. //escape external variables
  55. /*
  56. -----------------------------------------------------------
  57. Header
  58. -----------------------------------------------------------
  59. */
  60. //$htmlHeadXtra[] = '<script type="text/javascript" src="lp_view.lib.js"></script>';
  61. //$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/')."\n";
  62. $htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
  63. $htmlHeadXtra[] = '<script language="javascript">
  64. function cleanlog(){
  65. if(document.getElementById){
  66. document.getElementById("log_content").innerHTML = "";
  67. }
  68. }
  69. </script>';
  70. $htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
  71. var dokeos_xajax_handler = window.oxajax;
  72. </script>';
  73. $_SESSION['oLP']->error = '';
  74. $lp_type = $_SESSION['oLP']->get_type();
  75. $lp_item_id = $_SESSION['oLP']->get_current_item_id();
  76. //$lp_item_id = learnpath::escape_string($_GET['item_id']);
  77. //$_SESSION['oLP']->set_current_item($lp_item_id); // already done by lp_controller.php
  78. //Prepare variables for the test tool (just in case) - honestly, this should disappear later on
  79. $_SESSION['scorm_view_id'] = $_SESSION['oLP']->get_view_id();
  80. $_SESSION['scorm_item_id'] = $lp_item_id;
  81. $_SESSION['lp_mode'] = $_SESSION['oLP']->mode;
  82. //reinit exercises variables to avoid spacename clashes (see exercise tool)
  83. if(isset($exerciseResult) or isset($_SESSION['exerciseResult']))
  84. {
  85. api_session_unregister($exerciseResult);
  86. }
  87. unset($_SESSION['objExercise']);
  88. unset($_SESSION['questionList']);
  89. /**
  90. * Get a link to the corresponding document
  91. */
  92. if (!isset($src))
  93. {
  94. $src = '';
  95. switch($lp_type)
  96. {
  97. case 1:
  98. $_SESSION['oLP']->stop_previous_item();
  99. $htmlHeadXtra[] = '<script src="scorm_api.php" type="text/javascript" language="javascript"></script>';
  100. $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
  101. if($prereq_check === true){
  102. $src = $_SESSION['oLP']->get_link('http',$lp_item_id);
  103. $_SESSION['oLP']->start_current_item(); //starts time counter manually if asset
  104. }else{
  105. $src = 'blank.php?error=prerequisites';
  106. }
  107. break;
  108. case 2:
  109. //save old if asset
  110. $_SESSION['oLP']->stop_previous_item(); //save status manually if asset
  111. $htmlHeadXtra[] = '<script src="scorm_api.php" type="text/javascript" language="javascript"></script>';
  112. $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
  113. if($prereq_check === true){
  114. $src = $_SESSION['oLP']->get_link('http',$lp_item_id);
  115. $_SESSION['oLP']->start_current_item(); //starts time counter manually if asset
  116. }else{
  117. $src = 'blank.php?error=prerequisites';
  118. }
  119. break;
  120. case 3:
  121. //aicc
  122. $_SESSION['oLP']->stop_previous_item(); //save status manually if asset
  123. $htmlHeadXtra[] = '<script src="'.$_SESSION['oLP']->get_js_lib().'" type="text/javascript" language="javascript"></script>';
  124. $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
  125. if($prereq_check === true){
  126. $src = $_SESSION['oLP']->get_link('http',$lp_item_id);
  127. $_SESSION['oLP']->start_current_item(); //starts time counter manually if asset
  128. }else{
  129. $src = 'blank.php';
  130. }
  131. break;
  132. case 4:
  133. break;
  134. }
  135. }
  136. $list = $_SESSION['oLP']->get_toc();
  137. $type_quiz = false;
  138. foreach($list as $toc) {
  139. if ($toc['id'] == $lp_item_id && ($toc['type']=='quiz') ) {
  140. $type_quiz = true;
  141. }
  142. }
  143. $ctok = $_SESSION['sec_token'];
  144. // update status,total_time from lp_item_view table when you finish the exercises in learning path
  145. if ($type_quiz && !empty($_REQUEST['exeId']) && isset($_GET['lp_id']) && isset($_GET['lp_item_id'])) {
  146. global $src;
  147. $_SESSION['oLP']->items[$_SESSION['oLP']->current]->write_to_db();
  148. $TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
  149. $TBL_LP_ITEM_VIEW = Database::get_course_table(TABLE_LP_ITEM_VIEW);
  150. $TBL_LP_VIEW = Database::get_course_table(TABLE_LP_VIEW);
  151. $TBL_LP_ITEM = Database::get_course_table(TABLE_LP_ITEM);
  152. $safe_item_id = Database::escape_string($_GET['lp_item_id']);
  153. $safe_id = Database::escape_string($_GET['lp_id']);
  154. $safe_exe_id = Database::escape_string($_REQUEST['exeId']);
  155. if ($safe_id == strval(intval($safe_id)) && $safe_item_id == strval(intval($safe_item_id))) {
  156. $sql = 'SELECT start_date,exe_date,exe_result,exe_weighting FROM ' . $TBL_TRACK_EXERCICES . ' WHERE exe_id = '.(int)$safe_exe_id;
  157. $res = api_sql_query($sql,__FILE__,__LINE__);
  158. $row_dates = Database::fetch_array($res);
  159. $time_start_date = convert_mysql_date($row_dates['start_date']);
  160. $time_exe_date = convert_mysql_date($row_dates['exe_date']);
  161. $mytime = ((int)$time_exe_date-(int)$time_start_date);
  162. $score = (float)$row_dates['exe_result'];
  163. $max_score = (float)$row_dates['exe_weighting'];
  164. $sql_upd_status = "UPDATE $TBL_LP_ITEM_VIEW SET status = 'completed' WHERE lp_item_id = '".(int)$safe_item_id."'
  165. AND lp_view_id = (SELECT lp_view.id FROM $TBL_LP_VIEW lp_view WHERE user_id = '".(int)$_SESSION['oLP']->user_id."' AND lp_id='".(int)$safe_id."')";
  166. api_sql_query($sql_upd_status,__FILE__,__LINE__);
  167. $sql_upd_max_score = "UPDATE $TBL_LP_ITEM SET max_score = '$max_score' WHERE id = '".(int)$safe_item_id."'";
  168. api_sql_query($sql_upd_max_score,__FILE__,__LINE__);
  169. $sql_last_attempt = "SELECT id FROM $TBL_LP_ITEM_VIEW WHERE lp_item_id = '$safe_item_id' AND lp_view_id = '".$_SESSION['oLP']->lp_view_id."' order by id desc limit 1";
  170. $res_last_attempt = api_sql_query($sql_last_attempt,__FILE__,__LINE__);
  171. $row_last_attempt = Database::fetch_row($res_last_attempt);
  172. if (Database::num_rows($res_last_attempt)>0) {
  173. $sql_upd_score = "UPDATE $TBL_LP_ITEM_VIEW SET score = $score,total_time = $mytime WHERE id='".$row_last_attempt[0]."'";
  174. api_sql_query($sql_upd_score,__FILE__,__LINE__);
  175. }
  176. }
  177. $src = 'blank.php?msg=exerciseFinished';
  178. }
  179. $_SESSION['oLP']->set_previous_item($lp_item_id);
  180. $nameTools = $_SESSION['oLP']->get_name();
  181. $save_setting = get_setting("show_navigation_menu");
  182. global $_setting;
  183. $_setting['show_navigation_menu'] = 'false';
  184. $scorm_css_header=true;
  185. $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)
  186. if($_SESSION['oLP']->mode == 'fullscreen')
  187. {
  188. $htmlHeadXtra[] = "<script>window.open('$src','content_id','toolbar=0,location=0,status=0,scrollbars=1,resizable=1');</script>";
  189. include_once('../inc/reduced_header.inc.php');
  190. //set flag to ensure lp_header.php is loaded by this script (flag is unset in lp_header.php)
  191. $_SESSION['loaded_lp_view'] = true;
  192. ?>
  193. <input type="hidden" id="old_item" name ="old_item" value="0"/>
  194. <input type="hidden" id="current_item_id" name ="current_item_id" value="0" />
  195. <div id="learningPathMain" style="width:100%;height:100%;" >
  196. <div id="learningPathLeftZone" style="float:left;width:280px;height:100%">
  197. <!-- header -->
  198. <div id="header">
  199. <div id="learningPathHeader" style="font-size:14px;">
  200. <table>
  201. <tr>
  202. <td>
  203. <a href="lp_controller.php?action=return_to_course_homepage" target="_top" onclick="window.parent.API.save_asset();"><img src="../img/lp_arrow.gif" /></a>
  204. </td>
  205. <td>
  206. <a class="link" href="lp_controller.php?action=return_to_course_homepage" target="_top" onclick="window.parent.API.save_asset();"><?php echo get_lang('CourseHomepageLink'); ?></a>
  207. </td>
  208. </tr>
  209. </table>
  210. </div>
  211. </div>
  212. <!-- end header -->
  213. <!-- Image preview Layout -->
  214. <div id="author_image" name="author_image" class="lp_author_image" style="height:23%; width:100%;margin-left:5px">
  215. <?php $image = '../img/lp_author_background.gif'; ?>
  216. <div id="preview_image" style="padding:5px;background-image: url('../img/lp_author_background.gif');background-repeat:no-repeat;height:110px">
  217. <div style="width:100; float:left;height:105;margin:5px">
  218. <span>
  219. <?php if ($_SESSION['oLP']->get_preview_image()!=''): ?>
  220. <img width="115" height="100" src="<?php echo api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image(); ?>">
  221. <?php
  222. else
  223. : echo Display :: display_icon('unknown_250_100.jpg', ' ');
  224. endif;
  225. ?>
  226. </span>
  227. </div>
  228. <div id="nav_id" name="nav_name" class="lp_nav" style="margin-left:105;height:90">
  229. <?php
  230. $display_mode = $_SESSION['oLP']->mode;
  231. $scorm_css_header = true;
  232. $lp_theme_css = $_SESSION['oLP']->get_theme();
  233. //Setting up the CSS theme if exists
  234. if (!empty ($lp_theme_css) && !empty ($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
  235. global $lp_theme_css;
  236. } else {
  237. $lp_theme_css = $my_style;
  238. }
  239. $progress_bar = $_SESSION['oLP']->get_progress_bar('', -1, '', true);
  240. $navigation_bar = $_SESSION['oLP']->get_navigation_bar();
  241. $mediaplayer = $_SESSION['oLP']->get_mediaplayer();
  242. $tbl_lp_item = Database::get_course_table('lp_item');
  243. $show_audioplayer = false;
  244. // getting all the information about the item
  245. $sql = "SELECT audio FROM " . $tbl_lp_item . " WHERE lp_id = '" . $_SESSION['oLP']->lp_id."'";
  246. $res_media= api_sql_query($sql, __FILE__, __LINE__);
  247. if(Database::num_rows($res_media) > 0){
  248. while($row_media= Database::fetch_array($res_media)) {
  249. if(!empty($row_media['audio'])) {$show_audioplayer = true; break;}
  250. }
  251. }
  252. ?>
  253. <div id="lp_navigation_elem" class="lp_navigation_elem" style="padding-left:130px;margin-top:9px;">
  254. <div style="padding-top:20px;padding-bottom:50px;" ><?php echo $navigation_bar; ?></div>
  255. <div style="height:20px"><?php echo $progress_bar; ?></div>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. <!-- end image preview Layout -->
  261. <div id="author_name" style="position:relative;top:2px;left:0px;margin:0;padding:0;text-align:center;width:100%">
  262. <?php echo $_SESSION['oLP']->get_author() ?>
  263. </div>
  264. <!-- media player layaout -->
  265. <?php $style_media = (($show_audioplayer)?' style= "position:relative;top:10px;left:10px;margin:8px;font-size:32pt;height:20px;"':'style="height:15px"'); ?>
  266. <div id="media" <?php echo $style_media ?>>
  267. <?php echo (!empty($mediaplayer))?$mediaplayer:'&nbsp;' ?>
  268. </div>
  269. <!-- end media player layaout -->
  270. <!-- toc layout -->
  271. <div id="toc_id" name="toc_name" style="padding:0;margin-top:20px;height:60%;width:100%">
  272. <div id="learningPathToc" style="font-size:9pt;margin:0;"><?php echo $_SESSION['oLP']->get_html_toc(); ?>
  273. <!-- log message layout -->
  274. <div id="lp_log_name" name="lp_log_name" class="lp_log" style="height:50px;overflow:auto;margin:15px">
  275. <div id="log_content"></div>
  276. <div style="color: white;" onClick="cleanlog();">.</div>
  277. </div>
  278. <!-- end log message layout -->
  279. </div>
  280. </div>
  281. <!-- end toc layout -->
  282. </div>
  283. <!-- end left Zone -->
  284. <!-- right Zone -->
  285. <div id="learningPathRightZone" style="margin-left:282px;border : 0pt solid blue;height:100%">
  286. <iframe id="content_id_blank" name="content_name_blank" src="blank.php" border="0" frameborder="0" style="width:100%;height:600px" ></iframe>
  287. </div>
  288. <!-- end right Zone -->
  289. </div>
  290. <script language="JavaScript" type="text/javascript">
  291. // Need to be called after the <head> to be sure window.oxajax is defined
  292. var dokeos_xajax_handler = window.oxajax;
  293. </script>
  294. <script language="JavaScript" type="text/javascript">
  295. <!--
  296. var leftZoneHeightOccupied = 0;
  297. var rightZoneHeightOccupied = 0;
  298. var initialLeftZoneHeight = 0;
  299. var initialRightZoneHeight = 0;
  300. var updateContentHeight = function() {
  301. winHeight = (window.innerHeight != undefined ? window.innerHeight : document.documentElement.clientHeight);
  302. newLeftZoneHeight = winHeight - leftZoneHeightOccupied;
  303. newRightZoneHeight = winHeight - rightZoneHeightOccupied;
  304. if (newLeftZoneHeight <= initialLeftZoneHeight) {
  305. newLeftZoneHeight = initialLeftZoneHeight;
  306. newRightZoneHeight = newLeftZoneHeight + leftZoneHeightOccupied - rightZoneHeightOccupied;
  307. }
  308. if (newRightZoneHeight <= initialRightZoneHeight) {
  309. newRightZoneHeight = initialRightZoneHeight;
  310. newLeftZoneHeight = newRightZoneHeight + rightZoneHeightOccupied - leftZoneHeightOccupied;
  311. }
  312. document.getElementById('learningPathToc').style.height = newLeftZoneHeight + 'px';
  313. document.getElementById('learningPathRightZone').style.height = newRightZoneHeight + 'px';
  314. document.getElementById('content_id_blank').style.height = newRightZoneHeight + 'px';
  315. if (document.body.clientHeight > winHeight) {
  316. document.body.style.overflow = 'auto';
  317. } else {
  318. document.body.style.overflow = 'hidden';
  319. }
  320. };
  321. window.onload = function() {
  322. screen_height = screen.height;
  323. screen_width = screen.height;
  324. document.getElementById('learningPathLeftZone').style.height = "100%";
  325. document.getElementById('learningPathToc').style.height = "60%";
  326. document.getElementById('learningPathToc').style.width = "100%";
  327. document.getElementById('learningPathRightZone').style.height = "100%"
  328. document.getElementById('content_id').style.height = "100%" ;
  329. if (screen_height <= 600) {
  330. document.getElementById('inner_lp_toc').style.height = "100px" ;
  331. document.getElementById('learningPathLeftZone').style.height = "415px";
  332. }
  333. initialLeftZoneHeight = document.getElementById('learningPathToc').offsetHeight;
  334. initialRightZoneHeight = document.getElementById('learningPathRightZone').offsetHeight;
  335. docHeight = document.body.clientHeight;
  336. leftZoneHeightOccupied = docHeight - initialLeftZoneHeight;
  337. rightZoneHeightOccupied = docHeight - initialRightZoneHeight;
  338. document.body.style.overflow = 'hidden';
  339. updateContentHeight();
  340. }
  341. window.onresize = updateContentHeight;
  342. -->
  343. </script>
  344. <?php
  345. }
  346. else
  347. {
  348. include_once('../inc/reduced_header.inc.php');
  349. //$displayAudioRecorder = (api_get_setting('service_visio','active')=='true') ? true : false;
  350. //check if audio recorder needs to be in studentview
  351. $course_id=$_SESSION["_course"]["id"];
  352. if($_SESSION["status"][$course_id]==5)
  353. {
  354. $audio_recorder_studentview = true;
  355. }
  356. else
  357. {
  358. $audio_recorder_studentview = false;
  359. }
  360. //set flag to ensure lp_header.php is loaded by this script (flag is unset in lp_header.php)
  361. $_SESSION['loaded_lp_view'] = true;
  362. ?>
  363. <input type="hidden" id="old_item" name ="old_item" value="0"/>
  364. <input type="hidden" id="current_item_id" name ="current_item_id" value="0" />
  365. <div id="learningPathMain" style="width:100%;height:100%;" >
  366. <div id="learningPathLeftZone" style="float:left;width:280px;height:100%">
  367. <!-- header -->
  368. <div id="header">
  369. <div id="learningPathHeader" style="font-size:14px;">
  370. <table>
  371. <tr>
  372. <td>
  373. <a href="lp_controller.php?action=return_to_course_homepage" target="_top" onclick="window.parent.API.save_asset();"><img src="../img/lp_arrow.gif" /></a>
  374. </td>
  375. <td>
  376. <a class="link" href="lp_controller.php?action=return_to_course_homepage" target="_top" onclick="window.parent.API.save_asset();"><?php echo get_lang('CourseHomepageLink'); ?></a>
  377. </td>
  378. </tr>
  379. </table>
  380. </div>
  381. </div>
  382. <!-- end header -->
  383. <!-- Image preview Layout -->
  384. <div id="author_image" name="author_image" class="lp_author_image" style="height:23%; width:100%;margin-left:5px">
  385. <?php $image = '../img/lp_author_background.gif'; ?>
  386. <div id="preview_image" style="padding:5px;background-image: url('../img/lp_author_background.gif');background-repeat:no-repeat;height:110px">
  387. <div style="width:100; float:left;height:105;margin:5px">
  388. <span>
  389. <?php if ($_SESSION['oLP']->get_preview_image()!=''): ?>
  390. <img width="115" height="100" src="<?php echo api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image(); ?>">
  391. <?php
  392. else
  393. : echo Display :: display_icon('unknown_250_100.jpg', ' ');
  394. endif;
  395. ?>
  396. </span>
  397. </div>
  398. <div id="nav_id" name="nav_name" class="lp_nav" style="margin-left:105;height:90">
  399. <?php
  400. $display_mode = $_SESSION['oLP']->mode;
  401. $scorm_css_header = true;
  402. $lp_theme_css = $_SESSION['oLP']->get_theme();
  403. //Setting up the CSS theme if exists
  404. if (!empty ($lp_theme_css) && !empty ($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
  405. global $lp_theme_css;
  406. } else {
  407. $lp_theme_css = $my_style;
  408. }
  409. $progress_bar = $_SESSION['oLP']->get_progress_bar('', -1, '', true);
  410. $navigation_bar = $_SESSION['oLP']->get_navigation_bar();
  411. $mediaplayer = $_SESSION['oLP']->get_mediaplayer();
  412. $tbl_lp_item = Database::get_course_table('lp_item');
  413. $show_audioplayer = false;
  414. // getting all the information about the item
  415. $sql = "SELECT audio FROM " . $tbl_lp_item . " WHERE lp_id = '" . $_SESSION['oLP']->lp_id."'";
  416. $res_media= api_sql_query($sql, __FILE__, __LINE__);
  417. if(Database::num_rows($res_media) > 0){
  418. while($row_media= Database::fetch_array($res_media)) {
  419. if(!empty($row_media['audio'])) {$show_audioplayer = true; break;}
  420. }
  421. }
  422. ?>
  423. <div id="lp_navigation_elem" class="lp_navigation_elem" style="padding-left:130px;margin-top:9px;">
  424. <div style="padding-top:20px;padding-bottom:50px;" ><?php echo $navigation_bar; ?></div>
  425. <div style="height:20px"><?php echo $progress_bar; ?></div>
  426. </div>
  427. </div>
  428. </div>
  429. </div>
  430. <!-- end image preview Layout -->
  431. <div id="author_name" style="position:relative;top:2px;left:0px;margin:0;padding:0;text-align:center;width:100%">
  432. <?php echo $_SESSION['oLP']->get_author() ?>
  433. </div>
  434. <!-- media player layaout -->
  435. <?php $style_media = (($show_audioplayer)?' style= "position:relative;top:10px;left:10px;margin:8px;font-size:32pt;height:20px;"':'style="height:15px"'); ?>
  436. <div id="media" <?php echo $style_media ?>>
  437. <?php echo (!empty($mediaplayer))?$mediaplayer:'&nbsp;' ?>
  438. </div>
  439. <!-- end media player layaout -->
  440. <!-- toc layout -->
  441. <div id="toc_id" name="toc_name" style="padding:0;margin-top:20px;height:60%;width:100%">
  442. <div id="learningPathToc" style="font-size:9pt;margin:0;"><?php echo $_SESSION['oLP']->get_html_toc(); ?>
  443. <!-- log message layout -->
  444. <div id="lp_log_name" name="lp_log_name" class="lp_log" style="height:50px;overflow:auto;margin:15px">
  445. <div id="log_content"></div>
  446. <div style="color: white;" onClick="cleanlog();">.</div>
  447. </div>
  448. <!-- end log message layout -->
  449. </div>
  450. </div>
  451. <!-- end toc layout -->
  452. </div>
  453. <!-- end left Zone -->
  454. <!-- right Zone -->
  455. <div id="learningPathRightZone" style="margin-left:282px;height:100%">
  456. <iframe id="content_id" name="content_name" src="<?php echo $src; ?>" border="0" frameborder="0" style="width:100%;height:600px" ></iframe>
  457. </div>
  458. <!-- end right Zone -->
  459. </div>
  460. <script language="JavaScript" type="text/javascript">
  461. // Need to be called after the <head> to be sure window.oxajax is defined
  462. var dokeos_xajax_handler = window.oxajax;
  463. </script>
  464. <script language="JavaScript" type="text/javascript">
  465. <!--
  466. var leftZoneHeightOccupied = 0;
  467. var rightZoneHeightOccupied = 0;
  468. var initialLeftZoneHeight = 0;
  469. var initialRightZoneHeight = 0;
  470. var updateContentHeight = function() {
  471. winHeight = (window.innerHeight != undefined ? window.innerHeight : document.documentElement.clientHeight);
  472. newLeftZoneHeight = winHeight - leftZoneHeightOccupied;
  473. newRightZoneHeight = winHeight - rightZoneHeightOccupied;
  474. if (newLeftZoneHeight <= initialLeftZoneHeight) {
  475. newLeftZoneHeight = initialLeftZoneHeight;
  476. newRightZoneHeight = newLeftZoneHeight + leftZoneHeightOccupied - rightZoneHeightOccupied;
  477. }
  478. if (newRightZoneHeight <= initialRightZoneHeight) {
  479. newRightZoneHeight = initialRightZoneHeight;
  480. newLeftZoneHeight = newRightZoneHeight + rightZoneHeightOccupied - leftZoneHeightOccupied;
  481. }
  482. document.getElementById('learningPathToc').style.height = newLeftZoneHeight + 'px';
  483. document.getElementById('learningPathRightZone').style.height = newRightZoneHeight + 'px';
  484. document.getElementById('content_id').style.height = newRightZoneHeight + 'px';
  485. if (document.body.clientHeight > winHeight) {
  486. document.body.style.overflow = 'auto';
  487. } else {
  488. document.body.style.overflow = 'hidden';
  489. }
  490. };
  491. window.onload = function() {
  492. screen_height = screen.height;
  493. screen_width = screen.height;
  494. document.getElementById('learningPathLeftZone').style.height = "100%";
  495. document.getElementById('learningPathToc').style.height = "60%";
  496. document.getElementById('learningPathToc').style.width = "100%";
  497. document.getElementById('learningPathRightZone').style.height = "100%"
  498. document.getElementById('content_id').style.height = "100%" ;
  499. if (screen_height <= 600) {
  500. document.getElementById('inner_lp_toc').style.height = "100px" ;
  501. document.getElementById('learningPathLeftZone').style.height = "415px";
  502. }
  503. initialLeftZoneHeight = document.getElementById('learningPathToc').offsetHeight;
  504. initialRightZoneHeight = document.getElementById('learningPathRightZone').offsetHeight;
  505. docHeight = document.body.clientHeight;
  506. leftZoneHeightOccupied = docHeight - initialLeftZoneHeight;
  507. rightZoneHeightOccupied = docHeight - initialRightZoneHeight;
  508. document.body.style.overflow = 'hidden';
  509. updateContentHeight();
  510. }
  511. window.onresize = updateContentHeight;
  512. -->
  513. </script>
  514. <?php
  515. /*
  516. ==============================================================================
  517. FOOTER
  518. ==============================================================================
  519. */
  520. //Display::display_footer();
  521. }
  522. //restore global setting
  523. $_setting['show_navigation_menu'] = $save_setting;
  524. ?>