blank.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use Chamilo\CoreBundle\Framework\Container;
  4. use ChamiloSession as Session;
  5. /**
  6. * Script that displays a blank page (with later a message saying why)
  7. * @package chamilo.learnpath
  8. * @author Yannick Warnier <ywarnier@beeznest.org>
  9. */
  10. // Flag to allow for anonymous user - needs to be set before global.inc.php.
  11. Container::$legacyTemplate = 'layout_empty.html.twig';
  12. $use_anonymous = true;
  13. $htmlHeadXtra[] = "
  14. <style>
  15. body { background: none;}
  16. </style>
  17. ";
  18. if (isset($_GET['error'])) {
  19. switch ($_GET['error']){
  20. case 'document_deleted':
  21. echo '<br /><br />';
  22. Display::display_error_message(get_lang('DocumentHasBeenDeleted'));
  23. break;
  24. case 'prerequisites':
  25. echo '<br /><br />';
  26. Display::display_warning_message(get_lang('LearnpathPrereqNotCompleted'));
  27. break;
  28. case 'document_not_found':
  29. echo '<br /><br />';
  30. Display::display_warning_message(get_lang('FileNotFound'));
  31. break;
  32. case 'reached_one_attempt':
  33. echo '<br /><br />';
  34. Display::display_warning_message(get_lang('ReachedOneAttempt'));
  35. break;
  36. case 'x_frames_options':
  37. $frameSource = Session::read('x_frame_source');
  38. if (!empty($frameSource)) {
  39. $src = $frameSource;
  40. $icon = '<em class="icon-play-sign icon-2x"></em>&nbsp;';
  41. echo Display::return_message(
  42. Display::url($icon.$src, $src, ['class' => 'btn generated', 'target' => '_blank']),
  43. 'normal',
  44. false
  45. );
  46. Session::erase('x_frame_source');
  47. }
  48. break;
  49. default:
  50. break;
  51. }
  52. } elseif (isset($_GET['msg']) && $_GET['msg'] == 'exerciseFinished') {
  53. echo '<br /><br />';
  54. Display::display_normal_message(get_lang('ExerciseFinished'));
  55. }
  56. ?>
  57. </body>
  58. </html>