lp_nav.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. $app['template.show_footer'] = false;
  19. $app['template.show_header'] = false;
  20. $app['default_layout'] = 'default/layout/blank.tpl';
  21. require_once 'learnpath.class.php';
  22. require_once 'scorm.class.php';
  23. require_once 'aicc.class.php';
  24. $htmlHeadXtra[] = '<script>
  25. var chamilo_xajax_handler = window.parent.oxajax;
  26. </script>';
  27. $progress_bar = '';
  28. $navigation_bar = '';
  29. $display_mode = '';
  30. $autostart = 'true';
  31. if (isset($_SESSION['lpobject'])) {
  32. //if($debug>0) //error_log('New LP - in lp_nav.php - SESSION[lpobject] is defined',0);
  33. $oLP = unserialize($_SESSION['lpobject']);
  34. if (is_object($oLP)) {
  35. $_SESSION['oLP'] = $oLP;
  36. } else {
  37. //error_log('New LP - in lp_nav.php - SESSION[lpobject] is not object - dying',0);
  38. die('Could not instanciate lp object');
  39. }
  40. $display_mode = $_SESSION['oLP']->mode;
  41. $scorm_css_header = true;
  42. $lp_theme_css = $_SESSION['oLP']->get_theme();
  43. $my_style = api_get_visual_theme();
  44. //Setting up the CSS theme if exists
  45. $mycourselptheme = null;
  46. if (api_get_setting('allow_course_theme') == 'true') {
  47. $mycourselptheme = api_get_course_setting('allow_learning_path_theme');
  48. }
  49. if (!empty($lp_theme_css) && !empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
  50. global $lp_theme_css;
  51. } else {
  52. $lp_theme_css = $my_style;
  53. }
  54. $progress_bar = $_SESSION['oLP']->get_progress_bar('', -1, '', true);
  55. $navigation_bar = $_SESSION['oLP']->get_navigation_bar();
  56. $mediaplayer = $_SESSION['oLP']->get_mediaplayer($autostart);
  57. }
  58. session_write_close();
  59. ?>
  60. <span><?php echo (!empty($mediaplayer)) ? $mediaplayer : '&nbsp;' ?></span>