lp_view.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This file was originally 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 chamilo.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. */
  14. /**
  15. * Code
  16. */
  17. use \ChamiloSession as Session;
  18. $use_anonymous = true;
  19. $_SESSION['whereami'] = 'lp/view';
  20. $this_section = SECTION_COURSES;
  21. if ($lp_controller_touched != 1) {
  22. header('location: lp_controller.php?action=view&item_id='.intval($_REQUEST['item_id']));
  23. exit;
  24. }
  25. /* Libraries */
  26. require_once 'back_compat.inc.php';
  27. require_once 'learnpath.class.php';
  28. require_once 'learnpathItem.class.php';
  29. //To prevent the template class
  30. $show_learnpath = true;
  31. api_protect_course_script();
  32. $lp_id = intval($_GET['lp_id']);
  33. // Check if the learning path is visible for student - (LP requisites)
  34. if (!api_is_platform_admin()) {
  35. if (!api_is_allowed_to_edit(null, true) && !learnpath::is_lp_visible_for_student($lp_id, api_get_user_id())) {
  36. api_not_allowed(true);
  37. }
  38. }
  39. // Checking visibility (eye icon)
  40. $visibility = api_get_item_visibility(api_get_course_info(), TOOL_LEARNPATH, $lp_id, $action, api_get_user_id(), api_get_session_id());
  41. if (!api_is_allowed_to_edit(false, true, false, false) && intval($visibility) == 0) {
  42. api_not_allowed(true);
  43. }
  44. if (empty($_SESSION['oLP'])) {
  45. api_not_allowed(true);
  46. }
  47. $debug = 0;
  48. if ($debug) {
  49. error_log('------ Entering lp_view.php -------');
  50. }
  51. $_SESSION['oLP']->error = '';
  52. $lp_item_id = $_SESSION['oLP']->get_current_item_id();
  53. $lp_type = $_SESSION['oLP']->get_type();
  54. $course_code = api_get_course_id();
  55. $course_id = api_get_course_int_id();
  56. $user_id = api_get_user_id();
  57. $platform_theme = api_get_setting('stylesheets'); // Plataform's css.
  58. $my_style = $platform_theme;
  59. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.lp_minipanel.js" type="text/javascript" language="javascript"></script>';
  60. $htmlHeadXtra[] = '<script>
  61. $(document).ready(function() {
  62. $("div#log_content_cleaner").bind("click", function() {
  63. $("div#log_content").empty();
  64. });
  65. //jQuery("video:not(.skip), audio:not(.skip)").mediaelementplayer();
  66. });
  67. var chamilo_xajax_handler = window.oxajax;
  68. </script>';
  69. if ($_SESSION['oLP']->mode == 'embedframe' || $_SESSION['oLP']->get_hide_toc_frame()==1 ) {
  70. $htmlHeadXtra[] = '<script>
  71. $(document).ready(function() {
  72. toogle_minipanel();
  73. });
  74. </script>';
  75. }
  76. //Impress js
  77. if ($_SESSION['oLP']->mode == 'impress') {
  78. $lp_id = $_SESSION['oLP']->get_id();
  79. $url = api_get_path(WEB_CODE_PATH)."newscorm/lp_impress.php?lp_id=$lp_id&".api_get_cidreq();
  80. header("Location: $url");
  81. exit;
  82. }
  83. // Prepare variables for the test tool (just in case) - honestly, this should disappear later on.
  84. $_SESSION['scorm_view_id'] = $_SESSION['oLP']->get_view_id();
  85. $_SESSION['scorm_item_id'] = $lp_item_id;
  86. // Reinit exercises variables to avoid spacename clashes (see exercise tool)
  87. if (isset($exerciseResult) || isset($_SESSION['exerciseResult'])) {
  88. Session::erase('exerciseResult');
  89. Session::erase('objExercise');
  90. Session::erase('questionList');
  91. }
  92. // additional APIs
  93. $htmlHeadXtra[] = '<script>
  94. chamilo_courseCode = "'.$course_code.'";
  95. </script>';
  96. // Document API
  97. $htmlHeadXtra[] = '<script src="js/documentapi.js" type="text/javascript" language="javascript"></script>';
  98. // Storage API
  99. $htmlHeadXtra[] = '<script>
  100. var sv_user = \''.api_get_user_id().'\';
  101. var sv_course = chamilo_courseCode;
  102. var sv_sco = \''.intval($_REQUEST['lp_id']).'\';
  103. </script>'; // FIXME fetch sco and userid from a more reliable source directly in sotrageapi.js
  104. $htmlHeadXtra[] = '<script type="text/javascript" src="js/storageapi.js"></script>';
  105. /**
  106. * Get a link to the corresponding document.
  107. */
  108. if ($debug) {
  109. error_log(" src: $src ");
  110. error_log(" lp_type: $lp_type ");
  111. }
  112. $get_toc_list = $_SESSION['oLP']->get_toc();
  113. $type_quiz = false;
  114. foreach ($get_toc_list as $toc) {
  115. if ($toc['id'] == $lp_item_id && ($toc['type']=='quiz')) {
  116. $type_quiz = true;
  117. }
  118. }
  119. if (!isset($src)) {
  120. $src = null;
  121. switch ($lp_type) {
  122. case 1:
  123. $_SESSION['oLP']->stop_previous_item();
  124. $htmlHeadXtra[] = '<script src="scorm_api.php" type="text/javascript" language="javascript"></script>';
  125. $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
  126. if ($prereq_check === true) {
  127. $src = $_SESSION['oLP']->get_link('http', $lp_item_id, $get_toc_list);
  128. // Prevents FF 3.6 + Adobe Reader 9 bug see BT#794 when calling a pdf file in a LP.
  129. $file_info = parse_url($src);
  130. $file_info = pathinfo($file_info['path']);
  131. if (isset($file_info['extension']) &&
  132. api_strtolower(substr($file_info['extension'], 0, 3) == 'pdf')
  133. ) {
  134. $src = api_get_path(WEB_CODE_PATH).'newscorm/lp_view_item.php?lp_item_id='.$lp_item_id.'&'.api_get_cidreq();
  135. }
  136. $_SESSION['oLP']->start_current_item(); // starts time counter manually if asset
  137. } else {
  138. $src = 'blank.php?error=prerequisites';
  139. }
  140. break;
  141. case 2:
  142. // save old if asset
  143. $_SESSION['oLP']->stop_previous_item(); // save status manually if asset
  144. $htmlHeadXtra[] = '<script src="scorm_api.php" type="text/javascript" language="javascript"></script>';
  145. $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
  146. if ($prereq_check === true) {
  147. $src = $_SESSION['oLP']->get_link('http', $lp_item_id, $get_toc_list);
  148. $_SESSION['oLP']->start_current_item(); // starts time counter manually if asset
  149. } else {
  150. $src = 'blank.php?error=prerequisites';
  151. }
  152. break;
  153. case 3:
  154. // aicc
  155. $_SESSION['oLP']->stop_previous_item(); // save status manually if asset
  156. $htmlHeadXtra[] = '<script src="'.$_SESSION['oLP']->get_js_lib().'" type="text/javascript" language="javascript"></script>';
  157. $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
  158. if ($prereq_check === true) {
  159. $src = $_SESSION['oLP']->get_link('http', $lp_item_id, $get_toc_list);
  160. $_SESSION['oLP']->start_current_item(); // starts time counter manually if asset
  161. } else {
  162. $src = 'blank.php';
  163. }
  164. break;
  165. case 4:
  166. break;
  167. }
  168. }
  169. $autostart = 'true';
  170. // Update status, total_time from lp_item_view table when you finish the exercises in learning path.
  171. if ($debug) {
  172. error_log('$type_quiz: '.$type_quiz);
  173. error_log('$_REQUEST[exeId]: '.intval($_REQUEST['exeId']));
  174. error_log('$lp_id: '.$lp_id);
  175. error_log('$_GET[lp_item_id]: '.intval($_GET['lp_item_id']));
  176. }
  177. if ($type_quiz && !empty($_REQUEST['exeId']) && isset($lp_id) && isset($_GET['lp_item_id'])) {
  178. global $src;
  179. $_SESSION['oLP']->items[$_SESSION['oLP']->current]->write_to_db();
  180. $TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
  181. $TBL_LP_ITEM_VIEW = Database::get_course_table(TABLE_LP_ITEM_VIEW);
  182. $TBL_LP_ITEM = Database::get_course_table(TABLE_LP_ITEM);
  183. $safe_item_id = intval($_GET['lp_item_id']);
  184. $safe_id = $lp_id;
  185. $safe_exe_id = intval($_REQUEST['exeId']);
  186. if ($safe_id == strval(intval($safe_id)) && $safe_item_id == strval(intval($safe_item_id))) {
  187. $sql = 'SELECT start_date, exe_date, exe_result, exe_weighting
  188. FROM ' . $TBL_TRACK_EXERCICES . '
  189. WHERE exe_id = '.$safe_exe_id;
  190. $res = Database::query($sql);
  191. $row_dates = Database::fetch_array($res);
  192. $time_start_date = api_strtotime($row_dates['start_date'],'UTC');
  193. $time_exe_date = api_strtotime($row_dates['exe_date'],'UTC');
  194. $mytime = ((int)$time_exe_date-(int)$time_start_date);
  195. $score = (float)$row_dates['exe_result'];
  196. $max_score = (float)$row_dates['exe_weighting'];
  197. $sql = "UPDATE $TBL_LP_ITEM SET max_score = '$max_score'
  198. WHERE c_id = $course_id AND id = '".$safe_item_id."'";
  199. Database::query($sql);
  200. $sql = "SELECT id FROM $TBL_LP_ITEM_VIEW
  201. WHERE
  202. c_id = $course_id AND
  203. lp_item_id = '$safe_item_id' AND
  204. lp_view_id = '".$_SESSION['oLP']->lp_view_id."'
  205. ORDER BY id DESC
  206. LIMIT 1";
  207. $res_last_attempt = Database::query($sql);
  208. if (Database::num_rows($res_last_attempt)) {
  209. $row_last_attempt = Database::fetch_row($res_last_attempt);
  210. $lp_item_view_id = $row_last_attempt[0];
  211. $sql_upd_score = "UPDATE $TBL_LP_ITEM_VIEW SET status = 'completed' , score = $score, total_time = $mytime
  212. WHERE id='".$lp_item_view_id."' AND c_id = $course_id ";
  213. if ($debug) error_log($sql_upd_score);
  214. Database::query($sql_upd_score);
  215. $update_query = "UPDATE $TBL_TRACK_EXERCICES SET orig_lp_item_view_id = $lp_item_view_id WHERE exe_id = ".$safe_exe_id;
  216. Database::query($update_query);
  217. }
  218. }
  219. if (intval($_GET['fb_type']) > 0) {
  220. $src = 'blank.php?msg=exerciseFinished';
  221. } else {
  222. $src = api_get_path(WEB_CODE_PATH).'exercice/result.php?origin=learnpath&id='.$safe_exe_id;
  223. if ($debug) error_log('Calling URL: '.$src);
  224. }
  225. $autostart = 'false';
  226. }
  227. $_SESSION['oLP']->set_previous_item($lp_item_id);
  228. $nameTools = Security::remove_XSS($_SESSION['oLP']->get_name());
  229. $save_setting = api_get_setting('show_navigation_menu');
  230. global $_setting;
  231. $_setting['show_navigation_menu'] = 'false';
  232. $scorm_css_header = true;
  233. $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).
  234. if ($_SESSION['oLP']->mode == 'fullscreen') {
  235. $htmlHeadXtra[] = "<script>window.open('$src','content_id','toolbar=0,location=0,status=0,scrollbars=1,resizable=1');</script>";
  236. }
  237. // Not in fullscreen mode.
  238. Display::display_reduced_header($nameTools);
  239. // Check if audio recorder needs to be in studentview.
  240. if (isset($_SESSION['status']) && $_SESSION['status'][$course_code] == 5) {
  241. $audio_recorder_studentview = true;
  242. } else {
  243. $audio_recorder_studentview = false;
  244. }
  245. // Set flag to ensure lp_header.php is loaded by this script (flag is unset in lp_header.php).
  246. $_SESSION['loaded_lp_view'] = true;
  247. $display_none = '';
  248. $margin_left = '340px';
  249. //Media player code
  250. $display_mode = $_SESSION['oLP']->mode;
  251. $scorm_css_header = true;
  252. $lp_theme_css = $_SESSION['oLP']->get_theme();
  253. // Setting up the CSS theme if exists.
  254. if (!empty ($lp_theme_css) && !empty ($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
  255. global $lp_theme_css;
  256. } else {
  257. $lp_theme_css = $my_style;
  258. }
  259. $progress_bar = $_SESSION['oLP']->get_progress_bar('', -1, '', true);
  260. $navigation_bar = $_SESSION['oLP']->get_navigation_bar();
  261. $mediaplayer = $_SESSION['oLP']->get_mediaplayer($autostart);
  262. $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
  263. $show_audioplayer = false;
  264. // Getting all the information about the item.
  265. $sql = "SELECT audio FROM " . $tbl_lp_item . " WHERE c_id = $course_id AND lp_id = '" . $_SESSION['oLP']->lp_id."'";
  266. $res_media= Database::query($sql);
  267. if (Database::num_rows($res_media) > 0) {
  268. while ($row_media = Database::fetch_array($res_media)) {
  269. if (!empty($row_media['audio'])) {
  270. $show_audioplayer = true;
  271. break;
  272. }
  273. }
  274. }
  275. echo '<div id="learning_path_main" style="width:100%;height:100%;">';
  276. $is_allowed_to_edit = api_is_allowed_to_edit(false, true, true, false);
  277. if ($is_allowed_to_edit) {
  278. echo '<div id="learning_path_breadcrumb_zone">';
  279. global $interbreadcrumb;
  280. $interbreadcrumb[] = array('url' => 'lp_controller.php?action=list&isStudentView=false', 'name' => get_lang('LearningPaths'));
  281. $interbreadcrumb[] = array('url' => api_get_self()."?action=add_item&type=step&lp_id=".$_SESSION['oLP']->lp_id."&isStudentView=false", 'name' => $_SESSION['oLP']->get_name());
  282. $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Preview'));
  283. echo return_breadcrumb($interbreadcrumb, null, null);
  284. echo '</div>';
  285. }
  286. echo '<div id="learning_path_left_zone" style="'.$display_none.'"> ';
  287. echo '<div id="header">
  288. <table>
  289. <tr>
  290. <td>';
  291. echo '<a href="lp_controller.php?action=return_to_course_homepage&'.api_get_cidreq().'" target="_self" onclick="javascript: window.parent.API.save_asset();">
  292. <img src="../img/btn_home.png" />
  293. </a>
  294. </td>
  295. <td>';
  296. // Return to course home.
  297. if ($is_allowed_to_edit) {
  298. $url = 'lp_controller.php?isStudentView=false&action=return_to_course_homepage&' . api_get_cidreq();
  299. } else {
  300. $url = 'lp_controller.php?action=return_to_course_homepage&' . api_get_cidreq();
  301. }
  302. $name = get_lang('CourseHomepageLink');
  303. // Return to lp list
  304. if (api_get_course_setting('lp_return_link') == 1) {
  305. $url .= '&redirectTo=lp_list';
  306. $name = get_lang('LearningPathList');
  307. }
  308. echo Display::url(
  309. $name,
  310. $url,
  311. array(
  312. 'class' => 'link no-border',
  313. 'target' => '_self',
  314. 'onclick' => 'javascript: window.parent.API.save_asset();'
  315. )
  316. );
  317. echo '</td>
  318. </tr>
  319. </table>
  320. </div>';
  321. ?>
  322. <!-- end header -->
  323. <!-- Author image preview -->
  324. <div id="author_image">
  325. <div id="author_icon">
  326. <?php
  327. if ($_SESSION['oLP']->get_preview_image() != '') {
  328. $picture = getimagesize(api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image());
  329. $style = null;
  330. if ($picture['1'] < 96) {
  331. $style = ' style="padding-top:'.((94 -$picture['1'])/2).'px;" ';
  332. }
  333. $size = ($picture['0'] > 104 && $picture['1'] > 96 )? ' width="104" height="96" ': $style;
  334. $my_path = $_SESSION['oLP']->get_preview_image_path();
  335. echo '<img src="'.$my_path.'">';
  336. } else {
  337. echo Display :: display_icon('unknown_250_100.jpg');
  338. }
  339. ?>
  340. </div>
  341. <div id="lp_navigation_elem">
  342. <?php echo $navigation_bar; ?>
  343. <div id="progress_bar">
  344. <?php echo $progress_bar; ?>
  345. </div>
  346. </div>
  347. </div>
  348. <!-- end image preview Layout -->
  349. <div id="author_name">
  350. <?php echo $_SESSION['oLP']->get_author(); ?>
  351. </div>
  352. <!-- media player layout -->
  353. <?php
  354. if ($show_audioplayer) {
  355. echo '<div id="lp_media_file">';
  356. echo $mediaplayer;
  357. echo '</div>';
  358. }
  359. ?>
  360. <!-- end media player layout -->
  361. <!-- TOC layout -->
  362. <div id="toc_id" name="toc_name" style="overflow: auto; padding:0;margin-top:0px;width:100%;float:left">
  363. <div id="learning_path_toc">
  364. <?php echo $_SESSION['oLP']->get_html_toc($get_toc_list); ?>
  365. </div>
  366. </div>
  367. <!-- end TOC layout -->
  368. </div>
  369. <!-- end left zone -->
  370. <!-- right zone -->
  371. <div id="learning_path_right_zone" style="margin-left:<?php echo $margin_left;?>;height:100%">
  372. <?php
  373. // hub 26-05-2010 Fullscreen or not fullscreen
  374. $height = '100%';
  375. if ($_SESSION['oLP']->mode == 'fullscreen') {
  376. echo '<iframe id="content_id_blank" name="content_name_blank" src="blank.php" border="0" frameborder="0" style="width:100%;height:'.$height.'" ></iframe>';
  377. } else {
  378. echo '<iframe id="content_id" name="content_name" src="'.$src.'" border="0" frameborder="0" style="display: block; width:100%;height:'.$height.'"></iframe>';
  379. }
  380. ?>
  381. </div>
  382. <!-- end right Zone -->
  383. </div>
  384. <script>
  385. // Resize right and left pane to full height (HUB 20-05-2010).
  386. function updateContentHeight() {
  387. document.body.style.overflow = 'hidden';
  388. var IE = window.navigator.appName.match(/microsoft/i);
  389. var heightHeader = ($('#header').height())? $('#header').height() : 0 ;
  390. var heightAuthorImg = ($('#author_image').height())? $('#author_image').height() : 0 ;
  391. var heightAuthorName = ($('#author_name').height())? $('#author_name').height() : 0 ;
  392. var heightBreadcrumb = ($('#learning_path_breadcrumb_zone').height())? $('#learning_path_breadcrumb_zone').height() : 0 ;
  393. var heightControl = ($('#control').is(':visible'))? $('#control').height() : 0 ;
  394. var heightMedia = ($('#lp_media_file').length != 0)? $('#lp_media_file').height() : 0 ;
  395. var heightTitle = ($('#scorm_title').height())? $('#scorm_title').height() : 0 ;
  396. var heightAction = ($('#actions_lp').height())? $('#actions_lp').height() : 0 ;
  397. var heightTop = heightHeader + heightAuthorImg + heightAuthorName + heightMedia + heightTitle + heightAction + 100;
  398. heightTop = (heightTop < 230)? heightTop : 230;
  399. var innerHeight = (IE) ? document.body.clientHeight : window.innerHeight ;
  400. // -40 is a static adjustement for margin, spaces on the page
  401. $('#inner_lp_toc').css('height', innerHeight - heightTop - heightBreadcrumb - heightControl + "px");
  402. if ($('#content_id')) {
  403. $('#content_id').css('height', innerHeight - heightBreadcrumb - heightControl + "px");
  404. }
  405. if ($('#hide_bar')) {
  406. $('#hide_bar').css('height', innerHeight - heightBreadcrumb - heightControl + "px");
  407. }
  408. // Loads the glossary library.
  409. <?php
  410. if (api_get_setting('show_glossary_in_extra_tools') == 'true') {
  411. if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
  412. ?>
  413. $.frameReady(function(){
  414. // $("<div>I am a div courses</div>").prependTo("body");
  415. }, "top.content_name",
  416. { load: [
  417. {type:"script", id:"_fr1", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.min.js"},
  418. {type:"script", id:"_fr4", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery-ui/smoothness/jquery-ui-1.8.21.custom.min.js"},
  419. {type:"stylesheet", id:"_fr5", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery-ui/smoothness/jquery-ui-1.8.21.custom.css"},
  420. {type:"script", id:"_fr2", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"}
  421. ] }
  422. );
  423. <?php
  424. } elseif (api_get_setting('show_glossary_in_documents') == 'isautomatic') {
  425. ?>
  426. $.frameReady(function(){
  427. // $("<div>I am a div courses</div>").prependTo("body");
  428. },
  429. "top.content_name",
  430. {
  431. load: [
  432. {type:"script", id:"_fr1", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.min.js"},
  433. {type:"script", id:"_fr4", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery-ui/smoothness/jquery-ui-1.8.21.custom.min.js"},
  434. {type:"stylesheet", id:"_fr5", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery-ui/smoothness/jquery-ui-1.8.21.custom.css"},
  435. {type:"script", id:"_fr2", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"}
  436. ]}
  437. );
  438. <?php
  439. }
  440. }
  441. ?>}
  442. $(document).ready(function() {
  443. updateContentHeight();
  444. $('#hide_bar').children().click(function(){
  445. updateContentHeight();
  446. });
  447. $(window).resize(function() {
  448. updateContentHeight();
  449. });
  450. });
  451. window.onload = updateContentHeight();
  452. window.onresize = updateContentHeight();
  453. </script>
  454. <?php
  455. // Restore a global setting.
  456. $_setting['show_navigation_menu'] = $save_setting;
  457. if ($debug) {
  458. error_log(' ------- end lp_view.php ------');
  459. }