1 | <?php |
||
16 | class Alert extends Widget |
||
17 | { |
||
18 | //modal type |
||
19 | const TYPE_INFO = 'info'; |
||
20 | const TYPE_ERROR = 'error'; |
||
21 | const TYPE_SUCCESS = 'success'; |
||
22 | const TYPE_WARNING = 'warning'; |
||
23 | const TYPE_QUESTION = 'question'; |
||
24 | //input type |
||
25 | const INPUT_TYPE_TEXT = 'text'; |
||
26 | const INPUT_TYPE_EMAIL = 'email'; |
||
27 | const INPUT_TYPE_PASSWORD = 'password'; |
||
28 | const INPUT_TYPE_NUMBER = 'number'; |
||
29 | const INPUT_TYPE_RANGE = 'range'; |
||
30 | const INPUT_TYPE_TEXTAREA = 'textarea'; |
||
31 | const INPUT_TYPE_SELECT = 'select'; |
||
32 | const INPUT_TYPE_RADIO = 'radio'; |
||
33 | const INPUT_TYPE_CHECKBOX = 'checkbox'; |
||
34 | const INPUT_TYPE_FILE = 'file'; |
||
35 | |||
36 | /** |
||
37 | * All the flash messages stored for the session are displayed and removed from the session |
||
38 | * Defaults to false. |
||
39 | * @var bool |
||
40 | */ |
||
41 | public $useSessionFlash = false; |
||
42 | |||
43 | /** |
||
44 | * @var string alert callback |
||
45 | */ |
||
46 | public $callback = 'function() {}'; |
||
47 | |||
48 | /** |
||
49 | * Initializes the widget |
||
50 | */ |
||
51 | 4 | public function init() |
|
56 | |||
57 | /** |
||
58 | * @inheritdoc |
||
59 | */ |
||
60 | 3 | public function run() |
|
75 | |||
76 | 1 | /** |
|
77 | 1 | * @param $session bool|mixed|\yii\web\Session |
|
78 | 1 | * @return array |
|
79 | 1 | */ |
|
80 | public function processFlash($session) |
||
93 | |||
94 | /** |
||
95 | * @param array $steps |
||
96 | */ |
||
97 | 3 | public function getFlashWidget($steps = []) |
|
109 | 2 | ||
110 | /** |
||
111 | * Get widget options |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | 1 | public function getOptions() |
|
129 | 2 | ||
130 | 2 | /** |
|
131 | 2 | * @param array $steps |
|
132 | */ |
||
133 | public function initSwalQueue($steps = []) |
||
139 | 2 | ||
140 | /** |
||
141 | * @param string $options |
||
142 | * @param string $callback |
||
143 | */ |
||
144 | 4 | public function initSwal($options = '', $callback = '') |
|
150 | |||
151 | /** |
||
152 | 4 | * Register Animate Assets |
|
153 | */ |
||
154 | public function registerAnimate() |
||
158 | |||
159 | 3 | /** |
|
160 | * Register client assets |
||
161 | */ |
||
162 | public function registerAssets() |
||
171 | |||
172 | /** |
||
173 | * @return bool|mixed|\yii\web\Session |
||
174 | */ |
||
175 | private function getSession() |
||
179 | } |
||
180 |