blank.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 = '';
  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. $message = Display::return_message(get_lang('ExerciseFinished'));
  49. }
  50. $template = new Template();
  51. $template->assign('content', $message);
  52. $template->display_blank_template();