message.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Bibliotheca
  4. *
  5. * Copyright 2018-2023 Johannes Keßler
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0.
  19. */
  20. if(isset($TemplateData['message']['content'])) {
  21. $cssClass = 'primary';
  22. if(isset($TemplateData['message']['status'])) {
  23. switch($TemplateData['message']['status']) {
  24. case 'error':
  25. $cssClass = 'danger';
  26. break;
  27. case 'warning':
  28. $cssClass = 'warning';
  29. break;
  30. case 'success':
  31. $cssClass = 'success';
  32. break;
  33. case 'info':
  34. default:
  35. }
  36. }
  37. ?>
  38. <div class="uk-alert-<?php echo $cssClass; ?>" uk-alert>
  39. <p><?php echo $TemplateData['message']['content']; ?></p>
  40. </div>
  41. <?php } ?>