1 | <?php |
||
14 | class SessionAlert |
||
15 | { |
||
16 | private $message; |
||
17 | private $title; |
||
18 | private $type; |
||
19 | private $closable; |
||
20 | private $block; |
||
21 | |||
22 | /** |
||
23 | * @param string $message |
||
24 | * @param string $title |
||
25 | * @param string $type |
||
26 | * @param bool $closable |
||
27 | * @param bool $block |
||
28 | */ |
||
29 | public function __construct($message, $title, $type = "alert-info", $closable = true, $block = true) |
||
30 | { |
||
31 | $this->message = $message; |
||
32 | $this->title = $title; |
||
33 | $this->type = $type; |
||
34 | $this->closable = $closable; |
||
35 | $this->block = $block; |
||
36 | } |
||
37 | |||
38 | public function getAlertBox() |
||
39 | { |
||
40 | return BootstrapSkin::displayAlertBox($this->message, $this->type, $this->title, $this->block, $this->closable, true); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Shows a quick one-liner message |
||
45 | * @param string $message |
||
46 | * @param string $type |
||
47 | */ |
||
48 | public static function quick($message, $type = "alert-info") |
||
51 | } |
||
52 | |||
53 | public static function success($message) |
||
54 | { |
||
55 | self::append(new SessionAlert($message, "", "alert-success", true, true)); |
||
56 | } |
||
57 | |||
58 | public static function warning($message, $title = "Warning!") |
||
59 | { |
||
60 | self::append(new SessionAlert($message, $title, "alert-warning", true, true)); |
||
61 | } |
||
62 | |||
63 | public static function error($message, $title = "Error!") |
||
64 | { |
||
65 | self::append(new SessionAlert($message, $title, "alert-error", true, true)); |
||
66 | } |
||
67 | |||
68 | public static function append(SessionAlert $alert) |
||
78 | } |
||
79 | |||
80 | public static function retrieve() |
||
81 | { |
||
82 | $block = array(); |
||
92 | } |
||
93 | } |
||
94 |