notifications.php 684 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. use oxusmedia\webApp\notificacion;
  3. foreach ($this->webApp()->getNotifications() as $n) { ?>
  4. <div class="alert alert-<?php echo notificacionTipoAlerta($n);?> alert-dismissible">
  5. <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  6. <?php echo $n->text;?>
  7. </div>
  8. <?php }
  9. function notificacionTipoAlerta($n)
  10. {
  11. switch ($n->type) {
  12. case notificacion::SUCCESS:
  13. return 'success';
  14. case notificacion::ERROR:
  15. return 'danger';
  16. case notificacion::WARNING:
  17. return 'warning';
  18. case notificacion::INFO:
  19. return 'info';
  20. }
  21. return '';
  22. }