@@ -1,10 +1,10 @@ |
||
1 | -<?php if(($this->defaultForMessage)): ?> |
|
1 | +<?php if (($this->defaultForMessage)): ?> |
|
2 | 2 | jaxon.ajax.message.success = jaxon.dialogs.xdialog.success; |
3 | 3 | jaxon.ajax.message.info = jaxon.dialogs.xdialog.info; |
4 | 4 | jaxon.ajax.message.warning = jaxon.dialogs.xdialog.warning; |
5 | 5 | jaxon.ajax.message.error = jaxon.dialogs.xdialog.error; |
6 | 6 | <?php endif ?> |
7 | -<?php if(($this->defaultForQuestion)): ?> |
|
7 | +<?php if (($this->defaultForQuestion)): ?> |
|
8 | 8 | jaxon.ajax.message.confirm = jaxon.dialogs.xdialog.confirm; |
9 | 9 | <?php endif ?> |
10 | 10 | jaxon.command.handler.register("xdialog.show", jaxon.dialogs.xdialog.show); |
@@ -86,11 +86,11 @@ |
||
86 | 86 | */ |
87 | 87 | protected function alert(string $sContent, string $sTitle, string $sType): string |
88 | 88 | { |
89 | - if(!$sTitle) |
|
89 | + if (!$sTitle) |
|
90 | 90 | { |
91 | 91 | $sTitle = ' '; |
92 | 92 | } |
93 | - if($this->returnCode()) |
|
93 | + if ($this->returnCode()) |
|
94 | 94 | { |
95 | 95 | return "cuteAlert({message:" . $sContent . ", title:'" . $sTitle . "', type:'" . $sType . "'})"; |
96 | 96 | } |
@@ -29,8 +29,7 @@ |
||
29 | 29 | try |
30 | 30 | { |
31 | 31 | $jaxon->dialog()->registerLibrary($sClass, $sClass::NAME); |
32 | - } |
|
33 | - catch(SetupException $e){} |
|
32 | + } catch(SetupException $e){} |
|
34 | 33 | } |
35 | 34 | // Register the template dir into the template renderer |
36 | 35 | $jaxon->template()->addNamespace('jaxon::dialogs', dirname(__DIR__) . '/templates'); |
@@ -41,13 +41,13 @@ |
||
41 | 41 | CuteAlertLibrary::class, // CuteAlert |
42 | 42 | ]; |
43 | 43 | $jaxon = jaxon(); |
44 | - foreach($aLibraries as $sClass) |
|
44 | + foreach ($aLibraries as $sClass) |
|
45 | 45 | { |
46 | 46 | try |
47 | 47 | { |
48 | 48 | $jaxon->dialog()->registerLibrary($sClass, $sClass::NAME); |
49 | 49 | } |
50 | - catch(SetupException $e){} |
|
50 | + catch (SetupException $e) {} |
|
51 | 51 | } |
52 | 52 | // Register the template dir into the template renderer |
53 | 53 | $jaxon->template()->addNamespace('jaxon::dialogs', dirname(__DIR__) . '/templates'); |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | $aOptions['title'] = $sTitle; |
85 | 85 | $aOptions['body'] = $sContent; |
86 | 86 | $aOptions['buttons'] = []; |
87 | - foreach($aButtons as $aButton) |
|
87 | + foreach ($aButtons as $aButton) |
|
88 | 88 | { |
89 | - if($aButton['click'] === 'close') |
|
89 | + if ($aButton['click'] === 'close') |
|
90 | 90 | { |
91 | 91 | $aOptions['buttons']['cancel'] = $aButton['title']; |
92 | 92 | $aOptions['oncancel'] = 'jaxon.dialogs.xdialog.hide()'; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | protected function alert(string $sContent, string $sTitle, string $sType): string |
123 | 123 | { |
124 | - if($this->returnCode()) |
|
124 | + if ($this->returnCode()) |
|
125 | 125 | { |
126 | 126 | return "jaxon.dialogs.xdialog.$sType(" . $sContent . "'" . $sTitle . "')"; |
127 | 127 | } |
@@ -170,8 +170,7 @@ discard block |
||
170 | 170 | $sTitle = $this->helper()->getQuestionTitle(); |
171 | 171 | |
172 | 172 | return empty($sNoScript) ? |
173 | - "jaxon.dialogs.xdialog.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . ";})" : |
|
174 | - "jaxon.dialogs.xdialog.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . |
|
173 | + "jaxon.dialogs.xdialog.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . ";})" : "jaxon.dialogs.xdialog.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . |
|
175 | 174 | ";},function(){" . $sNoScript . ";})"; |
176 | 175 | } |
177 | 176 | } |
@@ -90,8 +90,7 @@ |
||
90 | 90 | { |
91 | 91 | $aOptions['buttons']['cancel'] = $aButton['title']; |
92 | 92 | $aOptions['oncancel'] = 'jaxon.dialogs.xdialog.hide()'; |
93 | - } |
|
94 | - else |
|
93 | + } else |
|
95 | 94 | { |
96 | 95 | $aOptions['buttons']['ok'] = $aButton['title']; |
97 | 96 | $aOptions['onok'] = $aButton['click']; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | // Assign dialog content |
100 | 100 | $this->response()->assign($sContainer, 'innerHTML', $html); |
101 | - if(isset($aOptions['width'])) |
|
101 | + if (isset($aOptions['width'])) |
|
102 | 102 | { |
103 | 103 | // Set the value of the dialog width |
104 | 104 | $width = $aOptions['width']; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | protected function alert(string $sContent, string $sTitle, string $sType): string |
128 | 128 | { |
129 | - if($this->returnCode()) |
|
129 | + if ($this->returnCode()) |
|
130 | 130 | { |
131 | 131 | return "jaxon.dialogs.bootbox.alert('" . $sType . "'," . $sContent . ",'" . $sTitle . "')"; |
132 | 132 | } |
@@ -174,8 +174,7 @@ discard block |
||
174 | 174 | $sTitle = $this->helper()->getQuestionTitle(); |
175 | 175 | |
176 | 176 | return empty($sNoScript) ? |
177 | - "jaxon.dialogs.bootbox.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . ";})" : |
|
178 | - "jaxon.dialogs.bootbox.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . |
|
177 | + "jaxon.dialogs.bootbox.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . ";})" : "jaxon.dialogs.bootbox.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . |
|
179 | 178 | ";},function(){" . $sNoScript . ";})"; |
180 | 179 | } |
181 | 180 | } |