1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00
raspap-webgui/includes/status_messages.php
2016-07-09 00:55:03 +01:00

23 lines
635 B
PHP

<?php
class StatusMessages {
public $messages = array();
public function addMessage($message, $level='success', $dismissable=true) {
$status = '<div class="alert alert-'.$level;
if ($dismissable) $status .= ' alert-dismissable';
$status .= '">'.$message;
if ($dismissable) $status .= '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">x</button>';
$status .= '</div>';
array_push($this->messages, $status);
}
public function showMessages($clear = true) {
foreach($this->messages as $message) {
echo $message;
}
if ( $clear ) $this->messages = array();
}
}
?>