@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $aOptions['title'] = (string)$sTitle; |
72 | 72 | $aOptions['message'] = (string)$sContent; |
73 | 73 | $aOptions['buttons'] = []; |
74 | - foreach($aButtons as $button) |
|
74 | + foreach ($aButtons as $button) |
|
75 | 75 | { |
76 | 76 | $_button = [ |
77 | 77 | 'label' => $button['title'], |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | 'action' => $button['click'], |
80 | 80 | ]; |
81 | 81 | // Optional attributes |
82 | - foreach($button as $attr => $value) |
|
82 | + foreach ($button as $attr => $value) |
|
83 | 83 | { |
84 | - if(!in_array($attr, ['title', 'class', 'click'])) |
|
84 | + if (!in_array($attr, ['title', 'class', 'click'])) |
|
85 | 85 | { |
86 | 86 | $_button[$attr] = $value; |
87 | 87 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $aOptions['buttons'][] = $_button; |
90 | 90 | } |
91 | 91 | // Turn the value of the nl2br option to false, because it alters form rendering. |
92 | - if(!array_key_exists('nl2br', $aOptions)) |
|
92 | + if (!array_key_exists('nl2br', $aOptions)) |
|
93 | 93 | { |
94 | 94 | $aOptions['nl2br'] = false; |
95 | 95 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | protected function alert(string $sMessage, string $sTitle, string $sType): string |
119 | 119 | { |
120 | - if($this->getReturn()) |
|
120 | + if ($this->getReturn()) |
|
121 | 121 | { |
122 | 122 | $aDataTypes = [ |
123 | 123 | 'success' => 'BootstrapDialog.TYPE_SUCCESS', |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | 'danger' => 'BootstrapDialog.TYPE_DANGER', |
127 | 127 | ]; |
128 | 128 | $sType = $aDataTypes[$sType]; |
129 | - if(($sTitle)) |
|
129 | + if (($sTitle)) |
|
130 | 130 | { |
131 | 131 | return "BootstrapDialog.alert({message:" . $sMessage . ", title:'" . $sTitle . "', type:" . $sType . "})"; |
132 | 132 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | } |
137 | 137 | } |
138 | 138 | $aOptions = array('message' => $sMessage, 'type' => $sType); |
139 | - if(($sTitle)) |
|
139 | + if (($sTitle)) |
|
140 | 140 | { |
141 | 141 | $aOptions['title'] = $sTitle; |
142 | 142 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
184 | 184 | { |
185 | 185 | $sTitle = $this->getQuestionTitle(); |
186 | - if(!$sNoScript) |
|
186 | + if (!$sNoScript) |
|
187 | 187 | { |
188 | 188 | return "jaxon.dialogs.bootstrap.confirm(" . $sQuestion . ",'" . |
189 | 189 | $sTitle . "',function(){" . $sYesScript . ";})"; |
@@ -129,8 +129,7 @@ |
||
129 | 129 | if(($sTitle)) |
130 | 130 | { |
131 | 131 | return "BootstrapDialog.alert({message:" . $sMessage . ", title:'" . $sTitle . "', type:" . $sType . "})"; |
132 | - } |
|
133 | - else |
|
132 | + } else |
|
134 | 133 | { |
135 | 134 | return "BootstrapDialog.alert({message:" . $sMessage . ", type:" . $sType . "})"; |
136 | 135 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | */ |
73 | 73 | private function alert($sMessage, $sType) |
74 | 74 | { |
75 | - if($this->getReturn()) |
|
75 | + if ($this->getReturn()) |
|
76 | 76 | { |
77 | 77 | return "$.simplyToast(" . $sMessage . ", '" . $sType . "')"; |
78 | 78 | } |
@@ -182,18 +182,18 @@ |
||
182 | 182 | $aOptions = $this->getOptionNames($sKeyPrefix); |
183 | 183 | $sSpaces = str_repeat(' ', $nSpaces); |
184 | 184 | $sScript = ''; |
185 | - foreach($aOptions as $sShortName => $sFullName) |
|
185 | + foreach ($aOptions as $sShortName => $sFullName) |
|
186 | 186 | { |
187 | 187 | $value = $this->xDialogPlugin->getOption($sFullName); |
188 | - if(is_string($value)) |
|
188 | + if (is_string($value)) |
|
189 | 189 | { |
190 | 190 | $value = "'$value'"; |
191 | 191 | } |
192 | - elseif(is_bool($value)) |
|
192 | + elseif (is_bool($value)) |
|
193 | 193 | { |
194 | 194 | $value = ($value ? 'true' : 'false'); |
195 | 195 | } |
196 | - elseif(!is_numeric($value)) |
|
196 | + elseif (!is_numeric($value)) |
|
197 | 197 | { |
198 | 198 | $value = json_encode($value); |
199 | 199 | } |
@@ -188,12 +188,10 @@ |
||
188 | 188 | if(is_string($value)) |
189 | 189 | { |
190 | 190 | $value = "'$value'"; |
191 | - } |
|
192 | - elseif(is_bool($value)) |
|
191 | + } elseif(is_bool($value)) |
|
193 | 192 | { |
194 | 193 | $value = ($value ? 'true' : 'false'); |
195 | - } |
|
196 | - elseif(!is_numeric($value)) |
|
194 | + } elseif(!is_numeric($value)) |
|
197 | 195 | { |
198 | 196 | $value = json_encode($value); |
199 | 197 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | protected function alert(string $sMessage, string $sTitle, string $sType) |
74 | 74 | { |
75 | - if($this->getReturn()) |
|
75 | + if ($this->getReturn()) |
|
76 | 76 | { |
77 | 77 | return "$('body').overhang({message:" . $sMessage . ", type:'" . $sType . "'})"; |
78 | 78 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
120 | 120 | { |
121 | - if(!$sNoScript) |
|
121 | + if (!$sNoScript) |
|
122 | 122 | { |
123 | 123 | return "jaxon.dialogs.overhang.confirm(" . $sQuestion . ",function(){" . $sYesScript . ";})"; |
124 | 124 | } |
@@ -121,8 +121,7 @@ |
||
121 | 121 | if(!$sNoScript) |
122 | 122 | { |
123 | 123 | return "jaxon.dialogs.overhang.confirm(" . $sQuestion . ",function(){" . $sYesScript . ";})"; |
124 | - } |
|
125 | - else |
|
124 | + } else |
|
126 | 125 | { |
127 | 126 | return "jaxon.dialogs.overhang.confirm(" . $sQuestion . ",function(){" . $sYesScript . ";},function(){" . $sNoScript . ";})"; |
128 | 127 | } |
@@ -73,9 +73,9 @@ |
||
73 | 73 | */ |
74 | 74 | protected function alert(string $sMessage, string $sTitle, string $sType): string |
75 | 75 | { |
76 | - if($this->getReturn()) |
|
76 | + if ($this->getReturn()) |
|
77 | 77 | { |
78 | - if(($sTitle)) |
|
78 | + if (($sTitle)) |
|
79 | 79 | { |
80 | 80 | return "toastr." . $sType . "(" . $sMessage . ", '" . $sTitle . "')"; |
81 | 81 | } |
@@ -78,8 +78,7 @@ |
||
78 | 78 | if(($sTitle)) |
79 | 79 | { |
80 | 80 | return "toastr." . $sType . "(" . $sMessage . ", '" . $sTitle . "')"; |
81 | - } |
|
82 | - else |
|
81 | + } else |
|
83 | 82 | { |
84 | 83 | return "toastr." . $sType . "(" . $sMessage . ")"; |
85 | 84 | } |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | */ |
69 | 69 | protected function alert(string $sMessage, string $sTitle, string $sType) |
70 | 70 | { |
71 | - if($this->getReturn()) |
|
71 | + if ($this->getReturn()) |
|
72 | 72 | { |
73 | 73 | return "swal({text:" . $sMessage . ", title:'" . $sTitle . "', type:'" . $sType . "'})"; |
74 | 74 | } |
75 | 75 | $aOptions = array('text' => $sMessage, 'title' => '', 'type' => $sType); |
76 | - if(($sTitle)) |
|
76 | + if (($sTitle)) |
|
77 | 77 | { |
78 | 78 | $aOptions['title'] = $sTitle; |
79 | 79 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
120 | 120 | { |
121 | 121 | $sTitle = $this->getQuestionTitle(); |
122 | - if(!$sNoScript) |
|
122 | + if (!$sNoScript) |
|
123 | 123 | { |
124 | 124 | return "jaxon.dialogs.swal.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . ";})"; |
125 | 125 | } |
@@ -122,8 +122,7 @@ |
||
122 | 122 | if(!$sNoScript) |
123 | 123 | { |
124 | 124 | return "jaxon.dialogs.swal.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . ";})"; |
125 | - } |
|
126 | - else |
|
125 | + } else |
|
127 | 126 | { |
128 | 127 | return "jaxon.dialogs.swal.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . ";},function(){" . $sNoScript . ";})"; |
129 | 128 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function getScript(): string |
44 | 44 | { |
45 | - return $this->render('noty/alert.js'); |
|
45 | + return $this->render('noty/alert.js'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function getReadyScript(): string |
52 | 52 | { |
53 | - return $this->render('noty/ready.js.php'); |
|
53 | + return $this->render('noty/ready.js.php'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | protected function alert(string $sMessage, string $sTitle, string $sType) |
66 | 66 | { |
67 | - if($this->getReturn()) |
|
67 | + if ($this->getReturn()) |
|
68 | 68 | { |
69 | 69 | return "noty({text:" . $sMessage . ", type:'" . $sType . "', layout: 'topCenter'})"; |
70 | 70 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
112 | 112 | { |
113 | 113 | $sTitle = $this->getQuestionTitle(); |
114 | - if(!$sNoScript) |
|
114 | + if (!$sNoScript) |
|
115 | 115 | { |
116 | 116 | return "jaxon.dialogs.noty.confirm(" . $sQuestion . ",'',function(){" . $sYesScript . ";})"; |
117 | 117 | } |
@@ -114,8 +114,7 @@ |
||
114 | 114 | if(!$sNoScript) |
115 | 115 | { |
116 | 116 | return "jaxon.dialogs.noty.confirm(" . $sQuestion . ",'',function(){" . $sYesScript . ";})"; |
117 | - } |
|
118 | - else |
|
117 | + } else |
|
119 | 118 | { |
120 | 119 | return "jaxon.dialogs.noty.confirm(" . $sQuestion . ",'',function(){" . $sYesScript . ";},function(){" . $sNoScript . ";})"; |
121 | 120 | } |
@@ -132,19 +132,19 @@ discard block |
||
132 | 132 | $this->registerLibraries(); |
133 | 133 | $this->registerClasses(); |
134 | 134 | // Get the default modal library |
135 | - if(($sName = $this->xConfigManager->getOption('dialogs.default.modal', ''))) |
|
135 | + if (($sName = $this->xConfigManager->getOption('dialogs.default.modal', ''))) |
|
136 | 136 | { |
137 | 137 | $this->aLibrariesInUse[] = $sName; |
138 | 138 | $xDialogFacade->setModalLibrary($sName); |
139 | 139 | } |
140 | 140 | // Get the configured message library |
141 | - if(($sName = $this->xConfigManager->getOption('dialogs.default.message', ''))) |
|
141 | + if (($sName = $this->xConfigManager->getOption('dialogs.default.message', ''))) |
|
142 | 142 | { |
143 | 143 | $this->aLibrariesInUse[] = $sName; |
144 | 144 | $xDialogFacade->setMessageLibrary($sName); |
145 | 145 | } |
146 | 146 | // Get the configured question library |
147 | - if(($sName = $this->xConfigManager->getOption('dialogs.default.question', ''))) |
|
147 | + if (($sName = $this->xConfigManager->getOption('dialogs.default.question', ''))) |
|
148 | 148 | { |
149 | 149 | $this->aLibrariesInUse[] = $sName; |
150 | 150 | $xDialogFacade->setQuestionLibrary($sName); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | */ |
244 | 244 | protected function registerLibraries() |
245 | 245 | { |
246 | - foreach($this->aLibraries as $sName => $sClass) |
|
246 | + foreach ($this->aLibraries as $sName => $sClass) |
|
247 | 247 | { |
248 | 248 | $this->registerLibrary($sName, $sClass); |
249 | 249 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | protected function registerClasses() |
258 | 258 | { |
259 | 259 | $aLibraries = $this->xConfigManager->getOptionNames('dialogs.classes'); |
260 | - foreach($aLibraries as $sShortName => $sFullName) |
|
260 | + foreach ($aLibraries as $sShortName => $sFullName) |
|
261 | 261 | { |
262 | 262 | $this->registerLibrary($sShortName, $this->xConfigManager->getOption($sFullName)); |
263 | 263 | } |
@@ -334,9 +334,9 @@ discard block |
||
334 | 334 | $aNames = array_merge($this->aLibrariesInUse, |
335 | 335 | $this->xConfigManager->getOption('dialogs.libraries', [])); |
336 | 336 | $aLibraries = []; |
337 | - foreach($aNames as $sName) |
|
337 | + foreach ($aNames as $sName) |
|
338 | 338 | { |
339 | - if(($xLibrary = $this->getLibrary($sName))) |
|
339 | + if (($xLibrary = $this->getLibrary($sName))) |
|
340 | 340 | { |
341 | 341 | $aLibraries[$xLibrary->getName()] = $xLibrary; |
342 | 342 | } |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | $aOptions['title'] = $sTitle; |
77 | 77 | $aOptions['content'] = $sMessage; |
78 | 78 | $aOptions['buttons'] = []; |
79 | - if(!array_key_exists('boxWidth', $aOptions)) |
|
79 | + if (!array_key_exists('boxWidth', $aOptions)) |
|
80 | 80 | { |
81 | 81 | $aOptions['useBootstrap'] = false; |
82 | 82 | $aOptions['boxWidth'] = '600'; |
83 | 83 | } |
84 | 84 | $ind = 0; |
85 | - foreach($aButtons as $button) |
|
85 | + foreach ($aButtons as $button) |
|
86 | 86 | { |
87 | 87 | $_button = [ |
88 | 88 | 'text' => $button['title'], |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | 'action' => $button['click'], |
91 | 91 | ]; |
92 | 92 | // Optional attributes |
93 | - foreach($button as $attr => $value) |
|
93 | + foreach ($button as $attr => $value) |
|
94 | 94 | { |
95 | - if(!in_array($attr, ['title', 'class', 'click'])) |
|
95 | + if (!in_array($attr, ['title', 'class', 'click'])) |
|
96 | 96 | { |
97 | 97 | $_button[$attr] = $value; |
98 | 98 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | protected function alert(string $sMessage, string $sTitle, string $sType, string $sIcon): string |
126 | 126 | { |
127 | - if($this->getReturn()) |
|
127 | + if ($this->getReturn()) |
|
128 | 128 | { |
129 | 129 | return "$.alert({content:" . $sMessage . ", title:'" . $sTitle . |
130 | 130 | "', type:'" . $sType . "', icon:'" . $sIcon . "'})"; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
173 | 173 | { |
174 | 174 | $sTitle = $this->getQuestionTitle(); |
175 | - if(!$sNoScript) |
|
175 | + if (!$sNoScript) |
|
176 | 176 | { |
177 | 177 | return "jaxon.dialogs.jconfirm.confirm(" . $sQuestion . ",'" . |
178 | 178 | $sTitle . "',function(){" . $sYesScript . ";})"; |