@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | $options['title'] = (string)$title; |
76 | 76 | $options['content'] = (string)$content; |
77 | 77 | $options['buttons'] = array(); |
78 | - if(!array_key_exists('boxWidth', $options)) |
|
78 | + if (!array_key_exists('boxWidth', $options)) |
|
79 | 79 | { |
80 | 80 | $options['useBootstrap'] = false; |
81 | 81 | $options['boxWidth'] = '600'; |
82 | 82 | } |
83 | 83 | $ind = 0; |
84 | - foreach($buttons as $button) |
|
84 | + foreach ($buttons as $button) |
|
85 | 85 | { |
86 | 86 | $_button = [ |
87 | 87 | 'text' => $button['title'], |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | 'action' => $button['click'], |
90 | 90 | ]; |
91 | 91 | // Optional attributes |
92 | - foreach($button as $attr => $value) |
|
92 | + foreach ($button as $attr => $value) |
|
93 | 93 | { |
94 | - if(!in_array($attr, ['title', 'class', 'click'])) |
|
94 | + if (!in_array($attr, ['title', 'class', 'click'])) |
|
95 | 95 | { |
96 | 96 | $_button[$attr] = $value; |
97 | 97 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | protected function alert($content, $title, $type, $icon) |
124 | 124 | { |
125 | - if($this->getReturn()) |
|
125 | + if ($this->getReturn()) |
|
126 | 126 | { |
127 | 127 | return "$.alert({content:" . $content . ", title:'" . $title . "', type:'" . $type . "', icon:'" . $icon . "'})"; |
128 | 128 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | public function confirm($question, $yesScript, $noScript) |
168 | 168 | { |
169 | 169 | $title = $this->getQuestionTitle(); |
170 | - if(!$noScript) |
|
170 | + if (!$noScript) |
|
171 | 171 | { |
172 | 172 | return "jaxon.dialogs.jconfirm.confirm(" . $question . ",'" . $title . "',function(){" . $yesScript . ";})"; |
173 | 173 | } |
@@ -170,8 +170,7 @@ |
||
170 | 170 | if(!$noScript) |
171 | 171 | { |
172 | 172 | return "jaxon.dialogs.jconfirm.confirm(" . $question . ",'" . $title . "',function(){" . $yesScript . ";})"; |
173 | - } |
|
174 | - else |
|
173 | + } else |
|
175 | 174 | { |
176 | 175 | return "jaxon.dialogs.jconfirm.confirm(" . $question . ",'" . $title . "',function(){" . $yesScript . ";},function(){" . $noScript . ";})"; |
177 | 176 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $options['title'] = (string)$title; |
71 | 71 | $options['message'] = (string)$content; |
72 | 72 | $options['buttons'] = array(); |
73 | - foreach($buttons as $button) |
|
73 | + foreach ($buttons as $button) |
|
74 | 74 | { |
75 | 75 | $_button = [ |
76 | 76 | 'label' => $button['title'], |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | 'action' => $button['click'], |
79 | 79 | ]; |
80 | 80 | // Optional attributes |
81 | - foreach($button as $attr => $value) |
|
81 | + foreach ($button as $attr => $value) |
|
82 | 82 | { |
83 | - if(!in_array($attr, ['title', 'class', 'click'])) |
|
83 | + if (!in_array($attr, ['title', 'class', 'click'])) |
|
84 | 84 | { |
85 | 85 | $_button[$attr] = $value; |
86 | 86 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $options['buttons'][] = $_button; |
89 | 89 | } |
90 | 90 | // Turn the value of the nl2br option to false, because it alters form rendering. |
91 | - if(!array_key_exists('nl2br', $options)) |
|
91 | + if (!array_key_exists('nl2br', $options)) |
|
92 | 92 | { |
93 | 93 | $options['nl2br'] = false; |
94 | 94 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | protected function alert($message, $title, $type) |
118 | 118 | { |
119 | - if($this->getReturn()) |
|
119 | + if ($this->getReturn()) |
|
120 | 120 | { |
121 | 121 | $aDataTypes = [ |
122 | 122 | 'success' => 'BootstrapDialog.TYPE_SUCCESS', |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | 'danger' => 'BootstrapDialog.TYPE_DANGER', |
126 | 126 | ]; |
127 | 127 | $type = $aDataTypes[$type]; |
128 | - if(($title)) |
|
128 | + if (($title)) |
|
129 | 129 | { |
130 | 130 | return "BootstrapDialog.alert({message:" . $message . ", title:'" . $title . "', type:" . $type . "})"; |
131 | 131 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | } |
136 | 136 | } |
137 | 137 | $options = array('message' => $message, 'type' => $type); |
138 | - if(($title)) |
|
138 | + if (($title)) |
|
139 | 139 | { |
140 | 140 | $options['title'] = $title; |
141 | 141 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | public function confirm($question, $yesScript, $noScript) |
182 | 182 | { |
183 | 183 | $title = $this->getQuestionTitle(); |
184 | - if(!$noScript) |
|
184 | + if (!$noScript) |
|
185 | 185 | { |
186 | 186 | return "jaxon.dialogs.bootstrap.confirm(" . $question . ",'" . $title . "',function(){" . $yesScript . ";})"; |
187 | 187 | } |
@@ -128,8 +128,7 @@ discard block |
||
128 | 128 | if(($title)) |
129 | 129 | { |
130 | 130 | return "BootstrapDialog.alert({message:" . $message . ", title:'" . $title . "', type:" . $type . "})"; |
131 | - } |
|
132 | - else |
|
131 | + } else |
|
133 | 132 | { |
134 | 133 | return "BootstrapDialog.alert({message:" . $message . ", type:" . $type . "})"; |
135 | 134 | } |
@@ -184,8 +183,7 @@ discard block |
||
184 | 183 | if(!$noScript) |
185 | 184 | { |
186 | 185 | return "jaxon.dialogs.bootstrap.confirm(" . $question . ",'" . $title . "',function(){" . $yesScript . ";})"; |
187 | - } |
|
188 | - else |
|
186 | + } else |
|
189 | 187 | { |
190 | 188 | return "jaxon.dialogs.bootstrap.confirm(" . $question . ",'" . $title . "',function(){" . $yesScript . ";},function(){" . $noScript . ";})"; |
191 | 189 | } |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | */ |
69 | 69 | protected function alert($message, $title, $type) |
70 | 70 | { |
71 | - if($this->getReturn()) |
|
71 | + if ($this->getReturn()) |
|
72 | 72 | { |
73 | 73 | return "swal({text:" . $message . ", title:'" . $title . "', type:'" . $type . "'})"; |
74 | 74 | } |
75 | 75 | $options = array('text' => $message, 'title' => '', 'type' => $type); |
76 | - if(($title)) |
|
76 | + if (($title)) |
|
77 | 77 | { |
78 | 78 | $options['title'] = $title; |
79 | 79 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public function confirm($question, $yesScript, $noScript) |
120 | 120 | { |
121 | 121 | $title = $this->getQuestionTitle(); |
122 | - if(!$noScript) |
|
122 | + if (!$noScript) |
|
123 | 123 | { |
124 | 124 | return "jaxon.dialogs.swal.confirm(" . $question . ",'" . $title . "',function(){" . $yesScript . ";})"; |
125 | 125 | } |
@@ -122,8 +122,7 @@ |
||
122 | 122 | if(!$noScript) |
123 | 123 | { |
124 | 124 | return "jaxon.dialogs.swal.confirm(" . $question . ",'" . $title . "',function(){" . $yesScript . ";})"; |
125 | - } |
|
126 | - else |
|
125 | + } else |
|
127 | 126 | { |
128 | 127 | return "jaxon.dialogs.swal.confirm(" . $question . ",'" . $title . "',function(){" . $yesScript . ";},function(){" . $noScript . ";})"; |
129 | 128 | } |
@@ -74,9 +74,9 @@ |
||
74 | 74 | */ |
75 | 75 | protected function alert($message, $title, $type) |
76 | 76 | { |
77 | - if($this->getReturn()) |
|
77 | + if ($this->getReturn()) |
|
78 | 78 | { |
79 | - if(($title)) |
|
79 | + if (($title)) |
|
80 | 80 | { |
81 | 81 | return "toastr." . $type . "(" . $message . ", '" . $title . "')"; |
82 | 82 | } |
@@ -79,8 +79,7 @@ |
||
79 | 79 | if(($title)) |
80 | 80 | { |
81 | 81 | return "toastr." . $type . "(" . $message . ", '" . $title . "')"; |
82 | - } |
|
83 | - else |
|
82 | + } else |
|
84 | 83 | { |
85 | 84 | return "toastr." . $type . "(" . $message . ")"; |
86 | 85 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | */ |
74 | 74 | private function alert($message, $type) |
75 | 75 | { |
76 | - if($this->getReturn()) |
|
76 | + if ($this->getReturn()) |
|
77 | 77 | { |
78 | 78 | return "$.simplyToast(" . $message . ", '" . $type . "')"; |
79 | 79 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | protected function alert($message, $title, $type) |
76 | 76 | { |
77 | - if($this->getReturn()) |
|
77 | + if ($this->getReturn()) |
|
78 | 78 | { |
79 | 79 | return "jaxon.dialogs.pnotify.alert({text:" . $message . ", type:'" . $type . "', title:'" . $title . "'})"; |
80 | 80 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | public function confirm($question, $yesScript, $noScript) |
122 | 122 | { |
123 | 123 | $title = $this->getQuestionTitle(); |
124 | - if(!$noScript) |
|
124 | + if (!$noScript) |
|
125 | 125 | { |
126 | 126 | return "jaxon.dialogs.pnotify.confirm(" . $question . ",'" . $title . "',function(){" . $yesScript . ";})"; |
127 | 127 | } |
@@ -124,8 +124,7 @@ |
||
124 | 124 | if(!$noScript) |
125 | 125 | { |
126 | 126 | return "jaxon.dialogs.pnotify.confirm(" . $question . ",'" . $title . "',function(){" . $yesScript . ";})"; |
127 | - } |
|
128 | - else |
|
127 | + } else |
|
129 | 128 | { |
130 | 129 | return "jaxon.dialogs.pnotify.confirm(" . $question . ",'" . $title . "',function(){" . $yesScript . ";},function(){" . $noScript . ";})"; |
131 | 130 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $sName = (string)$sName; |
133 | 133 | $sClass = (string)$sClass; |
134 | 134 | // Register the library in the DI container |
135 | - $this->di[$sName] = function ($c) use ($sName, $sClass) { |
|
135 | + $this->di[$sName] = function($c) use ($sName, $sClass) { |
|
136 | 136 | $xLibrary = new $sClass; |
137 | 137 | $xLibrary->init($sName, $this->di['dialog']); |
138 | 138 | return $xLibrary; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | // Register this instance of the plugin in the DI. |
150 | 150 | $this->di['dialog'] = $this; |
151 | 151 | // Register supported libraries in the DI container |
152 | - foreach($this->aLibraries as $sName => $sClass) |
|
152 | + foreach ($this->aLibraries as $sName => $sClass) |
|
153 | 153 | { |
154 | 154 | $this->registerLibrary($sName, $sClass); |
155 | 155 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | { |
165 | 165 | // Register user defined libraries in the DI container |
166 | 166 | $aLibraries = $this->getOptionNames('dialogs.classes'); |
167 | - foreach($aLibraries as $sShortName => $sFullName) |
|
167 | + foreach ($aLibraries as $sShortName => $sFullName) |
|
168 | 168 | { |
169 | 169 | $this->registerLibrary($sShortName, $this->getOption($sFullName)); |
170 | 170 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $library->setResponse($this->response()); |
187 | 187 | return $library; |
188 | 188 | } |
189 | - catch(\Exception $e) |
|
189 | + catch (\Exception $e) |
|
190 | 190 | { |
191 | 191 | return null; |
192 | 192 | } |
@@ -212,13 +212,13 @@ discard block |
||
212 | 212 | protected function getModalLibrary() |
213 | 213 | { |
214 | 214 | // Get the current modal library |
215 | - if(($this->sModalLibrary) && |
|
215 | + if (($this->sModalLibrary) && |
|
216 | 216 | ($library = $this->getLibrary($this->sModalLibrary)) && ($library instanceof Modal)) |
217 | 217 | { |
218 | 218 | return $library; |
219 | 219 | } |
220 | 220 | // Get the default modal library |
221 | - if(($sName = $this->getOption('dialogs.default.modal', '')) && |
|
221 | + if (($sName = $this->getOption('dialogs.default.modal', '')) && |
|
222 | 222 | ($library = $this->getLibrary($sName)) && ($library instanceof Modal)) |
223 | 223 | { |
224 | 224 | return $library; |
@@ -246,13 +246,13 @@ discard block |
||
246 | 246 | protected function getMessageLibrary($bReturnDefault = false) |
247 | 247 | { |
248 | 248 | // Get the current message library |
249 | - if(($this->sMessageLibrary) && |
|
249 | + if (($this->sMessageLibrary) && |
|
250 | 250 | ($library = $this->getLibrary($this->sMessageLibrary)) && ($library instanceof Message)) |
251 | 251 | { |
252 | 252 | return $library; |
253 | 253 | } |
254 | 254 | // Get the configured message library |
255 | - if(($sName = $this->getOption('dialogs.default.message', '')) && |
|
255 | + if (($sName = $this->getOption('dialogs.default.message', '')) && |
|
256 | 256 | ($library = $this->getLibrary($sName)) && ($library instanceof Message)) |
257 | 257 | { |
258 | 258 | return $library; |
@@ -283,13 +283,13 @@ discard block |
||
283 | 283 | protected function getQuestionLibrary($bReturnDefault = false) |
284 | 284 | { |
285 | 285 | // Get the current confirm library |
286 | - if(($this->sQuestionLibrary) && |
|
286 | + if (($this->sQuestionLibrary) && |
|
287 | 287 | ($library = $this->getLibrary($this->sQuestionLibrary)) && ($library instanceof Question)) |
288 | 288 | { |
289 | 289 | return $library; |
290 | 290 | } |
291 | 291 | // Get the configured confirm library |
292 | - if(($sName = $this->getOption('dialogs.default.question', '')) && |
|
292 | + if (($sName = $this->getOption('dialogs.default.question', '')) && |
|
293 | 293 | ($library = $this->getLibrary($sName)) && ($library instanceof Question)) |
294 | 294 | { |
295 | 295 | return $library; |
@@ -306,27 +306,27 @@ discard block |
||
306 | 306 | protected function getLibrariesInUse() |
307 | 307 | { |
308 | 308 | $aNames = $this->getOption('dialogs.libraries', array()); |
309 | - if(!is_array($aNames)) |
|
309 | + if (!is_array($aNames)) |
|
310 | 310 | { |
311 | 311 | $aNames = array(); |
312 | 312 | } |
313 | 313 | $libraries = array(); |
314 | - foreach($aNames as $sName) |
|
314 | + foreach ($aNames as $sName) |
|
315 | 315 | { |
316 | - if(($library = $this->getLibrary($sName))) |
|
316 | + if (($library = $this->getLibrary($sName))) |
|
317 | 317 | { |
318 | 318 | $libraries[$library->getName()] = $library; |
319 | 319 | } |
320 | 320 | } |
321 | - if(($library = $this->getModalLibrary())) |
|
321 | + if (($library = $this->getModalLibrary())) |
|
322 | 322 | { |
323 | 323 | $libraries[$library->getName()] = $library; |
324 | 324 | } |
325 | - if(($library = $this->getMessageLibrary())) |
|
325 | + if (($library = $this->getMessageLibrary())) |
|
326 | 326 | { |
327 | 327 | $libraries[$library->getName()] = $library; |
328 | 328 | } |
329 | - if(($library = $this->getQuestionLibrary())) |
|
329 | + if (($library = $this->getQuestionLibrary())) |
|
330 | 330 | { |
331 | 331 | $libraries[$library->getName()] = $library; |
332 | 332 | } |
@@ -338,13 +338,13 @@ discard block |
||
338 | 338 | */ |
339 | 339 | public function getJs() |
340 | 340 | { |
341 | - if(!$this->includeAssets()) |
|
341 | + if (!$this->includeAssets()) |
|
342 | 342 | { |
343 | 343 | return ''; |
344 | 344 | } |
345 | 345 | $libraries = $this->getLibrariesInUse(); |
346 | 346 | $code = ''; |
347 | - foreach($libraries as $library) |
|
347 | + foreach ($libraries as $library) |
|
348 | 348 | { |
349 | 349 | $code .= "\n" . $library->getJs() . "\n"; |
350 | 350 | } |
@@ -356,13 +356,13 @@ discard block |
||
356 | 356 | */ |
357 | 357 | public function getCss() |
358 | 358 | { |
359 | - if(!$this->includeAssets()) |
|
359 | + if (!$this->includeAssets()) |
|
360 | 360 | { |
361 | 361 | return ''; |
362 | 362 | } |
363 | 363 | $libraries = $this->getLibrariesInUse(); |
364 | 364 | $code = ''; |
365 | - foreach($libraries as $library) |
|
365 | + foreach ($libraries as $library) |
|
366 | 366 | { |
367 | 367 | $code .= $library->getCss() . "\n"; |
368 | 368 | } |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | { |
377 | 377 | $libraries = $this->getLibrariesInUse(); |
378 | 378 | $code = "jaxon.dialogs = {};\n"; |
379 | - foreach($libraries as $library) |
|
379 | + foreach ($libraries as $library) |
|
380 | 380 | { |
381 | 381 | $code .= $library->getScript() . "\n"; |
382 | 382 | } |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | { |
391 | 391 | $libraries = $this->getLibrariesInUse(); |
392 | 392 | $code = ""; |
393 | - foreach($libraries as $library) |
|
393 | + foreach ($libraries as $library) |
|
394 | 394 | { |
395 | 395 | $code .= $library->getReadyScript() . "\n"; |
396 | 396 | } |
@@ -185,8 +185,7 @@ |
||
185 | 185 | // Set the Response instance |
186 | 186 | $library->setResponse($this->response()); |
187 | 187 | return $library; |
188 | - } |
|
189 | - catch(\Exception $e) |
|
188 | + } catch(\Exception $e) |
|
190 | 189 | { |
191 | 190 | return null; |
192 | 191 | } |
@@ -1,10 +1,10 @@ |
||
1 | -<?php if(($this->defaultForMessage)): ?> |
|
1 | +<?php if (($this->defaultForMessage)): ?> |
|
2 | 2 | jaxon.ajax.message.success = jaxon.dialogs.noty.success; |
3 | 3 | jaxon.ajax.message.info = jaxon.dialogs.noty.info; |
4 | 4 | jaxon.ajax.message.warning = jaxon.dialogs.noty.warning; |
5 | 5 | jaxon.ajax.message.error = jaxon.dialogs.noty.error; |
6 | 6 | <?php endif ?> |
7 | -<?php if(($this->defaultForQuestion)): ?> |
|
7 | +<?php if (($this->defaultForQuestion)): ?> |
|
8 | 8 | jaxon.ajax.message.confirm = jaxon.dialogs.noty.confirm; |
9 | 9 | <?php endif ?> |
10 | 10 | jaxon.command.handler.register('noty.alert', function(args) { |
@@ -8,12 +8,12 @@ |
||
8 | 8 | jaxon.command.handler.register("bootbox", function(args) { |
9 | 9 | bootbox.alert(args.data.type, args.data.content, args.data.title); |
10 | 10 | }); |
11 | -<?php if(($this->defaultForMessage)): ?> |
|
11 | +<?php if (($this->defaultForMessage)): ?> |
|
12 | 12 | jaxon.ajax.message.success = jaxon.dialogs.bootbox.success; |
13 | 13 | jaxon.ajax.message.info = jaxon.dialogs.bootbox.info; |
14 | 14 | jaxon.ajax.message.warning = jaxon.dialogs.bootbox.warning; |
15 | 15 | jaxon.ajax.message.error = jaxon.dialogs.bootbox.error; |
16 | 16 | <?php endif ?> |
17 | -<?php if(($this->defaultForQuestion)): ?> |
|
17 | +<?php if (($this->defaultForQuestion)): ?> |
|
18 | 18 | jaxon.ajax.message.confirm = jaxon.dialogs.bootbox.confirm; |
19 | 19 | <?php endif; |