@@ 132-139 (lines=8) @@ | ||
129 | * @param string $title The notification's title |
|
130 | * @param array $options |
|
131 | */ |
|
132 | public function info($text, $onlyNextRequest = true, array $options = []) |
|
133 | { |
|
134 | $theme = (isset($options['theme']) && $options['theme'] != '') ? $options['theme'] : 'metroui'; |
|
135 | $timeout = (isset($options['timeout']) && $options['timeout'] != '' && is_int($options['timeout'])) ? $options['timeout'] : false; |
|
136 | $layout = (isset($options['layout']) && $options['layout'] != '') ? $options['layout'] : 'topRight'; |
|
137 | ||
138 | $this->add($theme, $timeout, 'info', $layout, $text, null, null, $onlyNextRequest); |
|
139 | } |
|
140 | ||
141 | /** |
|
142 | * Shortcut for adding an error notification |
|
@@ 148-155 (lines=8) @@ | ||
145 | * @param string $title The notification's title |
|
146 | * @param array $options |
|
147 | */ |
|
148 | public function error($text, $onlyNextRequest = true, array $options = []) |
|
149 | { |
|
150 | $theme = (isset($options['theme']) && $options['theme'] != '') ? $options['theme'] : 'metroui'; |
|
151 | $timeout = (isset($options['timeout']) && $options['timeout'] != '' && is_int($options['timeout'])) ? $options['timeout'] : 0; |
|
152 | $layout = (isset($options['layout']) && $options['layout'] != '') ? $options['layout'] : 'topRight'; |
|
153 | ||
154 | $this->add($theme, $timeout, 'error', $layout, $text, null, null, $onlyNextRequest); |
|
155 | } |
|
156 | ||
157 | /** |
|
158 | * Shortcut for adding a warning notification |
|
@@ 164-171 (lines=8) @@ | ||
161 | * @param string $title The notification's title |
|
162 | * @param array $options |
|
163 | */ |
|
164 | public function warning($text, $onlyNextRequest = true, array $options = []) |
|
165 | { |
|
166 | $theme = (isset($options['theme']) && $options['theme'] != '') ? $options['theme'] : 'metroui'; |
|
167 | $timeout = (isset($options['timeout']) && $options['timeout'] != '' && is_int($options['timeout'])) ? $options['timeout'] : 0; |
|
168 | $layout = (isset($options['layout']) && $options['layout'] != '') ? $options['layout'] : 'topRight'; |
|
169 | ||
170 | $this->add($theme, $timeout, 'warning', $layout, $text, null, null, $onlyNextRequest); |
|
171 | } |
|
172 | ||
173 | /** |
|
174 | * Shortcut for adding a success notification |
|
@@ 180-187 (lines=8) @@ | ||
177 | * @param string $title The notification's title |
|
178 | * @param array $options |
|
179 | */ |
|
180 | public function success($text, $onlyNextRequest = true, array $options = []) |
|
181 | { |
|
182 | $theme = (isset($options['theme']) && $options['theme'] != '') ? $options['theme'] : 'metroui'; |
|
183 | $timeout = (isset($options['timeout']) && $options['timeout'] != '' && is_int($options['timeout'])) ? $options['timeout'] : 0; |
|
184 | $layout = (isset($options['layout']) && $options['layout'] != '') ? $options['layout'] : 'topRight'; |
|
185 | ||
186 | $this->add($theme, $timeout, 'success', $layout, $text, null, null, $onlyNextRequest); |
|
187 | } |
|
188 | ||
189 | ||
190 | /** |