lp_nav.php 2.1 KB

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