lp_nav.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use Chamilo\CoreBundle\Framework\Container;
  4. /**
  5. * Script opened in an iframe and containing the
  6. * learning path's navigation and progress bar
  7. * @package chamilo.learnpath
  8. * @author Yannick Warnier <ywarnier@beeznest.org>
  9. */
  10. // Flag to allow for anonymous user - needs to be set before global.inc.php.
  11. $use_anonymous = true;
  12. //require_once '../inc/global.inc.php';
  13. $htmlHeadXtra[] = '<script>
  14. var chamilo_xajax_handler = window.parent.oxajax;
  15. </script>';
  16. $progress_bar = '';
  17. $navigation_bar = '';
  18. $display_mode = '';
  19. $autostart = 'true';
  20. $learnPath = learnpath::getCurrentLpFromSession();
  21. if (isset($learnPath)) {
  22. $display_mode = $learnPath->mode;
  23. $scorm_css_header = true;
  24. $lp_theme_css = $learnPath->get_theme();
  25. $my_style = api_get_visual_theme();
  26. // Setting up the CSS theme if exists
  27. $mycourselptheme = null;
  28. if (api_get_setting('course.allow_course_theme') == 'true') {
  29. $mycourselptheme = api_get_course_setting('allow_learning_path_theme');
  30. }
  31. if (!empty($lp_theme_css) && !empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
  32. global $lp_theme_css;
  33. } else {
  34. $lp_theme_css = $my_style;
  35. }
  36. $progress_bar = $learnPath->getProgressBar();
  37. $navigation_bar = $learnPath->get_navigation_bar();
  38. $mediaplayer = $learnPath->get_mediaplayer($autostart);
  39. }
  40. Container::$legacyTemplate = 'layout_empty.html.twig';
  41. session_write_close();
  42. ?>
  43. <script type="text/javascript">
  44. $(document).ready(function() {
  45. jQuery('video:not(.skip), audio:not(.skip)').mediaelementplayer({
  46. success: function(player, node) {
  47. }
  48. });
  49. });
  50. </script>
  51. <span>
  52. <?php echo (!empty($mediaplayer)) ? $mediaplayer : '&nbsp;' ?>
  53. </span>