lp_nav.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 __DIR__.'/../inc/global.inc.php';
  12. $htmlHeadXtra[] = '<script>
  13. var chamilo_xajax_handler = window.parent.oxajax;
  14. </script>';
  15. $lpItemId = isset($_REQUEST['lp_item']) ? intval($_REQUEST['lp_item']) : 0;
  16. if (!$lpItemId) {
  17. echo '';
  18. exit;
  19. }
  20. $progress_bar = '';
  21. $navigation_bar = '';
  22. $display_mode = '';
  23. $autostart = 'true';
  24. $myLP = learnpath::getLpFromSession(api_get_course_id(), '', '');
  25. if ($myLP) {
  26. $display_mode = $myLP->mode;
  27. $scorm_css_header = true;
  28. $lp_theme_css = $myLP->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 = $myLP->getProgressBar();
  41. $navigation_bar = $myLP->get_navigation_bar();
  42. $mediaplayer = $myLP->get_mediaplayer($lpItemId, $autostart);
  43. }
  44. session_write_close();
  45. ?>
  46. <script>
  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>