1 | <?php |
||
17 | class Alert extends Widget |
||
18 | { |
||
19 | // modal type |
||
20 | const TYPE_INFO = 'info'; |
||
21 | const TYPE_ERROR = 'error'; |
||
22 | const TYPE_SUCCESS = 'success'; |
||
23 | const TYPE_WARNING = 'warning'; |
||
24 | const TYPE_QUESTION = 'question'; |
||
25 | |||
26 | // input type |
||
27 | const INPUT_TYPE_TEXT = 'text'; |
||
28 | const INPUT_TYPE_EMAIL = 'email'; |
||
29 | const INPUT_TYPE_PASSWORD = 'password'; |
||
30 | const INPUT_TYPE_NUMBER = 'number'; |
||
31 | const INPUT_TYPE_RANGE = 'range'; |
||
32 | const INPUT_TYPE_TEXTAREA = 'textarea'; |
||
33 | const INPUT_TYPE_SELECT = 'select'; |
||
34 | const INPUT_TYPE_RADIO = 'radio'; |
||
35 | const INPUT_TYPE_CHECKBOX = 'checkbox'; |
||
36 | const INPUT_TYPE_FILE = 'file'; |
||
37 | |||
38 | /** |
||
39 | * All the flash messages stored for the session are displayed and removed from the session |
||
40 | * Defaults to false. |
||
41 | * @var bool |
||
42 | */ |
||
43 | public $useSessionFlash = false; |
||
44 | |||
45 | /** |
||
46 | * @var string alert callback |
||
47 | */ |
||
48 | public $callback = 'function() {}'; |
||
49 | |||
50 | /** |
||
51 | 4 | * @param array $steps |
|
52 | */ |
||
53 | 4 | public function initSwalQueue($steps = []) |
|
59 | |||
60 | 3 | /** |
|
61 | * @param string $options |
||
62 | 3 | * @param string $callback |
|
63 | 2 | */ |
|
64 | 2 | public function initSwal($options = '', $callback = '') |
|
70 | 2 | ||
71 | /** |
||
72 | 2 | * @inheritdoc |
|
73 | 2 | */ |
|
74 | 1 | public function run() |
|
90 | 3 | ||
91 | /** |
||
92 | * @param $session bool|mixed|\yii\web\Session |
||
93 | * @return array |
||
94 | */ |
||
95 | public function processFlash($session) |
||
108 | |||
109 | 2 | /** |
|
110 | * @param array $steps |
||
111 | */ |
||
112 | public function processFlashWidget($steps = []) |
||
123 | |||
124 | /** |
||
125 | * Get widget options |
||
126 | 2 | * |
|
127 | * @return string |
||
128 | 2 | */ |
|
129 | 2 | public function getOptions() |
|
146 | 4 | ||
147 | 4 | /** |
|
148 | 1 | * Add support Animate.css |
|
149 | 1 | * @see https://daneden.github.io/animate.css/ |
|
150 | */ |
||
151 | public function registerAnimateCss() |
||
159 | 3 | ||
160 | /** |
||
161 | * @return bool|mixed|\yii\web\Session |
||
162 | */ |
||
163 | private function getSession() |
||
167 | } |
||
168 |