lp_nav.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. require_once '../inc/global.inc.php';
  12. $htmlHeadXtra[] = '<script>
  13. var chamilo_xajax_handler = window.parent.oxajax;
  14. </script>';
  15. $progress_bar = '';
  16. $navigation_bar = '';
  17. $display_mode = '';
  18. $autostart = 'true';
  19. $myLP = learnpath::getLpFromSession(api_get_course_id(), '', '');
  20. if ($myLP) {
  21. $display_mode = $myLP->mode;
  22. $scorm_css_header = true;
  23. $lp_theme_css = $myLP->get_theme();
  24. $my_style = api_get_visual_theme();
  25. // Setting up the CSS theme if exists
  26. $mycourselptheme = null;
  27. if (api_get_setting('allow_course_theme') === 'true') {
  28. $mycourselptheme = api_get_course_setting('allow_learning_path_theme');
  29. }
  30. if (!empty($lp_theme_css) && !empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
  31. global $lp_theme_css;
  32. } else {
  33. $lp_theme_css = $my_style;
  34. }
  35. $progress_bar = $myLP->getProgressBar();
  36. $navigation_bar = $myLP->get_navigation_bar();
  37. $mediaplayer = $myLP->get_mediaplayer($autostart);
  38. }
  39. session_write_close();
  40. ?>
  41. <script>
  42. $(document).ready(function() {
  43. jQuery('video:not(.skip), audio:not(.skip)').mediaelementplayer({
  44. success: function(player, node) {
  45. }
  46. });
  47. });
  48. </script>
  49. <span>
  50. <?php echo !empty($mediaplayer) ? $mediaplayer : '&nbsp;' ?>
  51. </span>