@@ -51,7 +51,6 @@ |
||
| 51 | 51 | /** |
| 52 | 52 | * Registers a new RPC method and handler details |
| 53 | 53 | * @param string $methodName |
| 54 | - * @param array $handlerDetails containing the callback handler |
|
| 55 | 54 | */ |
| 56 | 55 | public function addMethod($methodName, $methodDetails) |
| 57 | 56 | { |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function __construct() |
| 37 | 37 | { |
| 38 | - $this->_xmlrpcServer = xmlrpc_server_create(); |
|
| 38 | + $this->_xmlrpcServer=xmlrpc_server_create(); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -72,16 +72,13 @@ |
||
| 72 | 72 | try |
| 73 | 73 | { |
| 74 | 74 | return xmlrpc_server_call_method($this->_xmlrpcServer, $requestPayload, null); |
| 75 | - } |
|
| 76 | - catch(TRpcException $e) |
|
| 75 | + } catch(TRpcException $e) |
|
| 77 | 76 | { |
| 78 | 77 | return $this->createErrorResponse($e); |
| 79 | - } |
|
| 80 | - catch(THttpException $e) |
|
| 78 | + } catch(THttpException $e) |
|
| 81 | 79 | { |
| 82 | 80 | throw $e; |
| 83 | - } |
|
| 84 | - catch(\Exception $e) |
|
| 81 | + } catch(\Exception $e) |
|
| 85 | 82 | { |
| 86 | 83 | return $this->createErrorResponse(new TRpcException('An internal error occured')); |
| 87 | 84 | } |
@@ -90,6 +90,7 @@ |
||
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | 92 | * @param integer the time the cookie expires. This is a Unix timestamp so is in number of seconds since the epoch. |
| 93 | + * @param integer $value |
|
| 93 | 94 | */ |
| 94 | 95 | public function setExpire($value) |
| 95 | 96 | { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * @var string domain of the cookie |
| 30 | 30 | */ |
| 31 | - private $_domain = ''; |
|
| 31 | + private $_domain=''; |
|
| 32 | 32 | /** |
| 33 | 33 | * @var string name of the cookie |
| 34 | 34 | */ |
@@ -36,23 +36,23 @@ discard block |
||
| 36 | 36 | /** |
| 37 | 37 | * @var string value of the cookie |
| 38 | 38 | */ |
| 39 | - private $_value = ''; |
|
| 39 | + private $_value=''; |
|
| 40 | 40 | /** |
| 41 | 41 | * @var integer expire of the cookie |
| 42 | 42 | */ |
| 43 | - private $_expire = 0; |
|
| 43 | + private $_expire=0; |
|
| 44 | 44 | /** |
| 45 | 45 | * @var string path of the cookie |
| 46 | 46 | */ |
| 47 | - private $_path = '/'; |
|
| 47 | + private $_path='/'; |
|
| 48 | 48 | /** |
| 49 | 49 | * @var boolean whether cookie should be sent via secure connection |
| 50 | 50 | */ |
| 51 | - private $_secure = false; |
|
| 51 | + private $_secure=false; |
|
| 52 | 52 | /** |
| 53 | 53 | * @var boolean if true the cookie value will be unavailable to JavaScript |
| 54 | 54 | */ |
| 55 | - private $_httpOnly = false; |
|
| 55 | + private $_httpOnly=false; |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * Constructor. |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function __construct($name, $value) |
| 63 | 63 | { |
| 64 | - $this->_name = $name; |
|
| 65 | - $this->_value = $value; |
|
| 64 | + $this->_name=$name; |
|
| 65 | + $this->_value=$value; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function setDomain($value) |
| 80 | 80 | { |
| 81 | - $this->_domain = $value; |
|
| 81 | + $this->_domain=$value; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function setExpire($value) |
| 96 | 96 | { |
| 97 | - $this->_expire = TPropertyValue::ensureInteger($value); |
|
| 97 | + $this->_expire=TPropertyValue::ensureInteger($value); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function setHttpOnly($value) |
| 112 | 112 | { |
| 113 | - $this->_httpOnly = TPropertyValue::ensureBoolean($value); |
|
| 113 | + $this->_httpOnly=TPropertyValue::ensureBoolean($value); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function setName($value) |
| 128 | 128 | { |
| 129 | - $this->_name = $value; |
|
| 129 | + $this->_name=$value; |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public function setValue($value) |
| 144 | 144 | { |
| 145 | - $this->_value = $value; |
|
| 145 | + $this->_value=$value; |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | public function setPath($value) |
| 160 | 160 | { |
| 161 | - $this->_path = $value; |
|
| 161 | + $this->_path=$value; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -174,6 +174,6 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | public function setSecure($value) |
| 176 | 176 | { |
| 177 | - $this->_secure = TPropertyValue::ensureBoolean($value); |
|
| 177 | + $this->_secure=TPropertyValue::ensureBoolean($value); |
|
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | \ No newline at end of file |
@@ -87,6 +87,7 @@ |
||
| 87 | 87 | * Constructor. |
| 88 | 88 | * Decomposes the specified URI into parts. |
| 89 | 89 | * @param string URI to be represented |
| 90 | + * @param string $uri |
|
| 90 | 91 | * @throws TInvalidDataValueException if URI is of bad format |
| 91 | 92 | */ |
| 92 | 93 | public function __construct($uri) |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | /** |
| 38 | 38 | * @var array list of default ports for known schemes |
| 39 | 39 | */ |
| 40 | - private static $_defaultPort = [ |
|
| 40 | + private static $_defaultPort=[ |
|
| 41 | 41 | 'ftp' => 21, |
| 42 | 42 | 'gopher' => 70, |
| 43 | 43 | 'http' => 80, |
@@ -92,18 +92,18 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function __construct($uri) |
| 94 | 94 | { |
| 95 | - if(($ret = @parse_url($uri)) !== false) |
|
| 95 | + if(($ret=@parse_url($uri))!==false) |
|
| 96 | 96 | { |
| 97 | 97 | // decoding??? |
| 98 | - $this->_scheme = isset($ret['scheme'])?$ret['scheme']:''; |
|
| 99 | - $this->_host = isset($ret['host'])?$ret['host']:''; |
|
| 100 | - $this->_port = isset($ret['port'])?$ret['port']:''; |
|
| 101 | - $this->_user = isset($ret['user'])?$ret['user']:''; |
|
| 102 | - $this->_pass = isset($ret['pass'])?$ret['pass']:''; |
|
| 103 | - $this->_path = isset($ret['path'])?$ret['path']:''; |
|
| 104 | - $this->_query = isset($ret['query'])?$ret['query']:''; |
|
| 105 | - $this->_fragment = isset($ret['fragment'])?$ret['fragment']:''; |
|
| 106 | - $this->_uri = $uri; |
|
| 98 | + $this->_scheme=isset($ret['scheme']) ? $ret['scheme'] : ''; |
|
| 99 | + $this->_host=isset($ret['host']) ? $ret['host'] : ''; |
|
| 100 | + $this->_port=isset($ret['port']) ? $ret['port'] : ''; |
|
| 101 | + $this->_user=isset($ret['user']) ? $ret['user'] : ''; |
|
| 102 | + $this->_pass=isset($ret['pass']) ? $ret['pass'] : ''; |
|
| 103 | + $this->_path=isset($ret['path']) ? $ret['path'] : ''; |
|
| 104 | + $this->_query=isset($ret['query']) ? $ret['query'] : ''; |
|
| 105 | + $this->_fragment=isset($ret['fragment']) ? $ret['fragment'] : ''; |
|
| 106 | + $this->_uri=$uri; |
|
| 107 | 107 | } |
| 108 | 108 | else |
| 109 | 109 | { |
@@ -104,8 +104,7 @@ |
||
| 104 | 104 | $this->_query = isset($ret['query'])?$ret['query']:''; |
| 105 | 105 | $this->_fragment = isset($ret['fragment'])?$ret['fragment']:''; |
| 106 | 106 | $this->_uri = $uri; |
| 107 | - } |
|
| 108 | - else |
|
| 107 | + } else |
|
| 109 | 108 | { |
| 110 | 109 | throw new TInvalidDataValueException('uri_format_invalid', $uri); |
| 111 | 110 | } |
@@ -606,6 +606,7 @@ discard block |
||
| 606 | 606 | |
| 607 | 607 | /** |
| 608 | 608 | * @param string full regular expression mapping pattern. |
| 609 | + * @param string $value |
|
| 609 | 610 | */ |
| 610 | 611 | public function setRegularExpression($value) |
| 611 | 612 | { |
@@ -715,6 +716,7 @@ discard block |
||
| 715 | 716 | * Uses URL pattern (or full regular expression if available) to |
| 716 | 717 | * match the given url path. |
| 717 | 718 | * @param THttpRequest the request module |
| 719 | + * @param THttpRequest $request |
|
| 718 | 720 | * @return array matched parameters, empty if no matches. |
| 719 | 721 | */ |
| 720 | 722 | public function getPatternMatches($request) |
@@ -785,7 +787,7 @@ discard block |
||
| 785 | 787 | } |
| 786 | 788 | |
| 787 | 789 | /** |
| 788 | - * @return THttpRequestUrlFormat the format of URLs. Defaults to THttpRequestUrlFormat::Get. |
|
| 790 | + * @return string the format of URLs. Defaults to THttpRequestUrlFormat::Get. |
|
| 789 | 791 | */ |
| 790 | 792 | public function getUrlFormat() |
| 791 | 793 | { |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | /** |
| 126 | 126 | * @var string service ID, default is 'page'. |
| 127 | 127 | */ |
| 128 | - private $_serviceID = 'page'; |
|
| 128 | + private $_serviceID='page'; |
|
| 129 | 129 | /** |
| 130 | 130 | * @var string url pattern to match. |
| 131 | 131 | */ |
@@ -141,25 +141,25 @@ discard block |
||
| 141 | 141 | /** |
| 142 | 142 | * @var string regular expression pattern. |
| 143 | 143 | */ |
| 144 | - private $_regexp = ''; |
|
| 144 | + private $_regexp=''; |
|
| 145 | 145 | |
| 146 | - private $_customUrl = true; |
|
| 146 | + private $_customUrl=true; |
|
| 147 | 147 | |
| 148 | 148 | private $_manager; |
| 149 | 149 | |
| 150 | - private $_caseSensitive = true; |
|
| 150 | + private $_caseSensitive=true; |
|
| 151 | 151 | |
| 152 | - private $_isWildCardPattern = false; |
|
| 152 | + private $_isWildCardPattern=false; |
|
| 153 | 153 | |
| 154 | - private $_urlFormat = THttpRequestUrlFormat::Get; |
|
| 154 | + private $_urlFormat=THttpRequestUrlFormat::Get; |
|
| 155 | 155 | |
| 156 | - private $_separator = '/'; |
|
| 156 | + private $_separator='/'; |
|
| 157 | 157 | |
| 158 | 158 | /** |
| 159 | 159 | * @var TUrlMappingPatternSecureConnection |
| 160 | 160 | * @since 3.2 |
| 161 | 161 | */ |
| 162 | - private $_secureConnection = TUrlMappingPatternSecureConnection::Automatic; |
|
| 162 | + private $_secureConnection=TUrlMappingPatternSecureConnection::Automatic; |
|
| 163 | 163 | |
| 164 | 164 | /** |
| 165 | 165 | * Constructor. |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | public function __construct(TUrlManager $manager) |
| 169 | 169 | { |
| 170 | - $this->_manager = $manager; |
|
| 170 | + $this->_manager=$manager; |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
@@ -185,10 +185,10 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | public function init($config) |
| 187 | 187 | { |
| 188 | - if($this->_serviceParameter === null) |
|
| 188 | + if($this->_serviceParameter===null) |
|
| 189 | 189 | throw new TConfigurationException('urlmappingpattern_serviceparameter_required', $this->getPattern()); |
| 190 | - if(strpos($this->_serviceParameter, '*') !== false) |
|
| 191 | - $this->_isWildCardPattern = true; |
|
| 190 | + if(strpos($this->_serviceParameter, '*')!==false) |
|
| 191 | + $this->_isWildCardPattern=true; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
@@ -198,32 +198,32 @@ discard block |
||
| 198 | 198 | */ |
| 199 | 199 | protected function getParameterizedPattern() |
| 200 | 200 | { |
| 201 | - $params = []; |
|
| 202 | - $values = []; |
|
| 203 | - if ($this->_parameters) |
|
| 201 | + $params=[]; |
|
| 202 | + $values=[]; |
|
| 203 | + if($this->_parameters) |
|
| 204 | 204 | { |
| 205 | 205 | foreach($this->_parameters as $key => $value) |
| 206 | 206 | { |
| 207 | - $params[] = '{' . $key . '}'; |
|
| 208 | - $values[] = '(?P<' . $key . '>' . $value . ')'; |
|
| 207 | + $params[]='{'.$key.'}'; |
|
| 208 | + $values[]='(?P<'.$key.'>'.$value.')'; |
|
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | - if ($this->getIsWildCardPattern()) |
|
| 211 | + if($this->getIsWildCardPattern()) |
|
| 212 | 212 | { |
| 213 | - $params[] = '{*}'; |
|
| 213 | + $params[]='{*}'; |
|
| 214 | 214 | // service parameter must not contain '=' and '/' |
| 215 | - $values[] = '(?P<' . $this->getServiceID() . '>[^=/]+)'; |
|
| 215 | + $values[]='(?P<'.$this->getServiceID().'>[^=/]+)'; |
|
| 216 | 216 | } |
| 217 | - $params[] = '/'; |
|
| 218 | - $values[] = '\\/'; |
|
| 219 | - $regexp = str_replace($params, $values, trim($this->getPattern(), '/') . '/'); |
|
| 220 | - if ($this->_urlFormat === THttpRequestUrlFormat::Get) |
|
| 221 | - $regexp = '/^' . $regexp . '$/u'; |
|
| 217 | + $params[]='/'; |
|
| 218 | + $values[]='\\/'; |
|
| 219 | + $regexp=str_replace($params, $values, trim($this->getPattern(), '/').'/'); |
|
| 220 | + if($this->_urlFormat===THttpRequestUrlFormat::Get) |
|
| 221 | + $regexp='/^'.$regexp.'$/u'; |
|
| 222 | 222 | else |
| 223 | - $regexp = '/^' . $regexp . '(?P<urlparams>.*)$/u'; |
|
| 223 | + $regexp='/^'.$regexp.'(?P<urlparams>.*)$/u'; |
|
| 224 | 224 | |
| 225 | 225 | if(!$this->getCaseSensitive()) |
| 226 | - $regexp .= 'i'; |
|
| 226 | + $regexp.='i'; |
|
| 227 | 227 | return $regexp; |
| 228 | 228 | } |
| 229 | 229 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | public function setRegularExpression($value) |
| 242 | 242 | { |
| 243 | - $this->_regexp = $value; |
|
| 243 | + $this->_regexp=$value; |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | public function setCaseSensitive($value) |
| 258 | 258 | { |
| 259 | - $this->_caseSensitive = TPropertyValue::ensureBoolean($value); |
|
| 259 | + $this->_caseSensitive=TPropertyValue::ensureBoolean($value); |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | */ |
| 265 | 265 | public function setServiceParameter($value) |
| 266 | 266 | { |
| 267 | - $this->_serviceParameter = $value; |
|
| 267 | + $this->_serviceParameter=$value; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | /** |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | */ |
| 281 | 281 | public function setServiceID($value) |
| 282 | 282 | { |
| 283 | - $this->_serviceID = $value; |
|
| 283 | + $this->_serviceID=$value; |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /** |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | public function setPattern($value) |
| 306 | 306 | { |
| 307 | - $this->_pattern = $value; |
|
| 307 | + $this->_pattern=$value; |
|
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | /** |
@@ -312,9 +312,9 @@ discard block |
||
| 312 | 312 | */ |
| 313 | 313 | public function getParameters() |
| 314 | 314 | { |
| 315 | - if (!$this->_parameters) |
|
| 315 | + if(!$this->_parameters) |
|
| 316 | 316 | { |
| 317 | - $this->_parameters = new TAttributeCollection; |
|
| 317 | + $this->_parameters=new TAttributeCollection; |
|
| 318 | 318 | $this->_parameters->setCaseSensitive(true); |
| 319 | 319 | } |
| 320 | 320 | return $this->_parameters; |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | */ |
| 326 | 326 | public function setParameters($value) |
| 327 | 327 | { |
| 328 | - $this->_parameters = $value; |
|
| 328 | + $this->_parameters=$value; |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /** |
@@ -334,9 +334,9 @@ discard block |
||
| 334 | 334 | */ |
| 335 | 335 | public function getConstants() |
| 336 | 336 | { |
| 337 | - if (!$this->_constants) |
|
| 337 | + if(!$this->_constants) |
|
| 338 | 338 | { |
| 339 | - $this->_constants = new TAttributeCollection; |
|
| 339 | + $this->_constants=new TAttributeCollection; |
|
| 340 | 340 | $this->_constants->setCaseSensitive(true); |
| 341 | 341 | } |
| 342 | 342 | return $this->_constants; |
@@ -350,30 +350,30 @@ discard block |
||
| 350 | 350 | */ |
| 351 | 351 | public function getPatternMatches($request) |
| 352 | 352 | { |
| 353 | - $matches = []; |
|
| 354 | - if(($pattern = $this->getRegularExpression()) !== '') |
|
| 353 | + $matches=[]; |
|
| 354 | + if(($pattern=$this->getRegularExpression())!=='') |
|
| 355 | 355 | preg_match($pattern, $request->getPathInfo(), $matches); |
| 356 | 356 | else |
| 357 | - preg_match($this->getParameterizedPattern(), trim($request->getPathInfo(), '/') . '/', $matches); |
|
| 357 | + preg_match($this->getParameterizedPattern(), trim($request->getPathInfo(), '/').'/', $matches); |
|
| 358 | 358 | |
| 359 | 359 | if($this->getIsWildCardPattern() && isset($matches[$this->_serviceID])) |
| 360 | - $matches[$this->_serviceID] = str_replace('*', $matches[$this->_serviceID], $this->_serviceParameter); |
|
| 360 | + $matches[$this->_serviceID]=str_replace('*', $matches[$this->_serviceID], $this->_serviceParameter); |
|
| 361 | 361 | |
| 362 | - if (isset($matches['urlparams'])) |
|
| 362 | + if(isset($matches['urlparams'])) |
|
| 363 | 363 | { |
| 364 | - $params = explode('/', $matches['urlparams']); |
|
| 365 | - if ($this->_separator === '/') |
|
| 364 | + $params=explode('/', $matches['urlparams']); |
|
| 365 | + if($this->_separator==='/') |
|
| 366 | 366 | { |
| 367 | - while($key = array_shift($params)) |
|
| 368 | - $matches[$key] = ($value = array_shift($params)) ? $value : ''; |
|
| 367 | + while($key=array_shift($params)) |
|
| 368 | + $matches[$key]=($value=array_shift($params)) ? $value : ''; |
|
| 369 | 369 | } |
| 370 | 370 | else |
| 371 | 371 | { |
| 372 | 372 | array_pop($params); |
| 373 | 373 | foreach($params as $param) |
| 374 | 374 | { |
| 375 | - list($key, $value) = explode($this->_separator, $param, 2); |
|
| 376 | - $matches[$key] = $value; |
|
| 375 | + list($key, $value)=explode($this->_separator, $param, 2); |
|
| 376 | + $matches[$key]=$value; |
|
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | unset($matches['urlparams']); |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | if(count($matches) > 0 && $this->_constants) |
| 383 | 383 | { |
| 384 | 384 | foreach($this->_constants->toArray() as $key => $value) |
| 385 | - $matches[$key] = $value; |
|
| 385 | + $matches[$key]=$value; |
|
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | return $matches; |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | */ |
| 405 | 405 | public function setEnableCustomUrl($value) |
| 406 | 406 | { |
| 407 | - $this->_customUrl = TPropertyValue::ensureBoolean($value); |
|
| 407 | + $this->_customUrl=TPropertyValue::ensureBoolean($value); |
|
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | /** |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | */ |
| 437 | 437 | public function setUrlFormat($value) |
| 438 | 438 | { |
| 439 | - $this->_urlFormat = TPropertyValue::ensureEnum($value, 'Prado\\Web\\THttpRequestUrlFormat'); |
|
| 439 | + $this->_urlFormat=TPropertyValue::ensureEnum($value, 'Prado\\Web\\THttpRequestUrlFormat'); |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | /** |
@@ -453,8 +453,8 @@ discard block |
||
| 453 | 453 | */ |
| 454 | 454 | public function setUrlParamSeparator($value) |
| 455 | 455 | { |
| 456 | - if(strlen($value) === 1) |
|
| 457 | - $this->_separator = $value; |
|
| 456 | + if(strlen($value)===1) |
|
| 457 | + $this->_separator=$value; |
|
| 458 | 458 | else |
| 459 | 459 | throw new TInvalidDataValueException('httprequest_separator_invalid'); |
| 460 | 460 | } |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | */ |
| 475 | 475 | public function setSecureConnection($value) |
| 476 | 476 | { |
| 477 | - $this->_secureConnection = TPropertyValue::ensureEnum($value, 'Prado\\Web\\TUrlMappingPatternSecureConnection'); |
|
| 477 | + $this->_secureConnection=TPropertyValue::ensureEnum($value, 'Prado\\Web\\TUrlMappingPatternSecureConnection'); |
|
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 | /** |
@@ -484,9 +484,9 @@ discard block |
||
| 484 | 484 | */ |
| 485 | 485 | public function supportCustomUrl($getItems) |
| 486 | 486 | { |
| 487 | - if(!$this->_customUrl || $this->getPattern() === null) |
|
| 487 | + if(!$this->_customUrl || $this->getPattern()===null) |
|
| 488 | 488 | return false; |
| 489 | - if ($this->_parameters) |
|
| 489 | + if($this->_parameters) |
|
| 490 | 490 | { |
| 491 | 491 | foreach($this->_parameters as $key => $value) |
| 492 | 492 | { |
@@ -495,13 +495,13 @@ discard block |
||
| 495 | 495 | } |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | - if ($this->_constants) |
|
| 498 | + if($this->_constants) |
|
| 499 | 499 | { |
| 500 | 500 | foreach($this->_constants->toArray() as $key => $value) |
| 501 | 501 | { |
| 502 | - if (!isset($getItems[$key])) |
|
| 502 | + if(!isset($getItems[$key])) |
|
| 503 | 503 | return false; |
| 504 | - if ($getItems[$key] != $value) |
|
| 504 | + if($getItems[$key]!=$value) |
|
| 505 | 505 | return false; |
| 506 | 506 | } |
| 507 | 507 | } |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | */ |
| 519 | 519 | public function constructUrl($getItems, $encodeAmpersand, $encodeGetItems) |
| 520 | 520 | { |
| 521 | - if ($this->_constants) |
|
| 521 | + if($this->_constants) |
|
| 522 | 522 | { |
| 523 | 523 | foreach($this->_constants->toArray() as $key => $value) |
| 524 | 524 | { |
@@ -526,42 +526,42 @@ discard block |
||
| 526 | 526 | } |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | - $extra = []; |
|
| 530 | - $replace = []; |
|
| 529 | + $extra=[]; |
|
| 530 | + $replace=[]; |
|
| 531 | 531 | // for the GET variables matching the pattern, put them in the URL path |
| 532 | 532 | foreach($getItems as $key => $value) |
| 533 | 533 | { |
| 534 | - if(($this->_parameters && $this->_parameters->contains($key)) || ($key === '*' && $this->getIsWildCardPattern())) |
|
| 535 | - $replace['{' . $key . '}'] = $encodeGetItems ? rawurlencode($value) : $value; |
|
| 534 | + if(($this->_parameters && $this->_parameters->contains($key)) || ($key==='*' && $this->getIsWildCardPattern())) |
|
| 535 | + $replace['{'.$key.'}']=$encodeGetItems ? rawurlencode($value) : $value; |
|
| 536 | 536 | else |
| 537 | - $extra[$key] = $value; |
|
| 537 | + $extra[$key]=$value; |
|
| 538 | 538 | } |
| 539 | 539 | |
| 540 | - $url = $this->_manager->getUrlPrefix() . '/' . ltrim(strtr($this->getPattern(), $replace), '/'); |
|
| 540 | + $url=$this->_manager->getUrlPrefix().'/'.ltrim(strtr($this->getPattern(), $replace), '/'); |
|
| 541 | 541 | |
| 542 | 542 | // for the rest of the GET variables, put them in the query string |
| 543 | 543 | if(count($extra) > 0) |
| 544 | 544 | { |
| 545 | - if ($this->_urlFormat === THttpRequestUrlFormat::Path && $this->getIsWildCardPattern()) { |
|
| 546 | - foreach ($extra as $name => $value) |
|
| 547 | - $url .= '/' . $name . $this->_separator . ($encodeGetItems?rawurlencode($value):$value); |
|
| 545 | + if($this->_urlFormat===THttpRequestUrlFormat::Path && $this->getIsWildCardPattern()) { |
|
| 546 | + foreach($extra as $name => $value) |
|
| 547 | + $url.='/'.$name.$this->_separator.($encodeGetItems ?rawurlencode($value) : $value); |
|
| 548 | 548 | return $url; |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | - $url2 = ''; |
|
| 552 | - $amp = $encodeAmpersand?'&':'&'; |
|
| 551 | + $url2=''; |
|
| 552 | + $amp=$encodeAmpersand ? '&' : '&'; |
|
| 553 | 553 | if($encodeGetItems) |
| 554 | 554 | { |
| 555 | 555 | foreach($extra as $name => $value) |
| 556 | 556 | { |
| 557 | 557 | if(is_array($value)) |
| 558 | 558 | { |
| 559 | - $name = rawurlencode($name . '[]'); |
|
| 559 | + $name=rawurlencode($name.'[]'); |
|
| 560 | 560 | foreach($value as $v) |
| 561 | - $url2 .= $amp . $name . '=' . rawurlencode($v); |
|
| 561 | + $url2.=$amp.$name.'='.rawurlencode($v); |
|
| 562 | 562 | } |
| 563 | 563 | else |
| 564 | - $url2 .= $amp . rawurlencode($name) . '=' . rawurlencode($value); |
|
| 564 | + $url2.=$amp.rawurlencode($name).'='.rawurlencode($value); |
|
| 565 | 565 | } |
| 566 | 566 | } |
| 567 | 567 | else |
@@ -571,13 +571,13 @@ discard block |
||
| 571 | 571 | if(is_array($value)) |
| 572 | 572 | { |
| 573 | 573 | foreach($value as $v) |
| 574 | - $url2 .= $amp . $name . '[]=' . $v; |
|
| 574 | + $url2.=$amp.$name.'[]='.$v; |
|
| 575 | 575 | } |
| 576 | 576 | else |
| 577 | - $url2 .= $amp . $name . '=' . $value; |
|
| 577 | + $url2.=$amp.$name.'='.$value; |
|
| 578 | 578 | } |
| 579 | 579 | } |
| 580 | - $url = $url . '?' . substr($url2, strlen($amp)); |
|
| 580 | + $url=$url.'?'.substr($url2, strlen($amp)); |
|
| 581 | 581 | } |
| 582 | 582 | return $this -> applySecureConnectionPrefix($url); |
| 583 | 583 | } |
@@ -593,26 +593,26 @@ discard block |
||
| 593 | 593 | protected function applySecureConnectionPrefix($url) |
| 594 | 594 | { |
| 595 | 595 | static $request; |
| 596 | - if($request === null) $request = Prado::getApplication() -> getRequest(); |
|
| 596 | + if($request===null) $request=Prado::getApplication() -> getRequest(); |
|
| 597 | 597 | |
| 598 | 598 | static $isSecureConnection; |
| 599 | - if($isSecureConnection === null) $isSecureConnection = $request -> getIsSecureConnection(); |
|
| 599 | + if($isSecureConnection===null) $isSecureConnection=$request -> getIsSecureConnection(); |
|
| 600 | 600 | |
| 601 | 601 | switch($this -> getSecureConnection()) |
| 602 | 602 | { |
| 603 | 603 | case TUrlMappingPatternSecureConnection::EnableIfNotSecure: |
| 604 | 604 | if($isSecureConnection) return $url; |
| 605 | - return $request -> getBaseUrl(true) . $url; |
|
| 605 | + return $request -> getBaseUrl(true).$url; |
|
| 606 | 606 | break; |
| 607 | 607 | case TUrlMappingPatternSecureConnection::DisableIfSecure: |
| 608 | 608 | if(!$isSecureConnection) return $url; |
| 609 | - return $request -> getBaseUrl(false) . $url; |
|
| 609 | + return $request -> getBaseUrl(false).$url; |
|
| 610 | 610 | break; |
| 611 | 611 | case TUrlMappingPatternSecureConnection::Enable: |
| 612 | - return $request -> getBaseUrl(true) . $url; |
|
| 612 | + return $request -> getBaseUrl(true).$url; |
|
| 613 | 613 | break; |
| 614 | 614 | case TUrlMappingPatternSecureConnection::Disable: |
| 615 | - return $request -> getBaseUrl(false) . $url; |
|
| 615 | + return $request -> getBaseUrl(false).$url; |
|
| 616 | 616 | break; |
| 617 | 617 | case TUrlMappingPatternSecureConnection::Automatic: |
| 618 | 618 | default: |
@@ -364,10 +364,10 @@ discard block |
||
| 364 | 364 | $params = explode('/', $matches['urlparams']); |
| 365 | 365 | if ($this->_separator === '/') |
| 366 | 366 | { |
| 367 | - while($key = array_shift($params)) |
|
| 368 | - $matches[$key] = ($value = array_shift($params)) ? $value : ''; |
|
| 369 | - } |
|
| 370 | - else |
|
| 367 | + while($key = array_shift($params)) { |
|
| 368 | + $matches[$key] = ($value = array_shift($params)) ? $value : ''; |
|
| 369 | + } |
|
| 370 | + } else |
|
| 371 | 371 | { |
| 372 | 372 | array_pop($params); |
| 373 | 373 | foreach($params as $param) |
@@ -559,12 +559,10 @@ discard block |
||
| 559 | 559 | $name = rawurlencode($name . '[]'); |
| 560 | 560 | foreach($value as $v) |
| 561 | 561 | $url2 .= $amp . $name . '=' . rawurlencode($v); |
| 562 | - } |
|
| 563 | - else |
|
| 562 | + } else |
|
| 564 | 563 | $url2 .= $amp . rawurlencode($name) . '=' . rawurlencode($value); |
| 565 | 564 | } |
| 566 | - } |
|
| 567 | - else |
|
| 565 | + } else |
|
| 568 | 566 | { |
| 569 | 567 | foreach($extra as $name => $value) |
| 570 | 568 | { |
@@ -572,8 +570,7 @@ discard block |
||
| 572 | 570 | { |
| 573 | 571 | foreach($value as $v) |
| 574 | 572 | $url2 .= $amp . $name . '[]=' . $v; |
| 575 | - } |
|
| 576 | - else |
|
| 573 | + } else |
|
| 577 | 574 | $url2 .= $amp . $name . '=' . $value; |
| 578 | 575 | } |
| 579 | 576 | } |
@@ -28,6 +28,7 @@ |
||
| 28 | 28 | * appropriate event(s) (e.g. OnClick, OnCommand) indicating the component |
| 29 | 29 | * is responsible for the callback event. |
| 30 | 30 | * @param TCallbackEventParameter the parameter associated with the callback event |
| 31 | + * @return void |
|
| 31 | 32 | */ |
| 32 | 33 | public function raiseCallbackEvent($eventArgument); |
| 33 | 34 | } |
| 34 | 35 | \ No newline at end of file |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | 89 | * Creates a control used for repetition (used as a template). |
| 90 | - * @return TControl the control to be repeated |
|
| 90 | + * @return TActiveCheckBoxListItem the control to be repeated |
|
| 91 | 91 | */ |
| 92 | 92 | protected function createRepeatedControl() |
| 93 | 93 | { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * updated later. |
| 73 | 73 | *@return boolean always true |
| 74 | 74 | */ |
| 75 | - protected function getSpanNeeded () |
|
| 75 | + protected function getSpanNeeded() |
|
| 76 | 76 | { |
| 77 | 77 | return true; |
| 78 | 78 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | protected function createRepeatedControl() |
| 93 | 93 | { |
| 94 | - $control = new TActiveCheckBoxListItem; |
|
| 94 | + $control=new TActiveCheckBoxListItem; |
|
| 95 | 95 | $control->getAdapter()->setBaseActiveControl($this->getActiveControl()); |
| 96 | 96 | return $control; |
| 97 | 97 | } |
@@ -252,7 +252,7 @@ |
||
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | /** |
| 255 | - * @return boolean true to observe changes. |
|
| 255 | + * @return boolean|string true to observe changes. |
|
| 256 | 256 | */ |
| 257 | 257 | public function getObserveChanges() |
| 258 | 258 | { |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | */ |
| 90 | 90 | public function getObserveChanges() |
| 91 | 91 | { |
| 92 | - $changes = $this->getOption('ObserveChanges'); |
|
| 93 | - return ($changes === null) ? true : $changes; |
|
| 92 | + $changes=$this->getOption('ObserveChanges'); |
|
| 93 | + return ($changes===null) ? true : $changes; |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | \ No newline at end of file |
@@ -233,6 +233,8 @@ |
||
| 233 | 233 | |
| 234 | 234 | /** |
| 235 | 235 | * Appends data or javascript code to the body content surrounded with delimiters |
| 236 | + * @param \Prado\Web\THttpResponse $response |
|
| 237 | + * @param string $delimiter |
|
| 236 | 238 | */ |
| 237 | 239 | private function appendContentPart($response, $delimiter, $data) |
| 238 | 240 | { |
@@ -256,14 +256,12 @@ |
||
| 256 | 256 | $param = $this->getCallbackEventParameter(); |
| 257 | 257 | $result = new TCallbackEventParameter($this->getResponse(), $param); |
| 258 | 258 | $callbackHandler->raiseCallbackEvent($result); |
| 259 | - } |
|
| 260 | - else |
|
| 259 | + } else |
|
| 261 | 260 | { |
| 262 | 261 | throw new TInvalidCallbackException( |
| 263 | 262 | 'callback_invalid_handler', $callbackHandler->getUniqueID()); |
| 264 | 263 | } |
| 265 | - } |
|
| 266 | - else |
|
| 264 | + } else |
|
| 267 | 265 | { |
| 268 | 266 | $target = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_TARGET); |
| 269 | 267 | throw new TInvalidCallbackException('callback_invalid_target', $target); |
@@ -37,40 +37,40 @@ discard block |
||
| 37 | 37 | /** |
| 38 | 38 | * Callback response data header name. |
| 39 | 39 | */ |
| 40 | - const CALLBACK_DATA_HEADER = 'X-PRADO-DATA'; |
|
| 40 | + const CALLBACK_DATA_HEADER='X-PRADO-DATA'; |
|
| 41 | 41 | /** |
| 42 | 42 | * Callback response client-side action header name. |
| 43 | 43 | */ |
| 44 | - const CALLBACK_ACTION_HEADER = 'X-PRADO-ACTIONS'; |
|
| 44 | + const CALLBACK_ACTION_HEADER='X-PRADO-ACTIONS'; |
|
| 45 | 45 | /** |
| 46 | 46 | * Callback error header name. |
| 47 | 47 | */ |
| 48 | - const CALLBACK_ERROR_HEADER = 'X-PRADO-ERROR'; |
|
| 48 | + const CALLBACK_ERROR_HEADER='X-PRADO-ERROR'; |
|
| 49 | 49 | /** |
| 50 | 50 | * Callback page state header name. |
| 51 | 51 | */ |
| 52 | - const CALLBACK_PAGESTATE_HEADER = 'X-PRADO-PAGESTATE'; |
|
| 52 | + const CALLBACK_PAGESTATE_HEADER='X-PRADO-PAGESTATE'; |
|
| 53 | 53 | /** |
| 54 | 54 | * Script list header name. |
| 55 | 55 | */ |
| 56 | - const CALLBACK_SCRIPTLIST_HEADER = 'X-PRADO-SCRIPTLIST'; |
|
| 56 | + const CALLBACK_SCRIPTLIST_HEADER='X-PRADO-SCRIPTLIST'; |
|
| 57 | 57 | /** |
| 58 | 58 | * Stylesheet list header name. |
| 59 | 59 | */ |
| 60 | - const CALLBACK_STYLESHEETLIST_HEADER = 'X-PRADO-STYLESHEETLIST'; |
|
| 60 | + const CALLBACK_STYLESHEETLIST_HEADER='X-PRADO-STYLESHEETLIST'; |
|
| 61 | 61 | /** |
| 62 | 62 | * Stylesheet header name. |
| 63 | 63 | */ |
| 64 | - const CALLBACK_STYLESHEET_HEADER = 'X-PRADO-STYLESHEET'; |
|
| 64 | + const CALLBACK_STYLESHEET_HEADER='X-PRADO-STYLESHEET'; |
|
| 65 | 65 | /** |
| 66 | 66 | * Hidden field list header name. |
| 67 | 67 | */ |
| 68 | - const CALLBACK_HIDDENFIELDLIST_HEADER = 'X-PRADO-HIDDENFIELDLIST'; |
|
| 68 | + const CALLBACK_HIDDENFIELDLIST_HEADER='X-PRADO-HIDDENFIELDLIST'; |
|
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * Callback redirect url header name. |
| 72 | 72 | */ |
| 73 | - const CALLBACK_REDIRECT = 'X-PRADO-REDIRECT'; |
|
| 73 | + const CALLBACK_REDIRECT='X-PRADO-REDIRECT'; |
|
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | 76 | * @var ICallbackEventHandler callback event handler. |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | private $_callbackClient; |
| 87 | 87 | |
| 88 | - private $_controlsToRender = []; |
|
| 88 | + private $_controlsToRender=[]; |
|
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * Constructor, trap errors and exception to let the callback response |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | parent::__construct($control); |
| 97 | 97 | |
| 98 | 98 | //TODO: can this be done later? |
| 99 | - $response = $this->getApplication()->getResponse(); |
|
| 99 | + $response=$this->getApplication()->getResponse(); |
|
| 100 | 100 | $response->setAdapter(new TCallbackResponseAdapter($response)); |
| 101 | 101 | |
| 102 | 102 | $this->trapCallbackErrorsExceptions(); |
@@ -119,9 +119,9 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public function registerControlToRender($control, $writer) |
| 121 | 121 | { |
| 122 | - $id = $control->getUniqueID(); |
|
| 122 | + $id=$control->getUniqueID(); |
|
| 123 | 123 | if(!isset($this->_controlsToRender[$id])) |
| 124 | - $this->_controlsToRender[$id] = [$control,$writer]; |
|
| 124 | + $this->_controlsToRender[$id]=[$control, $writer]; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | public function renderCallbackResponse($writer) |
| 140 | 140 | { |
| 141 | 141 | Prado::trace("ActivePage renderCallbackResponse()", 'Prado\Web\UI\ActiveControls\TActivePageAdapter'); |
| 142 | - if(($url = $this->getResponse()->getAdapter()->getRedirectedUrl()) === null) |
|
| 142 | + if(($url=$this->getResponse()->getAdapter()->getRedirectedUrl())===null) |
|
| 143 | 143 | $this->renderResponse($writer); |
| 144 | 144 | else |
| 145 | 145 | $this->redirect($url); |
@@ -167,26 +167,26 @@ discard block |
||
| 167 | 167 | foreach($this->_controlsToRender as $rid => $forRender) |
| 168 | 168 | $forRender[0]->render($forRender[1]); |
| 169 | 169 | |
| 170 | - $response = $this->getResponse(); |
|
| 170 | + $response=$this->getResponse(); |
|
| 171 | 171 | |
| 172 | 172 | //send response data in header |
| 173 | 173 | if($response->getHasAdapter()) |
| 174 | 174 | { |
| 175 | - $responseData = $response->getAdapter()->getResponseData(); |
|
| 176 | - if($responseData !== null) |
|
| 175 | + $responseData=$response->getAdapter()->getResponseData(); |
|
| 176 | + if($responseData!==null) |
|
| 177 | 177 | { |
| 178 | - $data = TJavaScript::jsonEncode($responseData); |
|
| 178 | + $data=TJavaScript::jsonEncode($responseData); |
|
| 179 | 179 | |
| 180 | 180 | $this->appendContentPart($response, self::CALLBACK_DATA_HEADER, $data); |
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | //sends page state in header |
| 185 | - if(($handler = $this->getCallbackEventTarget()) !== null) |
|
| 185 | + if(($handler=$this->getCallbackEventTarget())!==null) |
|
| 186 | 186 | { |
| 187 | 187 | if($handler->getActiveControl()->getClientSide()->getEnablePageStateUpdate()) |
| 188 | 188 | { |
| 189 | - $pagestate = $this->getPage()->getClientState(); |
|
| 189 | + $pagestate=$this->getPage()->getClientState(); |
|
| 190 | 190 | $this->appendContentPart($response, self::CALLBACK_PAGESTATE_HEADER, $pagestate); |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -197,37 +197,37 @@ discard block |
||
| 197 | 197 | //output the end javascript |
| 198 | 198 | if($this->getPage()->getClientScript()->hasEndScripts()) |
| 199 | 199 | { |
| 200 | - $writer = $response->createHtmlWriter(); |
|
| 200 | + $writer=$response->createHtmlWriter(); |
|
| 201 | 201 | $this->getPage()->getClientScript()->renderEndScriptsCallback($writer); |
| 202 | 202 | $this->getPage()->getCallbackClient()->evaluateScript($writer); |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | //output the actions |
| 206 | - $executeJavascript = $this->getCallbackClientHandler()->getClientFunctionsToExecute(); |
|
| 207 | - $actions = TJavaScript::jsonEncode($executeJavascript); |
|
| 206 | + $executeJavascript=$this->getCallbackClientHandler()->getClientFunctionsToExecute(); |
|
| 207 | + $actions=TJavaScript::jsonEncode($executeJavascript); |
|
| 208 | 208 | $this->appendContentPart($response, self::CALLBACK_ACTION_HEADER, $actions); |
| 209 | 209 | |
| 210 | 210 | |
| 211 | - $cs = $this->Page->getClientScript(); |
|
| 211 | + $cs=$this->Page->getClientScript(); |
|
| 212 | 212 | |
| 213 | 213 | // collect all stylesheet file references |
| 214 | - $stylesheets = $cs->getStyleSheetUrls(); |
|
| 215 | - if (count($stylesheets) > 0) |
|
| 214 | + $stylesheets=$cs->getStyleSheetUrls(); |
|
| 215 | + if(count($stylesheets) > 0) |
|
| 216 | 216 | $this->appendContentPart($response, self::CALLBACK_STYLESHEETLIST_HEADER, TJavaScript::jsonEncode($stylesheets)); |
| 217 | 217 | |
| 218 | 218 | // collect all stylesheet snippets references |
| 219 | - $stylesheets = $cs->getStyleSheetCodes(); |
|
| 220 | - if (count($stylesheets) > 0) |
|
| 219 | + $stylesheets=$cs->getStyleSheetCodes(); |
|
| 220 | + if(count($stylesheets) > 0) |
|
| 221 | 221 | $this->appendContentPart($response, self::CALLBACK_STYLESHEET_HEADER, TJavaScript::jsonEncode($stylesheets)); |
| 222 | 222 | |
| 223 | 223 | // collect all script file references |
| 224 | - $scripts = $cs->getScriptUrls(); |
|
| 225 | - if (count($scripts) > 0) |
|
| 224 | + $scripts=$cs->getScriptUrls(); |
|
| 225 | + if(count($scripts) > 0) |
|
| 226 | 226 | $this->appendContentPart($response, self::CALLBACK_SCRIPTLIST_HEADER, TJavaScript::jsonEncode($scripts)); |
| 227 | 227 | |
| 228 | 228 | // collect all hidden field references |
| 229 | - $fields = $cs->getHiddenFields(); |
|
| 230 | - if (count($fields) > 0) |
|
| 229 | + $fields=$cs->getHiddenFields(); |
|
| 230 | + if(count($fields) > 0) |
|
| 231 | 231 | $this->appendContentPart($response, self::CALLBACK_HIDDENFIELDLIST_HEADER, TJavaScript::jsonEncode($fields)); |
| 232 | 232 | } |
| 233 | 233 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | private function appendContentPart($response, $delimiter, $data) |
| 238 | 238 | { |
| 239 | - $content = $response->createHtmlWriter(); |
|
| 239 | + $content=$response->createHtmlWriter(); |
|
| 240 | 240 | $content->getWriter()->setBoundary($delimiter); |
| 241 | 241 | $content->write($data); |
| 242 | 242 | } |
@@ -249,12 +249,12 @@ discard block |
||
| 249 | 249 | */ |
| 250 | 250 | private function raiseCallbackEvent() |
| 251 | 251 | { |
| 252 | - if(($callbackHandler = $this->getCallbackEventTarget()) !== null) |
|
| 252 | + if(($callbackHandler=$this->getCallbackEventTarget())!==null) |
|
| 253 | 253 | { |
| 254 | 254 | if($callbackHandler instanceof ICallbackEventHandler) |
| 255 | 255 | { |
| 256 | - $param = $this->getCallbackEventParameter(); |
|
| 257 | - $result = new TCallbackEventParameter($this->getResponse(), $param); |
|
| 256 | + $param=$this->getCallbackEventParameter(); |
|
| 257 | + $result=new TCallbackEventParameter($this->getResponse(), $param); |
|
| 258 | 258 | $callbackHandler->raiseCallbackEvent($result); |
| 259 | 259 | } |
| 260 | 260 | else |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | } |
| 266 | 266 | else |
| 267 | 267 | { |
| 268 | - $target = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_TARGET); |
|
| 268 | + $target=$this->getRequest()->itemAt(TPage::FIELD_CALLBACK_TARGET); |
|
| 269 | 269 | throw new TInvalidCallbackException('callback_invalid_target', $target); |
| 270 | 270 | } |
| 271 | 271 | } |
@@ -276,11 +276,11 @@ discard block |
||
| 276 | 276 | */ |
| 277 | 277 | public function getCallbackEventTarget() |
| 278 | 278 | { |
| 279 | - if($this->_callbackEventTarget === null) |
|
| 279 | + if($this->_callbackEventTarget===null) |
|
| 280 | 280 | { |
| 281 | - $eventTarget = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_TARGET); |
|
| 281 | + $eventTarget=$this->getRequest()->itemAt(TPage::FIELD_CALLBACK_TARGET); |
|
| 282 | 282 | if(!empty($eventTarget)) |
| 283 | - $this->_callbackEventTarget = $this->getPage()->findControl($eventTarget); |
|
| 283 | + $this->_callbackEventTarget=$this->getPage()->findControl($eventTarget); |
|
| 284 | 284 | } |
| 285 | 285 | return $this->_callbackEventTarget; |
| 286 | 286 | } |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | public function setCallbackEventTarget(TControl $control) |
| 293 | 293 | { |
| 294 | - $this->_callbackEventTarget = $control; |
|
| 294 | + $this->_callbackEventTarget=$control; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /** |
@@ -300,10 +300,10 @@ discard block |
||
| 300 | 300 | */ |
| 301 | 301 | public function getCallbackEventParameter() |
| 302 | 302 | { |
| 303 | - if($this->_callbackEventParameter === null) |
|
| 303 | + if($this->_callbackEventParameter===null) |
|
| 304 | 304 | { |
| 305 | - $param = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER); |
|
| 306 | - $this->_callbackEventParameter = $param; |
|
| 305 | + $param=$this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER); |
|
| 306 | + $this->_callbackEventParameter=$param; |
|
| 307 | 307 | } |
| 308 | 308 | return $this->_callbackEventParameter; |
| 309 | 309 | } |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | */ |
| 314 | 314 | public function setCallbackEventParameter($value) |
| 315 | 315 | { |
| 316 | - $this->_callbackEventParameter = $value; |
|
| 316 | + $this->_callbackEventParameter=$value; |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /** |
@@ -323,8 +323,8 @@ discard block |
||
| 323 | 323 | */ |
| 324 | 324 | public function getCallbackClientHandler() |
| 325 | 325 | { |
| 326 | - if($this->_callbackClient === null) |
|
| 327 | - $this->_callbackClient = new TCallbackClientScript; |
|
| 326 | + if($this->_callbackClient===null) |
|
| 327 | + $this->_callbackClient=new TCallbackClientScript; |
|
| 328 | 328 | return $this->_callbackClient; |
| 329 | 329 | } |
| 330 | 330 | } |
| 331 | 331 | \ No newline at end of file |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * Creates a control used for repetition (used as a template). |
| 79 | - * @return TControl the control to be repeated |
|
| 79 | + * @return TActiveRadioButtonItem the control to be repeated |
|
| 80 | 80 | */ |
| 81 | 81 | protected function createRepeatedControl() |
| 82 | 82 | { |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | */ |
| 81 | 81 | protected function createRepeatedControl() |
| 82 | 82 | { |
| 83 | - $control = new TActiveRadioButtonItem; |
|
| 83 | + $control=new TActiveRadioButtonItem; |
|
| 84 | 84 | $control->getAdapter()->setBaseActiveControl($this->getActiveControl()); |
| 85 | 85 | return $control; |
| 86 | 86 | } |