@@ -16,36 +16,36 @@ |
||
16 | 16 | |
17 | 17 | public function generate($sender) |
18 | 18 | { |
19 | - if ($this->IsValid) |
|
19 | + if($this->IsValid) |
|
20 | 20 | { |
21 | - $tableName = $this->table_name->Text; |
|
22 | - $outputFolderNs = $this->output_folder->Text; |
|
23 | - $classPrefix = $this->class_prefix->Text; |
|
24 | - $classSuffix = $this->class_suffix->Text; |
|
21 | + $tableName=$this->table_name->Text; |
|
22 | + $outputFolderNs=$this->output_folder->Text; |
|
23 | + $classPrefix=$this->class_prefix->Text; |
|
24 | + $classSuffix=$this->class_suffix->Text; |
|
25 | 25 | |
26 | 26 | try |
27 | 27 | { |
28 | - $ar_generator = new TWsatARGenerator(); |
|
28 | + $ar_generator=new TWsatARGenerator(); |
|
29 | 29 | $ar_generator->setOpFile($outputFolderNs); |
30 | 30 | $ar_generator->setClasPrefix($classPrefix); |
31 | 31 | $ar_generator->setClassSufix($classSuffix); |
32 | 32 | |
33 | - if ($this->build_rel->Checked) |
|
33 | + if($this->build_rel->Checked) |
|
34 | 34 | $ar_generator->buildRelations(); |
35 | 35 | |
36 | - if ($tableName != "*") |
|
36 | + if($tableName!="*") |
|
37 | 37 | $ar_generator->generate($tableName); |
38 | 38 | else |
39 | 39 | $ar_generator->generateAll(); |
40 | 40 | |
41 | - $this->feedback_panel->CssClass = "green_panel"; |
|
42 | - $this->generation_msg->Text = "The code has been generated successfully."; |
|
43 | - } catch (Exception $ex) |
|
41 | + $this->feedback_panel->CssClass="green_panel"; |
|
42 | + $this->generation_msg->Text="The code has been generated successfully."; |
|
43 | + } catch(Exception $ex) |
|
44 | 44 | { |
45 | - $this->feedback_panel->CssClass = "red_panel"; |
|
46 | - $this->generation_msg->Text = $ex->getMessage(); |
|
45 | + $this->feedback_panel->CssClass="red_panel"; |
|
46 | + $this->generation_msg->Text=$ex->getMessage(); |
|
47 | 47 | } |
48 | - $this->feedback_panel->Visible = true; |
|
48 | + $this->feedback_panel->Visible=true; |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 |
@@ -21,44 +21,44 @@ |
||
21 | 21 | class TWsatGenerateAR extends TPage |
22 | 22 | { |
23 | 23 | |
24 | - public function generate($sender) |
|
25 | - { |
|
26 | - if ($this->IsValid) |
|
27 | - { |
|
28 | - $tableName = $this->table_name->Text; |
|
29 | - $outputFolderNs = $this->output_folder->Text; |
|
30 | - $classPrefix = $this->class_prefix->Text; |
|
31 | - $classSuffix = $this->class_suffix->Text; |
|
24 | + public function generate($sender) |
|
25 | + { |
|
26 | + if ($this->IsValid) |
|
27 | + { |
|
28 | + $tableName = $this->table_name->Text; |
|
29 | + $outputFolderNs = $this->output_folder->Text; |
|
30 | + $classPrefix = $this->class_prefix->Text; |
|
31 | + $classSuffix = $this->class_suffix->Text; |
|
32 | 32 | |
33 | - try |
|
34 | - { |
|
35 | - $ar_generator = new TWsatARGenerator(); |
|
36 | - $ar_generator->setOpFile($outputFolderNs); |
|
37 | - $ar_generator->setClasPrefix($classPrefix); |
|
38 | - $ar_generator->setClassSufix($classSuffix); |
|
33 | + try |
|
34 | + { |
|
35 | + $ar_generator = new TWsatARGenerator(); |
|
36 | + $ar_generator->setOpFile($outputFolderNs); |
|
37 | + $ar_generator->setClasPrefix($classPrefix); |
|
38 | + $ar_generator->setClassSufix($classSuffix); |
|
39 | 39 | |
40 | - if ($this->build_rel->Checked) |
|
41 | - $ar_generator->buildRelations(); |
|
40 | + if ($this->build_rel->Checked) |
|
41 | + $ar_generator->buildRelations(); |
|
42 | 42 | |
43 | - if ($tableName != "*") |
|
44 | - $ar_generator->generate($tableName); |
|
45 | - else |
|
46 | - $ar_generator->generateAll(); |
|
43 | + if ($tableName != "*") |
|
44 | + $ar_generator->generate($tableName); |
|
45 | + else |
|
46 | + $ar_generator->generateAll(); |
|
47 | 47 | |
48 | - $this->feedback_panel->CssClass = "green_panel"; |
|
49 | - $this->generation_msg->Text = "The code has been generated successfully."; |
|
50 | - } catch (Exception $ex) |
|
51 | - { |
|
52 | - $this->feedback_panel->CssClass = "red_panel"; |
|
53 | - $this->generation_msg->Text = $ex->getMessage(); |
|
54 | - } |
|
55 | - $this->feedback_panel->Visible = true; |
|
56 | - } |
|
57 | - } |
|
48 | + $this->feedback_panel->CssClass = "green_panel"; |
|
49 | + $this->generation_msg->Text = "The code has been generated successfully."; |
|
50 | + } catch (Exception $ex) |
|
51 | + { |
|
52 | + $this->feedback_panel->CssClass = "red_panel"; |
|
53 | + $this->generation_msg->Text = $ex->getMessage(); |
|
54 | + } |
|
55 | + $this->feedback_panel->Visible = true; |
|
56 | + } |
|
57 | + } |
|
58 | 58 | |
59 | - public function preview($sender) |
|
60 | - { |
|
61 | - throw new THttpException(500, "Not implemented yet."); |
|
62 | - } |
|
59 | + public function preview($sender) |
|
60 | + { |
|
61 | + throw new THttpException(500, "Not implemented yet."); |
|
62 | + } |
|
63 | 63 | |
64 | 64 | } |
65 | 65 | \ No newline at end of file |
@@ -171,8 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | return '{'.$results.'}'; |
174 | - } |
|
175 | - else |
|
174 | + } else |
|
176 | 175 | { |
177 | 176 | foreach($value as $v) |
178 | 177 | { |
@@ -185,8 +184,7 @@ discard block |
||
185 | 184 | } |
186 | 185 | return '['.$results.']'; |
187 | 186 | } |
188 | - } |
|
189 | - else if(is_integer($value)) |
|
187 | + } else if(is_integer($value)) |
|
190 | 188 | return "$value"; |
191 | 189 | else if(is_float($value)) |
192 | 190 | { |
@@ -206,8 +204,7 @@ discard block |
||
206 | 204 | return str_replace($locale['decimal_point'], '.', "$value"); |
207 | 205 | break; |
208 | 206 | } |
209 | - } |
|
210 | - else if(is_object($value)) |
|
207 | + } else if(is_object($value)) |
|
211 | 208 | if ($value instanceof TJavaScriptLiteral) |
212 | 209 | return $value->toJavaScriptLiteral(); |
213 | 210 | else |
@@ -77,6 +77,7 @@ discard block |
||
77 | 77 | /** |
78 | 78 | * Renders javascript block |
79 | 79 | * @param string javascript block |
80 | + * @param string $script |
|
80 | 81 | * @return string rendering result |
81 | 82 | */ |
82 | 83 | public static function renderScriptBlock($script) |
@@ -97,7 +98,7 @@ discard block |
||
97 | 98 | } |
98 | 99 | |
99 | 100 | /** |
100 | - * @return Marks a string as a javascript function. Once marke, the string is considered as a |
|
101 | + * @return TJavaScriptLiteral a string as a javascript function. Once marke, the string is considered as a |
|
101 | 102 | * raw javascript function that is not supposed to be encoded by {@link encode} |
102 | 103 | */ |
103 | 104 | public static function quoteJsLiteral($js) |
@@ -260,6 +261,7 @@ discard block |
||
260 | 261 | * @param string string to be decoded |
261 | 262 | * @param bool whether to convert returned objects to associative arrays |
262 | 263 | * @param int recursion depth |
264 | + * @param string $value |
|
263 | 265 | * @return mixed decoded variable |
264 | 266 | */ |
265 | 267 | public static function jsonDecode($value, $assoc = false, $depth = 512) |
@@ -302,7 +304,8 @@ discard block |
||
302 | 304 | * Minimize the size of a javascript script. |
303 | 305 | * This method is based on Douglas Crockford's JSMin. |
304 | 306 | * @param string code that you want to minimzie |
305 | - * @return minimized version of the code |
|
307 | + * @param string $code |
|
308 | + * @return string version of the code |
|
306 | 309 | */ |
307 | 310 | public static function JSMin($code) |
308 | 311 | { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | { |
35 | 35 | $str=''; |
36 | 36 | foreach($files as $file) |
37 | - $str.= self::renderScriptFile($file); |
|
37 | + $str.=self::renderScriptFile($file); |
|
38 | 38 | return $str; |
39 | 39 | } |
40 | 40 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public static function renderScriptBlocks($scripts) |
57 | 57 | { |
58 | 58 | if(count($scripts)) |
59 | - return "<script type=\"text/javascript\">\n/*<![CDATA[*/\n".implode("\n",$scripts)."\n/*]]>*/\n</script>\n"; |
|
59 | + return "<script type=\"text/javascript\">\n/*<![CDATA[*/\n".implode("\n", $scripts)."\n/*]]>*/\n</script>\n"; |
|
60 | 60 | else |
61 | 61 | return ''; |
62 | 62 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | public static function renderScriptBlocksCallback($scripts) |
70 | 70 | { |
71 | 71 | if(count($scripts)) |
72 | - return implode("\n",$scripts)."\n"; |
|
72 | + return implode("\n", $scripts)."\n"; |
|
73 | 73 | else |
74 | 74 | return ''; |
75 | 75 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public static function quoteString($js) |
95 | 95 | { |
96 | - return self::jsonEncode($js,JSON_HEX_QUOT | JSON_HEX_APOS | JSON_HEX_TAG); |
|
96 | + return self::jsonEncode($js, JSON_HEX_QUOT | JSON_HEX_APOS | JSON_HEX_TAG); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -154,16 +154,16 @@ discard block |
||
154 | 154 | * @param boolean wether to encode empty strings too. Default to false for BC. |
155 | 155 | * @return string the encoded string |
156 | 156 | */ |
157 | - public static function encode($value,$toMap=true,$encodeEmptyStrings=false) |
|
157 | + public static function encode($value, $toMap=true, $encodeEmptyStrings=false) |
|
158 | 158 | { |
159 | 159 | if(is_string($value)) |
160 | 160 | return self::quoteString($value); |
161 | 161 | else if(is_bool($value)) |
162 | - return $value?'true':'false'; |
|
162 | + return $value ? 'true' : 'false'; |
|
163 | 163 | else if(is_array($value)) |
164 | 164 | { |
165 | 165 | $results=''; |
166 | - if(($n=count($value))>0 && array_keys($value)!==range(0,$n-1)) |
|
166 | + if(($n=count($value)) > 0 && array_keys($value)!==range(0, $n - 1)) |
|
167 | 167 | { |
168 | 168 | foreach($value as $k=>$v) |
169 | 169 | { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | { |
172 | 172 | if($results!=='') |
173 | 173 | $results.=','; |
174 | - $results.="'$k':".self::encode($v,$toMap,$encodeEmptyStrings); |
|
174 | + $results.="'$k':".self::encode($v, $toMap, $encodeEmptyStrings); |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 | return '{'.$results.'}'; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | { |
185 | 185 | if($results!=='') |
186 | 186 | $results.=','; |
187 | - $results.=self::encode($v,$toMap, $encodeEmptyStrings); |
|
187 | + $results.=self::encode($v, $toMap, $encodeEmptyStrings); |
|
188 | 188 | } |
189 | 189 | } |
190 | 190 | return '['.$results.']'; |
@@ -212,10 +212,10 @@ discard block |
||
212 | 212 | } |
213 | 213 | } |
214 | 214 | else if(is_object($value)) |
215 | - if ($value instanceof TJavaScriptLiteral) |
|
215 | + if($value instanceof TJavaScriptLiteral) |
|
216 | 216 | return $value->toJavaScriptLiteral(); |
217 | 217 | else |
218 | - return self::encode(get_object_vars($value),$toMap); |
|
218 | + return self::encode(get_object_vars($value), $toMap); |
|
219 | 219 | else if($value===null) |
220 | 220 | return 'null'; |
221 | 221 | else |
@@ -227,14 +227,14 @@ discard block |
||
227 | 227 | * @param mixed variable to be encoded |
228 | 228 | * @return string encoded string |
229 | 229 | */ |
230 | - public static function jsonEncode($value, $options = 0) |
|
230 | + public static function jsonEncode($value, $options=0) |
|
231 | 231 | { |
232 | - if (($g=Prado::getApplication()->getGlobalization(false))!==null && |
|
232 | + if(($g=Prado::getApplication()->getGlobalization(false))!==null && |
|
233 | 233 | strtoupper($enc=$g->getCharset())!='UTF-8') { |
234 | 234 | self::convertToUtf8($value, $enc); |
235 | 235 | } |
236 | 236 | |
237 | - $s = @json_encode($value,$options); |
|
237 | + $s=@json_encode($value, $options); |
|
238 | 238 | self::checkJsonError(); |
239 | 239 | return $s; |
240 | 240 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | private static function convertToUtf8(&$value, $sourceEncoding) { |
248 | 248 | if(is_string($value)) |
249 | 249 | $value=iconv($sourceEncoding, 'UTF-8', $value); |
250 | - else if (is_array($value)) |
|
250 | + else if(is_array($value)) |
|
251 | 251 | { |
252 | 252 | foreach($value as &$element) |
253 | 253 | self::convertToUtf8($element, $sourceEncoding); |
@@ -262,37 +262,37 @@ discard block |
||
262 | 262 | * @param int recursion depth |
263 | 263 | * @return mixed decoded variable |
264 | 264 | */ |
265 | - public static function jsonDecode($value, $assoc = false, $depth = 512) |
|
265 | + public static function jsonDecode($value, $assoc=false, $depth=512) |
|
266 | 266 | { |
267 | - $s= @json_decode($value, $assoc, $depth); |
|
267 | + $s=@json_decode($value, $assoc, $depth); |
|
268 | 268 | self::checkJsonError(); |
269 | 269 | return $s; |
270 | 270 | } |
271 | 271 | |
272 | 272 | private static function checkJsonError() |
273 | 273 | { |
274 | - switch ($err = json_last_error()) |
|
274 | + switch($err=json_last_error()) |
|
275 | 275 | { |
276 | 276 | case JSON_ERROR_NONE: |
277 | 277 | return; |
278 | 278 | break; |
279 | 279 | case JSON_ERROR_DEPTH: |
280 | - $msg = 'Maximum stack depth exceeded'; |
|
280 | + $msg='Maximum stack depth exceeded'; |
|
281 | 281 | break; |
282 | 282 | case JSON_ERROR_STATE_MISMATCH: |
283 | - $msg = 'Underflow or the modes mismatch'; |
|
283 | + $msg='Underflow or the modes mismatch'; |
|
284 | 284 | break; |
285 | 285 | case JSON_ERROR_CTRL_CHAR: |
286 | - $msg = 'Unexpected control character found'; |
|
286 | + $msg='Unexpected control character found'; |
|
287 | 287 | break; |
288 | 288 | case JSON_ERROR_SYNTAX: |
289 | - $msg = 'Syntax error, malformed JSON'; |
|
289 | + $msg='Syntax error, malformed JSON'; |
|
290 | 290 | break; |
291 | 291 | case JSON_ERROR_UTF8: |
292 | - $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded'; |
|
292 | + $msg='Malformed UTF-8 characters, possibly incorrectly encoded'; |
|
293 | 293 | break; |
294 | 294 | default: |
295 | - $msg = 'Unknown error'; |
|
295 | + $msg='Unknown error'; |
|
296 | 296 | break; |
297 | 297 | } |
298 | 298 | throw new \Exception("JSON error ($err): $msg"); |
@@ -80,12 +80,10 @@ discard block |
||
80 | 80 | $name=urlencode($name.'[]'); |
81 | 81 | foreach($value as $v) |
82 | 82 | $url.=$amp.$name.'='.urlencode($v); |
83 | - } |
|
84 | - else |
|
83 | + } else |
|
85 | 84 | $url.=$amp.urlencode($name).'='.urlencode($value); |
86 | 85 | } |
87 | - } |
|
88 | - else |
|
86 | + } else |
|
89 | 87 | { |
90 | 88 | foreach($getItems as $name=>$value) |
91 | 89 | { |
@@ -93,8 +91,7 @@ discard block |
||
93 | 91 | { |
94 | 92 | foreach($value as $v) |
95 | 93 | $url.=$amp.$name.'[]='.$v; |
96 | - } |
|
97 | - else |
|
94 | + } else |
|
98 | 95 | $url.=$amp.$name.'='.$value; |
99 | 96 | } |
100 | 97 | } |
@@ -147,14 +144,12 @@ discard block |
||
147 | 144 | $getVariables[substr($name,0,$pos)][]=$value; |
148 | 145 | else |
149 | 146 | $getVariables[$name]=$value; |
150 | - } |
|
151 | - else |
|
147 | + } else |
|
152 | 148 | $getVariables[$path]=''; |
153 | 149 | } |
154 | 150 | } |
155 | 151 | return $getVariables; |
156 | - } |
|
157 | - else |
|
152 | + } else |
|
158 | 153 | return array(); |
159 | 154 | } |
160 | 155 | } |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | * @return string URL |
65 | 65 | * @see parseUrl |
66 | 66 | */ |
67 | - public function constructUrl($serviceID,$serviceParam,$getItems,$encodeAmpersand,$encodeGetItems) |
|
67 | + public function constructUrl($serviceID, $serviceParam, $getItems, $encodeAmpersand, $encodeGetItems) |
|
68 | 68 | { |
69 | 69 | $url=$serviceID.'='.urlencode($serviceParam); |
70 | - $amp=$encodeAmpersand?'&':'&'; |
|
70 | + $amp=$encodeAmpersand ? '&' : '&'; |
|
71 | 71 | $request=$this->getRequest(); |
72 | 72 | if(is_array($getItems) || $getItems instanceof \Traversable) |
73 | 73 | { |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | switch($request->getUrlFormat()) |
104 | 104 | { |
105 | 105 | case THttpRequestUrlFormat::Path: |
106 | - return $request->getApplicationUrl().'/'.strtr($url,array($amp=>'/','?'=>'/','='=>$request->getUrlParamSeparator())); |
|
106 | + return $request->getApplicationUrl().'/'.strtr($url, array($amp=>'/', '?'=>'/', '='=>$request->getUrlParamSeparator())); |
|
107 | 107 | case THttpRequestUrlFormat::HiddenPath: |
108 | - return rtrim(dirname($request->getApplicationUrl()), '/').'/'.strtr($url,array($amp=>'/','?'=>'/','='=>$request->getUrlParamSeparator())); |
|
108 | + return rtrim(dirname($request->getApplicationUrl()), '/').'/'.strtr($url, array($amp=>'/', '?'=>'/', '='=>$request->getUrlParamSeparator())); |
|
109 | 109 | default: |
110 | 110 | return $request->getApplicationUrl().'?'.$url; |
111 | 111 | } |
@@ -127,24 +127,24 @@ discard block |
||
127 | 127 | public function parseUrl() |
128 | 128 | { |
129 | 129 | $request=$this->getRequest(); |
130 | - $pathInfo=trim($request->getPathInfo(),'/'); |
|
130 | + $pathInfo=trim($request->getPathInfo(), '/'); |
|
131 | 131 | if(($request->getUrlFormat()===THttpRequestUrlFormat::Path || |
132 | 132 | $request->getUrlFormat()===THttpRequestUrlFormat::HiddenPath) && |
133 | 133 | $pathInfo!=='') |
134 | 134 | { |
135 | 135 | $separator=$request->getUrlParamSeparator(); |
136 | - $paths=explode('/',$pathInfo); |
|
136 | + $paths=explode('/', $pathInfo); |
|
137 | 137 | $getVariables=array(); |
138 | 138 | foreach($paths as $path) |
139 | 139 | { |
140 | 140 | if(($path=trim($path))!=='') |
141 | 141 | { |
142 | - if(($pos=strpos($path,$separator))!==false) |
|
142 | + if(($pos=strpos($path, $separator))!==false) |
|
143 | 143 | { |
144 | - $name=substr($path,0,$pos); |
|
145 | - $value=substr($path,$pos+1); |
|
146 | - if(($pos=strpos($name,'[]'))!==false) |
|
147 | - $getVariables[substr($name,0,$pos)][]=$value; |
|
144 | + $name=substr($path, 0, $pos); |
|
145 | + $value=substr($path, $pos + 1); |
|
146 | + if(($pos=strpos($name, '[]'))!==false) |
|
147 | + $getVariables[substr($name, 0, $pos)][]=$value; |
|
148 | 148 | else |
149 | 149 | $getVariables[$name]=$value; |
150 | 150 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | $status=TPropertyValue::ensureInteger($status); |
282 | 282 | if(isset(self::$HTTP_STATUS_CODES[$status])) { |
283 | 283 | $this->_reason=self::$HTTP_STATUS_CODES[$status]; |
284 | - }else{ |
|
284 | + } else{ |
|
285 | 285 | if($reason===null || $reason==='') { |
286 | 286 | throw new TInvalidDataValueException("response_status_reason_missing"); |
287 | 287 | } |
@@ -377,8 +377,7 @@ discard block |
||
377 | 377 | { |
378 | 378 | foreach($headers as $h) |
379 | 379 | header($h); |
380 | - } |
|
381 | - else |
|
380 | + } else |
|
382 | 381 | { |
383 | 382 | header('Pragma: public'); |
384 | 383 | header('Expires: 0'); |
@@ -488,13 +487,11 @@ discard block |
||
488 | 487 | { |
489 | 488 | $this->_bufferOutput = false; |
490 | 489 | ob_end_flush(); |
491 | - } |
|
492 | - else |
|
490 | + } else |
|
493 | 491 | ob_flush(); |
494 | 492 | flush(); |
495 | 493 | } |
496 | - } |
|
497 | - else |
|
494 | + } else |
|
498 | 495 | flush(); |
499 | 496 | } |
500 | 497 | |
@@ -645,8 +642,7 @@ discard block |
||
645 | 642 | $cookie->getSecure(), |
646 | 643 | $cookie->getHttpOnly() |
647 | 644 | ); |
648 | - } |
|
649 | - else { |
|
645 | + } else { |
|
650 | 646 | setcookie( |
651 | 647 | $cookie->getName(), |
652 | 648 | $cookie->getValue(), |
@@ -233,6 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | /** |
235 | 235 | * @param string|boolean output charset. |
236 | + * @param string $charset |
|
236 | 237 | */ |
237 | 238 | public function setCharset($charset) |
238 | 239 | { |
@@ -402,6 +403,7 @@ discard block |
||
402 | 403 | * The current application will be terminated after this method is invoked. |
403 | 404 | * @param string URL to be redirected to. If the URL is a relative one, the base URL of |
404 | 405 | * the current request will be inserted at the beginning. |
406 | + * @param string $url |
|
405 | 407 | */ |
406 | 408 | public function redirect($url) |
407 | 409 | { |
@@ -605,6 +607,7 @@ discard block |
||
605 | 607 | * Sends a header. |
606 | 608 | * @param string header |
607 | 609 | * @param boolean whether the header should replace a previous similar header, or add a second header of the same type |
610 | + * @param string $value |
|
608 | 611 | */ |
609 | 612 | public function appendHeader($value, $replace=true) |
610 | 613 | { |
@@ -630,6 +633,7 @@ discard block |
||
630 | 633 | * Sends a cookie. |
631 | 634 | * Do not call this method directly. Operate with the result of {@link getCookies} instead. |
632 | 635 | * @param THttpCookie cook to be sent |
636 | + * @param THttpCookie $cookie |
|
633 | 637 | */ |
634 | 638 | public function addCookie($cookie) |
635 | 639 | { |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | */ |
66 | 66 | class THttpResponse extends \Prado\TModule implements \Prado\IO\ITextWriter |
67 | 67 | { |
68 | - const DEFAULT_CONTENTTYPE = 'text/html'; |
|
69 | - const DEFAULT_CHARSET = 'UTF-8'; |
|
68 | + const DEFAULT_CONTENTTYPE='text/html'; |
|
69 | + const DEFAULT_CHARSET='UTF-8'; |
|
70 | 70 | |
71 | 71 | /** |
72 | 72 | * @var The differents defined status code by RFC 2616 {@link http://www.faqs.org/rfcs/rfc2616} |
73 | 73 | */ |
74 | - private static $HTTP_STATUS_CODES = array( |
|
74 | + private static $HTTP_STATUS_CODES=array( |
|
75 | 75 | 100 => 'Continue', 101 => 'Switching Protocols', |
76 | 76 | 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', |
77 | 77 | 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 307 => 'Temporary Redirect', |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | */ |
203 | 203 | public function setCacheControl($value) |
204 | 204 | { |
205 | - session_cache_limiter(TPropertyValue::ensureEnum($value,array('none','nocache','private','private_no_expire','public'))); |
|
205 | + session_cache_limiter(TPropertyValue::ensureEnum($value, array('none', 'nocache', 'private', 'private_no_expire', 'public'))); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | /** |
@@ -210,9 +210,9 @@ discard block |
||
210 | 210 | */ |
211 | 211 | public function setContentType($type) |
212 | 212 | { |
213 | - if ($this->_contentTypeHeaderSent) |
|
213 | + if($this->_contentTypeHeaderSent) |
|
214 | 214 | throw new \Exception('Unable to alter content-type as it has been already sent'); |
215 | - $this->_contentType = $type; |
|
215 | + $this->_contentType=$type; |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function setCharset($charset) |
238 | 238 | { |
239 | - $this->_charset = (strToLower($charset) === 'false') ? false : (string)$charset; |
|
239 | + $this->_charset=(strToLower($charset)==='false') ? false : (string) $charset; |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | /** |
@@ -277,12 +277,12 @@ discard block |
||
277 | 277 | */ |
278 | 278 | public function setStatusCode($status, $reason=null) |
279 | 279 | { |
280 | - if ($this->_httpHeaderSent) |
|
280 | + if($this->_httpHeaderSent) |
|
281 | 281 | throw new \Exception('Unable to alter response as HTTP header already sent'); |
282 | 282 | $status=TPropertyValue::ensureInteger($status); |
283 | 283 | if(isset(self::$HTTP_STATUS_CODES[$status])) { |
284 | 284 | $this->_reason=self::$HTTP_STATUS_CODES[$status]; |
285 | - }else{ |
|
285 | + } else { |
|
286 | 286 | if($reason===null || $reason==='') { |
287 | 287 | throw new TInvalidDataValueException("response_status_reason_missing"); |
288 | 288 | } |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | public function write($str) |
321 | 321 | { |
322 | 322 | // when starting output make sure we send the headers first |
323 | - if (!$this->_bufferOutput and !$this->_httpHeaderSent) |
|
323 | + if(!$this->_bufferOutput and !$this->_httpHeaderSent) |
|
324 | 324 | $this->ensureHeadersSent(); |
325 | 325 | echo $str; |
326 | 326 | } |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @param integer size of file or content in bytes if already known. Defaults to 'null' means auto-detect. |
338 | 338 | * @throws TInvalidDataValueException if the file cannot be found |
339 | 339 | */ |
340 | - public function writeFile($fileName,$content=null,$mimeType=null,$headers=null,$forceDownload=true,$clientFileName=null,$fileSize=null) |
|
340 | + public function writeFile($fileName, $content=null, $mimeType=null, $headers=null, $forceDownload=true, $clientFileName=null, $fileSize=null) |
|
341 | 341 | { |
342 | 342 | static $defaultMimeTypes=array( |
343 | 343 | 'css'=>'text/css', |
@@ -357,9 +357,9 @@ discard block |
||
357 | 357 | $mimeType='text/plain'; |
358 | 358 | if(function_exists('mime_content_type')) |
359 | 359 | $mimeType=mime_content_type($fileName); |
360 | - else if(($ext=strrchr($fileName,'.'))!==false) |
|
360 | + else if(($ext=strrchr($fileName, '.'))!==false) |
|
361 | 361 | { |
362 | - $ext=substr($ext,1); |
|
362 | + $ext=substr($ext, 1); |
|
363 | 363 | if(isset($defaultMimeTypes[$ext])) |
364 | 364 | $mimeType=$defaultMimeTypes[$ext]; |
365 | 365 | } |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | $clientFileName=basename($clientFileName); |
372 | 372 | |
373 | 373 | if($fileSize===null || $fileSize < 0) |
374 | - $fileSize = ($content===null?filesize($fileName):strlen($content)); |
|
374 | + $fileSize=($content===null ?filesize($fileName) : strlen($content)); |
|
375 | 375 | |
376 | 376 | $this->sendHttpHeader(); |
377 | 377 | if(is_array($headers)) |
@@ -385,11 +385,11 @@ discard block |
||
385 | 385 | header('Expires: 0'); |
386 | 386 | header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
387 | 387 | header("Content-Type: $mimeType"); |
388 | - $this->_contentTypeHeaderSent = true; |
|
388 | + $this->_contentTypeHeaderSent=true; |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | header('Content-Length: '.$fileSize); |
392 | - header("Content-Disposition: " . ($forceDownload ? 'attachment' : 'inline') . "; filename=\"$clientFileName\""); |
|
392 | + header("Content-Disposition: ".($forceDownload ? 'attachment' : 'inline')."; filename=\"$clientFileName\""); |
|
393 | 393 | header('Content-Transfer-Encoding: binary'); |
394 | 394 | if($content===null) |
395 | 395 | readfile($fileName); |
@@ -429,25 +429,25 @@ discard block |
||
429 | 429 | |
430 | 430 | // Under IIS, explicitly send an HTTP response including the status code |
431 | 431 | // this is handled automatically by PHP on Apache and others |
432 | - $isIIS = (stripos($this->getRequest()->getServerSoftware(), "microsoft-iis") !== false); |
|
432 | + $isIIS=(stripos($this->getRequest()->getServerSoftware(), "microsoft-iis")!==false); |
|
433 | 433 | if($url[0]==='/') |
434 | 434 | $url=$this->getRequest()->getBaseUrl().$url; |
435 | - if ($this->_status >= 300 && $this->_status < 400) |
|
435 | + if($this->_status >= 300 && $this->_status < 400) |
|
436 | 436 | { |
437 | 437 | // The status code has been modified to a valid redirection status, send it |
438 | 438 | if($isIIS) |
439 | 439 | { |
440 | - header('HTTP/1.1 ' . $this->_status . ' ' . self::$HTTP_STATUS_CODES[ |
|
440 | + header('HTTP/1.1 '.$this->_status.' '.self::$HTTP_STATUS_CODES[ |
|
441 | 441 | array_key_exists($this->_status, self::$HTTP_STATUS_CODES) |
442 | 442 | ? $this->_status |
443 | 443 | : 302 |
444 | 444 | ]); |
445 | 445 | } |
446 | - header('Location: '.str_replace('&','&',$url), true, $this->_status); |
|
446 | + header('Location: '.str_replace('&', '&', $url), true, $this->_status); |
|
447 | 447 | } else { |
448 | 448 | if($isIIS) |
449 | 449 | header('HTTP/1.1 302 '.self::$HTTP_STATUS_CODES[302]); |
450 | - header('Location: '.str_replace('&','&',$url)); |
|
450 | + header('Location: '.str_replace('&', '&', $url)); |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | if(!$this->getApplication()->getRequestCompleted()) |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | /** |
470 | 470 | * Flush the response contents and headers. |
471 | 471 | */ |
472 | - public function flush($continueBuffering = true) |
|
472 | + public function flush($continueBuffering=true) |
|
473 | 473 | { |
474 | 474 | if($this->getHasAdapter()) |
475 | 475 | $this->_adapter->flushContent($continueBuffering); |
@@ -491,18 +491,18 @@ discard block |
||
491 | 491 | * This method is used internally. Please use {@link flush} instead. |
492 | 492 | * @param boolean whether to continue buffering after flush if buffering was active |
493 | 493 | */ |
494 | - public function flushContent($continueBuffering = true) |
|
494 | + public function flushContent($continueBuffering=true) |
|
495 | 495 | { |
496 | - Prado::trace("Flushing output",'Prado\Web\THttpResponse'); |
|
496 | + Prado::trace("Flushing output", 'Prado\Web\THttpResponse'); |
|
497 | 497 | $this->ensureHeadersSent(); |
498 | 498 | if($this->_bufferOutput) |
499 | 499 | { |
500 | 500 | // avoid forced send of http headers (ob_flush() does that) if there's no output yet |
501 | - if (ob_get_length()>0) |
|
501 | + if(ob_get_length() > 0) |
|
502 | 502 | { |
503 | - if (!$continueBuffering) |
|
503 | + if(!$continueBuffering) |
|
504 | 504 | { |
505 | - $this->_bufferOutput = false; |
|
505 | + $this->_bufferOutput=false; |
|
506 | 506 | ob_end_flush(); |
507 | 507 | } |
508 | 508 | else |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | */ |
520 | 520 | protected function ensureHttpHeaderSent() |
521 | 521 | { |
522 | - if (!$this->_httpHeaderSent) |
|
522 | + if(!$this->_httpHeaderSent) |
|
523 | 523 | $this->sendHttpHeader(); |
524 | 524 | } |
525 | 525 | |
@@ -529,12 +529,12 @@ discard block |
||
529 | 529 | protected function sendHttpHeader() |
530 | 530 | { |
531 | 531 | $protocol=$this->getRequest()->getHttpProtocolVersion(); |
532 | - if($this->getRequest()->getHttpProtocolVersion() === null) |
|
532 | + if($this->getRequest()->getHttpProtocolVersion()===null) |
|
533 | 533 | $protocol='HTTP/1.1'; |
534 | 534 | |
535 | 535 | header($protocol.' '.$this->_status.' '.$this->_reason, true, TPropertyValue::ensureInteger($this->_status)); |
536 | 536 | |
537 | - $this->_httpHeaderSent = true; |
|
537 | + $this->_httpHeaderSent=true; |
|
538 | 538 | } |
539 | 539 | |
540 | 540 | /** |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | */ |
543 | 543 | protected function ensureContentTypeHeaderSent() |
544 | 544 | { |
545 | - if (!$this->_contentTypeHeaderSent) |
|
545 | + if(!$this->_contentTypeHeaderSent) |
|
546 | 546 | $this->sendContentTypeHeader(); |
547 | 547 | } |
548 | 548 | |
@@ -551,9 +551,9 @@ discard block |
||
551 | 551 | */ |
552 | 552 | protected function sendContentTypeHeader() |
553 | 553 | { |
554 | - $contentType=$this->_contentType===null?self::DEFAULT_CONTENTTYPE:$this->_contentType; |
|
554 | + $contentType=$this->_contentType===null ?self::DEFAULT_CONTENTTYPE : $this->_contentType; |
|
555 | 555 | $charset=$this->getCharset(); |
556 | - if($charset === false) { |
|
556 | + if($charset===false) { |
|
557 | 557 | $this->appendHeader('Content-Type: '.$contentType); |
558 | 558 | return; |
559 | 559 | } |
@@ -561,10 +561,10 @@ discard block |
||
561 | 561 | if($charset==='' && ($globalization=$this->getApplication()->getGlobalization(false))!==null) |
562 | 562 | $charset=$globalization->getCharset(); |
563 | 563 | |
564 | - if($charset==='') $charset = self::DEFAULT_CHARSET; |
|
564 | + if($charset==='') $charset=self::DEFAULT_CHARSET; |
|
565 | 565 | $this->appendHeader('Content-Type: '.$contentType.';charset='.$charset); |
566 | 566 | |
567 | - $this->_contentTypeHeaderSent = true; |
|
567 | + $this->_contentTypeHeaderSent=true; |
|
568 | 568 | } |
569 | 569 | |
570 | 570 | /** |
@@ -575,8 +575,8 @@ discard block |
||
575 | 575 | */ |
576 | 576 | public function getContents() |
577 | 577 | { |
578 | - Prado::trace("Retrieving output",'Prado\Web\THttpResponse'); |
|
579 | - return $this->_bufferOutput?ob_get_contents():''; |
|
578 | + Prado::trace("Retrieving output", 'Prado\Web\THttpResponse'); |
|
579 | + return $this->_bufferOutput ?ob_get_contents() : ''; |
|
580 | 580 | } |
581 | 581 | |
582 | 582 | /** |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | { |
587 | 587 | if($this->_bufferOutput) |
588 | 588 | ob_clean(); |
589 | - Prado::trace("Clearing output",'Prado\Web\THttpResponse'); |
|
589 | + Prado::trace("Clearing output", 'Prado\Web\THttpResponse'); |
|
590 | 590 | } |
591 | 591 | |
592 | 592 | /** |
@@ -595,19 +595,19 @@ discard block |
||
595 | 595 | */ |
596 | 596 | public function getHeaders($case=null) |
597 | 597 | { |
598 | - $result = array(); |
|
599 | - $headers = headers_list(); |
|
598 | + $result=array(); |
|
599 | + $headers=headers_list(); |
|
600 | 600 | foreach($headers as $header) { |
601 | - $tmp = explode(':', $header); |
|
602 | - $key = trim(array_shift($tmp)); |
|
603 | - $value = trim(implode(':', $tmp)); |
|
601 | + $tmp=explode(':', $header); |
|
602 | + $key=trim(array_shift($tmp)); |
|
603 | + $value=trim(implode(':', $tmp)); |
|
604 | 604 | if(isset($result[$key])) |
605 | - $result[$key] .= ', ' . $value; |
|
605 | + $result[$key].=', '.$value; |
|
606 | 606 | else |
607 | - $result[$key] = $value; |
|
607 | + $result[$key]=$value; |
|
608 | 608 | } |
609 | 609 | |
610 | - if($case !== null) |
|
610 | + if($case!==null) |
|
611 | 611 | return array_change_key_case($result, $case); |
612 | 612 | |
613 | 613 | return $result; |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | */ |
621 | 621 | public function appendHeader($value, $replace=true) |
622 | 622 | { |
623 | - Prado::trace("Sending header '$value'",'Prado\Web\THttpResponse'); |
|
623 | + Prado::trace("Sending header '$value'", 'Prado\Web\THttpResponse'); |
|
624 | 624 | header($value, $replace); |
625 | 625 | } |
626 | 626 | |
@@ -633,9 +633,9 @@ discard block |
||
633 | 633 | * @param string The extra headers. It's used when the message parameter is set to 1. This message type uses the same internal function as mail() does. |
634 | 634 | * @see http://us2.php.net/manual/en/function.error-log.php |
635 | 635 | */ |
636 | - public function appendLog($message,$messageType=0,$destination='',$extraHeaders='') |
|
636 | + public function appendLog($message, $messageType=0, $destination='', $extraHeaders='') |
|
637 | 637 | { |
638 | - error_log($message,$messageType,$destination,$extraHeaders); |
|
638 | + error_log($message, $messageType, $destination, $extraHeaders); |
|
639 | 639 | } |
640 | 640 | |
641 | 641 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function setDecayRate($value) |
81 | 81 | { |
82 | - $decay = TPropertyValue::ensureFloat($value); |
|
82 | + $decay=TPropertyValue::ensureFloat($value); |
|
83 | 83 | if($decay < 0) |
84 | 84 | throw new TConfigurationException('callback_decay_be_not_negative', $this->getID()); |
85 | 85 | $this->setViewState('Decay', $decay); |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | */ |
91 | 91 | protected function getTriggerOptions() |
92 | 92 | { |
93 | - $options = parent::getTriggerOptions(); |
|
94 | - $options['PropertyName'] = $this->getPropertyName(); |
|
95 | - $options['Interval'] = $this->getInterval(); |
|
96 | - $options['Decay'] = $this->getDecayRate(); |
|
93 | + $options=parent::getTriggerOptions(); |
|
94 | + $options['PropertyName']=$this->getPropertyName(); |
|
95 | + $options['Interval']=$this->getInterval(); |
|
96 | + $options['Decay']=$this->getDecayRate(); |
|
97 | 97 | return $options; |
98 | 98 | } |
99 | 99 |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected function renderCustomScriptFile($writer) |
43 | 43 | { |
44 | - if(($scriptUrl = $this->getScriptUrl())!=='') |
|
44 | + if(($scriptUrl=$this->getScriptUrl())!=='') |
|
45 | 45 | { |
46 | 46 | if($this->getPage()->getIsCallback()) |
47 | 47 | { |
48 | - $cs = $this->getPage()->getClientScript(); |
|
48 | + $cs=$this->getPage()->getClientScript(); |
|
49 | 49 | $uniqueid=$this->ClientID.'_custom'; |
50 | 50 | if(!$cs->isScriptFileRegistered($uniqueid)) |
51 | 51 | $cs->registerScriptFile($uniqueid, $scriptUrl); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | if($this->getPage()->getIsCallback()) |
67 | 67 | { |
68 | - $extWriter= $this->getPage()->getResponse()->createHtmlWriter(); |
|
68 | + $extWriter=$this->getPage()->getResponse()->createHtmlWriter(); |
|
69 | 69 | $extWriter->write("/*<![CDATA[*/\n"); |
70 | 70 | $this->renderChildren($extWriter); |
71 | 71 | $extWriter->write("\n/*]]>*/"); |
@@ -36,7 +36,7 @@ |
||
36 | 36 | public function getClientSide() |
37 | 37 | { |
38 | 38 | if($this->_clientSide===null) |
39 | - $this->_clientSide = $this->createClientSide(); |
|
39 | + $this->_clientSide=$this->createClientSide(); |
|
40 | 40 | return $this->_clientSide; |
41 | 41 | } |
42 | 42 |
@@ -119,8 +119,7 @@ discard block |
||
119 | 119 | { |
120 | 120 | $this->raiseCallbackEvent($param); |
121 | 121 | return true; |
122 | - } |
|
123 | - else return false; |
|
122 | + } else return false; |
|
124 | 123 | } |
125 | 124 | |
126 | 125 | /** |
@@ -163,8 +162,7 @@ discard block |
||
163 | 162 | parent::render($writer); |
164 | 163 | if ($this->getActiveControl()->canUpdateClientSide()) |
165 | 164 | $this->getPage()->getCallbackClient()->replaceContent($this, $writer); |
166 | - } |
|
167 | - else |
|
165 | + } else |
|
168 | 166 | { |
169 | 167 | $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
170 | 168 | // If we update a TActiveTableRow on callback, we shouldn't update all childs, |
@@ -100,6 +100,7 @@ discard block |
||
100 | 100 | * TActiveTableRow. |
101 | 101 | * This method is mainly used by framework and control developers. |
102 | 102 | * @param TCallbackEventParameter the event parameter |
103 | + * @param TActiveTableCellEventParameter $param |
|
103 | 104 | */ |
104 | 105 | public function raiseCallbackEvent($param) |
105 | 106 | { |
@@ -131,6 +132,7 @@ discard block |
||
131 | 132 | * method, be sure to call the parent implementation so that the event |
132 | 133 | * handler can be invoked. |
133 | 134 | * @param TActiveTableRowEventParameter event parameter to be passed to the event handlers |
135 | + * @param TActiveTableRowEventParameter $param |
|
134 | 136 | */ |
135 | 137 | public function onRowSelected($param) |
136 | 138 | { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function raiseCallbackEvent($param) |
105 | 105 | { |
106 | - $parameter = new TActiveTableRowEventParameter($this->getResponse(), $param->getCallbackParameter(), $this->getRowIndex()); |
|
106 | + $parameter=new TActiveTableRowEventParameter($this->getResponse(), $param->getCallbackParameter(), $this->getRowIndex()); |
|
107 | 107 | $this->onRowSelected($parameter); |
108 | 108 | } |
109 | 109 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function bubbleEvent($sender, $param) |
119 | 119 | { |
120 | - if ($param instanceof TActiveTableCellEventParameter) |
|
120 | + if($param instanceof TActiveTableCellEventParameter) |
|
121 | 121 | { |
122 | 122 | $this->raiseCallbackEvent($param); |
123 | 123 | return true; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | { |
148 | 148 | parent::addAttributesToRender($writer); |
149 | 149 | $writer->addAttribute('id', $this->getClientID()); |
150 | - if ($this->hasEventHandler('OnRowSelected')) |
|
150 | + if($this->hasEventHandler('OnRowSelected')) |
|
151 | 151 | $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions()); |
152 | 152 | } |
153 | 153 | |
@@ -160,10 +160,10 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function render($writer) |
162 | 162 | { |
163 | - if ($this->getHasPreRendered()) |
|
163 | + if($this->getHasPreRendered()) |
|
164 | 164 | { |
165 | 165 | parent::render($writer); |
166 | - if ($this->getActiveControl()->canUpdateClientSide()) |
|
166 | + if($this->getActiveControl()->canUpdateClientSide()) |
|
167 | 167 | $this->getPage()->getCallbackClient()->replaceContent($this, $writer); |
168 | 168 | } |
169 | 169 | else |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
172 | 172 | // If we update a TActiveTableRow on callback, we shouldn't update all childs, |
173 | 173 | // because the whole content will be replaced by the parent. |
174 | - if ($this->getHasControls()) |
|
174 | + if($this->getHasControls()) |
|
175 | 175 | { |
176 | - foreach ($this->findControlsByType('Prado\Web\UI\ActiveControls\IActiveControl', false) as $control) |
|
176 | + foreach($this->findControlsByType('Prado\Web\UI\ActiveControls\IActiveControl', false) as $control) |
|
177 | 177 | $control->getActiveControl()->setEnableUpdate(false); |
178 | 178 | } |
179 | 179 | } |
@@ -186,8 +186,8 @@ discard block |
||
186 | 186 | */ |
187 | 187 | protected function getPostBackOptions() |
188 | 188 | { |
189 | - $options['ID'] = $this->getClientID(); |
|
190 | - $options['EventTarget'] = $this->getUniqueID(); |
|
189 | + $options['ID']=$this->getClientID(); |
|
190 | + $options['EventTarget']=$this->getUniqueID(); |
|
191 | 191 | return $options; |
192 | 192 | } |
193 | 193 | |
@@ -199,8 +199,8 @@ discard block |
||
199 | 199 | */ |
200 | 200 | public function getRowIndex() |
201 | 201 | { |
202 | - foreach ($this->getTable()->getRows() as $key => $row) |
|
203 | - if ($row == $this) return $key; |
|
202 | + foreach($this->getTable()->getRows() as $key => $row) |
|
203 | + if($row==$this) return $key; |
|
204 | 204 | throw new TConfigurationException('tactivetablerow_control_notincollection', get_class($this), $this->getUniqueID()); |
205 | 205 | } |
206 | 206 | |
@@ -211,14 +211,14 @@ discard block |
||
211 | 211 | */ |
212 | 212 | public function getTable() |
213 | 213 | { |
214 | - if ($this->_table === null) |
|
214 | + if($this->_table===null) |
|
215 | 215 | { |
216 | - $table = $this->getParent(); |
|
217 | - while (!($table instanceof TTable) && $table !== null) |
|
216 | + $table=$this->getParent(); |
|
217 | + while(!($table instanceof TTable) && $table!==null) |
|
218 | 218 | { |
219 | - $table = $table->getParent(); |
|
219 | + $table=$table->getParent(); |
|
220 | 220 | } |
221 | - if ($table instanceof TTable) $this->_table = $table; |
|
221 | + if($table instanceof TTable) $this->_table=$table; |
|
222 | 222 | else throw new TConfigurationException('tactivetablerow_control_outoftable', get_class($this), $this->getUniqueID()); |
223 | 223 | } |
224 | 224 | return $this->_table; |
@@ -47,8 +47,8 @@ |
||
47 | 47 | */ |
48 | 48 | public function __construct($response, $parameter) |
49 | 49 | { |
50 | - $this->_response = $response; |
|
51 | - $this->_parameter = $parameter; |
|
50 | + $this->_response=$response; |
|
51 | + $this->_parameter=$parameter; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |