shibboleth_display.class.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. /**
  26. * @param string $message
  27. */
  28. public function error_page($message)
  29. {
  30. $page_title = get_lang('ShibbolethLogin');
  31. Display :: display_header($page_title);
  32. echo Display::return_message($message, 'error');
  33. Display :: display_footer();
  34. die;
  35. }
  36. /**
  37. * @param string $message
  38. */
  39. public function message_page($message, $title = '')
  40. {
  41. $title = $title ? $title : get_lang('ShibbolethLogin');
  42. Display::display_header($title);
  43. echo Display::return_message($message, 'confirm');
  44. Display::display_footer();
  45. die;
  46. }
  47. public function page($content, $title = '')
  48. {
  49. $title = $title ? $title : get_lang('ShibbolethLogin');
  50. Display :: display_header($title);
  51. echo $content;
  52. Display :: display_footer();
  53. die;
  54. }
  55. }