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 | * @return string|void |
||
59 | */ |
||
60 | 3 | public function run() |
|
93 | |||
94 | /** |
||
95 | * Get widget options |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | 3 | public function getOptions() |
|
113 | |||
114 | /** |
||
115 | * @param array $steps |
||
116 | */ |
||
117 | 1 | protected function initSwalQueue($steps = []) |
|
123 | |||
124 | /** |
||
125 | * @param string $options |
||
126 | * @param string $callback |
||
127 | */ |
||
128 | 2 | protected function initSwal($options = '', $callback = '') |
|
134 | |||
135 | /** |
||
136 | * Register Animate Assets |
||
137 | */ |
||
138 | 2 | protected function registerAnimate() |
|
142 | |||
143 | /** |
||
144 | * Register client assets |
||
145 | */ |
||
146 | 4 | protected function registerAssets() |
|
155 | |||
156 | /** |
||
157 | * @return \yii\web\Session |
||
158 | */ |
||
159 | 2 | private function getSession() |
|
163 | } |
||
164 |