@@ -54,7 +54,8 @@ |
||
54 | 54 | /** |
55 | 55 | * The constructor. |
56 | 56 | * |
57 | - * @param string $sFunction The javascript function |
|
57 | + * @param string $sName |
|
58 | + * @param string $sType |
|
58 | 59 | */ |
59 | 60 | public function __construct($sName, $sType) |
60 | 61 | { |
@@ -20,7 +20,6 @@ |
||
20 | 20 | |
21 | 21 | namespace Jaxon\Request; |
22 | 22 | |
23 | -use JsonSerializable; |
|
24 | 23 | use Jaxon\Jaxon; |
25 | 24 | |
26 | 25 | class Request extends JsCall |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function hasPageNumber() |
71 | 71 | { |
72 | - foreach($this->aParameters as $xParameter) |
|
72 | + foreach ($this->aParameters as $xParameter) |
|
73 | 73 | { |
74 | - if($xParameter->getType() == Jaxon::PAGE_NUMBER) |
|
74 | + if ($xParameter->getType() == Jaxon::PAGE_NUMBER) |
|
75 | 75 | { |
76 | 76 | return true; |
77 | 77 | } |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | public function setPageNumber($nPageNumber) |
90 | 90 | { |
91 | 91 | // Set the value of the Jaxon::PAGE_NUMBER parameter |
92 | - foreach($this->aParameters as $xParameter) |
|
92 | + foreach ($this->aParameters as $xParameter) |
|
93 | 93 | { |
94 | - if($xParameter->getType() == Jaxon::PAGE_NUMBER) |
|
94 | + if ($xParameter->getType() == Jaxon::PAGE_NUMBER) |
|
95 | 95 | { |
96 | 96 | $xParameter->setValue(intval($nPageNumber)); |
97 | 97 | break; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $this->sCondition = '__confirm__'; |
113 | 113 | $this->aMessageArgs = func_get_args(); |
114 | - array_walk($this->aMessageArgs, function(&$xParameter){ |
|
114 | + array_walk($this->aMessageArgs, function(&$xParameter) { |
|
115 | 115 | $xParameter = Parameter::make($xParameter); |
116 | 116 | }); |
117 | 117 | return $this; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $this->sCondition = Parameter::make($sCondition)->getScript(); |
133 | 133 | $this->aMessageArgs = func_get_args(); |
134 | 134 | array_shift($this->aMessageArgs); // Remove the first entry (the condition) from the array |
135 | - array_walk($this->aMessageArgs, function(&$xParameter){ |
|
135 | + array_walk($this->aMessageArgs, function(&$xParameter) { |
|
136 | 136 | $xParameter = Parameter::make($xParameter); |
137 | 137 | }); |
138 | 138 | return $this; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $this->sCondition = '!(' . Parameter::make($sCondition)->getScript() . ')'; |
154 | 154 | $this->aMessageArgs = func_get_args(); |
155 | 155 | array_shift($this->aMessageArgs); // Remove the first entry (the condition) from the array |
156 | - array_walk($this->aMessageArgs, function(&$xParameter){ |
|
156 | + array_walk($this->aMessageArgs, function(&$xParameter) { |
|
157 | 157 | $xParameter = Parameter::make($xParameter); |
158 | 158 | }); |
159 | 159 | return $this; |
@@ -178,12 +178,12 @@ discard block |
||
178 | 178 | // This array will avoid declaring many variables with the same value. |
179 | 179 | // The array key is the variable value, while the array value is the variable name. |
180 | 180 | $aVariables = array(); // Array of local variables. |
181 | - foreach($this->aParameters as &$xParameter) |
|
181 | + foreach ($this->aParameters as &$xParameter) |
|
182 | 182 | { |
183 | 183 | $sParameterStr = $xParameter->getScript(); |
184 | - if($xParameter instanceof \Jaxon\JQuery\Dom\Element) |
|
184 | + if ($xParameter instanceof \Jaxon\JQuery\Dom\Element) |
|
185 | 185 | { |
186 | - if(!array_key_exists($sParameterStr, $aVariables)) |
|
186 | + if (!array_key_exists($sParameterStr, $aVariables)) |
|
187 | 187 | { |
188 | 188 | // The value is not yet defined. A new variable is created. |
189 | 189 | $sVarName = "jxnVar$nVarId"; |
@@ -201,19 +201,19 @@ discard block |
||
201 | 201 | } |
202 | 202 | |
203 | 203 | $sPhrase = ''; |
204 | - if(count($this->aMessageArgs) > 0) |
|
204 | + if (count($this->aMessageArgs) > 0) |
|
205 | 205 | { |
206 | 206 | $sPhrase = array_shift($this->aMessageArgs); // The first array entry is the question. |
207 | 207 | // $sPhrase = "'" . addslashes($sPhrase) . "'"; // Wrap the phrase with single quotes |
208 | - if(count($this->aMessageArgs) > 0) |
|
208 | + if (count($this->aMessageArgs) > 0) |
|
209 | 209 | { |
210 | 210 | $nParamId = 1; |
211 | - foreach($this->aMessageArgs as &$xParameter) |
|
211 | + foreach ($this->aMessageArgs as &$xParameter) |
|
212 | 212 | { |
213 | 213 | $sParameterStr = $xParameter->getScript(); |
214 | - if($xParameter instanceof \Jaxon\JQuery\Dom\Element) |
|
214 | + if ($xParameter instanceof \Jaxon\JQuery\Dom\Element) |
|
215 | 215 | { |
216 | - if(!array_key_exists($sParameterStr, $aVariables)) |
|
216 | + if (!array_key_exists($sParameterStr, $aVariables)) |
|
217 | 217 | { |
218 | 218 | // The value is not yet defined. A new variable is created. |
219 | 219 | $sVarName = "jxnVar$nVarId"; |
@@ -236,17 +236,17 @@ discard block |
||
236 | 236 | } |
237 | 237 | |
238 | 238 | $sScript = $this->getOption('core.prefix.' . $this->sType) . parent::getScript(); |
239 | - if($this->sCondition == '__confirm__') |
|
239 | + if ($this->sCondition == '__confirm__') |
|
240 | 240 | { |
241 | 241 | $xConfirm = $this->getPluginManager()->getConfirm(); |
242 | 242 | $sScript = $xConfirm->confirm($sPhrase, $sScript, ''); |
243 | 243 | } |
244 | - else if($this->sCondition !== null) |
|
244 | + else if ($this->sCondition !== null) |
|
245 | 245 | { |
246 | 246 | $xAlert = $this->getPluginManager()->getAlert(); |
247 | 247 | $xAlert->setReturn(true); |
248 | 248 | $sScript = 'if(' . $this->sCondition . '){' . $sScript . ';}'; |
249 | - if(($sPhrase)) |
|
249 | + if (($sPhrase)) |
|
250 | 250 | { |
251 | 251 | $sScript .= 'else{' . $xAlert->warning($sPhrase) . ';}'; |
252 | 252 | } |
@@ -190,8 +190,7 @@ discard block |
||
190 | 190 | $aVariables[$sParameterStr] = $sVarName; |
191 | 191 | $sVars .= "$sVarName=$xParameter;"; |
192 | 192 | $nVarId++; |
193 | - } |
|
194 | - else |
|
193 | + } else |
|
195 | 194 | { |
196 | 195 | // The value is already defined. The corresponding variable is assigned. |
197 | 196 | $sVarName = $aVariables[$sParameterStr]; |
@@ -220,8 +219,7 @@ discard block |
||
220 | 219 | $aVariables[$sParameterStr] = $sVarName; |
221 | 220 | $sVars .= "$sVarName=$xParameter;"; |
222 | 221 | $nVarId++; |
223 | - } |
|
224 | - else |
|
222 | + } else |
|
225 | 223 | { |
226 | 224 | // The value is already defined. The corresponding variable is assigned. |
227 | 225 | $sVarName = $aVariables[$sParameterStr]; |
@@ -240,8 +238,7 @@ discard block |
||
240 | 238 | { |
241 | 239 | $xConfirm = $this->getPluginManager()->getConfirm(); |
242 | 240 | $sScript = $xConfirm->confirm($sPhrase, $sScript, ''); |
243 | - } |
|
244 | - else if($this->sCondition !== null) |
|
241 | + } else if($this->sCondition !== null) |
|
245 | 242 | { |
246 | 243 | $xAlert = $this->getPluginManager()->getAlert(); |
247 | 244 | $xAlert->setReturn(true); |
@@ -74,7 +74,7 @@ |
||
74 | 74 | * the client script that is sent to the browser |
75 | 75 | * |
76 | 76 | * @param string $sName The name of the configuration option |
77 | - * @param string $sValue The value of the configuration option |
|
77 | + * @param string $mValue The value of the configuration option |
|
78 | 78 | * |
79 | 79 | * @return void |
80 | 80 | */ |
@@ -21,8 +21,6 @@ |
||
21 | 21 | namespace Jaxon\Request\Support; |
22 | 22 | |
23 | 23 | use Jaxon\Request\Request; |
24 | -use Jaxon\Request\Manager as RequestManager; |
|
25 | -use Jaxon\Response\Manager as ResponseManager; |
|
26 | 24 | |
27 | 25 | class BrowserEvent |
28 | 26 | { |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | $sEventPrefix = $this->getOption('core.prefix.event'); |
120 | 120 | $sMode = ''; |
121 | 121 | $sMethod = ''; |
122 | - if(isset($this->aConfiguration['mode'])) |
|
122 | + if (isset($this->aConfiguration['mode'])) |
|
123 | 123 | { |
124 | 124 | $sMode = $this->aConfiguration['mode']; |
125 | 125 | } |
126 | - if(isset($this->aConfiguration['method'])) |
|
126 | + if (isset($this->aConfiguration['method'])) |
|
127 | 127 | { |
128 | 128 | $sMethod = $this->aConfiguration['method']; |
129 | 129 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function fire($aArgs) |
147 | 147 | { |
148 | - foreach($this->aHandlers as $xHandler) |
|
148 | + foreach ($this->aHandlers as $xHandler) |
|
149 | 149 | { |
150 | 150 | $xHandler->call($aArgs); |
151 | 151 | } |
@@ -158,7 +158,7 @@ |
||
158 | 158 | /** |
159 | 159 | * Constructs and returns a <Jaxon\Request\Request> object which is capable of generating the javascript call to invoke this jaxon enabled function |
160 | 160 | * |
161 | - * @return Jaxon\Request\Request |
|
161 | + * @return Request |
|
162 | 162 | */ |
163 | 163 | public function generateRequest() |
164 | 164 | { |
@@ -90,13 +90,13 @@ discard block |
||
90 | 90 | { |
91 | 91 | $this->aConfiguration = array(); |
92 | 92 | $this->sAlias = ''; |
93 | - if(is_array($sUserFunction)) |
|
93 | + if (is_array($sUserFunction)) |
|
94 | 94 | { |
95 | - if(count($sUserFunction) != 2 && count($sUserFunction) != 3) |
|
95 | + if (count($sUserFunction) != 2 && count($sUserFunction) != 3) |
|
96 | 96 | { |
97 | 97 | throw new \Jaxon\Exception\Error($this->trans('errors.functions.invalid-declaration')); |
98 | 98 | } |
99 | - if(count($sUserFunction) == 3) |
|
99 | + if (count($sUserFunction) == 3) |
|
100 | 100 | { |
101 | 101 | $this->sAlias = $sUserFunction[0]; |
102 | 102 | $this->sUserFunction = array_slice($sUserFunction, 1); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $this->sUserFunction = $sUserFunction; |
107 | 107 | } |
108 | 108 | } |
109 | - else if(is_string($sUserFunction)) |
|
109 | + else if (is_string($sUserFunction)) |
|
110 | 110 | { |
111 | 111 | $this->sUserFunction = $sUserFunction; |
112 | 112 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | public function getName() |
125 | 125 | { |
126 | 126 | // Do not use sAlias here! |
127 | - if(is_array($this->sUserFunction)) |
|
127 | + if (is_array($this->sUserFunction)) |
|
128 | 128 | { |
129 | 129 | return $this->sUserFunction[1]; |
130 | 130 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function configure($sName, $sValue) |
143 | 143 | { |
144 | - switch($sName) |
|
144 | + switch ($sName) |
|
145 | 145 | { |
146 | 146 | case 'alias': |
147 | 147 | $this->sAlias = $sValue; |
@@ -195,12 +195,12 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function call($aArgs = array()) |
197 | 197 | { |
198 | - if(($this->sInclude)) |
|
198 | + if (($this->sInclude)) |
|
199 | 199 | { |
200 | 200 | ob_start(); |
201 | 201 | require_once $this->sInclude; |
202 | 202 | $sOutput = ob_get_clean(); |
203 | - if(($sOutput)) |
|
203 | + if (($sOutput)) |
|
204 | 204 | { |
205 | 205 | $sOutput = $this->trans('debug.function.include', array( |
206 | 206 | 'file' => $this->sInclude, |
@@ -100,17 +100,14 @@ |
||
100 | 100 | { |
101 | 101 | $this->sAlias = $sUserFunction[0]; |
102 | 102 | $this->sUserFunction = array_slice($sUserFunction, 1); |
103 | - } |
|
104 | - else |
|
103 | + } else |
|
105 | 104 | { |
106 | 105 | $this->sUserFunction = $sUserFunction; |
107 | 106 | } |
108 | - } |
|
109 | - else if(is_string($sUserFunction)) |
|
107 | + } else if(is_string($sUserFunction)) |
|
110 | 108 | { |
111 | 109 | $this->sUserFunction = $sUserFunction; |
112 | - } |
|
113 | - else |
|
110 | + } else |
|
114 | 111 | { |
115 | 112 | throw new \Jaxon\Exception\Error($this->trans('errors.functions.invalid-declaration')); |
116 | 113 | } |
@@ -89,7 +89,6 @@ discard block |
||
89 | 89 | * Return the javascript call to an Jaxon object method |
90 | 90 | * |
91 | 91 | * @param string $sMethod The method (without class) name |
92 | - * @param ... $xParams The parameters of the method |
|
93 | 92 | * |
94 | 93 | * @return object |
95 | 94 | */ |
@@ -110,7 +109,6 @@ discard block |
||
110 | 109 | * @param integer $nItemsPerPage the number of items per page |
111 | 110 | * @param integer $nCurrentPage the current page |
112 | 111 | * @param string $sMethod the name of the method |
113 | - * @param ... $parameters the parameters of the method |
|
114 | 112 | * |
115 | 113 | * @return string the pagination links |
116 | 114 | */ |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function getJaxonClassName() |
46 | 46 | { |
47 | - if(!$this->xJaxonCallable) |
|
47 | + if (!$this->xJaxonCallable) |
|
48 | 48 | { |
49 | 49 | // Make the Jaxon class name for a class without an associated callable |
50 | 50 | // !! Warning !! This can happen only if this object is not registered with the Jaxon libary |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function getJaxonNamespace() |
64 | 64 | { |
65 | - if(!$this->xJaxonCallable) |
|
65 | + if (!$this->xJaxonCallable) |
|
66 | 66 | { |
67 | 67 | // Return an empty string. |
68 | 68 | return ''; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function getJaxonClassPath() |
79 | 79 | { |
80 | - if(!$this->xJaxonCallable) |
|
80 | + if (!$this->xJaxonCallable) |
|
81 | 81 | { |
82 | 82 | // Return an empty string. |
83 | 83 | return ''; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * @param array $aAttributes Associative array of attributes that will describe the command |
156 | 156 | * @param mixed $mData The data to be associated with this command |
157 | 157 | * |
158 | - * @return \Jaxon\Plugin\Response |
|
158 | + * @return Response |
|
159 | 159 | */ |
160 | 160 | public function addCommand($aAttributes, $mData) |
161 | 161 | { |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | /** |
197 | 197 | * Clear all the commands already added to the response |
198 | 198 | * |
199 | - * @return \Jaxon\Plugin\Response |
|
199 | + * @return Response |
|
200 | 200 | */ |
201 | 201 | public function clearCommands() |
202 | 202 | { |
@@ -208,11 +208,11 @@ discard block |
||
208 | 208 | /** |
209 | 209 | * Add a response command that is generated by a plugin |
210 | 210 | * |
211 | - * @param Plugin $xPlugin The plugin object |
|
211 | + * @param \Jaxon\Plugin\Response $xPlugin The plugin object |
|
212 | 212 | * @param array $aAttributes The attributes for this response command |
213 | - * @param mixed $mData The data to be sent with this command |
|
213 | + * @param string $mData The data to be sent with this command |
|
214 | 214 | * |
215 | - * @return \Jaxon\Plugin\Response |
|
215 | + * @return Response |
|
216 | 216 | */ |
217 | 217 | public function addPluginCommand($xPlugin, $aAttributes, $mData) |
218 | 218 | { |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | * @param integer $iCmdNumber The number of commands to skip upon cancel |
274 | 274 | * @param string $sMessage The message to display to the user |
275 | 275 | * |
276 | - * @return \Jaxon\Plugin\Response |
|
276 | + * @return Response |
|
277 | 277 | */ |
278 | 278 | public function confirmCommands($iCmdNumber, $sMessage) |
279 | 279 | { |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | * @param string $sAttribute The attribute to be assigned |
294 | 294 | * @param string $sData The value to be assigned to the attribute |
295 | 295 | * |
296 | - * @return \Jaxon\Plugin\Response |
|
296 | + * @return Response |
|
297 | 297 | */ |
298 | 298 | public function assign($sTarget, $sAttribute, $sData) |
299 | 299 | { |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | * @param string $sTarget The id of the html element on the browser |
316 | 316 | * @param string $sData The value to be assigned to the attribute |
317 | 317 | * |
318 | - * @return \Jaxon\Plugin\Response |
|
318 | + * @return Response |
|
319 | 319 | */ |
320 | 320 | public function html($sTarget, $sData) |
321 | 321 | { |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | * @param string $sAttribute The name of the attribute to be appended to |
330 | 330 | * @param string $sData The data to be appended to the attribute |
331 | 331 | * |
332 | - * @return \Jaxon\Plugin\Response |
|
332 | + * @return Response |
|
333 | 333 | */ |
334 | 334 | public function append($sTarget, $sAttribute, $sData) |
335 | 335 | { |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | * @param string $sAttribute The name of the attribute to be prepended to |
351 | 351 | * @param string $sData The value to be prepended to the attribute |
352 | 352 | * |
353 | - * @return \Jaxon\Plugin\Response |
|
353 | + * @return Response |
|
354 | 354 | */ |
355 | 355 | public function prepend($sTarget, $sAttribute, $sData) |
356 | 356 | { |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | * @param string $sSearch The needle to search for |
373 | 373 | * @param string $sData The data to use in place of the needle |
374 | 374 | * |
375 | - * @return \Jaxon\Plugin\Response |
|
375 | + * @return Response |
|
376 | 376 | */ |
377 | 377 | public function replace($sTarget, $sAttribute, $sSearch, $sData) |
378 | 378 | { |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | * @param string $sTarget The id of the element to be updated. |
396 | 396 | * @param string $sAttribute The attribute to be cleared |
397 | 397 | * |
398 | - * @return \Jaxon\Plugin\Response |
|
398 | + * @return Response |
|
399 | 399 | */ |
400 | 400 | public function clear($sTarget, $sAttribute) |
401 | 401 | { |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | * @param string $sAttribute The attribute to be updated |
412 | 412 | * @param string $sData The value to assign |
413 | 413 | * |
414 | - * @return \Jaxon\Plugin\Response |
|
414 | + * @return Response |
|
415 | 415 | */ |
416 | 416 | public function contextAssign($sAttribute, $sData) |
417 | 417 | { |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | * @param string $sAttribute The attribute to be appended to |
434 | 434 | * @param string $sData The value to append |
435 | 435 | * |
436 | - * @return \Jaxon\Plugin\Response |
|
436 | + * @return Response |
|
437 | 437 | */ |
438 | 438 | public function contextAppend($sAttribute, $sData) |
439 | 439 | { |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | * @param string $sAttribute The attribute to be updated |
456 | 456 | * @param string $sData The value to be prepended |
457 | 457 | * |
458 | - * @return \Jaxon\Plugin\Response |
|
458 | + * @return Response |
|
459 | 459 | */ |
460 | 460 | public function contextPrepend($sAttribute, $sData) |
461 | 461 | { |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | * |
477 | 477 | * @param string $sAttribute The attribute to be cleared |
478 | 478 | * |
479 | - * @return \Jaxon\Plugin\Response |
|
479 | + * @return Response |
|
480 | 480 | */ |
481 | 481 | public function contextClear($sAttribute) |
482 | 482 | { |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | * |
489 | 489 | * @param string $sMessage The message to be displayed |
490 | 490 | * |
491 | - * @return \Jaxon\Plugin\Response |
|
491 | + * @return Response |
|
492 | 492 | */ |
493 | 493 | public function alert($sMessage) |
494 | 494 | { |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | * |
506 | 506 | * @param string $sMessage The message to be displayed |
507 | 507 | * |
508 | - * @return \Jaxon\Plugin\Response |
|
508 | + * @return Response |
|
509 | 509 | */ |
510 | 510 | public function debug($sMessage) |
511 | 511 | { |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | * @param string $sURL The relative or fully qualified URL |
524 | 524 | * @param integer $iDelay Number of seconds to delay before the redirect occurs |
525 | 525 | * |
526 | - * @return \Jaxon\Plugin\Response |
|
526 | + * @return Response |
|
527 | 527 | */ |
528 | 528 | public function redirect($sURL, $iDelay=0) |
529 | 529 | { |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | * |
577 | 577 | * @param string $sJS The script to execute |
578 | 578 | * |
579 | - * @return \Jaxon\Plugin\Response |
|
579 | + * @return Response |
|
580 | 580 | */ |
581 | 581 | public function script($sJS) |
582 | 582 | { |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | * |
594 | 594 | * @param string $sFunc The name of the function to call |
595 | 595 | * |
596 | - * @return \Jaxon\Plugin\Response |
|
596 | + * @return Response |
|
597 | 597 | */ |
598 | 598 | public function call($sFunc) |
599 | 599 | { |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | * |
614 | 614 | * @param string $sTarget The id of the element to be removed |
615 | 615 | * |
616 | - * @return \Jaxon\Plugin\Response |
|
616 | + * @return Response |
|
617 | 617 | */ |
618 | 618 | public function remove($sTarget) |
619 | 619 | { |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | * @param string $sTag The tag name to be used for the new element |
634 | 634 | * @param string $sId The id to assign to the new element |
635 | 635 | * |
636 | - * @return \Jaxon\Plugin\Response |
|
636 | + * @return Response |
|
637 | 637 | */ |
638 | 638 | public function create($sParent, $sTag, $sId) |
639 | 639 | { |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | * @param string $sTag The tag name to be used for the new element |
655 | 655 | * @param string $sId The id to assign to the new element |
656 | 656 | * |
657 | - * @return \Jaxon\Plugin\Response |
|
657 | + * @return Response |
|
658 | 658 | */ |
659 | 659 | public function insert($sBefore, $sTag, $sId) |
660 | 660 | { |
@@ -671,11 +671,10 @@ discard block |
||
671 | 671 | /** |
672 | 672 | * Add a command to insert a new element after the specified |
673 | 673 | * |
674 | - * @param string $sBefore The id of the element used as a reference point for the insertion |
|
675 | 674 | * @param string $sTag The tag name to be used for the new element |
676 | 675 | * @param string $sId The id to assign to the new element |
677 | 676 | * |
678 | - * @return \Jaxon\Plugin\Response |
|
677 | + * @return Response |
|
679 | 678 | */ |
680 | 679 | public function insertAfter($sAfter, $sTag, $sId) |
681 | 680 | { |
@@ -697,7 +696,7 @@ discard block |
||
697 | 696 | * @param string $sName The name of the new input element |
698 | 697 | * @param string $sId The id of the new element |
699 | 698 | * |
700 | - * @return \Jaxon\Plugin\Response |
|
699 | + * @return Response |
|
701 | 700 | */ |
702 | 701 | public function createInput($sParent, $sType, $sName, $sId) |
703 | 702 | { |
@@ -720,7 +719,7 @@ discard block |
||
720 | 719 | * @param string $sName The name of the new input element |
721 | 720 | * @param string $sId The id of the new element |
722 | 721 | * |
723 | - * @return \Jaxon\Plugin\Response |
|
722 | + * @return Response |
|
724 | 723 | */ |
725 | 724 | public function insertInput($sBefore, $sType, $sName, $sId) |
726 | 725 | { |
@@ -743,7 +742,7 @@ discard block |
||
743 | 742 | * @param string $sName The name of the new input element |
744 | 743 | * @param string $sId The id of the new element |
745 | 744 | * |
746 | - * @return \Jaxon\Plugin\Response |
|
745 | + * @return Response |
|
747 | 746 | */ |
748 | 747 | public function insertInputAfter($sAfter, $sType, $sName, $sId) |
749 | 748 | { |
@@ -765,7 +764,7 @@ discard block |
||
765 | 764 | * @param string $sEvent The name of the event |
766 | 765 | * @param string $sScript The javascript to execute when the event is fired |
767 | 766 | * |
768 | - * @return \Jaxon\Plugin\Response |
|
767 | + * @return Response |
|
769 | 768 | */ |
770 | 769 | public function setEvent($sTarget, $sEvent, $sScript) |
771 | 770 | { |
@@ -785,7 +784,7 @@ discard block |
||
785 | 784 | * @param string $sTarget The id of the element that contains the event |
786 | 785 | * @param string $sScript The javascript to execute when the event is fired |
787 | 786 | * |
788 | - * @return \Jaxon\Plugin\Response |
|
787 | + * @return Response |
|
789 | 788 | */ |
790 | 789 | public function onClick($sTarget, $sScript) |
791 | 790 | { |
@@ -801,7 +800,7 @@ discard block |
||
801 | 800 | * @param string $sEvent The name of the event |
802 | 801 | * @param string $sHandler The javascript function to call when the event is fired |
803 | 802 | * |
804 | - * @return \Jaxon\Plugin\Response |
|
803 | + * @return Response |
|
805 | 804 | */ |
806 | 805 | public function addHandler($sTarget, $sEvent, $sHandler) |
807 | 806 | { |
@@ -822,7 +821,7 @@ discard block |
||
822 | 821 | * @param string $sEvent The name of the event |
823 | 822 | * @param string $sHandler The javascript function called when the event is fired |
824 | 823 | * |
825 | - * @return \Jaxon\Plugin\Response |
|
824 | + * @return Response |
|
826 | 825 | */ |
827 | 826 | public function removeHandler($sTarget, $sEvent, $sHandler) |
828 | 827 | { |
@@ -843,7 +842,7 @@ discard block |
||
843 | 842 | * @param string $sArgs Comma separated list of parameter names |
844 | 843 | * @param string $sScript The javascript code that will become the body of the function |
845 | 844 | * |
846 | - * @return \Jaxon\Plugin\Response |
|
845 | + * @return Response |
|
847 | 846 | */ |
848 | 847 | public function setFunction($sFunction, $sArgs, $sScript) |
849 | 848 | { |
@@ -870,7 +869,7 @@ discard block |
||
870 | 869 | * @param string $sReturnValueVar The name of the variable that will retain the return value |
871 | 870 | * from the call to the original function |
872 | 871 | * |
873 | - * @return \Jaxon\Plugin\Response |
|
872 | + * @return Response |
|
874 | 873 | */ |
875 | 874 | public function wrapFunction($sFunction, $sArgs, $aScripts, $sReturnValueVar) |
876 | 875 | { |
@@ -891,7 +890,7 @@ discard block |
||
891 | 890 | * @param string $sFileName The relative or fully qualified URI of the javascript file |
892 | 891 | * @param string $sType Determines the script type. Defaults to 'text/javascript' |
893 | 892 | * |
894 | - * @return \Jaxon\Plugin\Response |
|
893 | + * @return Response |
|
895 | 894 | */ |
896 | 895 | public function includeScript($sFileName, $sType = null, $sId = null) |
897 | 896 | { |
@@ -912,7 +911,7 @@ discard block |
||
912 | 911 | * @param string $sFileName The relative or fully qualified URI of the javascript file |
913 | 912 | * @param string $sType Determines the script type. Defaults to 'text/javascript' |
914 | 913 | * |
915 | - * @return \Jaxon\Plugin\Response |
|
914 | + * @return Response |
|
916 | 915 | */ |
917 | 916 | public function includeScriptOnce($sFileName, $sType = null, $sId = null) |
918 | 917 | { |
@@ -935,7 +934,7 @@ discard block |
||
935 | 934 | * @param string $sFileName The relative or fully qualified URI of the javascript file |
936 | 935 | * @param string $sUnload Name of a javascript function to call prior to unlaoding the file |
937 | 936 | * |
938 | - * @return \Jaxon\Plugin\Response |
|
937 | + * @return Response |
|
939 | 938 | */ |
940 | 939 | public function removeScript($sFileName, $sUnload = '') |
941 | 940 | { |
@@ -956,7 +955,7 @@ discard block |
||
956 | 955 | * @param string $sFileName The relative or fully qualified URI of the css file |
957 | 956 | * @param string $sMedia The media type of the CSS file. Defaults to 'screen' |
958 | 957 | * |
959 | - * @return \Jaxon\Plugin\Response |
|
958 | + * @return Response |
|
960 | 959 | */ |
961 | 960 | public function includeCSS($sFileName, $sMedia = null) |
962 | 961 | { |
@@ -975,7 +974,7 @@ discard block |
||
975 | 974 | * |
976 | 975 | * @param string $sFileName The relative or fully qualified URI of the css file |
977 | 976 | * |
978 | - * @return \Jaxon\Plugin\Response |
|
977 | + * @return Response |
|
979 | 978 | */ |
980 | 979 | public function removeCSS($sFileName, $sMedia = null) |
981 | 980 | { |
@@ -1000,7 +999,7 @@ discard block |
||
1000 | 999 | * @param integer $iTimeout The number of 1/10ths of a second to pause before timing out |
1001 | 1000 | * and continuing with the execution of the response commands |
1002 | 1001 | * |
1003 | - * @return \Jaxon\Plugin\Response |
|
1002 | + * @return Response |
|
1004 | 1003 | */ |
1005 | 1004 | public function waitForCSS($iTimeout = 600) |
1006 | 1005 | { |
@@ -1025,7 +1024,7 @@ discard block |
||
1025 | 1024 | * @param integer $tenths The number of 1/10ths of a second to wait before timing out |
1026 | 1025 | * and continuing with the execution of the response commands. |
1027 | 1026 | * |
1028 | - * @return \Jaxon\Plugin\Response |
|
1027 | + * @return Response |
|
1029 | 1028 | */ |
1030 | 1029 | public function waitFor($script, $tenths) |
1031 | 1030 | { |
@@ -1046,7 +1045,7 @@ discard block |
||
1046 | 1045 | * |
1047 | 1046 | * @param integer $tenths The number of 1/10ths of a second to sleep |
1048 | 1047 | * |
1049 | - * @return \Jaxon\Plugin\Response |
|
1048 | + * @return Response |
|
1050 | 1049 | */ |
1051 | 1050 | public function sleep($tenths) |
1052 | 1051 | { |
@@ -1075,7 +1074,7 @@ discard block |
||
1075 | 1074 | * @param string $variable The DOM element name (id or class) |
1076 | 1075 | * @param string $tag The HTML tag of the new DOM element |
1077 | 1076 | * |
1078 | - * @return \Jaxon\Plugin\Response |
|
1077 | + * @return Response |
|
1079 | 1078 | */ |
1080 | 1079 | public function domCreateElement($variable, $tag) |
1081 | 1080 | { |
@@ -1095,7 +1094,7 @@ discard block |
||
1095 | 1094 | * @param string $key The name of the attribute |
1096 | 1095 | * @param string $value The value of the attribute |
1097 | 1096 | * |
1098 | - * @return \Jaxon\Plugin\Response |
|
1097 | + * @return Response |
|
1099 | 1098 | */ |
1100 | 1099 | public function domSetAttribute($variable, $key, $value) |
1101 | 1100 | { |
@@ -1116,7 +1115,7 @@ discard block |
||
1116 | 1115 | * @param string $skip The ?? |
1117 | 1116 | * @param string $remove The ?? |
1118 | 1117 | * |
1119 | - * @return \Jaxon\Plugin\Response |
|
1118 | + * @return Response |
|
1120 | 1119 | */ |
1121 | 1120 | public function domRemoveChildren($parent, $skip = null, $remove = null) |
1122 | 1121 | { |
@@ -1137,7 +1136,7 @@ discard block |
||
1137 | 1136 | * @param string $parent The DOM parent element |
1138 | 1137 | * @param string $variable The DOM element name (id or class) |
1139 | 1138 | * |
1140 | - * @return \Jaxon\Plugin\Response |
|
1139 | + * @return Response |
|
1141 | 1140 | */ |
1142 | 1141 | public function domAppendChild($parent, $variable) |
1143 | 1142 | { |
@@ -1156,7 +1155,7 @@ discard block |
||
1156 | 1155 | * @param string $target The DOM target element |
1157 | 1156 | * @param string $variable The DOM element name (id or class) |
1158 | 1157 | * |
1159 | - * @return \Jaxon\Plugin\Response |
|
1158 | + * @return Response |
|
1160 | 1159 | */ |
1161 | 1160 | public function domInsertBefore($target, $variable) |
1162 | 1161 | { |
@@ -1175,7 +1174,7 @@ discard block |
||
1175 | 1174 | * @param string $target The DOM target element |
1176 | 1175 | * @param string $variable The DOM element name (id or class) |
1177 | 1176 | * |
1178 | - * @return \Jaxon\Plugin\Response |
|
1177 | + * @return Response |
|
1179 | 1178 | */ |
1180 | 1179 | public function domInsertAfter($target, $variable) |
1181 | 1180 | { |
@@ -1194,7 +1193,7 @@ discard block |
||
1194 | 1193 | * @param string $parent The DOM parent element |
1195 | 1194 | * @param string $text The HTML text to append |
1196 | 1195 | * |
1197 | - * @return \Jaxon\Plugin\Response |
|
1196 | + * @return Response |
|
1198 | 1197 | */ |
1199 | 1198 | public function domAppendText($parent, $text) |
1200 | 1199 | { |
@@ -1235,7 +1234,7 @@ discard block |
||
1235 | 1234 | * |
1236 | 1235 | * @param mixed $value Any value |
1237 | 1236 | * |
1238 | - * @return \Jaxon\Plugin\Response |
|
1237 | + * @return Response |
|
1239 | 1238 | */ |
1240 | 1239 | public function setReturnValue($value) |
1241 | 1240 | { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | public function plugin($sName) |
98 | 98 | { |
99 | 99 | $xPlugin = $this->getPluginManager()->getResponsePlugin($sName); |
100 | - if(!$xPlugin) |
|
100 | + if (!$xPlugin) |
|
101 | 101 | { |
102 | 102 | return false; |
103 | 103 | } |
@@ -160,21 +160,21 @@ discard block |
||
160 | 160 | public function addCommand($aAttributes, $mData) |
161 | 161 | { |
162 | 162 | /* merge commands if possible */ |
163 | - if(in_array($aAttributes['cmd'], array('js', 'ap'))) |
|
163 | + if (in_array($aAttributes['cmd'], array('js', 'ap'))) |
|
164 | 164 | { |
165 | - if(($aLastCommand = array_pop($this->aCommands))) |
|
165 | + if (($aLastCommand = array_pop($this->aCommands))) |
|
166 | 166 | { |
167 | - if($aLastCommand['cmd'] == $aAttributes['cmd']) |
|
167 | + if ($aLastCommand['cmd'] == $aAttributes['cmd']) |
|
168 | 168 | { |
169 | - if($aLastCommand['cmd'] == 'js') |
|
169 | + if ($aLastCommand['cmd'] == 'js') |
|
170 | 170 | { |
171 | - $mData = $aLastCommand['data'].'; '.$mData; |
|
171 | + $mData = $aLastCommand['data'] . '; ' . $mData; |
|
172 | 172 | } |
173 | - else if($aLastCommand['cmd'] == 'ap' && |
|
173 | + else if ($aLastCommand['cmd'] == 'ap' && |
|
174 | 174 | $aLastCommand['id'] == $aAttributes['id'] && |
175 | 175 | $aLastCommand['prop'] == $aAttributes['prop']) |
176 | 176 | { |
177 | - $mData = $aLastCommand['data'].' '.$mData; |
|
177 | + $mData = $aLastCommand['data'] . ' ' . $mData; |
|
178 | 178 | } |
179 | 179 | else |
180 | 180 | { |
@@ -231,11 +231,11 @@ discard block |
||
231 | 231 | */ |
232 | 232 | public function appendResponse($mCommands, $bBefore = false) |
233 | 233 | { |
234 | - if( $mCommands instanceof Response ) |
|
234 | + if ($mCommands instanceof Response) |
|
235 | 235 | { |
236 | 236 | $this->returnValue = $mCommands->returnValue; |
237 | 237 | |
238 | - if($bBefore) |
|
238 | + if ($bBefore) |
|
239 | 239 | { |
240 | 240 | $this->aCommands = array_merge($mCommands->aCommands, $this->aCommands); |
241 | 241 | } |
@@ -244,9 +244,9 @@ discard block |
||
244 | 244 | $this->aCommands = array_merge($this->aCommands, $mCommands->aCommands); |
245 | 245 | } |
246 | 246 | } |
247 | - else if(is_array($mCommands)) |
|
247 | + else if (is_array($mCommands)) |
|
248 | 248 | { |
249 | - if($bBefore) |
|
249 | + if ($bBefore) |
|
250 | 250 | { |
251 | 251 | $this->aCommands = array_merge($mCommands, $this->aCommands); |
252 | 252 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | } |
258 | 258 | else |
259 | 259 | { |
260 | - if(!empty($mCommands)) |
|
260 | + if (!empty($mCommands)) |
|
261 | 261 | { |
262 | 262 | throw new \Jaxon\Exception\Error($this->trans('errors.response.data.invalid')); |
263 | 263 | } |
@@ -525,33 +525,33 @@ discard block |
||
525 | 525 | * |
526 | 526 | * @return \Jaxon\Plugin\Response |
527 | 527 | */ |
528 | - public function redirect($sURL, $iDelay=0) |
|
528 | + public function redirect($sURL, $iDelay = 0) |
|
529 | 529 | { |
530 | 530 | // we need to parse the query part so that the values are rawurlencode()'ed |
531 | 531 | // can't just use parse_url() cos we could be dealing with a relative URL which |
532 | 532 | // parse_url() can't deal with. |
533 | 533 | $queryStart = strpos($sURL, '?', strrpos($sURL, '/')); |
534 | - if($queryStart !== false) |
|
534 | + if ($queryStart !== false) |
|
535 | 535 | { |
536 | 536 | $queryStart++; |
537 | 537 | $queryEnd = strpos($sURL, '#', $queryStart); |
538 | - if($queryEnd === false) |
|
538 | + if ($queryEnd === false) |
|
539 | 539 | $queryEnd = strlen($sURL); |
540 | - $queryPart = substr($sURL, $queryStart, $queryEnd-$queryStart); |
|
540 | + $queryPart = substr($sURL, $queryStart, $queryEnd - $queryStart); |
|
541 | 541 | parse_str($queryPart, $queryParts); |
542 | 542 | $newQueryPart = ""; |
543 | - if($queryParts) |
|
543 | + if ($queryParts) |
|
544 | 544 | { |
545 | 545 | $first = true; |
546 | - foreach($queryParts as $key => $value) |
|
546 | + foreach ($queryParts as $key => $value) |
|
547 | 547 | { |
548 | - if($first) |
|
548 | + if ($first) |
|
549 | 549 | $first = false; |
550 | 550 | else |
551 | 551 | $newQueryPart .= '&'; |
552 | - $newQueryPart .= rawurlencode($key).'='.rawurlencode($value); |
|
552 | + $newQueryPart .= rawurlencode($key) . '=' . rawurlencode($value); |
|
553 | 553 | } |
554 | - } else if($_SERVER['QUERY_STRING']) { |
|
554 | + } else if ($_SERVER['QUERY_STRING']) { |
|
555 | 555 | //couldn't break up the query, but there's one there |
556 | 556 | //possibly "http://url/page.html?query1234" type of query? |
557 | 557 | //just encode it and hope it works |
@@ -559,8 +559,8 @@ discard block |
||
559 | 559 | } |
560 | 560 | $sURL = str_replace($queryPart, $newQueryPart, $sURL); |
561 | 561 | } |
562 | - if($iDelay) |
|
563 | - $this->script('window.setTimeout("window.location = \'' . $sURL . '\';",' . ($iDelay*1000) . ');'); |
|
562 | + if ($iDelay) |
|
563 | + $this->script('window.setTimeout("window.location = \'' . $sURL . '\';",' . ($iDelay * 1000) . ');'); |
|
564 | 564 | else |
565 | 565 | $this->script('window.location = "' . $sURL . '";'); |
566 | 566 | return $this; |
@@ -897,10 +897,10 @@ discard block |
||
897 | 897 | { |
898 | 898 | $command = array('cmd' => 'in'); |
899 | 899 | |
900 | - if(($sType)) |
|
900 | + if (($sType)) |
|
901 | 901 | $command['type'] = trim((string)$sType, " \t"); |
902 | 902 | |
903 | - if(($sId)) |
|
903 | + if (($sId)) |
|
904 | 904 | $command['elm_id'] = trim((string)$sId, " \t"); |
905 | 905 | |
906 | 906 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
@@ -918,10 +918,10 @@ discard block |
||
918 | 918 | { |
919 | 919 | $command = array('cmd' => 'ino'); |
920 | 920 | |
921 | - if(($sType)) |
|
921 | + if (($sType)) |
|
922 | 922 | $command['type'] = trim((string)$sType, " \t"); |
923 | 923 | |
924 | - if(($sId)) |
|
924 | + if (($sId)) |
|
925 | 925 | $command['elm_id'] = trim((string)$sId, " \t"); |
926 | 926 | |
927 | 927 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
@@ -962,7 +962,7 @@ discard block |
||
962 | 962 | { |
963 | 963 | $command = array('cmd' => 'css'); |
964 | 964 | |
965 | - if(($sMedia)) |
|
965 | + if (($sMedia)) |
|
966 | 966 | $command['media'] = trim((string)$sMedia, " \t"); |
967 | 967 | |
968 | 968 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
@@ -981,7 +981,7 @@ discard block |
||
981 | 981 | { |
982 | 982 | $command = array('cmd' => 'rcss'); |
983 | 983 | |
984 | - if(($sMedia)) |
|
984 | + if (($sMedia)) |
|
985 | 985 | $command['media'] = trim((string)$sMedia, " \t"); |
986 | 986 | |
987 | 987 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
@@ -1122,10 +1122,10 @@ discard block |
||
1122 | 1122 | { |
1123 | 1123 | $command = array('cmd' => 'DRC'); |
1124 | 1124 | |
1125 | - if(($skip)) |
|
1125 | + if (($skip)) |
|
1126 | 1126 | $command['skip'] = $skip; |
1127 | 1127 | |
1128 | - if(($remove)) |
|
1128 | + if (($remove)) |
|
1129 | 1129 | $command['remove'] = $remove; |
1130 | 1130 | |
1131 | 1131 | return $this->addCommand($command, $parent); |
@@ -1251,17 +1251,17 @@ discard block |
||
1251 | 1251 | public function sendHeaders() |
1252 | 1252 | { |
1253 | 1253 | $xRequestManager = $this->getRequestManager(); |
1254 | - if($xRequestManager->getRequestMethod() == Jaxon::METHOD_GET) |
|
1254 | + if ($xRequestManager->getRequestMethod() == Jaxon::METHOD_GET) |
|
1255 | 1255 | { |
1256 | - header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); |
|
1257 | - header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
1258 | - header ("Cache-Control: no-cache, must-revalidate"); |
|
1259 | - header ("Pragma: no-cache"); |
|
1256 | + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); |
|
1257 | + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
1258 | + header("Cache-Control: no-cache, must-revalidate"); |
|
1259 | + header("Pragma: no-cache"); |
|
1260 | 1260 | } |
1261 | 1261 | |
1262 | 1262 | $sCharacterSet = ''; |
1263 | 1263 | $sCharacterEncoding = trim($this->getOption('core.encoding')); |
1264 | - if(($sCharacterEncoding) && strlen($sCharacterEncoding) > 0) |
|
1264 | + if (($sCharacterEncoding) && strlen($sCharacterEncoding) > 0) |
|
1265 | 1265 | { |
1266 | 1266 | $sCharacterSet = '; charset="' . trim($sCharacterEncoding) . '"'; |
1267 | 1267 | } |
@@ -1278,13 +1278,13 @@ discard block |
||
1278 | 1278 | { |
1279 | 1279 | $response = array(); |
1280 | 1280 | |
1281 | - if(($this->returnValue)) |
|
1281 | + if (($this->returnValue)) |
|
1282 | 1282 | { |
1283 | 1283 | $response['jxnrv'] = $this->returnValue; |
1284 | 1284 | } |
1285 | 1285 | $response['jxnobj'] = array(); |
1286 | 1286 | |
1287 | - foreach($this->aCommands as $xCommand) |
|
1287 | + foreach ($this->aCommands as $xCommand) |
|
1288 | 1288 | { |
1289 | 1289 | $response['jxnobj'][] = $xCommand; |
1290 | 1290 | } |
@@ -169,19 +169,16 @@ discard block |
||
169 | 169 | if($aLastCommand['cmd'] == 'js') |
170 | 170 | { |
171 | 171 | $mData = $aLastCommand['data'].'; '.$mData; |
172 | - } |
|
173 | - else if($aLastCommand['cmd'] == 'ap' && |
|
172 | + } else if($aLastCommand['cmd'] == 'ap' && |
|
174 | 173 | $aLastCommand['id'] == $aAttributes['id'] && |
175 | 174 | $aLastCommand['prop'] == $aAttributes['prop']) |
176 | 175 | { |
177 | 176 | $mData = $aLastCommand['data'].' '.$mData; |
178 | - } |
|
179 | - else |
|
177 | + } else |
|
180 | 178 | { |
181 | 179 | $this->aCommands[] = $aLastCommand; |
182 | 180 | } |
183 | - } |
|
184 | - else |
|
181 | + } else |
|
185 | 182 | { |
186 | 183 | $this->aCommands[] = $aLastCommand; |
187 | 184 | } |
@@ -238,24 +235,20 @@ discard block |
||
238 | 235 | if($bBefore) |
239 | 236 | { |
240 | 237 | $this->aCommands = array_merge($mCommands->aCommands, $this->aCommands); |
241 | - } |
|
242 | - else |
|
238 | + } else |
|
243 | 239 | { |
244 | 240 | $this->aCommands = array_merge($this->aCommands, $mCommands->aCommands); |
245 | 241 | } |
246 | - } |
|
247 | - else if(is_array($mCommands)) |
|
242 | + } else if(is_array($mCommands)) |
|
248 | 243 | { |
249 | 244 | if($bBefore) |
250 | 245 | { |
251 | 246 | $this->aCommands = array_merge($mCommands, $this->aCommands); |
252 | - } |
|
253 | - else |
|
247 | + } else |
|
254 | 248 | { |
255 | 249 | $this->aCommands = array_merge($this->aCommands, $mCommands); |
256 | 250 | } |
257 | - } |
|
258 | - else |
|
251 | + } else |
|
259 | 252 | { |
260 | 253 | if(!empty($mCommands)) |
261 | 254 | { |
@@ -535,8 +528,9 @@ discard block |
||
535 | 528 | { |
536 | 529 | $queryStart++; |
537 | 530 | $queryEnd = strpos($sURL, '#', $queryStart); |
538 | - if($queryEnd === false) |
|
539 | - $queryEnd = strlen($sURL); |
|
531 | + if($queryEnd === false) { |
|
532 | + $queryEnd = strlen($sURL); |
|
533 | + } |
|
540 | 534 | $queryPart = substr($sURL, $queryStart, $queryEnd-$queryStart); |
541 | 535 | parse_str($queryPart, $queryParts); |
542 | 536 | $newQueryPart = ""; |
@@ -545,10 +539,11 @@ discard block |
||
545 | 539 | $first = true; |
546 | 540 | foreach($queryParts as $key => $value) |
547 | 541 | { |
548 | - if($first) |
|
549 | - $first = false; |
|
550 | - else |
|
551 | - $newQueryPart .= '&'; |
|
542 | + if($first) { |
|
543 | + $first = false; |
|
544 | + } else { |
|
545 | + $newQueryPart .= '&'; |
|
546 | + } |
|
552 | 547 | $newQueryPart .= rawurlencode($key).'='.rawurlencode($value); |
553 | 548 | } |
554 | 549 | } else if($_SERVER['QUERY_STRING']) { |
@@ -559,10 +554,11 @@ discard block |
||
559 | 554 | } |
560 | 555 | $sURL = str_replace($queryPart, $newQueryPart, $sURL); |
561 | 556 | } |
562 | - if($iDelay) |
|
563 | - $this->script('window.setTimeout("window.location = \'' . $sURL . '\';",' . ($iDelay*1000) . ');'); |
|
564 | - else |
|
565 | - $this->script('window.location = "' . $sURL . '";'); |
|
557 | + if($iDelay) { |
|
558 | + $this->script('window.setTimeout("window.location = \'' . $sURL . '\';",' . ($iDelay*1000) . ');'); |
|
559 | + } else { |
|
560 | + $this->script('window.location = "' . $sURL . '";'); |
|
561 | + } |
|
566 | 562 | return $this; |
567 | 563 | } |
568 | 564 | |
@@ -897,11 +893,13 @@ discard block |
||
897 | 893 | { |
898 | 894 | $command = array('cmd' => 'in'); |
899 | 895 | |
900 | - if(($sType)) |
|
901 | - $command['type'] = trim((string)$sType, " \t"); |
|
896 | + if(($sType)) { |
|
897 | + $command['type'] = trim((string)$sType, " \t"); |
|
898 | + } |
|
902 | 899 | |
903 | - if(($sId)) |
|
904 | - $command['elm_id'] = trim((string)$sId, " \t"); |
|
900 | + if(($sId)) { |
|
901 | + $command['elm_id'] = trim((string)$sId, " \t"); |
|
902 | + } |
|
905 | 903 | |
906 | 904 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
907 | 905 | } |
@@ -918,11 +916,13 @@ discard block |
||
918 | 916 | { |
919 | 917 | $command = array('cmd' => 'ino'); |
920 | 918 | |
921 | - if(($sType)) |
|
922 | - $command['type'] = trim((string)$sType, " \t"); |
|
919 | + if(($sType)) { |
|
920 | + $command['type'] = trim((string)$sType, " \t"); |
|
921 | + } |
|
923 | 922 | |
924 | - if(($sId)) |
|
925 | - $command['elm_id'] = trim((string)$sId, " \t"); |
|
923 | + if(($sId)) { |
|
924 | + $command['elm_id'] = trim((string)$sId, " \t"); |
|
925 | + } |
|
926 | 926 | |
927 | 927 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
928 | 928 | } |
@@ -962,8 +962,9 @@ discard block |
||
962 | 962 | { |
963 | 963 | $command = array('cmd' => 'css'); |
964 | 964 | |
965 | - if(($sMedia)) |
|
966 | - $command['media'] = trim((string)$sMedia, " \t"); |
|
965 | + if(($sMedia)) { |
|
966 | + $command['media'] = trim((string)$sMedia, " \t"); |
|
967 | + } |
|
967 | 968 | |
968 | 969 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
969 | 970 | } |
@@ -981,8 +982,9 @@ discard block |
||
981 | 982 | { |
982 | 983 | $command = array('cmd' => 'rcss'); |
983 | 984 | |
984 | - if(($sMedia)) |
|
985 | - $command['media'] = trim((string)$sMedia, " \t"); |
|
985 | + if(($sMedia)) { |
|
986 | + $command['media'] = trim((string)$sMedia, " \t"); |
|
987 | + } |
|
986 | 988 | |
987 | 989 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
988 | 990 | } |
@@ -1122,11 +1124,13 @@ discard block |
||
1122 | 1124 | { |
1123 | 1125 | $command = array('cmd' => 'DRC'); |
1124 | 1126 | |
1125 | - if(($skip)) |
|
1126 | - $command['skip'] = $skip; |
|
1127 | + if(($skip)) { |
|
1128 | + $command['skip'] = $skip; |
|
1129 | + } |
|
1127 | 1130 | |
1128 | - if(($remove)) |
|
1129 | - $command['remove'] = $remove; |
|
1131 | + if(($remove)) { |
|
1132 | + $command['remove'] = $remove; |
|
1133 | + } |
|
1130 | 1134 | |
1131 | 1135 | return $this->addCommand($command, $parent); |
1132 | 1136 | } |
@@ -201,7 +201,7 @@ |
||
201 | 201 | /** |
202 | 202 | * Create a new the config manager |
203 | 203 | * |
204 | - * @return Jaxon\Utils\Config\Config The config manager |
|
204 | + * @return Config\Config The config manager |
|
205 | 205 | */ |
206 | 206 | public function newConfig() |
207 | 207 | { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | public static function getInstance() |
29 | 29 | { |
30 | - if(!self::$xInstance) |
|
30 | + if (!self::$xInstance) |
|
31 | 31 | { |
32 | 32 | self::$xInstance = new Container(); |
33 | 33 | } |
@@ -65,19 +65,19 @@ discard block |
||
65 | 65 | * Managers |
66 | 66 | */ |
67 | 67 | // Plugin Manager |
68 | - $this->di['plugin_manager'] = function($c){ |
|
68 | + $this->di['plugin_manager'] = function($c) { |
|
69 | 69 | return new \Jaxon\Plugin\Manager(); |
70 | 70 | }; |
71 | 71 | // Request Manager |
72 | - $this->di['request_manager'] = function($c){ |
|
72 | + $this->di['request_manager'] = function($c) { |
|
73 | 73 | return new \Jaxon\Request\Manager(); |
74 | 74 | }; |
75 | 75 | // Request Factory |
76 | - $this->di['request_factory'] = function($c){ |
|
76 | + $this->di['request_factory'] = function($c) { |
|
77 | 77 | return new \Jaxon\Request\Factory(); |
78 | 78 | }; |
79 | 79 | // Response Manager |
80 | - $this->di['response_manager'] = function($c){ |
|
80 | + $this->di['response_manager'] = function($c) { |
|
81 | 81 | return new \Jaxon\Response\Manager(); |
82 | 82 | }; |
83 | 83 | |
@@ -85,35 +85,35 @@ discard block |
||
85 | 85 | * Services |
86 | 86 | */ |
87 | 87 | // Config manager |
88 | - $this->di['config'] = function($c){ |
|
88 | + $this->di['config'] = function($c) { |
|
89 | 89 | return new Config\Config(); |
90 | 90 | }; |
91 | 91 | // Minifier |
92 | - $this->di['minifier'] = function($c){ |
|
92 | + $this->di['minifier'] = function($c) { |
|
93 | 93 | return new Template\Minifier(); |
94 | 94 | }; |
95 | 95 | // Translator |
96 | - $this->di['translator'] = function($c){ |
|
96 | + $this->di['translator'] = function($c) { |
|
97 | 97 | return new Translation\Translator($c['translation_dir'], $c['config']); |
98 | 98 | }; |
99 | 99 | // Template engine |
100 | - $this->di['template'] = function($c){ |
|
100 | + $this->di['template'] = function($c) { |
|
101 | 101 | return new Template\Template($c['template_dir']); |
102 | 102 | }; |
103 | 103 | // Validator |
104 | - $this->di['validator'] = function($c){ |
|
104 | + $this->di['validator'] = function($c) { |
|
105 | 105 | return new Validation\Validator(); |
106 | 106 | }; |
107 | 107 | // Pagination Renderer |
108 | - $this->di['pagination.renderer'] = function($c){ |
|
108 | + $this->di['pagination.renderer'] = function($c) { |
|
109 | 109 | return new Pagination\Renderer(); |
110 | 110 | }; |
111 | 111 | // Pagination Paginator |
112 | - $this->di['pagination.paginator'] = function($c){ |
|
112 | + $this->di['pagination.paginator'] = function($c) { |
|
113 | 113 | return new Pagination\Paginator($c['pagination.renderer']); |
114 | 114 | }; |
115 | 115 | // Event Dispatcher |
116 | - $this->di['events'] = function($c){ |
|
116 | + $this->di['events'] = function($c) { |
|
117 | 117 | return new EventDispatcher(); |
118 | 118 | }; |
119 | 119 | |
@@ -121,27 +121,27 @@ discard block |
||
121 | 121 | * Core library objects |
122 | 122 | */ |
123 | 123 | // Global Response |
124 | - $this->di['response'] = function($c){ |
|
124 | + $this->di['response'] = function($c) { |
|
125 | 125 | return new \Jaxon\Response\Response(); |
126 | 126 | }; |
127 | 127 | // Jaxon Core |
128 | - $this->di['jaxon'] = function($c){ |
|
128 | + $this->di['jaxon'] = function($c) { |
|
129 | 129 | return new \Jaxon\Jaxon(); |
130 | 130 | }; |
131 | 131 | // Jaxon Sentry |
132 | - $this->di['sentry'] = function($c){ |
|
132 | + $this->di['sentry'] = function($c) { |
|
133 | 133 | // This class is not defined in this package |
134 | 134 | $sClass = '\\Jaxon\\Sentry\\Sentry'; |
135 | 135 | return new $sClass; |
136 | 136 | }; |
137 | 137 | // Armada |
138 | - $this->di['armada'] = function($c){ |
|
138 | + $this->di['armada'] = function($c) { |
|
139 | 139 | // This class is not defined in this package |
140 | 140 | $sClass = '\\Jaxon\\Armada\\Armada'; |
141 | 141 | return new $sClass; |
142 | 142 | }; |
143 | 143 | // View Renderer Facade |
144 | - $this->di['sentry.view.renderer'] = function($c){ |
|
144 | + $this->di['sentry.view.renderer'] = function($c) { |
|
145 | 145 | $aRenderers = $c['view.data.renderers']; |
146 | 146 | $sDefaultNamespace = $c['view.data.namespace.default']; |
147 | 147 | return new \Jaxon\Sentry\View\Facade($aRenderers, $sDefaultNamespace); |
@@ -396,9 +396,9 @@ discard block |
||
396 | 396 | $renderer = $c['sentry.view.base.' . $sId]; |
397 | 397 | // Init the renderer with the template namespaces |
398 | 398 | $aNamespaces = $this->di['view.data.namespaces']; |
399 | - if(key_exists($sId, $aNamespaces)) |
|
399 | + if (key_exists($sId, $aNamespaces)) |
|
400 | 400 | { |
401 | - foreach($aNamespaces[$sId] as $ns) |
|
401 | + foreach ($aNamespaces[$sId] as $ns) |
|
402 | 402 | { |
403 | 403 | $renderer->addNamespace($ns['namespace'], $ns['directory'], $ns['extension']); |
404 | 404 | } |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | */ |
417 | 417 | public function getViewRenderer($sId = '') |
418 | 418 | { |
419 | - if(!$sId) |
|
419 | + if (!$sId) |
|
420 | 420 | { |
421 | 421 | // Return the view renderer facade |
422 | 422 | return $this->di['sentry.view.renderer']; |
@@ -161,7 +161,7 @@ |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
164 | - * @return string |
|
164 | + * @return Request |
|
165 | 165 | */ |
166 | 166 | public function getRequest() |
167 | 167 | { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | protected function updateNumPages() |
67 | 67 | { |
68 | - $this->numPages = ($this->itemsPerPage == 0 ? 0 : (int) ceil($this->totalItems/$this->itemsPerPage)); |
|
68 | + $this->numPages = ($this->itemsPerPage == 0 ? 0 : (int)ceil($this->totalItems / $this->itemsPerPage)); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function setMaxPagesToShow($maxPagesToShow) |
76 | 76 | { |
77 | - if($maxPagesToShow < 3) |
|
77 | + if ($maxPagesToShow < 3) |
|
78 | 78 | { |
79 | 79 | throw new \InvalidArgumentException('maxPagesToShow cannot be less than 3.'); |
80 | 80 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | { |
155 | 155 | $this->request = $request; |
156 | 156 | // Append the page number to the parameter list, if not yet given. |
157 | - if(($this->request) && !$this->request->hasPageNumber()) |
|
157 | + if (($this->request) && !$this->request->hasPageNumber()) |
|
158 | 158 | { |
159 | 159 | $this->request->addParameter(Jaxon::PAGE_NUMBER, 0); |
160 | 160 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | |
194 | 194 | public function getNextPage() |
195 | 195 | { |
196 | - if($this->currentPage < $this->numPages) |
|
196 | + if ($this->currentPage < $this->numPages) |
|
197 | 197 | { |
198 | 198 | return $this->currentPage + 1; |
199 | 199 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | |
204 | 204 | public function getPrevPage() |
205 | 205 | { |
206 | - if($this->currentPage > 1) |
|
206 | + if ($this->currentPage > 1) |
|
207 | 207 | { |
208 | 208 | return $this->currentPage - 1; |
209 | 209 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | |
214 | 214 | public function getNextCall() |
215 | 215 | { |
216 | - if(!$this->getNextPage()) |
|
216 | + if (!$this->getNextPage()) |
|
217 | 217 | { |
218 | 218 | return null; |
219 | 219 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | */ |
227 | 227 | public function getPrevCall() |
228 | 228 | { |
229 | - if(!$this->getPrevPage()) |
|
229 | + if (!$this->getPrevPage()) |
|
230 | 230 | { |
231 | 231 | return null; |
232 | 232 | } |
@@ -254,14 +254,14 @@ discard block |
||
254 | 254 | { |
255 | 255 | $pages = array(); |
256 | 256 | |
257 | - if($this->numPages <= 1) |
|
257 | + if ($this->numPages <= 1) |
|
258 | 258 | { |
259 | 259 | return array(); |
260 | 260 | } |
261 | 261 | |
262 | - if($this->numPages <= $this->maxPagesToShow) |
|
262 | + if ($this->numPages <= $this->maxPagesToShow) |
|
263 | 263 | { |
264 | - for($i = 1; $i <= $this->numPages; $i++) |
|
264 | + for ($i = 1; $i <= $this->numPages; $i++) |
|
265 | 265 | { |
266 | 266 | $pages[] = $this->createPage($i, $i == $this->currentPage); |
267 | 267 | } |
@@ -269,9 +269,9 @@ discard block |
||
269 | 269 | else |
270 | 270 | { |
271 | 271 | // Determine the sliding range, centered around the current page. |
272 | - $numAdjacents = (int) floor(($this->maxPagesToShow - 3) / 2); |
|
272 | + $numAdjacents = (int)floor(($this->maxPagesToShow - 3) / 2); |
|
273 | 273 | |
274 | - if($this->currentPage + $numAdjacents > $this->numPages) |
|
274 | + if ($this->currentPage + $numAdjacents > $this->numPages) |
|
275 | 275 | { |
276 | 276 | $slidingStart = $this->numPages - $this->maxPagesToShow + 2; |
277 | 277 | } |
@@ -279,28 +279,28 @@ discard block |
||
279 | 279 | { |
280 | 280 | $slidingStart = $this->currentPage - $numAdjacents; |
281 | 281 | } |
282 | - if($slidingStart < 2) |
|
282 | + if ($slidingStart < 2) |
|
283 | 283 | { |
284 | 284 | $slidingStart = 2; |
285 | 285 | } |
286 | 286 | |
287 | 287 | $slidingEnd = $slidingStart + $this->maxPagesToShow - 3; |
288 | - if($slidingEnd >= $this->numPages) |
|
288 | + if ($slidingEnd >= $this->numPages) |
|
289 | 289 | { |
290 | 290 | $slidingEnd = $this->numPages - 1; |
291 | 291 | } |
292 | 292 | |
293 | 293 | // Build the list of pages. |
294 | 294 | $pages[] = $this->createPage(1, $this->currentPage == 1); |
295 | - if($slidingStart > 2) |
|
295 | + if ($slidingStart > 2) |
|
296 | 296 | { |
297 | 297 | $pages[] = $this->createPageEllipsis(); |
298 | 298 | } |
299 | - for($i = $slidingStart; $i <= $slidingEnd; $i++) |
|
299 | + for ($i = $slidingStart; $i <= $slidingEnd; $i++) |
|
300 | 300 | { |
301 | 301 | $pages[] = $this->createPage($i, $i == $this->currentPage); |
302 | 302 | } |
303 | - if($slidingEnd < $this->numPages - 1) |
|
303 | + if ($slidingEnd < $this->numPages - 1) |
|
304 | 304 | { |
305 | 305 | $pages[] = $this->createPageEllipsis(); |
306 | 306 | } |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | */ |
347 | 347 | public function toHtml() |
348 | 348 | { |
349 | - if($this->getNumPages() <= 1) |
|
349 | + if ($this->getNumPages() <= 1) |
|
350 | 350 | { |
351 | 351 | return ''; |
352 | 352 | } |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | { |
370 | 370 | $first = ($this->currentPage - 1) * $this->itemsPerPage + 1; |
371 | 371 | |
372 | - if($first > $this->totalItems) |
|
372 | + if ($first > $this->totalItems) |
|
373 | 373 | { |
374 | 374 | return null; |
375 | 375 | } |
@@ -380,13 +380,13 @@ discard block |
||
380 | 380 | public function getCurrentPageLastItem() |
381 | 381 | { |
382 | 382 | $first = $this->getCurrentPageFirstItem(); |
383 | - if($first === null) |
|
383 | + if ($first === null) |
|
384 | 384 | { |
385 | 385 | return null; |
386 | 386 | } |
387 | 387 | |
388 | 388 | $last = $first + $this->itemsPerPage - 1; |
389 | - if($last > $this->totalItems) |
|
389 | + if ($last > $this->totalItems) |
|
390 | 390 | { |
391 | 391 | return $this->totalItems; |
392 | 392 | } |
@@ -265,8 +265,7 @@ discard block |
||
265 | 265 | { |
266 | 266 | $pages[] = $this->createPage($i, $i == $this->currentPage); |
267 | 267 | } |
268 | - } |
|
269 | - else |
|
268 | + } else |
|
270 | 269 | { |
271 | 270 | // Determine the sliding range, centered around the current page. |
272 | 271 | $numAdjacents = (int) floor(($this->maxPagesToShow - 3) / 2); |
@@ -274,8 +273,7 @@ discard block |
||
274 | 273 | if($this->currentPage + $numAdjacents > $this->numPages) |
275 | 274 | { |
276 | 275 | $slidingStart = $this->numPages - $this->maxPagesToShow + 2; |
277 | - } |
|
278 | - else |
|
276 | + } else |
|
279 | 277 | { |
280 | 278 | $slidingStart = $this->currentPage - $numAdjacents; |
281 | 279 | } |
@@ -69,7 +69,7 @@ |
||
69 | 69 | * Get a translated string |
70 | 70 | * |
71 | 71 | * @param string $sText The key of the translated string |
72 | - * @param string $aPlaceHolders The placeholders of the translated string |
|
72 | + * @param string $placeholders The placeholders of the translated string |
|
73 | 73 | * @param string $sLanguage The language of the translated string |
74 | 74 | * |
75 | 75 | * @return string The translated string |
@@ -87,7 +87,7 @@ |
||
87 | 87 | } |
88 | 88 | if(!array_key_exists($sLanguage, $this->aMessages) || !array_key_exists($sText, $this->aMessages[$sLanguage])) |
89 | 89 | { |
90 | - return $sText; |
|
90 | + return $sText; |
|
91 | 91 | } |
92 | 92 | $message = $this->aMessages[$sLanguage][$sText]; |
93 | 93 | foreach($placeholders as $name => $value) |
@@ -45,17 +45,17 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function loadMessages($sFilePath, $sLanguage) |
47 | 47 | { |
48 | - if(!file_exists($sFilePath)) |
|
48 | + if (!file_exists($sFilePath)) |
|
49 | 49 | { |
50 | 50 | return; |
51 | 51 | } |
52 | 52 | $aMessages = require($sFilePath); |
53 | - if(!is_array($aMessages)) |
|
53 | + if (!is_array($aMessages)) |
|
54 | 54 | { |
55 | 55 | return; |
56 | 56 | } |
57 | 57 | // Load the translations |
58 | - if(!array_key_exists($sLanguage, $this->aMessages)) |
|
58 | + if (!array_key_exists($sLanguage, $this->aMessages)) |
|
59 | 59 | { |
60 | 60 | $this->aMessages[$sLanguage] = $aMessages; |
61 | 61 | } |
@@ -77,20 +77,20 @@ discard block |
||
77 | 77 | public function trans($sText, array $placeholders = array(), $sLanguage = null) |
78 | 78 | { |
79 | 79 | $sText = trim((string)$sText); |
80 | - if(!$sLanguage) |
|
80 | + if (!$sLanguage) |
|
81 | 81 | { |
82 | 82 | $sLanguage = $this->xConfig->getOption('language'); |
83 | 83 | } |
84 | - if(!$sLanguage) |
|
84 | + if (!$sLanguage) |
|
85 | 85 | { |
86 | 86 | $sLanguage = $this->sDefaultLocale; |
87 | 87 | } |
88 | - if(!array_key_exists($sLanguage, $this->aMessages) || !array_key_exists($sText, $this->aMessages[$sLanguage])) |
|
88 | + if (!array_key_exists($sLanguage, $this->aMessages) || !array_key_exists($sText, $this->aMessages[$sLanguage])) |
|
89 | 89 | { |
90 | 90 | return $sText; |
91 | 91 | } |
92 | 92 | $message = $this->aMessages[$sLanguage][$sText]; |
93 | - foreach($placeholders as $name => $value) |
|
93 | + foreach ($placeholders as $name => $value) |
|
94 | 94 | { |
95 | 95 | $message = str_replace(":$name", $value, $message); |
96 | 96 | } |
@@ -58,8 +58,7 @@ |
||
58 | 58 | if(!array_key_exists($sLanguage, $this->aMessages)) |
59 | 59 | { |
60 | 60 | $this->aMessages[$sLanguage] = $aMessages; |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->aMessages[$sLanguage] = array_merge($aMessages, $this->aMessages[$sLanguage]); |
65 | 64 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function __construct($xCallable) |
94 | 94 | { |
95 | - if(is_string($xCallable)) // Received a class name |
|
95 | + if (is_string($xCallable)) // Received a class name |
|
96 | 96 | { |
97 | 97 | $this->reflectionClass = new \ReflectionClass($xCallable); |
98 | 98 | $this->callableObject = null; |
@@ -118,12 +118,12 @@ discard block |
||
118 | 118 | */ |
119 | 119 | private function setCallable($xCallable = null) |
120 | 120 | { |
121 | - if($xCallable == null) |
|
121 | + if ($xCallable == null) |
|
122 | 122 | { |
123 | 123 | $xCallable = $this->reflectionClass->newInstance(); |
124 | 124 | } |
125 | 125 | // Save the Jaxon callable object into the user callable object |
126 | - if($this->reflectionClass->hasMethod('setJaxonCallable')) |
|
126 | + if ($this->reflectionClass->hasMethod('setJaxonCallable')) |
|
127 | 127 | { |
128 | 128 | $xCallable->setJaxonCallable($this); |
129 | 129 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function getRegisteredObject() |
139 | 139 | { |
140 | - if($this->callableObject == null) |
|
140 | + if ($this->callableObject == null) |
|
141 | 141 | { |
142 | 142 | $this->setCallable(); |
143 | 143 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | // The class name without the namespace. |
168 | 168 | $name = $this->reflectionClass->getShortName(); |
169 | 169 | // Append the classpath to the name |
170 | - if(($this->classpath)) |
|
170 | + if (($this->classpath)) |
|
171 | 171 | { |
172 | 172 | $name = $this->classpath . $this->separator . $name; |
173 | 173 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | public function getMethods() |
205 | 205 | { |
206 | 206 | $aReturn = array(); |
207 | - foreach($this->reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $xMethod) |
|
207 | + foreach ($this->reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $xMethod) |
|
208 | 208 | { |
209 | 209 | $sMethodName = $xMethod->getShortName(); |
210 | 210 | // Don't take magic __call, __construct, __destruct methods |
211 | - if(strlen($sMethodName) > 2 && substr($sMethodName, 0, 2) == '__') |
|
211 | + if (strlen($sMethodName) > 2 && substr($sMethodName, 0, 2) == '__') |
|
212 | 212 | { |
213 | 213 | continue; |
214 | 214 | } |
215 | 215 | // Don't take excluded methods |
216 | - if(in_array($sMethodName, $this->aProtectedMethods)) |
|
216 | + if (in_array($sMethodName, $this->aProtectedMethods)) |
|
217 | 217 | { |
218 | 218 | continue; |
219 | 219 | } |
@@ -234,37 +234,37 @@ discard block |
||
234 | 234 | public function configure($sMethod, $sName, $sValue) |
235 | 235 | { |
236 | 236 | // Set the namespace |
237 | - if($sName == 'namespace') |
|
237 | + if ($sName == 'namespace') |
|
238 | 238 | { |
239 | - if($sValue != '') |
|
239 | + if ($sValue != '') |
|
240 | 240 | $this->namespace = $sValue; |
241 | 241 | return; |
242 | 242 | } |
243 | 243 | // Set the classpath |
244 | - if($sName == 'classpath') |
|
244 | + if ($sName == 'classpath') |
|
245 | 245 | { |
246 | - if($sValue != '') |
|
246 | + if ($sValue != '') |
|
247 | 247 | $this->classpath = $sValue; |
248 | 248 | return; |
249 | 249 | } |
250 | 250 | // Set the separator |
251 | - if($sName == 'separator') |
|
251 | + if ($sName == 'separator') |
|
252 | 252 | { |
253 | - if($sValue == '_' || $sValue == '.') |
|
253 | + if ($sValue == '_' || $sValue == '.') |
|
254 | 254 | $this->separator = $sValue; |
255 | 255 | return; |
256 | 256 | } |
257 | 257 | // Set the excluded methods |
258 | - if($sName == 'protected') |
|
258 | + if ($sName == 'protected') |
|
259 | 259 | { |
260 | - if(is_array($sValue)) |
|
260 | + if (is_array($sValue)) |
|
261 | 261 | $this->aProtectedMethods = array_merge($this->aProtectedMethods, $sValue); |
262 | - else if(is_string($sValue)) |
|
262 | + else if (is_string($sValue)) |
|
263 | 263 | $this->aProtectedMethods[] = $sValue; |
264 | 264 | return; |
265 | 265 | } |
266 | 266 | |
267 | - if(!isset($this->aConfiguration[$sMethod])) |
|
267 | + if (!isset($this->aConfiguration[$sMethod])) |
|
268 | 268 | { |
269 | 269 | $this->aConfiguration[$sMethod] = array(); |
270 | 270 | } |
@@ -284,16 +284,16 @@ discard block |
||
284 | 284 | |
285 | 285 | // Common options to be set on all methods |
286 | 286 | $aCommonConfig = array_key_exists('*', $this->aConfiguration) ? $this->aConfiguration['*'] : array(); |
287 | - foreach($this->reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $xMethod) |
|
287 | + foreach ($this->reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $xMethod) |
|
288 | 288 | { |
289 | 289 | $sMethodName = $xMethod->getShortName(); |
290 | 290 | // Don't export magic __call, __construct, __destruct methods |
291 | - if(strlen($sMethodName) > 0 && substr($sMethodName, 0, 2) == '__') |
|
291 | + if (strlen($sMethodName) > 0 && substr($sMethodName, 0, 2) == '__') |
|
292 | 292 | { |
293 | 293 | continue; |
294 | 294 | } |
295 | 295 | // Don't export "protected" methods |
296 | - if(in_array($sMethodName, $this->aProtectedMethods)) |
|
296 | + if (in_array($sMethodName, $this->aProtectedMethods)) |
|
297 | 297 | { |
298 | 298 | continue; |
299 | 299 | } |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | */ |
344 | 344 | public function call($sMethod, $aArgs) |
345 | 345 | { |
346 | - if(!$this->hasMethod($sMethod)) |
|
346 | + if (!$this->hasMethod($sMethod)) |
|
347 | 347 | return; |
348 | 348 | $reflectionMethod = $this->reflectionClass->getMethod($sMethod); |
349 | 349 | $callableObject = $this->getRegisteredObject(); |
@@ -92,12 +92,13 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function __construct($xCallable) |
94 | 94 | { |
95 | - if(is_string($xCallable)) // Received a class name |
|
95 | + if(is_string($xCallable)) { |
|
96 | + // Received a class name |
|
96 | 97 | { |
97 | 98 | $this->reflectionClass = new \ReflectionClass($xCallable); |
98 | - $this->callableObject = null; |
|
99 | 99 | } |
100 | - else // if(is_object($xCallable)) // Received a class instance |
|
100 | + $this->callableObject = null; |
|
101 | + } else // if(is_object($xCallable)) // Received a class instance |
|
101 | 102 | { |
102 | 103 | $this->reflectionClass = new \ReflectionClass(get_class($xCallable)); |
103 | 104 | $this->setCallable($xCallable); |
@@ -236,31 +237,35 @@ discard block |
||
236 | 237 | // Set the namespace |
237 | 238 | if($sName == 'namespace') |
238 | 239 | { |
239 | - if($sValue != '') |
|
240 | - $this->namespace = $sValue; |
|
240 | + if($sValue != '') { |
|
241 | + $this->namespace = $sValue; |
|
242 | + } |
|
241 | 243 | return; |
242 | 244 | } |
243 | 245 | // Set the classpath |
244 | 246 | if($sName == 'classpath') |
245 | 247 | { |
246 | - if($sValue != '') |
|
247 | - $this->classpath = $sValue; |
|
248 | + if($sValue != '') { |
|
249 | + $this->classpath = $sValue; |
|
250 | + } |
|
248 | 251 | return; |
249 | 252 | } |
250 | 253 | // Set the separator |
251 | 254 | if($sName == 'separator') |
252 | 255 | { |
253 | - if($sValue == '_' || $sValue == '.') |
|
254 | - $this->separator = $sValue; |
|
256 | + if($sValue == '_' || $sValue == '.') { |
|
257 | + $this->separator = $sValue; |
|
258 | + } |
|
255 | 259 | return; |
256 | 260 | } |
257 | 261 | // Set the excluded methods |
258 | 262 | if($sName == 'protected') |
259 | 263 | { |
260 | - if(is_array($sValue)) |
|
261 | - $this->aProtectedMethods = array_merge($this->aProtectedMethods, $sValue); |
|
262 | - else if(is_string($sValue)) |
|
263 | - $this->aProtectedMethods[] = $sValue; |
|
264 | + if(is_array($sValue)) { |
|
265 | + $this->aProtectedMethods = array_merge($this->aProtectedMethods, $sValue); |
|
266 | + } else if(is_string($sValue)) { |
|
267 | + $this->aProtectedMethods[] = $sValue; |
|
268 | + } |
|
264 | 269 | return; |
265 | 270 | } |
266 | 271 | |
@@ -343,8 +348,9 @@ discard block |
||
343 | 348 | */ |
344 | 349 | public function call($sMethod, $aArgs) |
345 | 350 | { |
346 | - if(!$this->hasMethod($sMethod)) |
|
347 | - return; |
|
351 | + if(!$this->hasMethod($sMethod)) { |
|
352 | + return; |
|
353 | + } |
|
348 | 354 | $reflectionMethod = $this->reflectionClass->getMethod($sMethod); |
349 | 355 | $callableObject = $this->getRegisteredObject(); |
350 | 356 | $this->getResponseManager()->append($reflectionMethod->invokeArgs($callableObject, $aArgs)); |