@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php echo $this->sPrefix ?><?php echo $this->sEvent ?> = function() { |
2 | 2 | return jaxon.request( |
3 | 3 | { jxnevt: '<?php echo $this->sEvent ?>' }, |
4 | - { parameters: arguments<?php if(($this->sMode)): ?>, mode: '<?php echo $this->sMode ?>'<?php endif ?><?php if(($this->sMethod)): ?>, method: '<?php echo $this->sMethod ?>'<?php endif ?> } |
|
4 | + { parameters: arguments<?php if (($this->sMode)): ?>, mode: '<?php echo $this->sMode ?>'<?php endif ?><?php if (($this->sMethod)): ?>, method: '<?php echo $this->sMethod ?>'<?php endif ?> } |
|
5 | 5 | ); |
6 | 6 | }; |
@@ -1,3 +1,3 @@ |
||
1 | -<?php foreach($this->aUrls as $sUrl): ?> |
|
1 | +<?php foreach ($this->aUrls as $sUrl): ?> |
|
2 | 2 | <script type="text/javascript" src="<?php echo $sUrl ?>" <?php echo $this->sJsOptions ?> charset="UTF-8"></script> |
3 | 3 | <?php endforeach ?> |
@@ -1,7 +1,7 @@ |
||
1 | 1 | jaxon.dom.ready(function() { |
2 | 2 | jaxon.command.handler.register('cc', jaxon.confirm.commands); |
3 | 3 | |
4 | -<?php if($this->sPluginScript): ?> |
|
4 | +<?php if ($this->sPluginScript): ?> |
|
5 | 5 | <?php echo $this->sPluginScript ?> |
6 | 6 | <?php endif ?> |
7 | 7 | }); |
@@ -23,7 +23,6 @@ discard block |
||
23 | 23 | * Return the javascript call to a Jaxon function or object method |
24 | 24 | * |
25 | 25 | * @param string $sName The function or method (with class) name |
26 | - * @param ... $xParams The parameters of the function or method |
|
27 | 26 | * |
28 | 27 | * @return \Jaxon\Request\Request |
29 | 28 | */ |
@@ -46,7 +45,6 @@ discard block |
||
46 | 45 | * Return the javascript call to a generic function |
47 | 46 | * |
48 | 47 | * @param string $sName The function or method (with class) name |
49 | - * @param ... $xParams The parameters of the function or method |
|
50 | 48 | * |
51 | 49 | * @return \Jaxon\Request\Request |
52 | 50 | */ |
@@ -70,7 +68,6 @@ discard block |
||
70 | 68 | * @param integer $nItemsPerPage The number of items per page page |
71 | 69 | * @param integer $nCurrentPage The current page |
72 | 70 | * @param string $sMethod The name of function or a method prepended with its class name |
73 | - * @param ... $xParams The parameters of the function or method |
|
74 | 71 | * |
75 | 72 | * @return string the pagination links |
76 | 73 | */ |
@@ -100,7 +100,7 @@ |
||
100 | 100 | * |
101 | 101 | * @param array $aArgs An array containing the callable object specification |
102 | 102 | * |
103 | - * @return array |
|
103 | + * @return boolean |
|
104 | 104 | */ |
105 | 105 | public function register($aArgs) |
106 | 106 | { |
@@ -67,19 +67,19 @@ discard block |
||
67 | 67 | $this->sRequestedClass = null; |
68 | 68 | $this->sRequestedMethod = null; |
69 | 69 | |
70 | - if(!empty($_GET['jxncls'])) |
|
70 | + if (!empty($_GET['jxncls'])) |
|
71 | 71 | { |
72 | 72 | $this->sRequestedClass = $_GET['jxncls']; |
73 | 73 | } |
74 | - if(!empty($_GET['jxnmthd'])) |
|
74 | + if (!empty($_GET['jxnmthd'])) |
|
75 | 75 | { |
76 | 76 | $this->sRequestedMethod = $_GET['jxnmthd']; |
77 | 77 | } |
78 | - if(!empty($_POST['jxncls'])) |
|
78 | + if (!empty($_POST['jxncls'])) |
|
79 | 79 | { |
80 | 80 | $this->sRequestedClass = $_POST['jxncls']; |
81 | 81 | } |
82 | - if(!empty($_POST['jxnmthd'])) |
|
82 | + if (!empty($_POST['jxnmthd'])) |
|
83 | 83 | { |
84 | 84 | $this->sRequestedMethod = $_POST['jxnmthd']; |
85 | 85 | } |
@@ -104,44 +104,44 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function register($aArgs) |
106 | 106 | { |
107 | - if(count($aArgs) > 1) |
|
107 | + if (count($aArgs) > 1) |
|
108 | 108 | { |
109 | 109 | $sType = $aArgs[0]; |
110 | 110 | |
111 | - if($sType == Jaxon::CALLABLE_OBJECT) |
|
111 | + if ($sType == Jaxon::CALLABLE_OBJECT) |
|
112 | 112 | { |
113 | 113 | $xCallableObject = $aArgs[1]; |
114 | 114 | |
115 | - if(!is_object($xCallableObject) && !is_string($xCallableObject)) |
|
115 | + if (!is_object($xCallableObject) && !is_string($xCallableObject)) |
|
116 | 116 | { |
117 | 117 | throw new \Jaxon\Exception\Error($this->trans('errors.objects.instance')); |
118 | 118 | } |
119 | - if(is_string($xCallableObject) && !class_exists($xCallableObject)) |
|
119 | + if (is_string($xCallableObject) && !class_exists($xCallableObject)) |
|
120 | 120 | { |
121 | 121 | throw new \Jaxon\Exception\Error($this->trans('errors.objects.instance')); |
122 | 122 | } |
123 | - if(!($xCallableObject instanceof \Jaxon\Request\Support\CallableObject)) |
|
123 | + if (!($xCallableObject instanceof \Jaxon\Request\Support\CallableObject)) |
|
124 | 124 | { |
125 | 125 | $xCallableObject = new \Jaxon\Request\Support\CallableObject($xCallableObject); |
126 | 126 | } |
127 | - if(count($aArgs) > 2 && is_array($aArgs[2])) |
|
127 | + if (count($aArgs) > 2 && is_array($aArgs[2])) |
|
128 | 128 | { |
129 | 129 | $aOptions = $aArgs[2]; |
130 | 130 | // Save the classpath and the separator in this class |
131 | - if(array_key_exists('*', $aOptions) && is_array($aOptions['*'])) |
|
131 | + if (array_key_exists('*', $aOptions) && is_array($aOptions['*'])) |
|
132 | 132 | { |
133 | 133 | $aOptions = $aOptions['*']; |
134 | 134 | $sSeparator = '.'; |
135 | - if(array_key_exists('separator', $aOptions)) |
|
135 | + if (array_key_exists('separator', $aOptions)) |
|
136 | 136 | { |
137 | 137 | $sSeparator = trim($aOptions['separator']); |
138 | 138 | } |
139 | - if(!in_array($sSeparator, ['.', '_'])) |
|
139 | + if (!in_array($sSeparator, ['.', '_'])) |
|
140 | 140 | { |
141 | 141 | $sSeparator = '.'; |
142 | 142 | } |
143 | 143 | $aOptions['separator'] = $sSeparator; |
144 | - if(array_key_exists('classpath', $aOptions)) |
|
144 | + if (array_key_exists('classpath', $aOptions)) |
|
145 | 145 | { |
146 | 146 | $aOptions['classpath'] = trim($aOptions['classpath'], ' \\._'); |
147 | 147 | // Save classpath with "\" in the parameters |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | $this->aClassPaths[] = str_replace('\\', $sSeparator, $aOptions['classpath']); |
151 | 151 | } |
152 | 152 | } |
153 | - foreach($aArgs[2] as $sKey => $aValue) |
|
153 | + foreach ($aArgs[2] as $sKey => $aValue) |
|
154 | 154 | { |
155 | - foreach($aValue as $sName => $sValue) |
|
155 | + foreach ($aValue as $sName => $sValue) |
|
156 | 156 | { |
157 | 157 | $xCallableObject->configure($sKey, $sName, $sValue); |
158 | 158 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | public function generateHash() |
177 | 177 | { |
178 | 178 | $sHash = ''; |
179 | - foreach($this->aCallableObjects as $xCallableObject) |
|
179 | + foreach ($this->aCallableObjects as $xCallableObject) |
|
180 | 180 | { |
181 | 181 | $sHash .= $xCallableObject->getName(); |
182 | 182 | $sHash .= implode('|', $xCallableObject->getMethods()); |
@@ -195,15 +195,15 @@ discard block |
||
195 | 195 | // Generate code for javascript objects declaration |
196 | 196 | $code = ''; |
197 | 197 | $classes = array(); |
198 | - foreach($this->aClassPaths as $sClassPath) |
|
198 | + foreach ($this->aClassPaths as $sClassPath) |
|
199 | 199 | { |
200 | 200 | $offset = 0; |
201 | 201 | $sClassPath .= '.Null'; // This is a sentinel. The last token is not processed in the while loop. |
202 | - while(($dotPosition = strpos($sClassPath, '.', $offset)) !== false) |
|
202 | + while (($dotPosition = strpos($sClassPath, '.', $offset)) !== false) |
|
203 | 203 | { |
204 | 204 | $class = substr($sClassPath, 0, $dotPosition); |
205 | 205 | // Generate code for this object |
206 | - if(!array_key_exists($class, $classes)) |
|
206 | + if (!array_key_exists($class, $classes)) |
|
207 | 207 | { |
208 | 208 | $code .= "$sJaxonPrefix$class = {};\n"; |
209 | 209 | $classes[$class] = $class; |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | } |
213 | 213 | } |
214 | 214 | // Generate code for javascript methods |
215 | - foreach($this->aCallableObjects as $xCallableObject) |
|
215 | + foreach ($this->aCallableObjects as $xCallableObject) |
|
216 | 216 | { |
217 | 217 | $code .= $xCallableObject->getScript(); |
218 | 218 | } |
@@ -227,13 +227,13 @@ discard block |
||
227 | 227 | public function canProcessRequest() |
228 | 228 | { |
229 | 229 | // Check the validity of the class name |
230 | - if(($this->sRequestedClass) && !$this->validateClass($this->sRequestedClass)) |
|
230 | + if (($this->sRequestedClass) && !$this->validateClass($this->sRequestedClass)) |
|
231 | 231 | { |
232 | 232 | $this->sRequestedClass = null; |
233 | 233 | $this->sRequestedMethod = null; |
234 | 234 | } |
235 | 235 | // Check the validity of the method name |
236 | - if(($this->sRequestedMethod) && !$this->validateMethod($this->sRequestedMethod)) |
|
236 | + if (($this->sRequestedMethod) && !$this->validateMethod($this->sRequestedMethod)) |
|
237 | 237 | { |
238 | 238 | $this->sRequestedClass = null; |
239 | 239 | $this->sRequestedMethod = null; |
@@ -248,20 +248,20 @@ discard block |
||
248 | 248 | */ |
249 | 249 | public function processRequest() |
250 | 250 | { |
251 | - if(!$this->canProcessRequest()) |
|
251 | + if (!$this->canProcessRequest()) |
|
252 | 252 | return false; |
253 | 253 | |
254 | 254 | $aArgs = $this->getRequestManager()->process(); |
255 | 255 | |
256 | 256 | // Register an instance of the requested class, if it isn't yet |
257 | - if(!($xCallableObject = $this->getCallableObject($this->sRequestedClass))) |
|
257 | + if (!($xCallableObject = $this->getCallableObject($this->sRequestedClass))) |
|
258 | 258 | { |
259 | 259 | $this->getPluginManager()->registerClass($this->sRequestedClass); |
260 | 260 | $xCallableObject = $this->getCallableObject($this->sRequestedClass); |
261 | 261 | } |
262 | 262 | |
263 | 263 | // Find the requested method |
264 | - if(!$xCallableObject || !$xCallableObject->hasMethod($this->sRequestedMethod)) |
|
264 | + if (!$xCallableObject || !$xCallableObject->hasMethod($this->sRequestedMethod)) |
|
265 | 265 | { |
266 | 266 | // Unable to find the requested object or method |
267 | 267 | throw new \Jaxon\Exception\Error($this->trans('errors.objects.invalid', |
@@ -248,8 +248,9 @@ |
||
248 | 248 | */ |
249 | 249 | public function processRequest() |
250 | 250 | { |
251 | - if(!$this->canProcessRequest()) |
|
252 | - return false; |
|
251 | + if(!$this->canProcessRequest()) { |
|
252 | + return false; |
|
253 | + } |
|
253 | 254 | |
254 | 255 | $aArgs = $this->getRequestManager()->process(); |
255 | 256 |
@@ -71,13 +71,13 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function append(Response $xResponse) |
73 | 73 | { |
74 | - if(!$this->xResponse) |
|
74 | + if (!$this->xResponse) |
|
75 | 75 | { |
76 | 76 | $this->xResponse = $xResponse; |
77 | 77 | } |
78 | - elseif(get_class($this->xResponse) == get_class($xResponse)) |
|
78 | + elseif (get_class($this->xResponse) == get_class($xResponse)) |
|
79 | 79 | { |
80 | - if($this->xResponse != $xResponse) |
|
80 | + if ($this->xResponse != $xResponse) |
|
81 | 81 | { |
82 | 82 | $this->xResponse->appendResponse($xResponse); |
83 | 83 | } |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function printDebug() |
112 | 112 | { |
113 | - if(($this->xResponse)) |
|
113 | + if (($this->xResponse)) |
|
114 | 114 | { |
115 | - foreach($this->aDebugMessages as $sMessage) |
|
115 | + foreach ($this->aDebugMessages as $sMessage) |
|
116 | 116 | { |
117 | 117 | $this->xResponse->debug($sMessage); |
118 | 118 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function sendHeaders() |
129 | 129 | { |
130 | - if(($this->xResponse)) |
|
130 | + if (($this->xResponse)) |
|
131 | 131 | { |
132 | 132 | $this->xResponse->sendHeaders(); |
133 | 133 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | */ |
141 | 141 | public function getOutput() |
142 | 142 | { |
143 | - if(($this->xResponse)) |
|
143 | + if (($this->xResponse)) |
|
144 | 144 | { |
145 | 145 | return $this->xResponse->getOutput(); |
146 | 146 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function sendOutput() |
156 | 156 | { |
157 | - if(($this->xResponse)) |
|
157 | + if (($this->xResponse)) |
|
158 | 158 | { |
159 | 159 | $this->xResponse->sendHeaders(); |
160 | 160 | $this->xResponse->printOutput(); |
@@ -74,15 +74,13 @@ |
||
74 | 74 | if(!$this->xResponse) |
75 | 75 | { |
76 | 76 | $this->xResponse = $xResponse; |
77 | - } |
|
78 | - elseif(get_class($this->xResponse) == get_class($xResponse)) |
|
77 | + } elseif(get_class($this->xResponse) == get_class($xResponse)) |
|
79 | 78 | { |
80 | 79 | if($this->xResponse != $xResponse) |
81 | 80 | { |
82 | 81 | $this->xResponse->appendResponse($xResponse); |
83 | 82 | } |
84 | - } |
|
85 | - else |
|
83 | + } else |
|
86 | 84 | { |
87 | 85 | $this->debug($this->trans('errors.mismatch.types', array('class' => get_class($xResponse)))); |
88 | 86 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | public function plugin($sName) |
102 | 102 | { |
103 | 103 | $xPlugin = $this->getPluginManager()->getResponsePlugin($sName); |
104 | - if(!$xPlugin) |
|
104 | + if (!$xPlugin) |
|
105 | 105 | { |
106 | 106 | return null; |
107 | 107 | } |
@@ -164,21 +164,21 @@ discard block |
||
164 | 164 | public function addCommand($aAttributes, $mData) |
165 | 165 | { |
166 | 166 | /* merge commands if possible */ |
167 | - if(in_array($aAttributes['cmd'], array('js', 'ap'))) |
|
167 | + if (in_array($aAttributes['cmd'], array('js', 'ap'))) |
|
168 | 168 | { |
169 | - if(($aLastCommand = array_pop($this->aCommands))) |
|
169 | + if (($aLastCommand = array_pop($this->aCommands))) |
|
170 | 170 | { |
171 | - if($aLastCommand['cmd'] == $aAttributes['cmd']) |
|
171 | + if ($aLastCommand['cmd'] == $aAttributes['cmd']) |
|
172 | 172 | { |
173 | - if($aLastCommand['cmd'] == 'js') |
|
173 | + if ($aLastCommand['cmd'] == 'js') |
|
174 | 174 | { |
175 | - $mData = $aLastCommand['data'].'; '.$mData; |
|
175 | + $mData = $aLastCommand['data'] . '; ' . $mData; |
|
176 | 176 | } |
177 | - elseif($aLastCommand['cmd'] == 'ap' && |
|
177 | + elseif ($aLastCommand['cmd'] == 'ap' && |
|
178 | 178 | $aLastCommand['id'] == $aAttributes['id'] && |
179 | 179 | $aLastCommand['prop'] == $aAttributes['prop']) |
180 | 180 | { |
181 | - $mData = $aLastCommand['data'].' '.$mData; |
|
181 | + $mData = $aLastCommand['data'] . ' ' . $mData; |
|
182 | 182 | } |
183 | 183 | else |
184 | 184 | { |
@@ -235,11 +235,11 @@ discard block |
||
235 | 235 | */ |
236 | 236 | public function appendResponse($mCommands, $bBefore = false) |
237 | 237 | { |
238 | - if($mCommands instanceof Response) |
|
238 | + if ($mCommands instanceof Response) |
|
239 | 239 | { |
240 | 240 | $this->returnValue = $mCommands->returnValue; |
241 | 241 | |
242 | - if($bBefore) |
|
242 | + if ($bBefore) |
|
243 | 243 | { |
244 | 244 | $this->aCommands = array_merge($mCommands->aCommands, $this->aCommands); |
245 | 245 | } |
@@ -248,9 +248,9 @@ discard block |
||
248 | 248 | $this->aCommands = array_merge($this->aCommands, $mCommands->aCommands); |
249 | 249 | } |
250 | 250 | } |
251 | - elseif(is_array($mCommands)) |
|
251 | + elseif (is_array($mCommands)) |
|
252 | 252 | { |
253 | - if($bBefore) |
|
253 | + if ($bBefore) |
|
254 | 254 | { |
255 | 255 | $this->aCommands = array_merge($mCommands, $this->aCommands); |
256 | 256 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | } |
262 | 262 | else |
263 | 263 | { |
264 | - if(!empty($mCommands)) |
|
264 | + if (!empty($mCommands)) |
|
265 | 265 | { |
266 | 266 | throw new \Jaxon\Exception\Error($this->trans('errors.response.data.invalid')); |
267 | 267 | } |
@@ -529,33 +529,33 @@ discard block |
||
529 | 529 | * |
530 | 530 | * @return \Jaxon\Plugin\Response |
531 | 531 | */ |
532 | - public function redirect($sURL, $iDelay=0) |
|
532 | + public function redirect($sURL, $iDelay = 0) |
|
533 | 533 | { |
534 | 534 | // we need to parse the query part so that the values are rawurlencode()'ed |
535 | 535 | // can't just use parse_url() cos we could be dealing with a relative URL which |
536 | 536 | // parse_url() can't deal with. |
537 | 537 | $queryStart = strpos($sURL, '?', strrpos($sURL, '/')); |
538 | - if($queryStart !== false) |
|
538 | + if ($queryStart !== false) |
|
539 | 539 | { |
540 | 540 | $queryStart++; |
541 | 541 | $queryEnd = strpos($sURL, '#', $queryStart); |
542 | - if($queryEnd === false) |
|
542 | + if ($queryEnd === false) |
|
543 | 543 | $queryEnd = strlen($sURL); |
544 | - $queryPart = substr($sURL, $queryStart, $queryEnd-$queryStart); |
|
544 | + $queryPart = substr($sURL, $queryStart, $queryEnd - $queryStart); |
|
545 | 545 | parse_str($queryPart, $queryParts); |
546 | 546 | $newQueryPart = ""; |
547 | - if($queryParts) |
|
547 | + if ($queryParts) |
|
548 | 548 | { |
549 | 549 | $first = true; |
550 | - foreach($queryParts as $key => $value) |
|
550 | + foreach ($queryParts as $key => $value) |
|
551 | 551 | { |
552 | - if($first) |
|
552 | + if ($first) |
|
553 | 553 | $first = false; |
554 | 554 | else |
555 | 555 | $newQueryPart .= '&'; |
556 | - $newQueryPart .= rawurlencode($key).'='.rawurlencode($value); |
|
556 | + $newQueryPart .= rawurlencode($key) . '=' . rawurlencode($value); |
|
557 | 557 | } |
558 | - } elseif($_SERVER['QUERY_STRING']) { |
|
558 | + } elseif ($_SERVER['QUERY_STRING']) { |
|
559 | 559 | //couldn't break up the query, but there's one there |
560 | 560 | //possibly "http://url/page.html?query1234" type of query? |
561 | 561 | //just encode it and hope it works |
@@ -563,8 +563,8 @@ discard block |
||
563 | 563 | } |
564 | 564 | $sURL = str_replace($queryPart, $newQueryPart, $sURL); |
565 | 565 | } |
566 | - if($iDelay) |
|
567 | - $this->script('window.setTimeout("window.location = \'' . $sURL . '\';",' . ($iDelay*1000) . ');'); |
|
566 | + if ($iDelay) |
|
567 | + $this->script('window.setTimeout("window.location = \'' . $sURL . '\';",' . ($iDelay * 1000) . ');'); |
|
568 | 568 | else |
569 | 569 | $this->script('window.location = "' . $sURL . '";'); |
570 | 570 | return $this; |
@@ -901,10 +901,10 @@ discard block |
||
901 | 901 | { |
902 | 902 | $command = array('cmd' => 'in'); |
903 | 903 | |
904 | - if(($sType)) |
|
904 | + if (($sType)) |
|
905 | 905 | $command['type'] = trim((string)$sType, " \t"); |
906 | 906 | |
907 | - if(($sId)) |
|
907 | + if (($sId)) |
|
908 | 908 | $command['elm_id'] = trim((string)$sId, " \t"); |
909 | 909 | |
910 | 910 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
@@ -922,10 +922,10 @@ discard block |
||
922 | 922 | { |
923 | 923 | $command = array('cmd' => 'ino'); |
924 | 924 | |
925 | - if(($sType)) |
|
925 | + if (($sType)) |
|
926 | 926 | $command['type'] = trim((string)$sType, " \t"); |
927 | 927 | |
928 | - if(($sId)) |
|
928 | + if (($sId)) |
|
929 | 929 | $command['elm_id'] = trim((string)$sId, " \t"); |
930 | 930 | |
931 | 931 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
@@ -966,7 +966,7 @@ discard block |
||
966 | 966 | { |
967 | 967 | $command = array('cmd' => 'css'); |
968 | 968 | |
969 | - if(($sMedia)) |
|
969 | + if (($sMedia)) |
|
970 | 970 | $command['media'] = trim((string)$sMedia, " \t"); |
971 | 971 | |
972 | 972 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | { |
986 | 986 | $command = array('cmd' => 'rcss'); |
987 | 987 | |
988 | - if(($sMedia)) |
|
988 | + if (($sMedia)) |
|
989 | 989 | $command['media'] = trim((string)$sMedia, " \t"); |
990 | 990 | |
991 | 991 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
@@ -1126,10 +1126,10 @@ discard block |
||
1126 | 1126 | { |
1127 | 1127 | $command = array('cmd' => 'DRC'); |
1128 | 1128 | |
1129 | - if(($skip)) |
|
1129 | + if (($skip)) |
|
1130 | 1130 | $command['skip'] = $skip; |
1131 | 1131 | |
1132 | - if(($remove)) |
|
1132 | + if (($remove)) |
|
1133 | 1133 | $command['remove'] = $remove; |
1134 | 1134 | |
1135 | 1135 | return $this->addCommand($command, $parent); |
@@ -1255,7 +1255,7 @@ discard block |
||
1255 | 1255 | public function sendHeaders() |
1256 | 1256 | { |
1257 | 1257 | $xRequestManager = $this->getRequestManager(); |
1258 | - if($xRequestManager->getRequestMethod() == Jaxon::METHOD_GET) |
|
1258 | + if ($xRequestManager->getRequestMethod() == Jaxon::METHOD_GET) |
|
1259 | 1259 | { |
1260 | 1260 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); |
1261 | 1261 | header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
@@ -1265,7 +1265,7 @@ discard block |
||
1265 | 1265 | |
1266 | 1266 | $sCharacterSet = ''; |
1267 | 1267 | $sCharacterEncoding = trim($this->getOption('core.encoding')); |
1268 | - if(($sCharacterEncoding) && strlen($sCharacterEncoding) > 0) |
|
1268 | + if (($sCharacterEncoding) && strlen($sCharacterEncoding) > 0) |
|
1269 | 1269 | { |
1270 | 1270 | $sCharacterSet = '; charset="' . trim($sCharacterEncoding) . '"'; |
1271 | 1271 | } |
@@ -1282,13 +1282,13 @@ discard block |
||
1282 | 1282 | { |
1283 | 1283 | $response = array(); |
1284 | 1284 | |
1285 | - if(($this->returnValue)) |
|
1285 | + if (($this->returnValue)) |
|
1286 | 1286 | { |
1287 | 1287 | $response['jxnrv'] = $this->returnValue; |
1288 | 1288 | } |
1289 | 1289 | $response['jxnobj'] = array(); |
1290 | 1290 | |
1291 | - foreach($this->aCommands as $xCommand) |
|
1291 | + foreach ($this->aCommands as $xCommand) |
|
1292 | 1292 | { |
1293 | 1293 | $response['jxnobj'][] = $xCommand; |
1294 | 1294 | } |
@@ -173,19 +173,16 @@ discard block |
||
173 | 173 | if($aLastCommand['cmd'] == 'js') |
174 | 174 | { |
175 | 175 | $mData = $aLastCommand['data'].'; '.$mData; |
176 | - } |
|
177 | - elseif($aLastCommand['cmd'] == 'ap' && |
|
176 | + } elseif($aLastCommand['cmd'] == 'ap' && |
|
178 | 177 | $aLastCommand['id'] == $aAttributes['id'] && |
179 | 178 | $aLastCommand['prop'] == $aAttributes['prop']) |
180 | 179 | { |
181 | 180 | $mData = $aLastCommand['data'].' '.$mData; |
182 | - } |
|
183 | - else |
|
181 | + } else |
|
184 | 182 | { |
185 | 183 | $this->aCommands[] = $aLastCommand; |
186 | 184 | } |
187 | - } |
|
188 | - else |
|
185 | + } else |
|
189 | 186 | { |
190 | 187 | $this->aCommands[] = $aLastCommand; |
191 | 188 | } |
@@ -242,24 +239,20 @@ discard block |
||
242 | 239 | if($bBefore) |
243 | 240 | { |
244 | 241 | $this->aCommands = array_merge($mCommands->aCommands, $this->aCommands); |
245 | - } |
|
246 | - else |
|
242 | + } else |
|
247 | 243 | { |
248 | 244 | $this->aCommands = array_merge($this->aCommands, $mCommands->aCommands); |
249 | 245 | } |
250 | - } |
|
251 | - elseif(is_array($mCommands)) |
|
246 | + } elseif(is_array($mCommands)) |
|
252 | 247 | { |
253 | 248 | if($bBefore) |
254 | 249 | { |
255 | 250 | $this->aCommands = array_merge($mCommands, $this->aCommands); |
256 | - } |
|
257 | - else |
|
251 | + } else |
|
258 | 252 | { |
259 | 253 | $this->aCommands = array_merge($this->aCommands, $mCommands); |
260 | 254 | } |
261 | - } |
|
262 | - else |
|
255 | + } else |
|
263 | 256 | { |
264 | 257 | if(!empty($mCommands)) |
265 | 258 | { |
@@ -539,8 +532,9 @@ discard block |
||
539 | 532 | { |
540 | 533 | $queryStart++; |
541 | 534 | $queryEnd = strpos($sURL, '#', $queryStart); |
542 | - if($queryEnd === false) |
|
543 | - $queryEnd = strlen($sURL); |
|
535 | + if($queryEnd === false) { |
|
536 | + $queryEnd = strlen($sURL); |
|
537 | + } |
|
544 | 538 | $queryPart = substr($sURL, $queryStart, $queryEnd-$queryStart); |
545 | 539 | parse_str($queryPart, $queryParts); |
546 | 540 | $newQueryPart = ""; |
@@ -549,10 +543,11 @@ discard block |
||
549 | 543 | $first = true; |
550 | 544 | foreach($queryParts as $key => $value) |
551 | 545 | { |
552 | - if($first) |
|
553 | - $first = false; |
|
554 | - else |
|
555 | - $newQueryPart .= '&'; |
|
546 | + if($first) { |
|
547 | + $first = false; |
|
548 | + } else { |
|
549 | + $newQueryPart .= '&'; |
|
550 | + } |
|
556 | 551 | $newQueryPart .= rawurlencode($key).'='.rawurlencode($value); |
557 | 552 | } |
558 | 553 | } elseif($_SERVER['QUERY_STRING']) { |
@@ -563,10 +558,11 @@ discard block |
||
563 | 558 | } |
564 | 559 | $sURL = str_replace($queryPart, $newQueryPart, $sURL); |
565 | 560 | } |
566 | - if($iDelay) |
|
567 | - $this->script('window.setTimeout("window.location = \'' . $sURL . '\';",' . ($iDelay*1000) . ');'); |
|
568 | - else |
|
569 | - $this->script('window.location = "' . $sURL . '";'); |
|
561 | + if($iDelay) { |
|
562 | + $this->script('window.setTimeout("window.location = \'' . $sURL . '\';",' . ($iDelay*1000) . ');'); |
|
563 | + } else { |
|
564 | + $this->script('window.location = "' . $sURL . '";'); |
|
565 | + } |
|
570 | 566 | return $this; |
571 | 567 | } |
572 | 568 | |
@@ -901,11 +897,13 @@ discard block |
||
901 | 897 | { |
902 | 898 | $command = array('cmd' => 'in'); |
903 | 899 | |
904 | - if(($sType)) |
|
905 | - $command['type'] = trim((string)$sType, " \t"); |
|
900 | + if(($sType)) { |
|
901 | + $command['type'] = trim((string)$sType, " \t"); |
|
902 | + } |
|
906 | 903 | |
907 | - if(($sId)) |
|
908 | - $command['elm_id'] = trim((string)$sId, " \t"); |
|
904 | + if(($sId)) { |
|
905 | + $command['elm_id'] = trim((string)$sId, " \t"); |
|
906 | + } |
|
909 | 907 | |
910 | 908 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
911 | 909 | } |
@@ -922,11 +920,13 @@ discard block |
||
922 | 920 | { |
923 | 921 | $command = array('cmd' => 'ino'); |
924 | 922 | |
925 | - if(($sType)) |
|
926 | - $command['type'] = trim((string)$sType, " \t"); |
|
923 | + if(($sType)) { |
|
924 | + $command['type'] = trim((string)$sType, " \t"); |
|
925 | + } |
|
927 | 926 | |
928 | - if(($sId)) |
|
929 | - $command['elm_id'] = trim((string)$sId, " \t"); |
|
927 | + if(($sId)) { |
|
928 | + $command['elm_id'] = trim((string)$sId, " \t"); |
|
929 | + } |
|
930 | 930 | |
931 | 931 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
932 | 932 | } |
@@ -966,8 +966,9 @@ discard block |
||
966 | 966 | { |
967 | 967 | $command = array('cmd' => 'css'); |
968 | 968 | |
969 | - if(($sMedia)) |
|
970 | - $command['media'] = trim((string)$sMedia, " \t"); |
|
969 | + if(($sMedia)) { |
|
970 | + $command['media'] = trim((string)$sMedia, " \t"); |
|
971 | + } |
|
971 | 972 | |
972 | 973 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
973 | 974 | } |
@@ -985,8 +986,9 @@ discard block |
||
985 | 986 | { |
986 | 987 | $command = array('cmd' => 'rcss'); |
987 | 988 | |
988 | - if(($sMedia)) |
|
989 | - $command['media'] = trim((string)$sMedia, " \t"); |
|
989 | + if(($sMedia)) { |
|
990 | + $command['media'] = trim((string)$sMedia, " \t"); |
|
991 | + } |
|
990 | 992 | |
991 | 993 | return $this->addCommand($command, trim((string)$sFileName, " \t")); |
992 | 994 | } |
@@ -1126,11 +1128,13 @@ discard block |
||
1126 | 1128 | { |
1127 | 1129 | $command = array('cmd' => 'DRC'); |
1128 | 1130 | |
1129 | - if(($skip)) |
|
1130 | - $command['skip'] = $skip; |
|
1131 | + if(($skip)) { |
|
1132 | + $command['skip'] = $skip; |
|
1133 | + } |
|
1131 | 1134 | |
1132 | - if(($remove)) |
|
1133 | - $command['remove'] = $remove; |
|
1135 | + if(($remove)) { |
|
1136 | + $command['remove'] = $remove; |
|
1137 | + } |
|
1134 | 1138 | |
1135 | 1139 | return $this->addCommand($command, $parent); |
1136 | 1140 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @param array $aAttributes Associative array of attributes that will describe the command |
160 | 160 | * @param mixed $mData The data to be associated with this command |
161 | 161 | * |
162 | - * @return \Jaxon\Plugin\Response |
|
162 | + * @return Response |
|
163 | 163 | */ |
164 | 164 | public function addCommand($aAttributes, $mData) |
165 | 165 | { |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | /** |
201 | 201 | * Clear all the commands already added to the response |
202 | 202 | * |
203 | - * @return \Jaxon\Plugin\Response |
|
203 | + * @return Response |
|
204 | 204 | */ |
205 | 205 | public function clearCommands() |
206 | 206 | { |
@@ -214,9 +214,9 @@ discard block |
||
214 | 214 | * |
215 | 215 | * @param \Jaxon\Plugin\Plugin $xPlugin The plugin object |
216 | 216 | * @param array $aAttributes The attributes for this response command |
217 | - * @param mixed $mData The data to be sent with this command |
|
217 | + * @param string $mData The data to be sent with this command |
|
218 | 218 | * |
219 | - * @return \Jaxon\Plugin\Response |
|
219 | + * @return Response |
|
220 | 220 | */ |
221 | 221 | public function addPluginCommand($xPlugin, $aAttributes, $mData) |
222 | 222 | { |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * @param integer $iCmdNumber The number of commands to skip upon cancel |
278 | 278 | * @param string $sMessage The message to display to the user |
279 | 279 | * |
280 | - * @return \Jaxon\Plugin\Response |
|
280 | + * @return Response |
|
281 | 281 | */ |
282 | 282 | public function confirmCommands($iCmdNumber, $sMessage) |
283 | 283 | { |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | * @param string $sAttribute The attribute to be assigned |
298 | 298 | * @param string $sData The value to be assigned to the attribute |
299 | 299 | * |
300 | - * @return \Jaxon\Plugin\Response |
|
300 | + * @return Response |
|
301 | 301 | */ |
302 | 302 | public function assign($sTarget, $sAttribute, $sData) |
303 | 303 | { |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | * @param string $sTarget The id of the html element on the browser |
320 | 320 | * @param string $sData The value to be assigned to the attribute |
321 | 321 | * |
322 | - * @return \Jaxon\Plugin\Response |
|
322 | + * @return Response |
|
323 | 323 | */ |
324 | 324 | public function html($sTarget, $sData) |
325 | 325 | { |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @param string $sAttribute The name of the attribute to be appended to |
334 | 334 | * @param string $sData The data to be appended to the attribute |
335 | 335 | * |
336 | - * @return \Jaxon\Plugin\Response |
|
336 | + * @return Response |
|
337 | 337 | */ |
338 | 338 | public function append($sTarget, $sAttribute, $sData) |
339 | 339 | { |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | * @param string $sAttribute The name of the attribute to be prepended to |
355 | 355 | * @param string $sData The value to be prepended to the attribute |
356 | 356 | * |
357 | - * @return \Jaxon\Plugin\Response |
|
357 | + * @return Response |
|
358 | 358 | */ |
359 | 359 | public function prepend($sTarget, $sAttribute, $sData) |
360 | 360 | { |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | * @param string $sSearch The needle to search for |
377 | 377 | * @param string $sData The data to use in place of the needle |
378 | 378 | * |
379 | - * @return \Jaxon\Plugin\Response |
|
379 | + * @return Response |
|
380 | 380 | */ |
381 | 381 | public function replace($sTarget, $sAttribute, $sSearch, $sData) |
382 | 382 | { |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | * @param string $sTarget The id of the element to be updated. |
400 | 400 | * @param string $sAttribute The attribute to be cleared |
401 | 401 | * |
402 | - * @return \Jaxon\Plugin\Response |
|
402 | + * @return Response |
|
403 | 403 | */ |
404 | 404 | public function clear($sTarget, $sAttribute) |
405 | 405 | { |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | * @param string $sAttribute The attribute to be updated |
416 | 416 | * @param string $sData The value to assign |
417 | 417 | * |
418 | - * @return \Jaxon\Plugin\Response |
|
418 | + * @return Response |
|
419 | 419 | */ |
420 | 420 | public function contextAssign($sAttribute, $sData) |
421 | 421 | { |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | * @param string $sAttribute The attribute to be appended to |
438 | 438 | * @param string $sData The value to append |
439 | 439 | * |
440 | - * @return \Jaxon\Plugin\Response |
|
440 | + * @return Response |
|
441 | 441 | */ |
442 | 442 | public function contextAppend($sAttribute, $sData) |
443 | 443 | { |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | * @param string $sAttribute The attribute to be updated |
460 | 460 | * @param string $sData The value to be prepended |
461 | 461 | * |
462 | - * @return \Jaxon\Plugin\Response |
|
462 | + * @return Response |
|
463 | 463 | */ |
464 | 464 | public function contextPrepend($sAttribute, $sData) |
465 | 465 | { |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | * |
481 | 481 | * @param string $sAttribute The attribute to be cleared |
482 | 482 | * |
483 | - * @return \Jaxon\Plugin\Response |
|
483 | + * @return Response |
|
484 | 484 | */ |
485 | 485 | public function contextClear($sAttribute) |
486 | 486 | { |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | * |
493 | 493 | * @param string $sMessage The message to be displayed |
494 | 494 | * |
495 | - * @return \Jaxon\Plugin\Response |
|
495 | + * @return Response |
|
496 | 496 | */ |
497 | 497 | public function alert($sMessage) |
498 | 498 | { |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | * |
510 | 510 | * @param string $sMessage The message to be displayed |
511 | 511 | * |
512 | - * @return \Jaxon\Plugin\Response |
|
512 | + * @return Response |
|
513 | 513 | */ |
514 | 514 | public function debug($sMessage) |
515 | 515 | { |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | * @param string $sURL The relative or fully qualified URL |
528 | 528 | * @param integer $iDelay Number of seconds to delay before the redirect occurs |
529 | 529 | * |
530 | - * @return \Jaxon\Plugin\Response |
|
530 | + * @return Response |
|
531 | 531 | */ |
532 | 532 | public function redirect($sURL, $iDelay=0) |
533 | 533 | { |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | * |
581 | 581 | * @param string $sJS The script to execute |
582 | 582 | * |
583 | - * @return \Jaxon\Plugin\Response |
|
583 | + * @return Response |
|
584 | 584 | */ |
585 | 585 | public function script($sJS) |
586 | 586 | { |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | * |
598 | 598 | * @param string $sFunc The name of the function to call |
599 | 599 | * |
600 | - * @return \Jaxon\Plugin\Response |
|
600 | + * @return Response |
|
601 | 601 | */ |
602 | 602 | public function call($sFunc) |
603 | 603 | { |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | * |
618 | 618 | * @param string $sTarget The id of the element to be removed |
619 | 619 | * |
620 | - * @return \Jaxon\Plugin\Response |
|
620 | + * @return Response |
|
621 | 621 | */ |
622 | 622 | public function remove($sTarget) |
623 | 623 | { |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | * @param string $sTag The tag name to be used for the new element |
638 | 638 | * @param string $sId The id to assign to the new element |
639 | 639 | * |
640 | - * @return \Jaxon\Plugin\Response |
|
640 | + * @return Response |
|
641 | 641 | */ |
642 | 642 | public function create($sParent, $sTag, $sId) |
643 | 643 | { |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | * @param string $sTag The tag name to be used for the new element |
659 | 659 | * @param string $sId The id to assign to the new element |
660 | 660 | * |
661 | - * @return \Jaxon\Plugin\Response |
|
661 | + * @return Response |
|
662 | 662 | */ |
663 | 663 | public function insert($sBefore, $sTag, $sId) |
664 | 664 | { |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | * @param string $sTag The tag name to be used for the new element |
680 | 680 | * @param string $sId The id to assign to the new element |
681 | 681 | * |
682 | - * @return \Jaxon\Plugin\Response |
|
682 | + * @return Response |
|
683 | 683 | */ |
684 | 684 | public function insertAfter($sAfter, $sTag, $sId) |
685 | 685 | { |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | * @param string $sName The name of the new input element |
702 | 702 | * @param string $sId The id of the new element |
703 | 703 | * |
704 | - * @return \Jaxon\Plugin\Response |
|
704 | + * @return Response |
|
705 | 705 | */ |
706 | 706 | public function createInput($sParent, $sType, $sName, $sId) |
707 | 707 | { |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | * @param string $sName The name of the new input element |
725 | 725 | * @param string $sId The id of the new element |
726 | 726 | * |
727 | - * @return \Jaxon\Plugin\Response |
|
727 | + * @return Response |
|
728 | 728 | */ |
729 | 729 | public function insertInput($sBefore, $sType, $sName, $sId) |
730 | 730 | { |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | * @param string $sName The name of the new input element |
748 | 748 | * @param string $sId The id of the new element |
749 | 749 | * |
750 | - * @return \Jaxon\Plugin\Response |
|
750 | + * @return Response |
|
751 | 751 | */ |
752 | 752 | public function insertInputAfter($sAfter, $sType, $sName, $sId) |
753 | 753 | { |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | * @param string $sEvent The name of the event |
770 | 770 | * @param string $sScript The javascript to execute when the event is fired |
771 | 771 | * |
772 | - * @return \Jaxon\Plugin\Response |
|
772 | + * @return Response |
|
773 | 773 | */ |
774 | 774 | public function setEvent($sTarget, $sEvent, $sScript) |
775 | 775 | { |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | * @param string $sTarget The id of the element that contains the event |
790 | 790 | * @param string $sScript The javascript to execute when the event is fired |
791 | 791 | * |
792 | - * @return \Jaxon\Plugin\Response |
|
792 | + * @return Response |
|
793 | 793 | */ |
794 | 794 | public function onClick($sTarget, $sScript) |
795 | 795 | { |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | * @param string $sEvent The name of the event |
806 | 806 | * @param string $sHandler The name of the javascript function to call when the event is fired |
807 | 807 | * |
808 | - * @return \Jaxon\Plugin\Response |
|
808 | + * @return Response |
|
809 | 809 | */ |
810 | 810 | public function addHandler($sTarget, $sEvent, $sHandler) |
811 | 811 | { |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | * @param string $sEvent The name of the event |
827 | 827 | * @param string $sHandler The name of the javascript function called when the event is fired |
828 | 828 | * |
829 | - * @return \Jaxon\Plugin\Response |
|
829 | + * @return Response |
|
830 | 830 | */ |
831 | 831 | public function removeHandler($sTarget, $sEvent, $sHandler) |
832 | 832 | { |
@@ -847,7 +847,7 @@ discard block |
||
847 | 847 | * @param string $sArgs Comma separated list of parameter names |
848 | 848 | * @param string $sScript The javascript code that will become the body of the function |
849 | 849 | * |
850 | - * @return \Jaxon\Plugin\Response |
|
850 | + * @return Response |
|
851 | 851 | */ |
852 | 852 | public function setFunction($sFunction, $sArgs, $sScript) |
853 | 853 | { |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | * @param string $sReturnValueVar The name of the variable that will retain the return value |
875 | 875 | * from the call to the original function |
876 | 876 | * |
877 | - * @return \Jaxon\Plugin\Response |
|
877 | + * @return Response |
|
878 | 878 | */ |
879 | 879 | public function wrapFunction($sFunction, $sArgs, $aScripts, $sReturnValueVar) |
880 | 880 | { |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | * @param string $sFileName The relative or fully qualified URI of the javascript file |
896 | 896 | * @param string $sType Determines the script type. Defaults to 'text/javascript' |
897 | 897 | * |
898 | - * @return \Jaxon\Plugin\Response |
|
898 | + * @return Response |
|
899 | 899 | */ |
900 | 900 | public function includeScript($sFileName, $sType = null, $sId = null) |
901 | 901 | { |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | * @param string $sFileName The relative or fully qualified URI of the javascript file |
917 | 917 | * @param string $sType Determines the script type. Defaults to 'text/javascript' |
918 | 918 | * |
919 | - * @return \Jaxon\Plugin\Response |
|
919 | + * @return Response |
|
920 | 920 | */ |
921 | 921 | public function includeScriptOnce($sFileName, $sType = null, $sId = null) |
922 | 922 | { |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | * @param string $sFileName The relative or fully qualified URI of the javascript file |
940 | 940 | * @param string $sUnload Name of a javascript function to call prior to unlaoding the file |
941 | 941 | * |
942 | - * @return \Jaxon\Plugin\Response |
|
942 | + * @return Response |
|
943 | 943 | */ |
944 | 944 | public function removeScript($sFileName, $sUnload = '') |
945 | 945 | { |
@@ -960,7 +960,7 @@ discard block |
||
960 | 960 | * @param string $sFileName The relative or fully qualified URI of the css file |
961 | 961 | * @param string $sMedia The media type of the CSS file. Defaults to 'screen' |
962 | 962 | * |
963 | - * @return \Jaxon\Plugin\Response |
|
963 | + * @return Response |
|
964 | 964 | */ |
965 | 965 | public function includeCSS($sFileName, $sMedia = null) |
966 | 966 | { |
@@ -979,7 +979,7 @@ discard block |
||
979 | 979 | * |
980 | 980 | * @param string $sFileName The relative or fully qualified URI of the css file |
981 | 981 | * |
982 | - * @return \Jaxon\Plugin\Response |
|
982 | + * @return Response |
|
983 | 983 | */ |
984 | 984 | public function removeCSS($sFileName, $sMedia = null) |
985 | 985 | { |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | * @param integer $iTimeout The number of 1/10ths of a second to pause before timing out |
1005 | 1005 | * and continuing with the execution of the response commands |
1006 | 1006 | * |
1007 | - * @return \Jaxon\Plugin\Response |
|
1007 | + * @return Response |
|
1008 | 1008 | */ |
1009 | 1009 | public function waitForCSS($iTimeout = 600) |
1010 | 1010 | { |
@@ -1029,7 +1029,7 @@ discard block |
||
1029 | 1029 | * @param integer $tenths The number of 1/10ths of a second to wait before timing out |
1030 | 1030 | * and continuing with the execution of the response commands. |
1031 | 1031 | * |
1032 | - * @return \Jaxon\Plugin\Response |
|
1032 | + * @return Response |
|
1033 | 1033 | */ |
1034 | 1034 | public function waitFor($script, $tenths) |
1035 | 1035 | { |
@@ -1050,7 +1050,7 @@ discard block |
||
1050 | 1050 | * |
1051 | 1051 | * @param integer $tenths The number of 1/10ths of a second to sleep |
1052 | 1052 | * |
1053 | - * @return \Jaxon\Plugin\Response |
|
1053 | + * @return Response |
|
1054 | 1054 | */ |
1055 | 1055 | public function sleep($tenths) |
1056 | 1056 | { |
@@ -1079,7 +1079,7 @@ discard block |
||
1079 | 1079 | * @param string $variable The DOM element name (id or class) |
1080 | 1080 | * @param string $tag The HTML tag of the new DOM element |
1081 | 1081 | * |
1082 | - * @return \Jaxon\Plugin\Response |
|
1082 | + * @return Response |
|
1083 | 1083 | */ |
1084 | 1084 | public function domCreateElement($variable, $tag) |
1085 | 1085 | { |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | * @param string $key The name of the attribute |
1100 | 1100 | * @param string $value The value of the attribute |
1101 | 1101 | * |
1102 | - * @return \Jaxon\Plugin\Response |
|
1102 | + * @return Response |
|
1103 | 1103 | */ |
1104 | 1104 | public function domSetAttribute($variable, $key, $value) |
1105 | 1105 | { |
@@ -1120,7 +1120,7 @@ discard block |
||
1120 | 1120 | * @param string $skip The ?? |
1121 | 1121 | * @param string $remove The ?? |
1122 | 1122 | * |
1123 | - * @return \Jaxon\Plugin\Response |
|
1123 | + * @return Response |
|
1124 | 1124 | */ |
1125 | 1125 | public function domRemoveChildren($parent, $skip = null, $remove = null) |
1126 | 1126 | { |
@@ -1141,7 +1141,7 @@ discard block |
||
1141 | 1141 | * @param string $parent The DOM parent element |
1142 | 1142 | * @param string $variable The DOM element name (id or class) |
1143 | 1143 | * |
1144 | - * @return \Jaxon\Plugin\Response |
|
1144 | + * @return Response |
|
1145 | 1145 | */ |
1146 | 1146 | public function domAppendChild($parent, $variable) |
1147 | 1147 | { |
@@ -1160,7 +1160,7 @@ discard block |
||
1160 | 1160 | * @param string $target The DOM target element |
1161 | 1161 | * @param string $variable The DOM element name (id or class) |
1162 | 1162 | * |
1163 | - * @return \Jaxon\Plugin\Response |
|
1163 | + * @return Response |
|
1164 | 1164 | */ |
1165 | 1165 | public function domInsertBefore($target, $variable) |
1166 | 1166 | { |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | * @param string $target The DOM target element |
1180 | 1180 | * @param string $variable The DOM element name (id or class) |
1181 | 1181 | * |
1182 | - * @return \Jaxon\Plugin\Response |
|
1182 | + * @return Response |
|
1183 | 1183 | */ |
1184 | 1184 | public function domInsertAfter($target, $variable) |
1185 | 1185 | { |
@@ -1198,7 +1198,7 @@ discard block |
||
1198 | 1198 | * @param string $parent The DOM parent element |
1199 | 1199 | * @param string $text The HTML text to append |
1200 | 1200 | * |
1201 | - * @return \Jaxon\Plugin\Response |
|
1201 | + * @return Response |
|
1202 | 1202 | */ |
1203 | 1203 | public function domAppendText($parent, $text) |
1204 | 1204 | { |
@@ -1239,7 +1239,7 @@ discard block |
||
1239 | 1239 | * |
1240 | 1240 | * @param mixed $value Any value |
1241 | 1241 | * |
1242 | - * @return \Jaxon\Plugin\Response |
|
1242 | + * @return Response |
|
1243 | 1243 | */ |
1244 | 1244 | public function setReturnValue($value) |
1245 | 1245 | { |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | $sSelector = trim($sSelector, " \t"); |
53 | 53 | $sContext = trim($sContext, " \t"); |
54 | 54 | $this->aCalls = array(); |
55 | - if(!$sSelector) |
|
55 | + if (!$sSelector) |
|
56 | 56 | { |
57 | 57 | $this->sSelector = "$(this)"; // If an empty selector is given, use javascript "this" instead |
58 | 58 | } |
59 | - elseif(($sContext)) |
|
59 | + elseif (($sContext)) |
|
60 | 60 | { |
61 | 61 | $this->sSelector = "$('" . $sSelector . "', $('" . $sContext . "'))"; |
62 | 62 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function getScript() |
114 | 114 | { |
115 | - if(count($this->aCalls) == 0) |
|
115 | + if (count($this->aCalls) == 0) |
|
116 | 116 | { |
117 | 117 | return $this->sSelector; |
118 | 118 | } |
@@ -55,12 +55,10 @@ |
||
55 | 55 | if(!$sSelector) |
56 | 56 | { |
57 | 57 | $this->sSelector = "$(this)"; // If an empty selector is given, use javascript "this" instead |
58 | - } |
|
59 | - elseif(($sContext)) |
|
58 | + } elseif(($sContext)) |
|
60 | 59 | { |
61 | 60 | $this->sSelector = "$('" . $sSelector . "', $('" . $sContext . "'))"; |
62 | - } |
|
63 | - else |
|
61 | + } else |
|
64 | 62 | { |
65 | 63 | $this->sSelector = "$('" . $sSelector . "')"; |
66 | 64 | } |
@@ -25,16 +25,16 @@ discard block |
||
25 | 25 | { |
26 | 26 | $aURL = array(); |
27 | 27 | // Try to get the request URL |
28 | - if(!empty($_SERVER['REQUEST_URI'])) |
|
28 | + if (!empty($_SERVER['REQUEST_URI'])) |
|
29 | 29 | { |
30 | - $_SERVER['REQUEST_URI'] = str_replace(array('"',"'",'<','>'), array('%22','%27','%3C','%3E'), $_SERVER['REQUEST_URI']); |
|
30 | + $_SERVER['REQUEST_URI'] = str_replace(array('"', "'", '<', '>'), array('%22', '%27', '%3C', '%3E'), $_SERVER['REQUEST_URI']); |
|
31 | 31 | $aURL = parse_url($_SERVER['REQUEST_URI']); |
32 | 32 | } |
33 | 33 | |
34 | 34 | // Fill in the empty values |
35 | - if(empty($aURL['scheme'])) |
|
35 | + if (empty($aURL['scheme'])) |
|
36 | 36 | { |
37 | - if(!empty($_SERVER['HTTP_SCHEME'])) |
|
37 | + if (!empty($_SERVER['HTTP_SCHEME'])) |
|
38 | 38 | { |
39 | 39 | $aURL['scheme'] = $_SERVER['HTTP_SCHEME']; |
40 | 40 | } |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
47 | - if(empty($aURL['host'])) |
|
47 | + if (empty($aURL['host'])) |
|
48 | 48 | { |
49 | - if(!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) |
|
49 | + if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) |
|
50 | 50 | { |
51 | - if(strpos($_SERVER['HTTP_X_FORWARDED_HOST'], ':') > 0) |
|
51 | + if (strpos($_SERVER['HTTP_X_FORWARDED_HOST'], ':') > 0) |
|
52 | 52 | { |
53 | 53 | list($aURL['host'], $aURL['port']) = explode(':', $_SERVER['HTTP_X_FORWARDED_HOST']); |
54 | 54 | } |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | $aURL['host'] = $_SERVER['HTTP_X_FORWARDED_HOST']; |
58 | 58 | } |
59 | 59 | } |
60 | - elseif(!empty($_SERVER['HTTP_HOST'])) |
|
60 | + elseif (!empty($_SERVER['HTTP_HOST'])) |
|
61 | 61 | { |
62 | - if(strpos($_SERVER['HTTP_HOST'], ':') > 0) |
|
62 | + if (strpos($_SERVER['HTTP_HOST'], ':') > 0) |
|
63 | 63 | { |
64 | 64 | list($aURL['host'], $aURL['port']) = explode(':', $_SERVER['HTTP_HOST']); |
65 | 65 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $aURL['host'] = $_SERVER['HTTP_HOST']; |
69 | 69 | } |
70 | 70 | } |
71 | - elseif(!empty($_SERVER['SERVER_NAME'])) |
|
71 | + elseif (!empty($_SERVER['SERVER_NAME'])) |
|
72 | 72 | { |
73 | 73 | $aURL['host'] = $_SERVER['SERVER_NAME']; |
74 | 74 | } |
@@ -78,20 +78,20 @@ discard block |
||
78 | 78 | } |
79 | 79 | } |
80 | 80 | |
81 | - if(empty($aURL['port']) && !empty($_SERVER['SERVER_PORT'])) |
|
81 | + if (empty($aURL['port']) && !empty($_SERVER['SERVER_PORT'])) |
|
82 | 82 | { |
83 | 83 | $aURL['port'] = $_SERVER['SERVER_PORT']; |
84 | 84 | } |
85 | 85 | |
86 | - if(!empty($aURL['path']) && strlen(basename($aURL['path'])) == 0) |
|
86 | + if (!empty($aURL['path']) && strlen(basename($aURL['path'])) == 0) |
|
87 | 87 | { |
88 | 88 | unset($aURL['path']); |
89 | 89 | } |
90 | 90 | |
91 | - if(empty($aURL['path'])) |
|
91 | + if (empty($aURL['path'])) |
|
92 | 92 | { |
93 | 93 | $sPath = array(); |
94 | - if(!empty($_SERVER['PATH_INFO'])) |
|
94 | + if (!empty($_SERVER['PATH_INFO'])) |
|
95 | 95 | { |
96 | 96 | $sPath = parse_url($_SERVER['PATH_INFO']); |
97 | 97 | } |
@@ -99,61 +99,61 @@ discard block |
||
99 | 99 | { |
100 | 100 | $sPath = parse_url($_SERVER['PHP_SELF']); |
101 | 101 | } |
102 | - if(isset($sPath['path'])) |
|
102 | + if (isset($sPath['path'])) |
|
103 | 103 | { |
104 | - $aURL['path'] = str_replace(array('"',"'",'<','>'), array('%22','%27','%3C','%3E'), $sPath['path']); |
|
104 | + $aURL['path'] = str_replace(array('"', "'", '<', '>'), array('%22', '%27', '%3C', '%3E'), $sPath['path']); |
|
105 | 105 | } |
106 | 106 | unset($sPath); |
107 | 107 | } |
108 | 108 | |
109 | - if(empty($aURL['query']) && !empty($_SERVER['QUERY_STRING'])) |
|
109 | + if (empty($aURL['query']) && !empty($_SERVER['QUERY_STRING'])) |
|
110 | 110 | { |
111 | 111 | $aURL['query'] = $_SERVER['QUERY_STRING']; |
112 | 112 | } |
113 | 113 | |
114 | - if(!empty($aURL['query'])) |
|
114 | + if (!empty($aURL['query'])) |
|
115 | 115 | { |
116 | - $aURL['query'] = '?'.$aURL['query']; |
|
116 | + $aURL['query'] = '?' . $aURL['query']; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | // Build the URL: Start with scheme, user and pass |
120 | - $sURL = $aURL['scheme'].'://'; |
|
121 | - if(!empty($aURL['user'])) |
|
120 | + $sURL = $aURL['scheme'] . '://'; |
|
121 | + if (!empty($aURL['user'])) |
|
122 | 122 | { |
123 | - $sURL.= $aURL['user']; |
|
124 | - if(!empty($aURL['pass'])) |
|
123 | + $sURL .= $aURL['user']; |
|
124 | + if (!empty($aURL['pass'])) |
|
125 | 125 | { |
126 | - $sURL.= ':'.$aURL['pass']; |
|
126 | + $sURL .= ':' . $aURL['pass']; |
|
127 | 127 | } |
128 | - $sURL.= '@'; |
|
128 | + $sURL .= '@'; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | // Add the host |
132 | - $sURL.= $aURL['host']; |
|
132 | + $sURL .= $aURL['host']; |
|
133 | 133 | |
134 | 134 | // Add the port if needed |
135 | - if(!empty($aURL['port']) |
|
135 | + if (!empty($aURL['port']) |
|
136 | 136 | && (($aURL['scheme'] == 'http' && $aURL['port'] != 80) |
137 | 137 | || ($aURL['scheme'] == 'https' && $aURL['port'] != 443))) |
138 | 138 | { |
139 | - $sURL.= ':'.$aURL['port']; |
|
139 | + $sURL .= ':' . $aURL['port']; |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | // Add the path and the query string |
143 | - $sURL.= $aURL['path'].@$aURL['query']; |
|
143 | + $sURL .= $aURL['path'] . @$aURL['query']; |
|
144 | 144 | |
145 | 145 | // Clean up |
146 | 146 | unset($aURL); |
147 | 147 | |
148 | 148 | $aURL = explode("?", $sURL); |
149 | 149 | |
150 | - if(1 < count($aURL)) |
|
150 | + if (1 < count($aURL)) |
|
151 | 151 | { |
152 | 152 | $aQueries = explode("&", $aURL[1]); |
153 | 153 | |
154 | - foreach($aQueries as $sKey => $sQuery) |
|
154 | + foreach ($aQueries as $sKey => $sQuery) |
|
155 | 155 | { |
156 | - if("jxnGenerate" == substr($sQuery, 0, 11)) |
|
156 | + if ("jxnGenerate" == substr($sQuery, 0, 11)) |
|
157 | 157 | unset($aQueries[$sKey]); |
158 | 158 | } |
159 | 159 |
@@ -37,8 +37,7 @@ discard block |
||
37 | 37 | if(!empty($_SERVER['HTTP_SCHEME'])) |
38 | 38 | { |
39 | 39 | $aURL['scheme'] = $_SERVER['HTTP_SCHEME']; |
40 | - } |
|
41 | - else |
|
40 | + } else |
|
42 | 41 | { |
43 | 42 | $aURL['scheme'] = ((!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') ? 'https' : 'http'); |
44 | 43 | } |
@@ -51,28 +50,23 @@ discard block |
||
51 | 50 | if(strpos($_SERVER['HTTP_X_FORWARDED_HOST'], ':') > 0) |
52 | 51 | { |
53 | 52 | list($aURL['host'], $aURL['port']) = explode(':', $_SERVER['HTTP_X_FORWARDED_HOST']); |
54 | - } |
|
55 | - else |
|
53 | + } else |
|
56 | 54 | { |
57 | 55 | $aURL['host'] = $_SERVER['HTTP_X_FORWARDED_HOST']; |
58 | 56 | } |
59 | - } |
|
60 | - elseif(!empty($_SERVER['HTTP_HOST'])) |
|
57 | + } elseif(!empty($_SERVER['HTTP_HOST'])) |
|
61 | 58 | { |
62 | 59 | if(strpos($_SERVER['HTTP_HOST'], ':') > 0) |
63 | 60 | { |
64 | 61 | list($aURL['host'], $aURL['port']) = explode(':', $_SERVER['HTTP_HOST']); |
65 | - } |
|
66 | - else |
|
62 | + } else |
|
67 | 63 | { |
68 | 64 | $aURL['host'] = $_SERVER['HTTP_HOST']; |
69 | 65 | } |
70 | - } |
|
71 | - elseif(!empty($_SERVER['SERVER_NAME'])) |
|
66 | + } elseif(!empty($_SERVER['SERVER_NAME'])) |
|
72 | 67 | { |
73 | 68 | $aURL['host'] = $_SERVER['SERVER_NAME']; |
74 | - } |
|
75 | - else |
|
69 | + } else |
|
76 | 70 | { |
77 | 71 | throw new \Jaxon\Exception\URI(); |
78 | 72 | } |
@@ -94,8 +88,7 @@ discard block |
||
94 | 88 | if(!empty($_SERVER['PATH_INFO'])) |
95 | 89 | { |
96 | 90 | $sPath = parse_url($_SERVER['PATH_INFO']); |
97 | - } |
|
98 | - else |
|
91 | + } else |
|
99 | 92 | { |
100 | 93 | $sPath = parse_url($_SERVER['PHP_SELF']); |
101 | 94 | } |
@@ -153,8 +146,9 @@ discard block |
||
153 | 146 | |
154 | 147 | foreach($aQueries as $sKey => $sQuery) |
155 | 148 | { |
156 | - if("jxnGenerate" == substr($sQuery, 0, 11)) |
|
157 | - unset($aQueries[$sKey]); |
|
149 | + if("jxnGenerate" == substr($sQuery, 0, 11)) { |
|
150 | + unset($aQueries[$sKey]); |
|
151 | + } |
|
158 | 152 | } |
159 | 153 | |
160 | 154 | $sQueries = implode("&", $aQueries); |