@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function hasPageNumber() |
| 72 | 72 | { |
| 73 | - foreach($this->aParameters as $xParameter) |
|
| 73 | + foreach ($this->aParameters as $xParameter) |
|
| 74 | 74 | { |
| 75 | - if($xParameter->getType() == Jaxon::PAGE_NUMBER) |
|
| 75 | + if ($xParameter->getType() == Jaxon::PAGE_NUMBER) |
|
| 76 | 76 | { |
| 77 | 77 | return true; |
| 78 | 78 | } |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | public function setPageNumber($nPageNumber) |
| 91 | 91 | { |
| 92 | 92 | // Set the value of the Jaxon::PAGE_NUMBER parameter |
| 93 | - foreach($this->aParameters as $xParameter) |
|
| 93 | + foreach ($this->aParameters as $xParameter) |
|
| 94 | 94 | { |
| 95 | - if($xParameter->getType() == Jaxon::PAGE_NUMBER) |
|
| 95 | + if ($xParameter->getType() == Jaxon::PAGE_NUMBER) |
|
| 96 | 96 | { |
| 97 | 97 | $xParameter->setValue(intval($nPageNumber)); |
| 98 | 98 | break; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | $this->sCondition = '__confirm__'; |
| 114 | 114 | $this->aMessageArgs = func_get_args(); |
| 115 | - array_walk($this->aMessageArgs, function (&$xParameter) { |
|
| 115 | + array_walk($this->aMessageArgs, function(&$xParameter) { |
|
| 116 | 116 | $xParameter = Parameter::make($xParameter); |
| 117 | 117 | }); |
| 118 | 118 | return $this; |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $this->sCondition = Parameter::make($sCondition)->getScript(); |
| 134 | 134 | $this->aMessageArgs = func_get_args(); |
| 135 | 135 | array_shift($this->aMessageArgs); // Remove the first entry (the condition) from the array |
| 136 | - array_walk($this->aMessageArgs, function (&$xParameter) { |
|
| 136 | + array_walk($this->aMessageArgs, function(&$xParameter) { |
|
| 137 | 137 | $xParameter = Parameter::make($xParameter); |
| 138 | 138 | }); |
| 139 | 139 | return $this; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $this->sCondition = '!(' . Parameter::make($sCondition)->getScript() . ')'; |
| 155 | 155 | $this->aMessageArgs = func_get_args(); |
| 156 | 156 | array_shift($this->aMessageArgs); // Remove the first entry (the condition) from the array |
| 157 | - array_walk($this->aMessageArgs, function (&$xParameter) { |
|
| 157 | + array_walk($this->aMessageArgs, function(&$xParameter) { |
|
| 158 | 158 | $xParameter = Parameter::make($xParameter); |
| 159 | 159 | }); |
| 160 | 160 | return $this; |
@@ -179,12 +179,12 @@ discard block |
||
| 179 | 179 | // This array will avoid declaring multiple variables with the same value. |
| 180 | 180 | // The array key is the variable value, while the array value is the variable name. |
| 181 | 181 | $aVariables = array(); // Array of local variables. |
| 182 | - foreach($this->aParameters as &$xParameter) |
|
| 182 | + foreach ($this->aParameters as &$xParameter) |
|
| 183 | 183 | { |
| 184 | 184 | $sParameterStr = $xParameter->getScript(); |
| 185 | - if($xParameter instanceof \Jaxon\JQuery\Dom\Element) |
|
| 185 | + if ($xParameter instanceof \Jaxon\JQuery\Dom\Element) |
|
| 186 | 186 | { |
| 187 | - if(!array_key_exists($sParameterStr, $aVariables)) |
|
| 187 | + if (!array_key_exists($sParameterStr, $aVariables)) |
|
| 188 | 188 | { |
| 189 | 189 | // The value is not yet defined. A new variable is created. |
| 190 | 190 | $sVarName = "jxnVar$nVarId"; |
@@ -202,19 +202,19 @@ discard block |
||
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | $sPhrase = ''; |
| 205 | - if(count($this->aMessageArgs) > 0) |
|
| 205 | + if (count($this->aMessageArgs) > 0) |
|
| 206 | 206 | { |
| 207 | 207 | $sPhrase = array_shift($this->aMessageArgs); // The first array entry is the question. |
| 208 | 208 | // $sPhrase = "'" . addslashes($sPhrase) . "'"; // Wrap the phrase with single quotes |
| 209 | - if(count($this->aMessageArgs) > 0) |
|
| 209 | + if (count($this->aMessageArgs) > 0) |
|
| 210 | 210 | { |
| 211 | 211 | $nParamId = 1; |
| 212 | - foreach($this->aMessageArgs as &$xParameter) |
|
| 212 | + foreach ($this->aMessageArgs as &$xParameter) |
|
| 213 | 213 | { |
| 214 | 214 | $sParameterStr = $xParameter->getScript(); |
| 215 | - if($xParameter instanceof \Jaxon\JQuery\Dom\Element) |
|
| 215 | + if ($xParameter instanceof \Jaxon\JQuery\Dom\Element) |
|
| 216 | 216 | { |
| 217 | - if(!array_key_exists($sParameterStr, $aVariables)) |
|
| 217 | + if (!array_key_exists($sParameterStr, $aVariables)) |
|
| 218 | 218 | { |
| 219 | 219 | // The value is not yet defined. A new variable is created. |
| 220 | 220 | $sVarName = "jxnVar$nVarId"; |
@@ -237,15 +237,15 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | $sScript = $this->getOption('core.prefix.' . $this->sType) . parent::getScript(); |
| 240 | - if($this->sCondition == '__confirm__') |
|
| 240 | + if ($this->sCondition == '__confirm__') |
|
| 241 | 241 | { |
| 242 | 242 | $xConfirm = $this->getPluginManager()->getConfirm(); |
| 243 | 243 | $sScript = $xConfirm->confirm($sPhrase, $sScript, ''); |
| 244 | 244 | } |
| 245 | - elseif($this->sCondition !== null) |
|
| 245 | + elseif ($this->sCondition !== null) |
|
| 246 | 246 | { |
| 247 | 247 | $sScript = 'if(' . $this->sCondition . '){' . $sScript . ';}'; |
| 248 | - if(($sPhrase)) |
|
| 248 | + if (($sPhrase)) |
|
| 249 | 249 | { |
| 250 | 250 | $xAlert = $this->getPluginManager()->getAlert(); |
| 251 | 251 | $xAlert->setReturn(true); |
@@ -191,8 +191,7 @@ discard block |
||
| 191 | 191 | $aVariables[$sParameterStr] = $sVarName; |
| 192 | 192 | $sVars .= "$sVarName=$xParameter;"; |
| 193 | 193 | $nVarId++; |
| 194 | - } |
|
| 195 | - else |
|
| 194 | + } else |
|
| 196 | 195 | { |
| 197 | 196 | // The value is already defined. The corresponding variable is assigned. |
| 198 | 197 | $sVarName = $aVariables[$sParameterStr]; |
@@ -221,8 +220,7 @@ discard block |
||
| 221 | 220 | $aVariables[$sParameterStr] = $sVarName; |
| 222 | 221 | $sVars .= "$sVarName=$xParameter;"; |
| 223 | 222 | $nVarId++; |
| 224 | - } |
|
| 225 | - else |
|
| 223 | + } else |
|
| 226 | 224 | { |
| 227 | 225 | // The value is already defined. The corresponding variable is assigned. |
| 228 | 226 | $sVarName = $aVariables[$sParameterStr]; |
@@ -241,8 +239,7 @@ discard block |
||
| 241 | 239 | { |
| 242 | 240 | $xConfirm = $this->getPluginManager()->getConfirm(); |
| 243 | 241 | $sScript = $xConfirm->confirm($sPhrase, $sScript, ''); |
| 244 | - } |
|
| 245 | - elseif($this->sCondition !== null) |
|
| 242 | + } elseif($this->sCondition !== null) |
|
| 246 | 243 | { |
| 247 | 244 | $sScript = 'if(' . $this->sCondition . '){' . $sScript . ';}'; |
| 248 | 245 | if(($sPhrase)) |