lp_nav.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. if (isset($_SESSION['lpobject'])) {
  20. $oLP = unserialize($_SESSION['lpobject']);
  21. if (is_object($oLP)) {
  22. $_SESSION['oLP'] = $oLP;
  23. } else {
  24. die('Could not instanciate lp object');
  25. }
  26. $display_mode = $_SESSION['oLP']->mode;
  27. $scorm_css_header = true;
  28. $lp_theme_css = $_SESSION['oLP']->get_theme();
  29. $my_style = api_get_visual_theme();
  30. // Setting up the CSS theme if exists
  31. $mycourselptheme = null;
  32. if (api_get_setting('allow_course_theme') == 'true') {
  33. $mycourselptheme = api_get_course_setting('allow_learning_path_theme');
  34. }
  35. if (!empty($lp_theme_css) && !empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
  36. global $lp_theme_css;
  37. } else {
  38. $lp_theme_css = $my_style;
  39. }
  40. $progress_bar = $_SESSION['oLP']->getProgressBar();
  41. $navigation_bar = $_SESSION['oLP']->get_navigation_bar();
  42. $mediaplayer = $_SESSION['oLP']->get_mediaplayer($autostart);
  43. }
  44. session_write_close();
  45. ?>
  46. <script type="text/javascript">
  47. $(document).ready(function() {
  48. jQuery('video:not(.skip), audio:not(.skip)').mediaelementplayer({
  49. success: function(player, node) {
  50. }
  51. });
  52. });
  53. </script>
  54. <span>
  55. <?php echo (!empty($mediaplayer)) ? $mediaplayer : '&nbsp;' ?>
  56. </span>