blank.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. *
  7. * @package chamilo.learnpath
  8. *
  9. * @author Yannick Warnier <ywarnier@beeznest.org>
  10. */
  11. // Flag to allow for anonymous user - needs to be set before global.inc.php.
  12. $use_anonymous = true;
  13. require_once __DIR__.'/../inc/global.inc.php';
  14. $htmlHeadXtra[] = "
  15. <style>
  16. body { background: none;}
  17. </style>
  18. ";
  19. $message = '';
  20. if (isset($_GET['error'])) {
  21. switch ($_GET['error']) {
  22. case 'document_deleted':
  23. $message = Display::return_message(get_lang('DocumentHasBeenDeleted'), 'error');
  24. break;
  25. case 'prerequisites':
  26. $prerequisiteMessage = isset($_GET['prerequisite_message']) ? $_GET['prerequisite_message'] : '';
  27. $message = Display::return_message(get_lang('LearnpathPrereqNotCompleted'), 'warning');
  28. if (!empty($prerequisiteMessage)) {
  29. $message = Display::return_message(Security::remove_XSS($prerequisiteMessage), 'warning');
  30. }
  31. break;
  32. case 'document_not_found':
  33. $message = Display::return_message(get_lang('FileNotFound'), 'warning');
  34. break;
  35. case 'reached_one_attempt':
  36. $message = Display::return_message(get_lang('ReachedOneAttempt'), 'warning');
  37. break;
  38. case 'x_frames_options':
  39. $src = Session::read('x_frame_source');
  40. if (!empty($src)) {
  41. $icon = '<em class="icon-play-sign icon-2x" aria-hidden="true"></em>';
  42. $message = Display::return_message(
  43. Display::url(
  44. $icon.$src,
  45. $src,
  46. ['class' => 'btn generated', 'target' => '_blank']
  47. ),
  48. 'normal',
  49. false
  50. );
  51. Session::erase('x_frame_source');
  52. }
  53. break;
  54. default:
  55. break;
  56. }
  57. } elseif (isset($_GET['msg']) && $_GET['msg'] == 'exerciseFinished') {
  58. $message = Display::return_message(get_lang('ExerciseFinished'));
  59. }
  60. $template = new Template();
  61. $template->assign('content', $message);
  62. $template->display_blank_template();