lp_message.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Container script for the messages coming from the learnpath object. Initially, this wasn't supposed to be
  5. * a separate file but rather some text included in lp_view.php, but SCORM involves loading a script that
  6. * saves the data asynchronously while the SCORM learning path carries on. Having an informational iframe
  7. * helps not popping up an additional window when saving data.
  8. *
  9. * This script is also used to refresh the TOC as sometimes the SCORM JS messages are taken into account
  10. * only after the TOC is drawn. As such, you might complete an item, browse to the next page, have the
  11. * TOC drawn with your 'incomplete' status, while the SCORM messages generally arrives just after the TOC
  12. * is drawn. By updating it here and in lp_save.php, we avoid funny visual effect like having a complete
  13. * item showing as incomplete.
  14. * @package chamilo.learnpath
  15. * @author Yannick Warnier <ywarnier@beeznest.org>
  16. */
  17. // Flag to allow for anonymous user - needs to be set before global.inc.php.
  18. $use_anonymous = true;
  19. // Name of the language file that needs to be included.
  20. $language_file = 'learnpath';
  21. require_once 'back_compat.inc.php';
  22. require_once 'learnpath.class.php';
  23. require_once 'scorm.class.php';
  24. if (empty($debug)) { $debug = 0; }
  25. $error = '';
  26. $display_mode = '';
  27. if (isset($_SESSION['lpobject'])) {
  28. $temp = $_SESSION['lpobject'];
  29. $_SESSION['oLP'] = unserialize($temp);
  30. $error = $_SESSION['oLP']->error;
  31. $display_mode = $_SESSION['oLP']->mode;
  32. }
  33. if ($debug > 0) { error_log('New LP - Loaded lp_message : '.$_SERVER['REQUEST_URI'].' from '.$_SERVER['HTTP_REFERER'], 0); }
  34. $htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
  35. var dokeos_xajax_handler = window.parent.oxajax;
  36. </script>';
  37. $lp_theme_css=$_SESSION['oLP']->get_theme();
  38. $scorm_css_header = true;
  39. include_once '../inc/reduced_header.inc.php';
  40. // Close the session immediately to avoid concurrent access problems.
  41. session_write_close();
  42. ?>
  43. <body dir="<?php echo api_get_text_direction(); ?>">
  44. <div id="msg_div_id">
  45. <?php
  46. echo $error;
  47. ?>
  48. </div>
  49. </body></html>