@@ -1,4 +1,4 @@ |
||
1 | -<?php if(($this->defaultForMessage)): ?> |
|
1 | +<?php if (($this->defaultForMessage)): ?> |
|
2 | 2 | jaxon.ajax.message.success = jaxon.dialogs.notify.success; |
3 | 3 | jaxon.ajax.message.info = jaxon.dialogs.notify.info; |
4 | 4 | jaxon.ajax.message.warning = jaxon.dialogs.notify.warning; |
@@ -1,10 +1,10 @@ |
||
1 | -<?php if(($this->defaultForMessage)): ?> |
|
1 | +<?php if (($this->defaultForMessage)): ?> |
|
2 | 2 | jaxon.ajax.message.success = jaxon.dialogs.jalert.success; |
3 | 3 | jaxon.ajax.message.info = jaxon.dialogs.jalert.info; |
4 | 4 | jaxon.ajax.message.warning = jaxon.dialogs.jalert.warning; |
5 | 5 | jaxon.ajax.message.error = jaxon.dialogs.jalert.error; |
6 | 6 | <?php endif ?> |
7 | -<?php if(($this->defaultForQuestion)): ?> |
|
7 | +<?php if (($this->defaultForQuestion)): ?> |
|
8 | 8 | jaxon.ajax.message.confirm = jaxon.dialogs.jalert.confirm; |
9 | 9 | <?php endif ?> |
10 | 10 | jaxon.command.handler.register("jalert.alert", function(args) { |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | */ |
70 | 70 | protected function alert(string $sContent, string $sTitle, string $sTheme): string |
71 | 71 | { |
72 | - if(!$sTitle) |
|
72 | + if (!$sTitle) |
|
73 | 73 | { |
74 | 74 | $sTitle = ' '; |
75 | 75 | } |
76 | - if($this->returnCode()) |
|
76 | + if ($this->returnCode()) |
|
77 | 77 | { |
78 | 78 | return "$.jAlert({content:" . $sContent . ", title:'" . $sTitle . "', theme:'" . $sTheme . "'})"; |
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->xHelper->getQuestionTitle(); |
122 | - if(!$sNoScript) |
|
122 | + if (!$sNoScript) |
|
123 | 123 | { |
124 | 124 | return "jaxon.dialogs.jalert.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . ";})"; |
125 | 125 | } |
@@ -125,8 +125,7 @@ |
||
125 | 125 | if(!$sNoScript) |
126 | 126 | { |
127 | 127 | return "jaxon.dialogs.jalert.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . ";})"; |
128 | - } |
|
129 | - else |
|
128 | + } else |
|
130 | 129 | { |
131 | 130 | return "jaxon.dialogs.jalert.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . ";},function(){" . $sNoScript . ";})"; |
132 | 131 | } |
@@ -91,7 +91,7 @@ |
||
91 | 91 | */ |
92 | 92 | protected function alert(string $sMessage, string $sTitle, string $sType): string |
93 | 93 | { |
94 | - if($this->returnCode()) |
|
94 | + if ($this->returnCode()) |
|
95 | 95 | { |
96 | 96 | return empty($sTitle) ? "toastr.$sType($sMessage)" : "toastr.$sType($sMessage, '$sTitle')"; |
97 | 97 | } |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | $aOptions['title'] = $sTitle; |
74 | 74 | $aOptions['content'] = $sMessage; |
75 | 75 | $aOptions['buttons'] = []; |
76 | - if(!array_key_exists('boxWidth', $aOptions)) |
|
76 | + if (!array_key_exists('boxWidth', $aOptions)) |
|
77 | 77 | { |
78 | 78 | $aOptions['useBootstrap'] = false; |
79 | 79 | $aOptions['boxWidth'] = '600'; |
80 | 80 | } |
81 | 81 | $ind = 0; |
82 | - foreach($aButtons as $button) |
|
82 | + foreach ($aButtons as $button) |
|
83 | 83 | { |
84 | 84 | $_button = [ |
85 | 85 | 'text' => $button['title'], |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | 'action' => $button['click'], |
88 | 88 | ]; |
89 | 89 | // Optional attributes |
90 | - foreach($button as $attr => $value) |
|
90 | + foreach ($button as $attr => $value) |
|
91 | 91 | { |
92 | - if(!in_array($attr, ['title', 'class', 'click'])) |
|
92 | + if (!in_array($attr, ['title', 'class', 'click'])) |
|
93 | 93 | { |
94 | 94 | $_button[$attr] = $value; |
95 | 95 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | protected function alert(string $sMessage, string $sTitle, string $sType, string $sIcon): string |
123 | 123 | { |
124 | - if($this->returnCode()) |
|
124 | + if ($this->returnCode()) |
|
125 | 125 | { |
126 | 126 | return "$.alert({content:" . $sMessage . ", title:'" . $sTitle . |
127 | 127 | "', type:'" . $sType . "', icon:'" . $sIcon . "'})"; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
170 | 170 | { |
171 | 171 | $sTitle = $this->xHelper->getQuestionTitle(); |
172 | - if(!$sNoScript) |
|
172 | + if (!$sNoScript) |
|
173 | 173 | { |
174 | 174 | return "jaxon.dialogs.jconfirm.confirm(" . $sQuestion . ",'" . |
175 | 175 | $sTitle . "',function(){" . $sYesScript . ";})"; |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | */ |
93 | 93 | protected function alert(string $sMessage, string $sTitle, string $sType): string |
94 | 94 | { |
95 | - if($this->returnCode()) |
|
95 | + if ($this->returnCode()) |
|
96 | 96 | { |
97 | 97 | return "swal({text:" . $sMessage . ", title:'" . $sTitle . "', type:'" . $sType . "'})"; |
98 | 98 | } |
99 | 99 | $aOptions = ['text' => $sMessage, 'title' => '', 'type' => $sType]; |
100 | - if(($sTitle)) |
|
100 | + if (($sTitle)) |
|
101 | 101 | { |
102 | 102 | $aOptions['title'] = $sTitle; |
103 | 103 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
145 | 145 | { |
146 | 146 | $sTitle = $this->xHelper->getQuestionTitle(); |
147 | - if(!$sNoScript) |
|
147 | + if (!$sNoScript) |
|
148 | 148 | { |
149 | 149 | return "jaxon.dialogs.swal.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . ";})"; |
150 | 150 | } |
@@ -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 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function getScript(): string |
62 | 62 | { |
63 | - return $this->xHelper->render('noty/alert.js'); |
|
63 | + return $this->xHelper->render('noty/alert.js'); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function getReadyScript(): string |
70 | 70 | { |
71 | - return $this->xHelper->render('noty/ready.js.php'); |
|
71 | + return $this->xHelper->render('noty/ready.js.php'); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | protected function alert(string $sMessage, string $sTitle, string $sType): string |
84 | 84 | { |
85 | - if($this->returnCode()) |
|
85 | + if ($this->returnCode()) |
|
86 | 86 | { |
87 | 87 | return "noty({text:" . $sMessage . ", type:'" . $sType . "', layout: 'topCenter'})"; |
88 | 88 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
131 | 131 | { |
132 | 132 | $sTitle = $this->xHelper->getQuestionTitle(); |
133 | - if(!$sNoScript) |
|
133 | + if (!$sNoScript) |
|
134 | 134 | { |
135 | 135 | return "jaxon.dialogs.noty.confirm(" . $sQuestion . ",'',function(){" . $sYesScript . ";})"; |
136 | 136 | } |
@@ -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 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $aOptions['content'] = $sContent; |
91 | 91 | $aOptions['buttons'] = []; |
92 | 92 | $ind = 0; |
93 | - foreach($aButtons as $button) |
|
93 | + foreach ($aButtons as $button) |
|
94 | 94 | { |
95 | 95 | $_button = [ |
96 | 96 | 'text' => $button['title'], |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | 'class' => $button['class'], |
99 | 99 | ]; |
100 | 100 | // Optional attributes |
101 | - foreach($button as $attr => $value) |
|
101 | + foreach ($button as $attr => $value) |
|
102 | 102 | { |
103 | - if(!in_array($attr, ['title', 'class', 'click'])) |
|
103 | + if (!in_array($attr, ['title', 'class', 'click'])) |
|
104 | 104 | { |
105 | 105 | $_button[$attr] = $value; |
106 | 106 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | protected function notify(string $sMessage, string $sTitle, string $sType): string |
134 | 134 | { |
135 | - if($this->returnCode()) |
|
135 | + if ($this->returnCode()) |
|
136 | 136 | { |
137 | 137 | return "Lobibox.notify('" . $sType . "', {title:'" . $sTitle . "', msg:" . $sMessage . "})"; |
138 | 138 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
181 | 181 | { |
182 | 182 | $sTitle = $this->xHelper->getQuestionTitle(); |
183 | - if(!$sNoScript) |
|
183 | + if (!$sNoScript) |
|
184 | 184 | { |
185 | 185 | return "jaxon.dialogs.lobibox.confirm(" . $sQuestion . ",'" . |
186 | 186 | $sTitle . "',function(){" . $sYesScript . ";})"; |
@@ -81,7 +81,7 @@ |
||
81 | 81 | */ |
82 | 82 | protected function alert(string $sMessage, string $sTitle, string $sClass): string |
83 | 83 | { |
84 | - if($this->returnCode()) |
|
84 | + if ($this->returnCode()) |
|
85 | 85 | { |
86 | 86 | return "$.notify(" . $sMessage . ", {className:'" . $sClass . "', position:'top center'})"; |
87 | 87 | } |