blank.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use ChamiloSession as Session;
  4. /**
  5. * Script that displays a blank page (with later a message saying why)
  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[] = "
  13. <style>
  14. body { background: none;}
  15. </style>
  16. ";
  17. $message = null;
  18. if (isset($_GET['error'])) {
  19. switch ($_GET['error']) {
  20. case 'document_deleted':
  21. $message = Display::return_message(get_lang('DocumentHasBeenDeleted'), 'error');
  22. break;
  23. case 'prerequisites':
  24. $message = Display::return_message(get_lang('LearnpathPrereqNotCompleted'), 'warning');
  25. break;
  26. case 'document_not_found':
  27. $message = Display::return_message(get_lang('FileNotFound'), 'warning');
  28. break;
  29. case 'reached_one_attempt':
  30. $message = Display::return_message(get_lang('ReachedOneAttempt'), 'warning');
  31. break;
  32. case 'x_frames_options':
  33. $src = Session::read('x_frame_source');
  34. if (!empty($src)) {
  35. $icon = '<em class="icon-play-sign icon-2x" aria-hidden="true"></em> ';
  36. $message = Display::return_message(
  37. Display::url($icon.$src, $src, ['class' => 'btn generated', 'target' => '_blank']),
  38. 'normal',
  39. false
  40. );
  41. Session::erase('x_frame_source');
  42. }
  43. break;
  44. default:
  45. break;
  46. }
  47. } elseif (isset($_GET['msg']) && $_GET['msg'] == 'exerciseFinished') {
  48. Display::addFlash(
  49. Display::return_message(get_lang('ExerciseFinished'))
  50. );
  51. }
  52. if (!empty($message)) {
  53. Display::addFlash($message);
  54. }
  55. Display::display_reduced_header();
  56. Display::display_reduced_footer();
  57. ?>