lp_nav.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Script opened in an iframe and containing the learning path's navigation and progress bar
  5. * @package chamilo.learnpath
  6. * @author Yannick Warnier <ywarnier@beeznest.org>
  7. */
  8. /**
  9. * Code
  10. */
  11. // Flag to allow for anonymous user - needs to be set before global.inc.php.
  12. $use_anonymous = true;
  13. // Language files that needs to be included.
  14. $language_file[] = 'scormdocument';
  15. $language_file[] = 'scorm';
  16. $language_file[] = 'learnpath';
  17. require_once 'back_compat.inc.php';
  18. require_once 'learnpath.class.php';
  19. require_once 'scorm.class.php';
  20. require_once 'aicc.class.php';
  21. $htmlHeadXtra[] = '<script type="text/javascript">
  22. var dokeos_xajax_handler = window.parent.oxajax;
  23. </script>';
  24. $progress_bar = '';
  25. $navigation_bar = '';
  26. $display_mode = '';
  27. $autostart = 'true';
  28. if (isset($_SESSION['lpobject'])) {
  29. //if($debug>0) //error_log('New LP - in lp_nav.php - SESSION[lpobject] is defined',0);
  30. $oLP = unserialize($_SESSION['lpobject']);
  31. if (is_object($oLP)) {
  32. $_SESSION['oLP'] = $oLP;
  33. } else {
  34. //error_log('New LP - in lp_nav.php - SESSION[lpobject] is not object - dying',0);
  35. die('Could not instanciate lp object');
  36. }
  37. $display_mode = $_SESSION['oLP']->mode;
  38. $scorm_css_header = true;
  39. $lp_theme_css = $_SESSION['oLP']->get_theme();
  40. $my_style = api_get_visual_theme();
  41. //Setting up the CSS theme if exists
  42. //require_once '../inc/reduced_header.inc.php'; //fixes js bug in ie8 -> "src" not found see #3750
  43. $mycourselptheme = null;
  44. if (api_get_setting('allow_course_theme') == 'true') {
  45. $mycourselptheme = api_get_course_setting('allow_learning_path_theme');
  46. }
  47. if (!empty($lp_theme_css) && !empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
  48. global $lp_theme_css;
  49. } else {
  50. $lp_theme_css = $my_style;
  51. }
  52. $progress_bar = $_SESSION['oLP']->get_progress_bar('', -1, '', true);
  53. $navigation_bar = $_SESSION['oLP']->get_navigation_bar();
  54. $mediaplayer = $_SESSION['oLP']->get_mediaplayer($autostart);
  55. }
  56. session_write_close();
  57. ?>
  58. <span><?php echo (!empty($mediaplayer)) ? $mediaplayer : '&nbsp;' ?></span>