lp_view.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  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. * @license GNU/GPL - See Chamilo license directory for details
  14. */
  15. /* INIT SECTION */
  16. $_SESSION['whereami'] = 'lp/view';
  17. $this_section = SECTION_COURSES;
  18. if ($lp_controller_touched != 1){
  19. header('location: lp_controller.php?action=view&item_id='.$_REQUEST['item_id']);
  20. exit;
  21. }
  22. /* Libraries */
  23. require_once 'back_compat.inc.php';
  24. //require_once '../learnpath/learnpath_functions.inc.php';
  25. require_once 'scorm.lib.php';
  26. require_once 'learnpath.class.php';
  27. require_once 'learnpathItem.class.php';
  28. //require_once 'lp_comm.common.php'; //xajax functions
  29. if (!$is_allowed_in_course) api_not_allowed();
  30. $oLearnpath = false;
  31. $course_code = api_get_course_id();
  32. $user_id = api_get_user_id();
  33. $platform_theme = api_get_setting('stylesheets'); // Plataform's css.
  34. $my_style = $platform_theme;
  35. // Escape external variables.
  36. /* Header */
  37. // Se incluye la libreria en el lp_controller.php
  38. // $htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.js" type="text/javascript" language="javascript"></script>';
  39. $htmlHeadXtra[] = '<link src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-ui/cupertino/jquery-ui-1.8.7.custom.css" type="text/css" rel="Stylesheet" />';
  40. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-ui/cupertino/jquery-ui-1.8.7.custom.min.js" type="text/javascript" language="javascript"></script>';
  41. // se incluye la librería para el mini panel
  42. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.lp_minipanel.js" type="text/javascript" language="javascript"></script>';
  43. if (api_get_setting('show_glossary_in_documents') == 'ismanual' || api_get_setting('show_glossary_in_documents') == 'isautomatic' ) {
  44. $htmlHeadXtra[] = '<script type="text/javascript">
  45. <!--
  46. var jQueryFrameReadyConfigPath = \''.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js\';
  47. -->
  48. </script>';
  49. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>';
  50. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>';
  51. }
  52. $htmlHeadXtra[] = '<script language="javascript" type="text/javascript">
  53. $(document).ready(function (){
  54. $("div#log_content_cleaner").bind("click", function(){
  55. $("div#log_content").empty();
  56. });
  57. });
  58. </script>';
  59. $htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
  60. var dokeos_xajax_handler = window.oxajax;
  61. </script>';
  62. $_SESSION['oLP']->error = '';
  63. $now = time();
  64. //Adding visibility reestrinctions
  65. if (!empty($_SESSION['oLP']->publicated_on) && $_SESSION['oLP']->publicated_on != '0000-00-00 00:00:00') {
  66. if ($now < api_strtotime($_SESSION['oLP']->publicated_on)) {
  67. api_not_allowed();
  68. }
  69. }
  70. if (!empty($_SESSION['oLP']->expired_on) && $_SESSION['oLP']->expired_on != '0000-00-00 00:00:00') {
  71. if ($now > api_strtotime($_SESSION['oLP']->expired_on)) {
  72. api_not_allowed();
  73. }
  74. }
  75. $lp_item_id = $_SESSION['oLP']->get_current_item_id();
  76. $lp_type = $_SESSION['oLP']->get_type();
  77. $lp_id = intval($_GET['lp_id']);
  78. // Check if the learning path is visible for student - (LP requisites)
  79. if (!api_is_allowed_to_edit(null, true) && !learnpath::is_lp_visible_for_student($lp_id, api_get_user_id())) {
  80. api_not_allowed();
  81. }
  82. //Checking visibility (eye icon)
  83. $visibility = api_get_item_visibility(api_get_course_info(), TOOL_LEARNPATH, $lp_id, $action, api_get_user_id(), api_get_session_id());
  84. if (intval($visibility) == 0 ) {
  85. api_not_allowed();
  86. }
  87. //$lp_item_id = learnpath::escape_string($_GET['item_id']);
  88. //$_SESSION['oLP']->set_current_item($lp_item_id); // Already done by lp_controller.php.
  89. // Prepare variables for the test tool (just in case) - honestly, this should disappear later on.
  90. $_SESSION['scorm_view_id'] = $_SESSION['oLP']->get_view_id();
  91. $_SESSION['scorm_item_id'] = $lp_item_id;
  92. $_SESSION['lp_mode'] = $_SESSION['oLP']->mode;
  93. // Reinit exercises variables to avoid spacename clashes (see exercise tool)
  94. if (isset($exerciseResult) || isset($_SESSION['exerciseResult'])) {
  95. api_session_unregister($exerciseResult);
  96. }
  97. unset($_SESSION['objExercise']);
  98. unset($_SESSION['questionList']);
  99. /**
  100. * Get a link to the corresponding document.
  101. */
  102. if (!isset($src)) {
  103. $src = '';
  104. switch($lp_type) {
  105. case 1:
  106. $_SESSION['oLP']->stop_previous_item();
  107. $htmlHeadXtra[] = '<script src="scorm_api.php" type="text/javascript" language="javascript"></script>';
  108. $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
  109. if ($prereq_check === true) {
  110. $src = $_SESSION['oLP']->get_link('http', $lp_item_id);
  111. //Prevents FF 3.6 + Adobe Reader 9 bug see BT#794 when calling a pdf file in a LP.
  112. $file_info = pathinfo($src);
  113. if (api_strtolower(substr($file_info['extension'], 0, 3) == 'pdf')) {
  114. $src = 'lp_view_item.php?src='.$src;
  115. }
  116. $_SESSION['oLP']->start_current_item(); // starts time counter manually if asset
  117. } else {
  118. $src = 'blank.php?error=prerequisites';
  119. }
  120. break;
  121. case 2:
  122. // save old if asset
  123. $_SESSION['oLP']->stop_previous_item(); // save status manually if asset
  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);
  128. $_SESSION['oLP']->start_current_item(); // starts time counter manually if asset
  129. } else {
  130. $src = 'blank.php?error=prerequisites';
  131. }
  132. break;
  133. case 3:
  134. // aicc
  135. $_SESSION['oLP']->stop_previous_item(); // save status manually if asset
  136. $htmlHeadXtra[] = '<script src="'.$_SESSION['oLP']->get_js_lib().'" type="text/javascript" language="javascript"></script>';
  137. $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
  138. if ($prereq_check === true) {
  139. $src = $_SESSION['oLP']->get_link('http',$lp_item_id);
  140. $_SESSION['oLP']->start_current_item(); // starts time counter manually if asset
  141. } else {
  142. $src = 'blank.php';
  143. }
  144. break;
  145. case 4:
  146. break;
  147. }
  148. }
  149. $list = $_SESSION['oLP']->get_toc();
  150. $type_quiz = false;
  151. /*
  152. $current_item = $_SESSION['oLP']->items[$_SESSION['oLP']->get_current_item_id()];
  153. $attempt_id = $current_item->get_attempt_id();
  154. error_log('get attempts'.$current_item->get_attempt_id());
  155. */
  156. foreach($list as $toc) {
  157. if ($toc['id'] == $lp_item_id && ($toc['type']=='quiz')) {
  158. $type_quiz = true;
  159. }
  160. }
  161. $autostart = 'true';
  162. // Update status, total_time from lp_item_view table when you finish the exercises in learning path.
  163. if ($type_quiz && !empty($_REQUEST['exeId']) && isset($lp_id) && isset($_GET['lp_item_id'])) {
  164. global $src;
  165. $_SESSION['oLP']->items[$_SESSION['oLP']->current]->write_to_db();
  166. $TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
  167. $TBL_LP_ITEM_VIEW = Database::get_course_table(TABLE_LP_ITEM_VIEW);
  168. $TBL_LP_VIEW = Database::get_course_table(TABLE_LP_VIEW);
  169. $TBL_LP_ITEM = Database::get_course_table(TABLE_LP_ITEM);
  170. $safe_item_id = Database::escape_string($_GET['lp_item_id']);
  171. $safe_id = $lp_id;
  172. $safe_exe_id = intval($_REQUEST['exeId']);
  173. if ($safe_id == strval(intval($safe_id)) && $safe_item_id == strval(intval($safe_item_id))) {
  174. $sql = 'SELECT start_date,exe_date,exe_result,exe_weighting FROM ' . $TBL_TRACK_EXERCICES . ' WHERE exe_id = '.$safe_exe_id;
  175. $res = Database::query($sql);
  176. $row_dates = Database::fetch_array($res);
  177. $time_start_date = api_strtotime($row_dates['start_date'],'UTC');
  178. $time_exe_date = api_strtotime($row_dates['exe_date'],'UTC');
  179. $mytime = ((int)$time_exe_date-(int)$time_start_date);
  180. $score = (float)$row_dates['exe_result'];
  181. $max_score = (float)$row_dates['exe_weighting'];
  182. /*$sql_upd_status = "UPDATE $TBL_LP_ITEM_VIEW SET status = 'completed' WHERE lp_item_id = '".(int)$safe_item_id."'
  183. 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."')";
  184. Database::query($sql_upd_status);*/
  185. $sql_upd_max_score = "UPDATE $TBL_LP_ITEM SET max_score = '$max_score' WHERE id = '".(int)$safe_item_id."'";
  186. Database::query($sql_upd_max_score);
  187. $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";
  188. $res_last_attempt = Database::query($sql_last_attempt);
  189. $row_last_attempt = Database::fetch_row($res_last_attempt);
  190. $lp_item_view_id = $row_last_attempt[0];
  191. if (Database::num_rows($res_last_attempt) > 0) {
  192. $sql_upd_score = "UPDATE $TBL_LP_ITEM_VIEW SET status = 'completed' , score = $score,total_time = $mytime WHERE id='".$lp_item_view_id."'";
  193. Database::query($sql_upd_score);
  194. $update_query = "UPDATE $TBL_TRACK_EXERCICES SET orig_lp_item_view_id = $lp_item_view_id WHERE exe_id = ".$safe_exe_id;
  195. Database::query($update_query);
  196. }
  197. }
  198. if (intval($_GET['fb_type']) > 0) {
  199. $src = 'blank.php?msg=exerciseFinished';
  200. } else {
  201. $src = api_get_path(WEB_CODE_PATH).'exercice/exercise_show.php?id='.Security::remove_XSS($_REQUEST['exeId']).'&origin=learnpath&learnpath_id='.$lp_id.'&learnpath_item_id='.$lp_id.'&fb_type='.Security::remove_XSS($_GET['fb_type']);
  202. }
  203. $autostart = 'false';
  204. }
  205. $_SESSION['oLP']->set_previous_item($lp_item_id);
  206. $nameTools = Security :: remove_XSS($_SESSION['oLP']->get_name());
  207. $save_setting = api_get_setting('show_navigation_menu');
  208. global $_setting;
  209. $_setting['show_navigation_menu'] = 'false';
  210. $scorm_css_header = true;
  211. $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).
  212. if ($_SESSION['oLP']->mode == 'fullscreen') {
  213. $htmlHeadXtra[] = "<script>window.open('$src','content_id','toolbar=0,location=0,status=0,scrollbars=1,resizable=1');</script>";
  214. }
  215. // Not in fullscreen mode.
  216. require_once '../inc/reduced_header.inc.php';
  217. //$displayAudioRecorder = (api_get_setting('service_visio', 'active') == 'true') ? true : false;
  218. // Check if audio recorder needs to be in studentview.
  219. $course_id = $_SESSION['_course']['id'];
  220. if ($_SESSION['status'][$course_id] == 5) {
  221. $audio_recorder_studentview = true;
  222. } else {
  223. $audio_recorder_studentview = false;
  224. }
  225. // Set flag to ensure lp_header.php is loaded by this script (flag is unset in lp_header.php).
  226. $_SESSION['loaded_lp_view'] = true;
  227. $display_none = '';
  228. $margin_left = '282px';
  229. if ($_SESSION['oLP']->mode == 'embedframe') {
  230. $display_none = ';display:none;';
  231. $margin_left = '0px';
  232. }
  233. ?>
  234. <body dir="<?php echo api_get_text_direction(); ?>">
  235. <div id="learning_path_main" style="width:100%;height:100%;" >
  236. <div id="learning_path_left_zone" style="float:left;width:280px;height:100%<?php echo $display_none;?>">
  237. <!-- header -->
  238. <div id="header">
  239. <div id="learning_path_header" style="font-size:14px;">
  240. <table >
  241. <tr>
  242. <td >
  243. <a href="lp_controller.php?action=return_to_course_homepage&<?php echo api_get_cidreq(); ?>" target="_self" onclick="javascript: window.parent.API.save_asset();"><img src="../img/lp_arrow.gif" /></a>
  244. </td>
  245. <td >
  246. <a class="link" href="lp_controller.php?action=return_to_course_homepage&<?php echo api_get_cidreq(); ?>" target="_self" onclick="javascript: window.parent.API.save_asset();">
  247. <?php echo get_lang('CourseHomepageLink'); ?></a>
  248. </td>
  249. </tr>
  250. </table>
  251. </div>
  252. </div>
  253. <!-- end header -->
  254. <!-- Image preview Layout -->
  255. <!-- hub 26-50-2010 for lp toc height
  256. <div id="author_image" name="author_image" class="lp_author_image" style="height:23%; width:100%;margin-left:5px;">
  257. -->
  258. <div id="author_image" name="author_image" class="lp_author_image" style="width:100%;margin-left:5px;">
  259. <?php $image = '../img/lp_author_background.gif'; ?>
  260. <div id="preview_image" style="padding:5px;background-image: url('../img/lp_author_background.gif');background-repeat:no-repeat;height:110px">
  261. <div style="width:100; float:left;height:105;margin:5px">
  262. <span style="width:104px; height:96px; float:left; vertical-align:bottom;">
  263. <center>
  264. <?php
  265. if ($_SESSION['oLP']->get_preview_image()!='') {
  266. $picture = getimagesize(api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image());
  267. if($picture['1'] < 96) { $style = ' style="padding-top:'.((94 -$picture['1'])/2).'px;" '; }
  268. $size = ($picture['0'] > 104 && $picture['1'] > 96 )? ' width="104" height="96" ': $style;
  269. $my_path = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image();
  270. echo '<img '.$size.' src="'.$my_path.'">';
  271. } else {
  272. echo Display :: display_icon('unknown_250_100.jpg', ' ');
  273. }
  274. ?>
  275. </center>
  276. </span>
  277. </div>
  278. <div id="nav_id" name="nav_name" class="lp_nav" style="margin-left:105;height:90">
  279. <?php
  280. $display_mode = $_SESSION['oLP']->mode;
  281. $scorm_css_header = true;
  282. $lp_theme_css = $_SESSION['oLP']->get_theme();
  283. // Setting up the CSS theme if exists.
  284. if (!empty ($lp_theme_css) && !empty ($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
  285. global $lp_theme_css;
  286. } else {
  287. $lp_theme_css = $my_style;
  288. }
  289. $progress_bar = $_SESSION['oLP']->get_progress_bar('', -1, '', true);
  290. $navigation_bar = $_SESSION['oLP']->get_navigation_bar();
  291. $mediaplayer = $_SESSION['oLP']->get_mediaplayer($autostart);
  292. $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
  293. $show_audioplayer = false;
  294. // Getting all the information about the item.
  295. $sql = "SELECT audio FROM " . $tbl_lp_item . " WHERE lp_id = '" . $_SESSION['oLP']->lp_id."'";
  296. $res_media= Database::query($sql);
  297. if (Database::num_rows($res_media) > 0) {
  298. while ($row_media= Database::fetch_array($res_media)) {
  299. if (!empty($row_media['audio'])) {$show_audioplayer = true; break;}
  300. }
  301. }
  302. ?>
  303. <div id="lp_navigation_elem" class="lp_navigation_elem" style="padding-left:130px;margin-top:9px;">
  304. <div style="padding-top:15px;padding-bottom:50px;" ><?php echo $navigation_bar; ?></div>
  305. <div style="height:20px"><?php echo $progress_bar; ?></div>
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. <!-- end image preview Layout -->
  311. <div id="author_name" style="position:relative;top:2px;left:0px;margin:0;padding:0;text-align:center;width:100%">
  312. <?php echo $_SESSION['oLP']->get_author(); ?>
  313. </div>
  314. <!-- media player layaout -->
  315. <?php $style_media = (($show_audioplayer) ? ' style= "position:relative;top:10px;left:10px;margin:8px;font-size:32pt;height:20px;"' : 'style="height:15px"'); ?>
  316. <div id="media" <?php echo $style_media; ?>>
  317. <?php echo (!empty($mediaplayer)) ? $mediaplayer : '&nbsp;' ?>
  318. </div>
  319. <!-- end media player layaout -->
  320. <!-- toc layout -->
  321. <!-- hub 26-05-2010 remove height for lp toc height resizable
  322. <div id="toc_id" name="toc_name" style="overflow: auto; padding:0;margin-top:20px;height:60%;width:100%">
  323. -->
  324. <div id="toc_id" name="toc_name" style="overflow: auto; padding:0;margin-top:20px;width:100%">
  325. <div id="learning_path_toc" style="font-size:9pt;margin:0;"><?php echo $_SESSION['oLP']->get_html_toc(); ?>
  326. <?php if (!empty($_SESSION['oLP']->scorm_debug)) { //only show log
  327. ?>
  328. <!-- log message layout -->
  329. <div id="lp_log_name" name="lp_log_name" class="lp_log" style="height:150px;overflow:auto;margin:4px">
  330. <div id="log_content"></div>
  331. <div id="log_content_cleaner" style="color: white;">.</div>
  332. </div>
  333. <!-- end log message layout -->
  334. <?php } ?>
  335. </div>
  336. </div>
  337. <!-- end toc layout -->
  338. </div>
  339. <!-- end left Zone -->
  340. <!-- right Zone -->
  341. <div id="learning_path_right_zone" style="margin-left:<?php echo $margin_left;?>;height:100%">
  342. <?php
  343. // hub 26-05-2010 Fullscreen or not fullscreen
  344. if ($_SESSION['oLP']->mode == 'fullscreen') {
  345. echo '<iframe id="content_id_blank" name="content_name_blank" src="blank.php" border="0" frameborder="0" style="width:100%;height:600px" ></iframe>';
  346. } else {
  347. echo '<iframe id="content_id" name="content_name" src="'.$src.'" border="0" frameborder="0" style="width:100%;height:600px" ></iframe>';
  348. }
  349. ?>
  350. </div>
  351. <!-- end right Zone -->
  352. </div>
  353. <script language="JavaScript" type="text/javascript">
  354. // Need to be called after the <head> to be sure window.oxajax is defined.
  355. //var dokeos_xajax_handler = window.oxajax;
  356. </script>
  357. <script language="JavaScript" type="text/javascript">
  358. // Resize right and left pane to full height (HUB 20-05-2010).
  359. function updateContentHeight() {
  360. document.body.style.overflow = 'hidden';
  361. var IE = window.navigator.appName.match(/microsoft/i);
  362. var hauteurHeader = document.getElementById('header').offsetHeight;
  363. var hauteurAuthorImg = document.getElementById('author_image').offsetHeight;
  364. var hauteurAuthorName = document.getElementById('author_name').offsetHeight;
  365. var hauteurMedia = document.getElementById('media').offsetHeight;
  366. var hauteurTitre = document.getElementById('scorm_title').offsetHeight;
  367. var hauteurAction = 0;
  368. if (document.getElementById('actions_lp')) hauteurAction = document.getElementById('actions_lp').offsetHeight;
  369. var hauteurHaut = hauteurHeader+hauteurAuthorImg+hauteurAuthorName+hauteurMedia+hauteurTitre+hauteurAction;
  370. var innerHauteur = (IE) ? document.body.clientHeight : window.innerHeight ;
  371. var debugsize = 0;
  372. // -40 is a static adjustement for margin, spaces on the page
  373. <?php if (!empty($_SESSION['oLP']->scorm_debug)) echo 'debugsize = 150;' ?>
  374. document.getElementById('inner_lp_toc').style.height = innerHauteur - hauteurHaut - 40 - debugsize + "px";
  375. if (document.getElementById('content_id')) {
  376. document.getElementById('content_id').style.height = innerHauteur + 'px';
  377. }
  378. // Loads the glossary library.
  379. <?php
  380. if (api_get_setting('show_glossary_in_extra_tools') == 'true') {
  381. if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
  382. ?>
  383. $.frameReady(function(){
  384. // $("<div>I am a div courses</div>").prependTo("body");
  385. }, "top.content_name",
  386. { load: [
  387. {type:"script", id:"_fr1", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.js"},
  388. {type:"script", id:"_fr2", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"},
  389. {type:"script", id:"_fr3", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>fckeditor/editor/plugins/glossary/fck_glossary_manual.js"}
  390. ] }
  391. );
  392. <?php
  393. } elseif (api_get_setting('show_glossary_in_documents') == 'isautomatic') {
  394. ?>
  395. $.frameReady(function(){
  396. // $("<div>I am a div courses</div>").prependTo("body");
  397. }, "top.content_name",
  398. { load: [
  399. {type:"script", id:"_fr1", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.js"},
  400. {type:"script", id:"_fr2", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"},
  401. {type:"script", id:"_fr3", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"}
  402. ] }
  403. );
  404. <?php
  405. }
  406. }
  407. ?>
  408. }
  409. window.onload = updateContentHeight;
  410. window.onresize = updateContentHeight;
  411. -->
  412. </script>
  413. </body>
  414. <?php
  415. // Restore a global setting.
  416. $_setting['show_navigation_menu'] = $save_setting;