@@ -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) { |
@@ -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 | } |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | */ |
94 | 94 | protected function alert(string $sContent, string $sTitle, string $sTheme): string |
95 | 95 | { |
96 | - if(!$sTitle) |
|
96 | + if (!$sTitle) |
|
97 | 97 | { |
98 | 98 | $sTitle = ' '; |
99 | 99 | } |
100 | - if($this->returnCode()) |
|
100 | + if ($this->returnCode()) |
|
101 | 101 | { |
102 | 102 | return "$.jAlert({content:" . $sContent . ", title:'" . $sTitle . "', theme:'" . $sTheme . "'})"; |
103 | 103 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
144 | 144 | { |
145 | 145 | $sTitle = $this->helper()->getQuestionTitle(); |
146 | - if(!$sNoScript) |
|
146 | + if (!$sNoScript) |
|
147 | 147 | { |
148 | 148 | return "jaxon.dialogs.jalert.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . ";})"; |
149 | 149 | } |
@@ -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 | } |
@@ -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 | } |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | */ |
96 | 96 | protected function alert(string $sMessage, string $sTitle, string $sType): string |
97 | 97 | { |
98 | - if($this->returnCode()) |
|
98 | + if ($this->returnCode()) |
|
99 | 99 | { |
100 | 100 | return "swal({text:" . $sMessage . ", title:'" . $sTitle . "', type:'" . $sType . "'})"; |
101 | 101 | } |
102 | 102 | $aOptions = ['text' => $sMessage, 'title' => '', 'type' => $sType]; |
103 | - if(($sTitle)) |
|
103 | + if (($sTitle)) |
|
104 | 104 | { |
105 | 105 | $aOptions['title'] = $sTitle; |
106 | 106 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
148 | 148 | { |
149 | 149 | $sTitle = $this->helper()->getQuestionTitle(); |
150 | - if(!$sNoScript) |
|
150 | + if (!$sNoScript) |
|
151 | 151 | { |
152 | 152 | return "jaxon.dialogs.swal.confirm(" . $sQuestion . ",'" . $sTitle . "',function(){" . $sYesScript . ";})"; |
153 | 153 | } |
@@ -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 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function getScript(): string |
65 | 65 | { |
66 | - return $this->helper()->render('noty/alert.js'); |
|
66 | + return $this->helper()->render('noty/alert.js'); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function getReadyScript(): string |
73 | 73 | { |
74 | - return $this->helper()->render('noty/ready.js.php'); |
|
74 | + return $this->helper()->render('noty/ready.js.php'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | protected function alert(string $sMessage, string $sTitle, string $sType): string |
87 | 87 | { |
88 | - if($this->returnCode()) |
|
88 | + if ($this->returnCode()) |
|
89 | 89 | { |
90 | 90 | return "noty({text:" . $sMessage . ", type:'" . $sType . "', layout: 'topCenter'})"; |
91 | 91 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
134 | 134 | { |
135 | 135 | $sTitle = $this->helper()->getQuestionTitle(); |
136 | - if(!$sNoScript) |
|
136 | + if (!$sNoScript) |
|
137 | 137 | { |
138 | 138 | return "jaxon.dialogs.noty.confirm(" . $sQuestion . ",'',function(){" . $sYesScript . ";})"; |
139 | 139 | } |
@@ -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 | } |
@@ -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 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $aOptions['title'] = $sTitle; |
93 | 93 | $aOptions['message'] = $sContent; |
94 | 94 | $aOptions['buttons'] = []; |
95 | - foreach($aButtons as $button) |
|
95 | + foreach ($aButtons as $button) |
|
96 | 96 | { |
97 | 97 | $_button = [ |
98 | 98 | 'label' => $button['title'], |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | 'action' => $button['click'], |
101 | 101 | ]; |
102 | 102 | // Optional attributes |
103 | - foreach($button as $attr => $value) |
|
103 | + foreach ($button as $attr => $value) |
|
104 | 104 | { |
105 | - if(!in_array($attr, ['title', 'class', 'click'])) |
|
105 | + if (!in_array($attr, ['title', 'class', 'click'])) |
|
106 | 106 | { |
107 | 107 | $_button[$attr] = $value; |
108 | 108 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $aOptions['buttons'][] = $_button; |
111 | 111 | } |
112 | 112 | // Turn the value of the nl2br option to false, because it alters form rendering. |
113 | - if(!array_key_exists('nl2br', $aOptions)) |
|
113 | + if (!array_key_exists('nl2br', $aOptions)) |
|
114 | 114 | { |
115 | 115 | $aOptions['nl2br'] = false; |
116 | 116 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | protected function alert(string $sMessage, string $sTitle, string $sType): string |
140 | 140 | { |
141 | - if($this->returnCode()) |
|
141 | + if ($this->returnCode()) |
|
142 | 142 | { |
143 | 143 | $aDataTypes = [ |
144 | 144 | 'success' => 'BootstrapDialog.TYPE_SUCCESS', |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | 'danger' => 'BootstrapDialog.TYPE_DANGER', |
148 | 148 | ]; |
149 | 149 | $sType = $aDataTypes[$sType]; |
150 | - if(($sTitle)) |
|
150 | + if (($sTitle)) |
|
151 | 151 | { |
152 | 152 | return "BootstrapDialog.alert({message:" . $sMessage . ", title:'" . $sTitle . "', type:" . $sType . "})"; |
153 | 153 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | } |
158 | 158 | } |
159 | 159 | $aOptions = ['message' => $sMessage, 'type' => $sType]; |
160 | - if(($sTitle)) |
|
160 | + if (($sTitle)) |
|
161 | 161 | { |
162 | 162 | $aOptions['title'] = $sTitle; |
163 | 163 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
205 | 205 | { |
206 | 206 | $sTitle = $this->helper()->getQuestionTitle(); |
207 | - if(!$sNoScript) |
|
207 | + if (!$sNoScript) |
|
208 | 208 | { |
209 | 209 | return "jaxon.dialogs.bootstrap.confirm(" . $sQuestion . ",'" . |
210 | 210 | $sTitle . "',function(){" . $sYesScript . ";})"; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | protected function alert(string $sMessage, string $sTitle, string $sType): string |
92 | 92 | { |
93 | - if($this->returnCode()) |
|
93 | + if ($this->returnCode()) |
|
94 | 94 | { |
95 | 95 | return "$('body').overhang({message:" . $sMessage . ", type:'" . $sType . "'})"; |
96 | 96 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string |
139 | 139 | { |
140 | - if(!$sNoScript) |
|
140 | + if (!$sNoScript) |
|
141 | 141 | { |
142 | 142 | return "jaxon.dialogs.overhang.confirm(" . $sQuestion . ",function(){" . $sYesScript . ";})"; |
143 | 143 | } |
@@ -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 | } |