shibboleth_display.class.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace Shibboleth;
  3. use \Display;
  4. /**
  5. * Utility display functions tailored for the Shibboleth pluging.
  6. *
  7. * @license see /license.txt
  8. * @author Laurent Opprecht <laurent@opprecht.info>, Nicolas Rod for the University of Geneva
  9. */
  10. class ShibbolethDisplay
  11. {
  12. /**
  13. *
  14. * @return ShibbolethDisplay
  15. */
  16. public static function instance()
  17. {
  18. static $result = false;
  19. if (empty($result))
  20. {
  21. $result = new self();
  22. }
  23. return $result;
  24. }
  25. public function error_page($message)
  26. {
  27. $page_title = get_lang('page_title');
  28. Display :: display_header($page_title);
  29. Display :: display_error_message($message);
  30. Display :: display_footer();
  31. die;
  32. }
  33. public function message_page($message, $title = '')
  34. {
  35. $title = $title ? $title : get_lang('page_title');
  36. Display :: display_header($title);
  37. Display :: display_confirmation_message($message);
  38. Display :: display_footer();
  39. die;
  40. }
  41. public function page($content, $title = '')
  42. {
  43. $title = $title ? $title : get_lang('page_title');
  44. Display :: display_header($title);
  45. echo $content;
  46. Display :: display_footer();
  47. die;
  48. }
  49. }