lp_nav.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 '../inc/global.inc.php';
  18. require_once 'learnpath.class.php';
  19. require_once 'scorm.class.php';
  20. require_once 'aicc.class.php';
  21. $htmlHeadXtra[] = '<script>
  22. var chamilo_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. $mycourselptheme = null;
  43. if (api_get_setting('allow_course_theme') == 'true') {
  44. $mycourselptheme = api_get_course_setting('allow_learning_path_theme');
  45. }
  46. if (!empty($lp_theme_css) && !empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
  47. global $lp_theme_css;
  48. } else {
  49. $lp_theme_css = $my_style;
  50. }
  51. $progress_bar = $_SESSION['oLP']->get_progress_bar('', -1, '', true);
  52. $navigation_bar = $_SESSION['oLP']->get_navigation_bar();
  53. $mediaplayer = $_SESSION['oLP']->get_mediaplayer($autostart);
  54. }
  55. session_write_close();
  56. ?>
  57. <span><?php echo (!empty($mediaplayer)) ? $mediaplayer : '&nbsp;' ?></span>