@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function setDirection($value) |
75 | 75 | { |
76 | - $this->setViewState('Direction', TPropertyValue::ensureEnum($value,'TSliderDirection'),TSliderDirection::Horizontal); |
|
76 | + $this->setViewState('Direction', TPropertyValue::ensureEnum($value, 'TSliderDirection'), TSliderDirection::Horizontal); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function getCssUrl() |
83 | 83 | { |
84 | - return $this->getViewState('CssUrl',''); |
|
84 | + return $this->getViewState('CssUrl', ''); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function setCssUrl($value) |
91 | 91 | { |
92 | - $this->setViewState('CssUrl',TPropertyValue::ensureString($value),''); |
|
92 | + $this->setViewState('CssUrl', TPropertyValue::ensureString($value), ''); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function getMaxValue() |
99 | 99 | { |
100 | - return $this->getViewState('MaxValue',100.0); |
|
100 | + return $this->getViewState('MaxValue', 100.0); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function setMaxValue($value) |
107 | 107 | { |
108 | - $this->setViewState('MaxValue', TPropertyValue::ensureFloat($value),100.0); |
|
108 | + $this->setViewState('MaxValue', TPropertyValue::ensureFloat($value), 100.0); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function getMinValue() |
115 | 115 | { |
116 | - return $this->getViewState('MinValue',0.0); |
|
116 | + return $this->getViewState('MinValue', 0.0); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function setMinValue($value) |
123 | 123 | { |
124 | - $this->setViewState('MinValue', TPropertyValue::ensureFloat($value),0.0); |
|
124 | + $this->setViewState('MinValue', TPropertyValue::ensureFloat($value), 0.0); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | /** |
148 | 148 | * @return boolean wether to display a progress indicator or not. Defaults to true. |
149 | 149 | */ |
150 | - public function getProgressIndicator () |
|
150 | + public function getProgressIndicator() |
|
151 | 151 | { |
152 | 152 | return $this->getViewState('ProgressIndicator', true); |
153 | 153 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | /** |
156 | 156 | * @param boolean wether to display a progress indicator or not. Defaults to true. |
157 | 157 | */ |
158 | - public function setProgressIndicator ($value) |
|
158 | + public function setProgressIndicator($value) |
|
159 | 159 | { |
160 | 160 | $this->setViewState('ProgressIndicator', TPropertyValue::ensureBoolean($value), true); |
161 | 161 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | public function getValue() |
166 | 166 | { |
167 | - return $this->getViewState('Value',0.0); |
|
167 | + return $this->getViewState('Value', 0.0); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public function setValue($value) |
174 | 174 | { |
175 | - $this->setViewState('Value', TPropertyValue::ensureFloat($value),0.0); |
|
175 | + $this->setViewState('Value', TPropertyValue::ensureFloat($value), 0.0); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | public function getAutoPostBack() |
226 | 226 | { |
227 | - return $this->getViewState('AutoPostBack',false); |
|
227 | + return $this->getViewState('AutoPostBack', false); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | public function setAutoPostBack($value) |
237 | 237 | { |
238 | - $this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),false); |
|
238 | + $this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), false); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | */ |
281 | 281 | public function onValueChanged($param) |
282 | 282 | { |
283 | - $this->raiseEvent('OnValueChanged',$this,$param); |
|
283 | + $this->raiseEvent('OnValueChanged', $this, $param); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | /** |
@@ -290,9 +290,9 @@ discard block |
||
290 | 290 | * @param array the input data collection |
291 | 291 | * @return boolean whether the data of the component has been changed |
292 | 292 | */ |
293 | - public function loadPostData($key,$values) |
|
293 | + public function loadPostData($key, $values) |
|
294 | 294 | { |
295 | - $value=(float)$values[$this->getClientID().'_1']; |
|
295 | + $value=(float) $values[$this->getClientID().'_1']; |
|
296 | 296 | if($this->getValue()!==$value) |
297 | 297 | { |
298 | 298 | $this->setValue($value); |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | public function getClientSide() |
317 | 317 | { |
318 | 318 | if($this->_clientScript===null) |
319 | - $this->_clientScript = $this->createClientScript(); |
|
319 | + $this->_clientScript=$this->createClientScript(); |
|
320 | 320 | return $this->_clientScript; |
321 | 321 | } |
322 | 322 | |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | /** |
332 | 332 | * @return string the HTML tag name for slider. Defaults to div. |
333 | 333 | */ |
334 | - public function getTagName () |
|
334 | + public function getTagName() |
|
335 | 335 | { |
336 | 336 | return "div"; |
337 | 337 | } |
@@ -343,10 +343,10 @@ discard block |
||
343 | 343 | protected function addAttributesToRender($writer) |
344 | 344 | { |
345 | 345 | parent::addAttributesToRender($writer); |
346 | - $writer->addAttribute('id',$this->getClientID()); |
|
347 | - if ($this->getCssClass()==='') |
|
346 | + $writer->addAttribute('id', $this->getClientID()); |
|
347 | + if($this->getCssClass()==='') |
|
348 | 348 | { |
349 | - $class=($this->getDirection()==TSliderDirection::Horizontal)?'HorizontalSlider':'VerticalSlider'; |
|
349 | + $class=($this->getDirection()==TSliderDirection::Horizontal) ? 'HorizontalSlider' : 'VerticalSlider'; |
|
350 | 350 | $writer->addAttribute('class', 'Slider '.$class); |
351 | 351 | } |
352 | 352 | |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | $writer->addAttribute('id', $this->getClientID().'_track'); |
363 | 363 | $writer->renderBeginTag('div'); |
364 | 364 | // Render the 'Progress Indicator' |
365 | - if ($this->getProgressIndicator()) |
|
365 | + if($this->getProgressIndicator()) |
|
366 | 366 | { |
367 | 367 | $writer->addAttribute('class', 'Progress'); |
368 | 368 | $writer->addAttribute('id', $this->getClientID().'_progress'); |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | * This method is invoked right before the control rendering, if the control is visible. |
400 | 400 | * @param mixed event parameter |
401 | 401 | */ |
402 | - public function onPreRender ($param) |
|
402 | + public function onPreRender($param) |
|
403 | 403 | { |
404 | 404 | parent::onPreRender($param); |
405 | 405 | $this->registerStyleSheet(); |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | $url=$manager->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'TSlider'); |
422 | 422 | $url.='/TSlider.css'; |
423 | 423 | } |
424 | - $this->getPage()->getClientScript()->registerStyleSheetFile($url,$url); |
|
424 | + $this->getPage()->getClientScript()->registerStyleSheetFile($url, $url); |
|
425 | 425 | } |
426 | 426 | |
427 | 427 | /** |
@@ -430,12 +430,12 @@ discard block |
||
430 | 430 | protected function registerSliderClientScript() |
431 | 431 | { |
432 | 432 | $page=$this->getPage(); |
433 | - $cs = $page->getClientScript(); |
|
433 | + $cs=$page->getClientScript(); |
|
434 | 434 | $cs->registerPradoScript("slider"); |
435 | 435 | $id=$this->getClientID(); |
436 | - $cs->registerHiddenField($id.'_1',$this->getValue()); |
|
436 | + $cs->registerHiddenField($id.'_1', $this->getValue()); |
|
437 | 437 | $page->registerRequiresPostData($this); |
438 | - $cs->registerPostBackControl($this->getClientClassName(),$this->getSliderOptions()); |
|
438 | + $cs->registerPostBackControl($this->getClientClassName(), $this->getSliderOptions()); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | /** |
@@ -445,30 +445,30 @@ discard block |
||
445 | 445 | protected function getSliderOptions() |
446 | 446 | { |
447 | 447 | // PostBack Options : |
448 | - $options['ID'] = $this->getClientID(); |
|
449 | - $options['EventTarget'] = $this->getUniqueID(); |
|
450 | - $options['AutoPostBack'] = $this->getAutoPostBack(); |
|
448 | + $options['ID']=$this->getClientID(); |
|
449 | + $options['EventTarget']=$this->getUniqueID(); |
|
450 | + $options['AutoPostBack']=$this->getAutoPostBack(); |
|
451 | 451 | |
452 | 452 | // Slider Control options |
453 | 453 | $minValue=$this->getMinValue(); |
454 | 454 | $maxValue=$this->getMaxValue(); |
455 | - $options['axis'] = strtolower($this->getDirection()); |
|
456 | - $options['maximum'] = $maxValue; |
|
457 | - $options['minimum'] = $minValue; |
|
458 | - $options['range'] = array($minValue, $maxValue); |
|
459 | - $options['sliderValue'] = $this->getValue(); |
|
460 | - $options['disabled'] = !$this->getEnabled(); |
|
455 | + $options['axis']=strtolower($this->getDirection()); |
|
456 | + $options['maximum']=$maxValue; |
|
457 | + $options['minimum']=$minValue; |
|
458 | + $options['range']=array($minValue, $maxValue); |
|
459 | + $options['sliderValue']=$this->getValue(); |
|
460 | + $options['disabled']=!$this->getEnabled(); |
|
461 | 461 | $values=$this->getValues(); |
462 | - if (!empty($values)) |
|
462 | + if(!empty($values)) |
|
463 | 463 | { |
464 | 464 | // Values are provided. Check if min/max are present in them |
465 | - if (!in_array($minValue, $values)) $values[]=$minValue; |
|
466 | - if (!in_array($maxValue, $values)) $values[]=$maxValue; |
|
465 | + if(!in_array($minValue, $values)) $values[]=$minValue; |
|
466 | + if(!in_array($maxValue, $values)) $values[]=$maxValue; |
|
467 | 467 | // Remove all values outsize the range [min..max] |
468 | - foreach ($values as $idx=>$value) |
|
468 | + foreach($values as $idx=>$value) |
|
469 | 469 | { |
470 | - if ($value < $minValue) unset ($values[$idx]); |
|
471 | - if ($value > $maxValue) unset ($values[$idx]); |
|
470 | + if($value < $minValue) unset ($values[$idx]); |
|
471 | + if($value > $maxValue) unset ($values[$idx]); |
|
472 | 472 | } |
473 | 473 | } |
474 | 474 | else |
@@ -476,19 +476,19 @@ discard block |
||
476 | 476 | // Values are not provided, generate automatically using stepsize |
477 | 477 | $step=$this->getStepSize(); |
478 | 478 | // We want at most self::MAX_STEPS values, so, change the step if necessary |
479 | - if (($maxValue-$minValue)/$step > self::MAX_STEPS) |
|
479 | + if(($maxValue - $minValue) / $step > self::MAX_STEPS) |
|
480 | 480 | { |
481 | - $step=($maxValue-$minValue)/self::MAX_STEPS; |
|
481 | + $step=($maxValue - $minValue) / self::MAX_STEPS; |
|
482 | 482 | } |
483 | 483 | $values=array(); |
484 | - for ($i=$minValue;$i<=$maxValue;$i+=$step) |
|
484 | + for($i=$minValue; $i <= $maxValue; $i+=$step) |
|
485 | 485 | $values[]=$i; |
486 | 486 | // Add max if it's not in the array because of step |
487 | - if (!in_array($maxValue, $values)) $values[]=$maxValue; |
|
487 | + if(!in_array($maxValue, $values)) $values[]=$maxValue; |
|
488 | 488 | } |
489 | - $options['values'] = $values; |
|
489 | + $options['values']=$values; |
|
490 | 490 | if($this->_clientScript!==null) |
491 | - $options = array_merge($options,$this->_clientScript->getOptions()->toArray()); |
|
491 | + $options=array_merge($options, $this->_clientScript->getOptions()->toArray()); |
|
492 | 492 | return $options; |
493 | 493 | } |
494 | 494 | } |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | if(($border=$this->getBorderWidth())==='') |
111 | 111 | $border=1; |
112 | 112 | else |
113 | - $border=(int)$border; |
|
113 | + $border=(int) $border; |
|
114 | 114 | } |
115 | 115 | } |
116 | - $writer->addAttribute('border',"$border"); |
|
116 | + $writer->addAttribute('border', "$border"); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function getCaption() |
141 | 141 | { |
142 | - return $this->getViewState('Caption',''); |
|
142 | + return $this->getViewState('Caption', ''); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function setCaption($value) |
149 | 149 | { |
150 | - $this->setViewState('Caption',$value,''); |
|
150 | + $this->setViewState('Caption', $value, ''); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function getCaptionAlign() |
157 | 157 | { |
158 | - return $this->getViewState('CaptionAlign',TTableCaptionAlign::NotSet); |
|
158 | + return $this->getViewState('CaptionAlign', TTableCaptionAlign::NotSet); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function setCaptionAlign($value) |
165 | 165 | { |
166 | - $this->setViewState('CaptionAlign',TPropertyValue::ensureEnum($value,'TTableCaptionAlign'),TTableCaptionAlign::NotSet); |
|
166 | + $this->setViewState('CaptionAlign', TPropertyValue::ensureEnum($value, 'TTableCaptionAlign'), TTableCaptionAlign::NotSet); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | if(($caption=$this->getCaption())!=='') |
273 | 273 | { |
274 | 274 | if(($align=$this->getCaptionAlign())!==TTableCaptionAlign::NotSet) |
275 | - $writer->addAttribute('align',strtolower($align)); |
|
275 | + $writer->addAttribute('align', strtolower($align)); |
|
276 | 276 | $writer->renderBeginTag('caption'); |
277 | 277 | $writer->write($caption); |
278 | 278 | $writer->renderEndTag(); |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | { |
312 | 312 | if($currentSection===TTableRowSection::Header) |
313 | 313 | { |
314 | - if($index>0) |
|
314 | + if($index > 0) |
|
315 | 315 | $writer->renderEndTag(); |
316 | 316 | if($section===TTableRowSection::Body) |
317 | 317 | $writer->renderBeginTag('tbody'); |
@@ -369,10 +369,10 @@ discard block |
||
369 | 369 | * @param mixed new item |
370 | 370 | * @throws TInvalidDataTypeException if the item to be inserted is not a TTableRow object. |
371 | 371 | */ |
372 | - public function insertAt($index,$item) |
|
372 | + public function insertAt($index, $item) |
|
373 | 373 | { |
374 | 374 | if($item instanceof TTableRow) |
375 | - parent::insertAt($index,$item); |
|
375 | + parent::insertAt($index, $item); |
|
376 | 376 | else |
377 | 377 | throw new TInvalidDataTypeException('tablerowcollection_tablerow_required'); |
378 | 378 | } |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function setID($value) |
85 | 85 | { |
86 | - if(!preg_match(TControl::ID_FORMAT,$value)) |
|
87 | - throw new TInvalidDataValueException('datagridcolumn_id_invalid',get_class($this),$value); |
|
86 | + if(!preg_match(TControl::ID_FORMAT, $value)) |
|
87 | + throw new TInvalidDataValueException('datagridcolumn_id_invalid', get_class($this), $value); |
|
88 | 88 | $this->_id=$value; |
89 | 89 | } |
90 | 90 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function getHeaderText() |
95 | 95 | { |
96 | - return $this->getViewState('HeaderText',''); |
|
96 | + return $this->getViewState('HeaderText', ''); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function setHeaderText($value) |
103 | 103 | { |
104 | - $this->setViewState('HeaderText',$value,''); |
|
104 | + $this->setViewState('HeaderText', $value, ''); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function getHeaderImageUrl() |
111 | 111 | { |
112 | - return $this->getViewState('HeaderImageUrl',''); |
|
112 | + return $this->getViewState('HeaderImageUrl', ''); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function setHeaderImageUrl($value) |
119 | 119 | { |
120 | - $this->setViewState('HeaderImageUrl',$value,''); |
|
120 | + $this->setViewState('HeaderImageUrl', $value, ''); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function getHeaderRenderer() |
128 | 128 | { |
129 | - return $this->getViewState('HeaderRenderer',''); |
|
129 | + return $this->getViewState('HeaderRenderer', ''); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function setHeaderRenderer($value) |
143 | 143 | { |
144 | - $this->setViewState('HeaderRenderer',$value,''); |
|
144 | + $this->setViewState('HeaderRenderer', $value, ''); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function getHeaderStyle($createStyle=true) |
152 | 152 | { |
153 | - if(($style=$this->getViewState('HeaderStyle',null))===null && $createStyle) |
|
153 | + if(($style=$this->getViewState('HeaderStyle', null))===null && $createStyle) |
|
154 | 154 | { |
155 | 155 | $style=new TTableItemStyle; |
156 | - $this->setViewState('HeaderStyle',$style,null); |
|
156 | + $this->setViewState('HeaderStyle', $style, null); |
|
157 | 157 | } |
158 | 158 | return $style; |
159 | 159 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function getFooterText() |
165 | 165 | { |
166 | - return $this->getViewState('FooterText',''); |
|
166 | + return $this->getViewState('FooterText', ''); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | public function setFooterText($value) |
173 | 173 | { |
174 | - $this->setViewState('FooterText',$value,''); |
|
174 | + $this->setViewState('FooterText', $value, ''); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function getFooterRenderer() |
182 | 182 | { |
183 | - return $this->getViewState('FooterRenderer',''); |
|
183 | + return $this->getViewState('FooterRenderer', ''); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function setFooterRenderer($value) |
197 | 197 | { |
198 | - $this->setViewState('FooterRenderer',$value,''); |
|
198 | + $this->setViewState('FooterRenderer', $value, ''); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
@@ -204,10 +204,10 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public function getFooterStyle($createStyle=true) |
206 | 206 | { |
207 | - if(($style=$this->getViewState('FooterStyle',null))===null && $createStyle) |
|
207 | + if(($style=$this->getViewState('FooterStyle', null))===null && $createStyle) |
|
208 | 208 | { |
209 | 209 | $style=new TTableItemStyle; |
210 | - $this->setViewState('FooterStyle',$style,null); |
|
210 | + $this->setViewState('FooterStyle', $style, null); |
|
211 | 211 | } |
212 | 212 | return $style; |
213 | 213 | } |
@@ -218,10 +218,10 @@ discard block |
||
218 | 218 | */ |
219 | 219 | public function getItemStyle($createStyle=true) |
220 | 220 | { |
221 | - if(($style=$this->getViewState('ItemStyle',null))===null && $createStyle) |
|
221 | + if(($style=$this->getViewState('ItemStyle', null))===null && $createStyle) |
|
222 | 222 | { |
223 | 223 | $style=new TTableItemStyle; |
224 | - $this->setViewState('ItemStyle',$style,null); |
|
224 | + $this->setViewState('ItemStyle', $style, null); |
|
225 | 225 | } |
226 | 226 | return $style; |
227 | 227 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | public function getSortExpression() |
233 | 233 | { |
234 | - return $this->getViewState('SortExpression',''); |
|
234 | + return $this->getViewState('SortExpression', ''); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | */ |
240 | 240 | public function setSortExpression($value) |
241 | 241 | { |
242 | - $this->setViewState('SortExpression',$value,''); |
|
242 | + $this->setViewState('SortExpression', $value, ''); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | /** |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | */ |
249 | 249 | public function getEnableCellGrouping() |
250 | 250 | { |
251 | - return $this->getViewState('EnableCellGrouping',false); |
|
251 | + return $this->getViewState('EnableCellGrouping', false); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | /** |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | */ |
258 | 258 | public function setEnableCellGrouping($value) |
259 | 259 | { |
260 | - $this->setViewState('EnableCellGrouping',TPropertyValue::ensureBoolean($value),false); |
|
260 | + $this->setViewState('EnableCellGrouping', TPropertyValue::ensureBoolean($value), false); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | /** |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | */ |
266 | 266 | public function getVisible($checkParents=true) |
267 | 267 | { |
268 | - return $this->getViewState('Visible',true); |
|
268 | + return $this->getViewState('Visible', true); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | */ |
274 | 274 | public function setVisible($value) |
275 | 275 | { |
276 | - $this->setViewState('Visible',TPropertyValue::ensureBoolean($value),true); |
|
276 | + $this->setViewState('Visible', TPropertyValue::ensureBoolean($value), true); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | /** |
@@ -283,9 +283,9 @@ discard block |
||
283 | 283 | * @param mixed the default value. If $key is not found in viewstate, $defaultValue will be returned |
284 | 284 | * @return mixed the viewstate value corresponding to $key |
285 | 285 | */ |
286 | - protected function getViewState($key,$defaultValue=null) |
|
286 | + protected function getViewState($key, $defaultValue=null) |
|
287 | 287 | { |
288 | - return isset($this->_viewState[$key])?$this->_viewState[$key]:$defaultValue; |
|
288 | + return isset($this->_viewState[$key]) ? $this->_viewState[$key] : $defaultValue; |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * @param mixed the viewstate value to be set |
297 | 297 | * @param mixed default value. If $value===$defaultValue, the item will be cleared from the viewstate. |
298 | 298 | */ |
299 | - protected function setViewState($key,$value,$defaultValue=null) |
|
299 | + protected function setViewState($key, $value, $defaultValue=null) |
|
300 | 300 | { |
301 | 301 | if($value===$defaultValue) |
302 | 302 | unset($this->_viewState[$key]); |
@@ -359,9 +359,9 @@ discard block |
||
359 | 359 | * @return mixed data value at the specified field |
360 | 360 | * @throws TInvalidDataValueException if the data or the field is invalid. |
361 | 361 | */ |
362 | - protected function getDataFieldValue($data,$field) |
|
362 | + protected function getDataFieldValue($data, $field) |
|
363 | 363 | { |
364 | - return TDataFieldAccessor::getDataFieldValue($data,$field); |
|
364 | + return TDataFieldAccessor::getDataFieldValue($data, $field); |
|
365 | 365 | } |
366 | 366 | |
367 | 367 | |
@@ -376,12 +376,12 @@ discard block |
||
376 | 376 | * @param integer the index to the Columns property that the cell resides in. |
377 | 377 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
378 | 378 | */ |
379 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
379 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
380 | 380 | { |
381 | 381 | if($itemType===TListItemType::Header) |
382 | - $this->initializeHeaderCell($cell,$columnIndex); |
|
382 | + $this->initializeHeaderCell($cell, $columnIndex); |
|
383 | 383 | else if($itemType===TListItemType::Footer) |
384 | - $this->initializeFooterCell($cell,$columnIndex); |
|
384 | + $this->initializeFooterCell($cell, $columnIndex); |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | /** |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | * @param TTableCell the cell to be initialized |
410 | 410 | * @param integer the index to the Columns property that the cell resides in. |
411 | 411 | */ |
412 | - protected function initializeHeaderCell($cell,$columnIndex) |
|
412 | + protected function initializeHeaderCell($cell, $columnIndex) |
|
413 | 413 | { |
414 | 414 | $text=$this->getHeaderText(); |
415 | 415 | |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | * @param TTableCell the cell to be initialized |
482 | 482 | * @param integer the index to the Columns property that the cell resides in. |
483 | 483 | */ |
484 | - protected function initializeFooterCell($cell,$columnIndex) |
|
484 | + protected function initializeFooterCell($cell, $columnIndex) |
|
485 | 485 | { |
486 | 486 | $text=$this->getFooterText(); |
487 | 487 | if(($classPath=$this->getFooterRenderer())!=='') |
@@ -517,13 +517,13 @@ discard block |
||
517 | 517 | * @param mixed the data to be formatted |
518 | 518 | * @return string the formatted result |
519 | 519 | */ |
520 | - protected function formatDataValue($formatString,$value) |
|
520 | + protected function formatDataValue($formatString, $value) |
|
521 | 521 | { |
522 | 522 | if($formatString==='') |
523 | 523 | return TPropertyValue::ensureString($value); |
524 | 524 | else if($formatString[0]==='#') |
525 | 525 | { |
526 | - $expression=strtr(substr($formatString,1),array('{0}'=>'$value')); |
|
526 | + $expression=strtr(substr($formatString, 1), array('{0}'=>'$value')); |
|
527 | 527 | try |
528 | 528 | { |
529 | 529 | if(eval("\$result=$expression;")===false) |
@@ -532,11 +532,11 @@ discard block |
||
532 | 532 | } |
533 | 533 | catch(Exception $e) |
534 | 534 | { |
535 | - throw new TInvalidDataValueException('datagridcolumn_expression_invalid',get_class($this),$expression,$e->getMessage()); |
|
535 | + throw new TInvalidDataValueException('datagridcolumn_expression_invalid', get_class($this), $expression, $e->getMessage()); |
|
536 | 536 | } |
537 | 537 | } |
538 | 538 | else |
539 | - return sprintf($formatString,$value); |
|
539 | + return sprintf($formatString, $value); |
|
540 | 540 | } |
541 | 541 | } |
542 | 542 |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function getDataSourceID() |
84 | 84 | { |
85 | - return $this->getViewState('DataSourceID',''); |
|
85 | + return $this->getViewState('DataSourceID', ''); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function setDataSourceID($value) |
93 | 93 | { |
94 | - $dsid=$this->getViewState('DataSourceID',''); |
|
94 | + $dsid=$this->getViewState('DataSourceID', ''); |
|
95 | 95 | if($dsid!=='' && $value==='') |
96 | 96 | $this->_requiresBindToNull=true; |
97 | - $this->setViewState('DataSourceID',$value,''); |
|
97 | + $this->setViewState('DataSourceID', $value, ''); |
|
98 | 98 | $this->onDataSourceChanged(); |
99 | 99 | } |
100 | 100 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | */ |
171 | 171 | public function getAllowPaging() |
172 | 172 | { |
173 | - return $this->getViewState('AllowPaging',false); |
|
173 | + return $this->getViewState('AllowPaging', false); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function setAllowPaging($value) |
180 | 180 | { |
181 | - $this->setViewState('AllowPaging',TPropertyValue::ensureBoolean($value),false); |
|
181 | + $this->setViewState('AllowPaging', TPropertyValue::ensureBoolean($value), false); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function getAllowCustomPaging() |
188 | 188 | { |
189 | - return $this->getViewState('AllowCustomPaging',false); |
|
189 | + return $this->getViewState('AllowCustomPaging', false); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | */ |
199 | 199 | public function setAllowCustomPaging($value) |
200 | 200 | { |
201 | - $this->setViewState('AllowCustomPaging',TPropertyValue::ensureBoolean($value),false); |
|
201 | + $this->setViewState('AllowCustomPaging', TPropertyValue::ensureBoolean($value), false); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function getCurrentPageIndex() |
208 | 208 | { |
209 | - return $this->getViewState('CurrentPageIndex',0); |
|
209 | + return $this->getViewState('CurrentPageIndex', 0); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
@@ -215,9 +215,9 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public function setCurrentPageIndex($value) |
217 | 217 | { |
218 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
218 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
219 | 219 | $value=0; |
220 | - $this->setViewState('CurrentPageIndex',$value,0); |
|
220 | + $this->setViewState('CurrentPageIndex', $value, 0); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | /** |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | public function getPageSize() |
227 | 227 | { |
228 | - return $this->getViewState('PageSize',10); |
|
228 | + return $this->getViewState('PageSize', 10); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
@@ -234,9 +234,9 @@ discard block |
||
234 | 234 | */ |
235 | 235 | public function setPageSize($value) |
236 | 236 | { |
237 | - if(($value=TPropertyValue::ensureInteger($value))<1) |
|
238 | - throw new TInvalidDataValueException('databoundcontrol_pagesize_invalid',get_class($this)); |
|
239 | - $this->setViewState('PageSize',TPropertyValue::ensureInteger($value),10); |
|
237 | + if(($value=TPropertyValue::ensureInteger($value)) < 1) |
|
238 | + throw new TInvalidDataValueException('databoundcontrol_pagesize_invalid', get_class($this)); |
|
239 | + $this->setViewState('PageSize', TPropertyValue::ensureInteger($value), 10); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | /** |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | public function getPageCount() |
246 | 246 | { |
247 | - return $this->getViewState('PageCount',1); |
|
247 | + return $this->getViewState('PageCount', 1); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | */ |
254 | 254 | public function getVirtualItemCount() |
255 | 255 | { |
256 | - return $this->getViewState('VirtualItemCount',0); |
|
256 | + return $this->getViewState('VirtualItemCount', 0); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -263,9 +263,9 @@ discard block |
||
263 | 263 | */ |
264 | 264 | public function setVirtualItemCount($value) |
265 | 265 | { |
266 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
267 | - throw new TInvalidDataValueException('databoundcontrol_virtualitemcount_invalid',get_class($this)); |
|
268 | - $this->setViewState('VirtualItemCount',$value,0); |
|
266 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
267 | + throw new TInvalidDataValueException('databoundcontrol_virtualitemcount_invalid', get_class($this)); |
|
268 | + $this->setViewState('VirtualItemCount', $value, 0); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
@@ -338,10 +338,10 @@ discard block |
||
338 | 338 | { |
339 | 339 | $ds=$this->createPagedDataSource(); |
340 | 340 | $ds->setDataSource($data); |
341 | - $this->setViewState('PageCount',$ds->getPageCount()); |
|
342 | - if($ds->getCurrentPageIndex()>=$ds->getPageCount()) |
|
341 | + $this->setViewState('PageCount', $ds->getPageCount()); |
|
342 | + if($ds->getCurrentPageIndex() >= $ds->getPageCount()) |
|
343 | 343 | { |
344 | - $ds->setCurrentPageIndex($ds->getPageCount()-1); |
|
344 | + $ds->setCurrentPageIndex($ds->getPageCount() - 1); |
|
345 | 345 | $this->setCurrentPageIndex($ds->getCurrentPageIndex()); |
346 | 346 | } |
347 | 347 | $this->performDataBinding($ds); |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $this->onDataBound(null); |
357 | 357 | } |
358 | 358 | |
359 | - public function dataSourceViewChanged($sender,$param) |
|
359 | + public function dataSourceViewChanged($sender, $param) |
|
360 | 360 | { |
361 | 361 | if(!$this->_ignoreDataSourceViewChanged) |
362 | 362 | $this->setRequiresDataBinding(true); |
@@ -367,13 +367,13 @@ discard block |
||
367 | 367 | if(!$this->_currentViewValid) |
368 | 368 | { |
369 | 369 | if($this->_currentView && $this->_currentViewIsFromDataSourceID) |
370 | - $this->_currentView->detachEventHandler('DataSourceViewChanged',array($this,'dataSourceViewChanged')); |
|
370 | + $this->_currentView->detachEventHandler('DataSourceViewChanged', array($this, 'dataSourceViewChanged')); |
|
371 | 371 | if(($dataSource=$this->determineDataSource())!==null) |
372 | 372 | { |
373 | 373 | if(($view=$dataSource->getView($this->getDataMember()))===null) |
374 | - throw new TInvalidDataValueException('databoundcontrol_datamember_invalid',$this->getDataMember()); |
|
374 | + throw new TInvalidDataValueException('databoundcontrol_datamember_invalid', $this->getDataMember()); |
|
375 | 375 | if($this->_currentViewIsFromDataSourceID=$this->getUsingDataSourceID()) |
376 | - $view->attachEventHandler('OnDataSourceViewChanged',array($this,'dataSourceViewChanged')); |
|
376 | + $view->attachEventHandler('OnDataSourceViewChanged', array($this, 'dataSourceViewChanged')); |
|
377 | 377 | $this->_currentView=$view; |
378 | 378 | } |
379 | 379 | else |
@@ -390,14 +390,14 @@ discard block |
||
390 | 390 | if(($dsid=$this->getDataSourceID())!=='') |
391 | 391 | { |
392 | 392 | if(($dataSource=$this->getNamingContainer()->findControl($dsid))===null) |
393 | - throw new TInvalidDataValueException('databoundcontrol_datasourceid_inexistent',$dsid); |
|
393 | + throw new TInvalidDataValueException('databoundcontrol_datasourceid_inexistent', $dsid); |
|
394 | 394 | else if(!($dataSource instanceof IDataSource)) |
395 | - throw new TInvalidDataValueException('databoundcontrol_datasourceid_invalid',$dsid); |
|
395 | + throw new TInvalidDataValueException('databoundcontrol_datasourceid_invalid', $dsid); |
|
396 | 396 | else |
397 | 397 | $this->_currentDataSource=$dataSource; |
398 | 398 | } |
399 | 399 | else if(($dataSource=$this->getDataSource())!==null) |
400 | - $this->_currentDataSource=new TReadOnlyDataSource($dataSource,$this->getDataMember()); |
|
400 | + $this->_currentDataSource=new TReadOnlyDataSource($dataSource, $this->getDataMember()); |
|
401 | 401 | else |
402 | 402 | $this->_currentDataSource=null; |
403 | 403 | $this->_currentDataSourceValid=true; |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | */ |
415 | 415 | public function onDataBound($param) |
416 | 416 | { |
417 | - $this->raiseEvent('OnDataBound',$this,$param); |
|
417 | + $this->raiseEvent('OnDataBound', $this, $param); |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | /** |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | { |
429 | 429 | parent::onInit($param); |
430 | 430 | $page=$this->getPage(); |
431 | - $page->attachEventHandler('OnPreLoad',array($this,'pagePreLoad')); |
|
431 | + $page->attachEventHandler('OnPreLoad', array($this, 'pagePreLoad')); |
|
432 | 432 | } |
433 | 433 | |
434 | 434 | /** |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | * @param mixed event sender |
438 | 438 | * @param TEventParameter event parameter |
439 | 439 | */ |
440 | - public function pagePreLoad($sender,$param) |
|
440 | + public function pagePreLoad($sender, $param) |
|
441 | 441 | { |
442 | 442 | $this->_initialized=true; |
443 | 443 | $isPostBack=$this->getPage()->getIsPostBack(); |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | if(is_array($value)) |
475 | 475 | $list->add($value); |
476 | 476 | else |
477 | - $list->add(array($value,is_string($key)?$key:$value)); |
|
477 | + $list->add(array($value, is_string($key) ? $key : $value)); |
|
478 | 478 | } |
479 | 479 | return $list; |
480 | 480 | } |
@@ -487,17 +487,17 @@ discard block |
||
487 | 487 | else if(($value instanceof Traversable) || $value===null) |
488 | 488 | return $value; |
489 | 489 | else |
490 | - throw new TInvalidDataTypeException('databoundcontrol_datasource_invalid',get_class($this)); |
|
490 | + throw new TInvalidDataTypeException('databoundcontrol_datasource_invalid', get_class($this)); |
|
491 | 491 | } |
492 | 492 | |
493 | 493 | public function getDataMember() |
494 | 494 | { |
495 | - return $this->getViewState('DataMember',''); |
|
495 | + return $this->getViewState('DataMember', ''); |
|
496 | 496 | } |
497 | 497 | |
498 | 498 | public function setDataMember($value) |
499 | 499 | { |
500 | - $this->setViewState('DataMember',$value,''); |
|
500 | + $this->setViewState('DataMember', $value, ''); |
|
501 | 501 | } |
502 | 502 | |
503 | 503 | public function getSelectParameters() |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function getEnableClientScript() |
115 | 115 | { |
116 | - return $this->getViewState('EnableClientScript',true); |
|
116 | + return $this->getViewState('EnableClientScript', true); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function setEnableClientScript($value) |
123 | 123 | { |
124 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
124 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $page=$this->getPage(); |
134 | 134 | $page->ensureRenderInForm($this); |
135 | 135 | if($this->getIsMultiSelect()) |
136 | - $writer->addAttribute('multiple','multiple'); |
|
136 | + $writer->addAttribute('multiple', 'multiple'); |
|
137 | 137 | if($this->getEnabled(true)) |
138 | 138 | { |
139 | 139 | if($this->getAutoPostBack() |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | } |
145 | 145 | } |
146 | 146 | else if($this->getEnabled()) |
147 | - $writer->addAttribute('disabled','disabled'); |
|
147 | + $writer->addAttribute('disabled', 'disabled'); |
|
148 | 148 | parent::addAttributesToRender($writer); |
149 | 149 | } |
150 | 150 | |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | */ |
154 | 154 | protected function renderClientControlScript($writer) |
155 | 155 | { |
156 | - $writer->addAttribute('id',$this->getClientID()); |
|
157 | - $this->getPage()->getClientScript()->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions()); |
|
156 | + $writer->addAttribute('id', $this->getClientID()); |
|
157 | + $this->getPage()->getClientScript()->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions()); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -172,10 +172,10 @@ discard block |
||
172 | 172 | */ |
173 | 173 | protected function getPostBackOptions() |
174 | 174 | { |
175 | - $options['ID'] = $this->getClientID(); |
|
176 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
177 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
178 | - $options['EventTarget'] = $this->getUniqueID(); |
|
175 | + $options['ID']=$this->getClientID(); |
|
176 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
177 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
178 | + $options['EventTarget']=$this->getUniqueID(); |
|
179 | 179 | return $options; |
180 | 180 | } |
181 | 181 | |
@@ -224,18 +224,18 @@ discard block |
||
224 | 224 | $item=$items->createListItem(); |
225 | 225 | if(is_array($object) || is_object($object)) |
226 | 226 | { |
227 | - $text=TDataFieldAccessor::getDataFieldValue($object,$textField); |
|
228 | - $value=TDataFieldAccessor::getDataFieldValue($object,$valueField); |
|
227 | + $text=TDataFieldAccessor::getDataFieldValue($object, $textField); |
|
228 | + $value=TDataFieldAccessor::getDataFieldValue($object, $valueField); |
|
229 | 229 | $item->setValue($value); |
230 | 230 | if($groupField!=='') |
231 | - $item->setAttribute('Group',TDataFieldAccessor::getDataFieldValue($object,$groupField)); |
|
231 | + $item->setAttribute('Group', TDataFieldAccessor::getDataFieldValue($object, $groupField)); |
|
232 | 232 | } |
233 | 233 | else |
234 | 234 | { |
235 | 235 | $text=$object; |
236 | 236 | $item->setValue("$key"); |
237 | 237 | } |
238 | - $item->setText($this->formatDataValue($textFormat,$text)); |
|
238 | + $item->setText($this->formatDataValue($textFormat, $text)); |
|
239 | 239 | } |
240 | 240 | // SelectedValue or SelectedIndex may be set before databinding |
241 | 241 | // so we make them be effective now |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | { |
288 | 288 | parent::saveState(); |
289 | 289 | if($this->_items) |
290 | - $this->setViewState('Items',$this->_items->saveState(),null); |
|
290 | + $this->setViewState('Items', $this->_items->saveState(), null); |
|
291 | 291 | else |
292 | 292 | $this->clearViewState('Items'); |
293 | 293 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | if(!$this->getIsDataBound()) |
304 | 304 | { |
305 | 305 | $this->_items=$this->createListItemCollection(); |
306 | - $this->_items->loadState($this->getViewState('Items',null)); |
|
306 | + $this->_items->loadState($this->getViewState('Items', null)); |
|
307 | 307 | } |
308 | 308 | $this->clearViewState('Items'); |
309 | 309 | } |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | */ |
322 | 322 | public function getAppendDataBoundItems() |
323 | 323 | { |
324 | - return $this->getViewState('AppendDataBoundItems',false); |
|
324 | + return $this->getViewState('AppendDataBoundItems', false); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | /** |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | */ |
330 | 330 | public function setAppendDataBoundItems($value) |
331 | 331 | { |
332 | - $this->setViewState('AppendDataBoundItems',TPropertyValue::ensureBoolean($value),false); |
|
332 | + $this->setViewState('AppendDataBoundItems', TPropertyValue::ensureBoolean($value), false); |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | /** |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | */ |
340 | 340 | public function getAutoPostBack() |
341 | 341 | { |
342 | - return $this->getViewState('AutoPostBack',false); |
|
342 | + return $this->getViewState('AutoPostBack', false); |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | /** |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | */ |
351 | 351 | public function setAutoPostBack($value) |
352 | 352 | { |
353 | - $this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),false); |
|
353 | + $this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), false); |
|
354 | 354 | } |
355 | 355 | |
356 | 356 | /** |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public function getCausesValidation() |
360 | 360 | { |
361 | - return $this->getViewState('CausesValidation',true); |
|
361 | + return $this->getViewState('CausesValidation', true); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | /** |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | */ |
367 | 367 | public function setCausesValidation($value) |
368 | 368 | { |
369 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
369 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | /** |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | */ |
375 | 375 | public function getDataTextField() |
376 | 376 | { |
377 | - return $this->getViewState('DataTextField',''); |
|
377 | + return $this->getViewState('DataTextField', ''); |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | /** |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | */ |
383 | 383 | public function setDataTextField($value) |
384 | 384 | { |
385 | - $this->setViewState('DataTextField',$value,''); |
|
385 | + $this->setViewState('DataTextField', $value, ''); |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | /** |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | */ |
391 | 391 | public function getDataTextFormatString() |
392 | 392 | { |
393 | - return $this->getViewState('DataTextFormatString',''); |
|
393 | + return $this->getViewState('DataTextFormatString', ''); |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | /** |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | */ |
403 | 403 | public function setDataTextFormatString($value) |
404 | 404 | { |
405 | - $this->setViewState('DataTextFormatString',$value,''); |
|
405 | + $this->setViewState('DataTextFormatString', $value, ''); |
|
406 | 406 | } |
407 | 407 | |
408 | 408 | /** |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | */ |
411 | 411 | public function getDataValueField() |
412 | 412 | { |
413 | - return $this->getViewState('DataValueField',''); |
|
413 | + return $this->getViewState('DataValueField', ''); |
|
414 | 414 | } |
415 | 415 | |
416 | 416 | /** |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | */ |
419 | 419 | public function setDataValueField($value) |
420 | 420 | { |
421 | - $this->setViewState('DataValueField',$value,''); |
|
421 | + $this->setViewState('DataValueField', $value, ''); |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | /** |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | */ |
427 | 427 | public function getDataGroupField() |
428 | 428 | { |
429 | - return $this->getViewState('DataGroupField',''); |
|
429 | + return $this->getViewState('DataGroupField', ''); |
|
430 | 430 | } |
431 | 431 | |
432 | 432 | /** |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | */ |
435 | 435 | public function setDataGroupField($value) |
436 | 436 | { |
437 | - $this->setViewState('DataGroupField',$value,''); |
|
437 | + $this->setViewState('DataGroupField', $value, ''); |
|
438 | 438 | } |
439 | 439 | |
440 | 440 | /** |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | */ |
443 | 443 | public function getItemCount() |
444 | 444 | { |
445 | - return $this->_items?$this->_items->getCount():0; |
|
445 | + return $this->_items ? $this->_items->getCount() : 0; |
|
446 | 446 | } |
447 | 447 | |
448 | 448 | /** |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | */ |
451 | 451 | public function getHasItems() |
452 | 452 | { |
453 | - return ($this->_items && $this->_items->getCount()>0); |
|
453 | + return ($this->_items && $this->_items->getCount() > 0); |
|
454 | 454 | } |
455 | 455 | |
456 | 456 | /** |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | if($this->_items) |
472 | 472 | { |
473 | 473 | $n=$this->_items->getCount(); |
474 | - for($i=0;$i<$n;++$i) |
|
474 | + for($i=0; $i < $n; ++$i) |
|
475 | 475 | if($this->_items->itemAt($i)->getSelected()) |
476 | 476 | return $i; |
477 | 477 | } |
@@ -483,12 +483,12 @@ discard block |
||
483 | 483 | */ |
484 | 484 | public function setSelectedIndex($index) |
485 | 485 | { |
486 | - if(($index=TPropertyValue::ensureInteger($index))<0) |
|
486 | + if(($index=TPropertyValue::ensureInteger($index)) < 0) |
|
487 | 487 | $index=-1; |
488 | 488 | if($this->_items) |
489 | 489 | { |
490 | 490 | $this->clearSelection(); |
491 | - if($index>=0 && $index<$this->_items->getCount()) |
|
491 | + if($index >= 0 && $index < $this->_items->getCount()) |
|
492 | 492 | $this->_items->itemAt($index)->setSelected(true); |
493 | 493 | } |
494 | 494 | $this->_cachedSelectedIndex=$index; |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | if($this->_items) |
506 | 506 | { |
507 | 507 | $n=$this->_items->getCount(); |
508 | - for($i=0;$i<$n;++$i) |
|
508 | + for($i=0; $i < $n; ++$i) |
|
509 | 509 | if($this->_items->itemAt($i)->getSelected()) |
510 | 510 | $selections[]=$i; |
511 | 511 | } |
@@ -525,14 +525,14 @@ discard block |
||
525 | 525 | $n=$this->_items->getCount(); |
526 | 526 | foreach($indices as $index) |
527 | 527 | { |
528 | - if($index>=0 && $index<$n) |
|
528 | + if($index >= 0 && $index < $n) |
|
529 | 529 | $this->_items->itemAt($index)->setSelected(true); |
530 | 530 | } |
531 | 531 | } |
532 | 532 | $this->_cachedSelectedIndices=$indices; |
533 | 533 | } |
534 | 534 | else |
535 | - throw new TNotSupportedException('listcontrol_multiselect_unsupported',get_class($this)); |
|
535 | + throw new TNotSupportedException('listcontrol_multiselect_unsupported', get_class($this)); |
|
536 | 536 | |
537 | 537 | if($this->getAdapter() instanceof IListControlAdapter) |
538 | 538 | $this->getAdapter()->setSelectedIndices($indices); |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | */ |
544 | 544 | public function getSelectedItem() |
545 | 545 | { |
546 | - if(($index=$this->getSelectedIndex())>=0) |
|
546 | + if(($index=$this->getSelectedIndex()) >= 0) |
|
547 | 547 | return $this->_items->itemAt($index); |
548 | 548 | else |
549 | 549 | return null; |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | public function getSelectedValue() |
582 | 582 | { |
583 | 583 | $index=$this->getSelectedIndex(); |
584 | - return $index>=0?$this->getItems()->itemAt($index)->getValue():''; |
|
584 | + return $index >= 0 ? $this->getItems()->itemAt($index)->getValue() : ''; |
|
585 | 585 | } |
586 | 586 | |
587 | 587 | /** |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | $this->_cachedSelectedValues=$values; |
650 | 650 | } |
651 | 651 | else |
652 | - throw new TNotSupportedException('listcontrol_multiselect_unsupported',get_class($this)); |
|
652 | + throw new TNotSupportedException('listcontrol_multiselect_unsupported', get_class($this)); |
|
653 | 653 | |
654 | 654 | if($this->getAdapter() instanceof IListControlAdapter) |
655 | 655 | $this->getAdapter()->setSelectedValues($values); |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | */ |
692 | 692 | public function getValidationGroup() |
693 | 693 | { |
694 | - return $this->getViewState('ValidationGroup',''); |
|
694 | + return $this->getViewState('ValidationGroup', ''); |
|
695 | 695 | } |
696 | 696 | |
697 | 697 | /** |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | */ |
700 | 700 | public function setValidationGroup($value) |
701 | 701 | { |
702 | - $this->setViewState('ValidationGroup',$value,''); |
|
702 | + $this->setViewState('ValidationGroup', $value, ''); |
|
703 | 703 | } |
704 | 704 | |
705 | 705 | /** |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | */ |
709 | 709 | public function getPromptText() |
710 | 710 | { |
711 | - return $this->getViewState('PromptText',''); |
|
711 | + return $this->getViewState('PromptText', ''); |
|
712 | 712 | } |
713 | 713 | |
714 | 714 | /** |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | */ |
718 | 718 | public function setPromptText($value) |
719 | 719 | { |
720 | - $this->setViewState('PromptText',$value,''); |
|
720 | + $this->setViewState('PromptText', $value, ''); |
|
721 | 721 | } |
722 | 722 | |
723 | 723 | /** |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | */ |
728 | 728 | public function getPromptValue() |
729 | 729 | { |
730 | - return $this->getViewState('PromptValue',''); |
|
730 | + return $this->getViewState('PromptValue', ''); |
|
731 | 731 | } |
732 | 732 | |
733 | 733 | /** |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | */ |
738 | 738 | public function setPromptValue($value) |
739 | 739 | { |
740 | - $this->setViewState('PromptValue',(string)$value,''); |
|
740 | + $this->setViewState('PromptValue', (string) $value, ''); |
|
741 | 741 | } |
742 | 742 | |
743 | 743 | /** |
@@ -748,7 +748,7 @@ discard block |
||
748 | 748 | */ |
749 | 749 | public function onSelectedIndexChanged($param) |
750 | 750 | { |
751 | - $this->raiseEvent('OnSelectedIndexChanged',$this,$param); |
|
751 | + $this->raiseEvent('OnSelectedIndexChanged', $this, $param); |
|
752 | 752 | $this->onTextChanged($param); |
753 | 753 | } |
754 | 754 | |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | */ |
761 | 761 | public function onTextChanged($param) |
762 | 762 | { |
763 | - $this->raiseEvent('OnTextChanged',$this,$param); |
|
763 | + $this->raiseEvent('OnTextChanged', $this, $param); |
|
764 | 764 | } |
765 | 765 | |
766 | 766 | /** |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | $value=$text; |
777 | 777 | if($value!=='') |
778 | 778 | { |
779 | - $writer->addAttribute('value',$value); |
|
779 | + $writer->addAttribute('value', $value); |
|
780 | 780 | $writer->renderBeginTag('option'); |
781 | 781 | $writer->write(THttpUtility::htmlEncode($text)); |
782 | 782 | $writer->renderEndTag(); |
@@ -814,14 +814,14 @@ discard block |
||
814 | 814 | } |
815 | 815 | if($group!==null) |
816 | 816 | { |
817 | - $writer->addAttribute('label',$group); |
|
817 | + $writer->addAttribute('label', $group); |
|
818 | 818 | $writer->renderBeginTag('optgroup'); |
819 | 819 | $writer->writeLine(); |
820 | 820 | $previousGroup=$group; |
821 | 821 | } |
822 | 822 | } |
823 | 823 | foreach($item->getAttributes() as $name=>$value) |
824 | - $writer->addAttribute($name,$value); |
|
824 | + $writer->addAttribute($name, $value); |
|
825 | 825 | } |
826 | 826 | else if($previousGroup!==null) |
827 | 827 | { |
@@ -830,8 +830,8 @@ discard block |
||
830 | 830 | $previousGroup=null; |
831 | 831 | } |
832 | 832 | if($item->getSelected()) |
833 | - $writer->addAttribute('selected','selected'); |
|
834 | - $writer->addAttribute('value',$item->getValue()); |
|
833 | + $writer->addAttribute('selected', 'selected'); |
|
834 | + $writer->addAttribute('value', $item->getValue()); |
|
835 | 835 | $writer->renderBeginTag('option'); |
836 | 836 | $writer->write(THttpUtility::htmlEncode($item->getText())); |
837 | 837 | $writer->renderEndTag(); |
@@ -858,13 +858,13 @@ discard block |
||
858 | 858 | * @param mixed the data to be formatted |
859 | 859 | * @return string the formatted result |
860 | 860 | */ |
861 | - protected function formatDataValue($formatString,$value) |
|
861 | + protected function formatDataValue($formatString, $value) |
|
862 | 862 | { |
863 | 863 | if($formatString==='') |
864 | 864 | return TPropertyValue::ensureString($value); |
865 | 865 | else if($formatString[0]==='#') |
866 | 866 | { |
867 | - $expression=strtr(substr($formatString,1),array('{0}'=>'$value')); |
|
867 | + $expression=strtr(substr($formatString, 1), array('{0}'=>'$value')); |
|
868 | 868 | try |
869 | 869 | { |
870 | 870 | if(eval("\$result=$expression;")===false) |
@@ -873,11 +873,11 @@ discard block |
||
873 | 873 | } |
874 | 874 | catch(Exception $e) |
875 | 875 | { |
876 | - throw new TInvalidDataValueException('listcontrol_expression_invalid',get_class($this),$expression,$e->getMessage()); |
|
876 | + throw new TInvalidDataValueException('listcontrol_expression_invalid', get_class($this), $expression, $e->getMessage()); |
|
877 | 877 | } |
878 | 878 | } |
879 | 879 | else |
880 | - return sprintf($formatString,$value); |
|
880 | + return sprintf($formatString, $value); |
|
881 | 881 | } |
882 | 882 | } |
883 | 883 |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | { |
72 | 72 | parent::addAttributesToRender($writer); |
73 | 73 | if(($butt=$this->getDefaultButton())!=='') |
74 | - $writer->addAttribute('id',$this->getClientID()); |
|
74 | + $writer->addAttribute('id', $this->getClientID()); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | public function getGroupingText() |
170 | 170 | { |
171 | - return $this->getViewState('GroupingText',''); |
|
171 | + return $this->getViewState('GroupingText', ''); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function setGroupingText($value) |
178 | 178 | { |
179 | - $this->setViewState('GroupingText',$value,''); |
|
179 | + $this->setViewState('GroupingText', $value, ''); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | if(($butt=$this->getDefaultButton())!=='') |
231 | 231 | { |
232 | 232 | if(($button=$this->findControl($butt))===null) |
233 | - throw new TInvalidDataValueException('panel_defaultbutton_invalid',$butt); |
|
233 | + throw new TInvalidDataValueException('panel_defaultbutton_invalid', $butt); |
|
234 | 234 | else |
235 | 235 | $this->getPage()->getClientScript()->registerDefaultButton($this, $button); |
236 | 236 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function getButtonType() |
58 | 58 | { |
59 | - return $this->getViewState('ButtonType',TButtonColumnType::LinkButton); |
|
59 | + return $this->getViewState('ButtonType', TButtonColumnType::LinkButton); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function setButtonType($value) |
66 | 66 | { |
67 | - $this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'TButtonColumnType'),TButtonColumnType::LinkButton); |
|
67 | + $this->setViewState('ButtonType', TPropertyValue::ensureEnum($value, 'TButtonColumnType'), TButtonColumnType::LinkButton); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function getEditText() |
74 | 74 | { |
75 | - return $this->getViewState('EditText','Edit'); |
|
75 | + return $this->getViewState('EditText', 'Edit'); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function setEditText($value) |
82 | 82 | { |
83 | - $this->setViewState('EditText',$value,'Edit'); |
|
83 | + $this->setViewState('EditText', $value, 'Edit'); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function getEditImageUrl() |
90 | 90 | { |
91 | - return $this->getViewState('EditImageUrl',''); |
|
91 | + return $this->getViewState('EditImageUrl', ''); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function setEditImageUrl($value) |
98 | 98 | { |
99 | - $this->setViewState('EditImageUrl',$value,''); |
|
99 | + $this->setViewState('EditImageUrl', $value, ''); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function getUpdateText() |
106 | 106 | { |
107 | - return $this->getViewState('UpdateText','Update'); |
|
107 | + return $this->getViewState('UpdateText', 'Update'); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function setUpdateText($value) |
114 | 114 | { |
115 | - $this->setViewState('UpdateText',$value,'Update'); |
|
115 | + $this->setViewState('UpdateText', $value, 'Update'); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function getUpdateImageUrl() |
122 | 122 | { |
123 | - return $this->getViewState('UpdateImageUrl',''); |
|
123 | + return $this->getViewState('UpdateImageUrl', ''); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function setUpdateImageUrl($value) |
130 | 130 | { |
131 | - $this->setViewState('UpdateImageUrl',$value,''); |
|
131 | + $this->setViewState('UpdateImageUrl', $value, ''); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function getCancelText() |
138 | 138 | { |
139 | - return $this->getViewState('CancelText','Cancel'); |
|
139 | + return $this->getViewState('CancelText', 'Cancel'); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function setCancelText($value) |
146 | 146 | { |
147 | - $this->setViewState('CancelText',$value,'Cancel'); |
|
147 | + $this->setViewState('CancelText', $value, 'Cancel'); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function getCancelImageUrl() |
154 | 154 | { |
155 | - return $this->getViewState('CancelImageUrl',''); |
|
155 | + return $this->getViewState('CancelImageUrl', ''); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function setCancelImageUrl($value) |
162 | 162 | { |
163 | - $this->setViewState('CancelImageUrl',$value,''); |
|
163 | + $this->setViewState('CancelImageUrl', $value, ''); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | public function getCausesValidation() |
170 | 170 | { |
171 | - return $this->getViewState('CausesValidation',true); |
|
171 | + return $this->getViewState('CausesValidation', true); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function setCausesValidation($value) |
178 | 178 | { |
179 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
179 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function getValidationGroup() |
186 | 186 | { |
187 | - return $this->getViewState('ValidationGroup',''); |
|
187 | + return $this->getViewState('ValidationGroup', ''); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function setValidationGroup($value) |
194 | 194 | { |
195 | - $this->setViewState('ValidationGroup',$value,''); |
|
195 | + $this->setViewState('ValidationGroup', $value, ''); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -204,27 +204,27 @@ discard block |
||
204 | 204 | * @param integer the index to the Columns property that the cell resides in. |
205 | 205 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
206 | 206 | */ |
207 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
207 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
208 | 208 | { |
209 | 209 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem) |
210 | 210 | { |
211 | - $button=$this->createButton('Edit',$this->getEditText(),false,''); |
|
211 | + $button=$this->createButton('Edit', $this->getEditText(), false, ''); |
|
212 | 212 | $cell->getControls()->add($button); |
213 | - $cell->registerObject('EditButton',$button); |
|
213 | + $cell->registerObject('EditButton', $button); |
|
214 | 214 | } |
215 | 215 | else if($itemType===TListItemType::EditItem) |
216 | 216 | { |
217 | 217 | $controls=$cell->getControls(); |
218 | - $button=$this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup()); |
|
218 | + $button=$this->createButton('Update', $this->getUpdateText(), $this->getCausesValidation(), $this->getValidationGroup()); |
|
219 | 219 | $controls->add($button); |
220 | - $cell->registerObject('UpdateButton',$button); |
|
220 | + $cell->registerObject('UpdateButton', $button); |
|
221 | 221 | $controls->add(' '); |
222 | - $button=$this->createButton('Cancel',$this->getCancelText(),false,''); |
|
222 | + $button=$this->createButton('Cancel', $this->getCancelText(), false, ''); |
|
223 | 223 | $controls->add($button); |
224 | - $cell->registerObject('CancelButton',$button); |
|
224 | + $cell->registerObject('CancelButton', $button); |
|
225 | 225 | } |
226 | 226 | else |
227 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
227 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | * @param string the validation group that the button belongs to |
237 | 237 | * @return mixed the newly created button. |
238 | 238 | */ |
239 | - protected function createButton($commandName,$text,$causesValidation,$validationGroup) |
|
239 | + protected function createButton($commandName, $text, $causesValidation, $validationGroup) |
|
240 | 240 | { |
241 | 241 | if($this->getButtonType()===TButtonColumnType::LinkButton) |
242 | 242 | $button=Prado::createComponent('System.Web.UI.WebControls.TLinkButton'); |
@@ -245,9 +245,9 @@ discard block |
||
245 | 245 | else // image buttons |
246 | 246 | { |
247 | 247 | $button=Prado::createComponent('System.Web.UI.WebControls.TImageButton'); |
248 | - if(strcasecmp($commandName,'Update')===0) |
|
248 | + if(strcasecmp($commandName, 'Update')===0) |
|
249 | 249 | $url=$this->getUpdateImageUrl(); |
250 | - else if(strcasecmp($commandName,'Cancel')===0) |
|
250 | + else if(strcasecmp($commandName, 'Cancel')===0) |
|
251 | 251 | $url=$this->getCancelImageUrl(); |
252 | 252 | else |
253 | 253 | $url=$this->getEditImageUrl(); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function setEnsureId($value) |
60 | 60 | { |
61 | - $this->_ensureid |= TPropertyValue::ensureBoolean($value); |
|
61 | + $this->_ensureid|=TPropertyValue::ensureBoolean($value); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | public function getDecorator($create=true) |
76 | 76 | { |
77 | 77 | if($create && !$this->_decorator) |
78 | - $this->_decorator = Prado::createComponent('TWebControlDecorator', $this); |
|
78 | + $this->_decorator=Prado::createComponent('TWebControlDecorator', $this); |
|
79 | 79 | return $this->_decorator; |
80 | 80 | } |
81 | 81 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function getAccessKey() |
103 | 103 | { |
104 | - return $this->getViewState('AccessKey',''); |
|
104 | + return $this->getViewState('AccessKey', ''); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function setAccessKey($value) |
115 | 115 | { |
116 | - if(strlen($value)>1) |
|
117 | - throw new TInvalidDataValueException('webcontrol_accesskey_invalid',get_class($this),$value); |
|
118 | - $this->setViewState('AccessKey',$value,''); |
|
116 | + if(strlen($value) > 1) |
|
117 | + throw new TInvalidDataValueException('webcontrol_accesskey_invalid', get_class($this), $value); |
|
118 | + $this->setViewState('AccessKey', $value, ''); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function getBackColor() |
125 | 125 | { |
126 | - if($style=$this->getViewState('Style',null)) |
|
126 | + if($style=$this->getViewState('Style', null)) |
|
127 | 127 | return $style->getBackColor(); |
128 | 128 | else |
129 | 129 | return ''; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | public function getBorderColor() |
144 | 144 | { |
145 | - if($style=$this->getViewState('Style',null)) |
|
145 | + if($style=$this->getViewState('Style', null)) |
|
146 | 146 | return $style->getBorderColor(); |
147 | 147 | else |
148 | 148 | return ''; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | */ |
162 | 162 | public function getBorderStyle() |
163 | 163 | { |
164 | - if($style=$this->getViewState('Style',null)) |
|
164 | + if($style=$this->getViewState('Style', null)) |
|
165 | 165 | return $style->getBorderStyle(); |
166 | 166 | else |
167 | 167 | return ''; |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function getBorderWidth() |
182 | 182 | { |
183 | - if($style=$this->getViewState('Style',null)) |
|
183 | + if($style=$this->getViewState('Style', null)) |
|
184 | 184 | return $style->getBorderWidth(); |
185 | 185 | else |
186 | 186 | return ''; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | */ |
208 | 208 | public function getForeColor() |
209 | 209 | { |
210 | - if($style=$this->getViewState('Style',null)) |
|
210 | + if($style=$this->getViewState('Style', null)) |
|
211 | 211 | return $style->getForeColor(); |
212 | 212 | else |
213 | 213 | return ''; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | */ |
227 | 227 | public function getHeight() |
228 | 228 | { |
229 | - if($style=$this->getViewState('Style',null)) |
|
229 | + if($style=$this->getViewState('Style', null)) |
|
230 | 230 | return $style->getHeight(); |
231 | 231 | else |
232 | 232 | return ''; |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function getCssClass() |
263 | 263 | { |
264 | - if($style=$this->getViewState('Style',null)) |
|
264 | + if($style=$this->getViewState('Style', null)) |
|
265 | 265 | return $style->getCssClass(); |
266 | 266 | else |
267 | 267 | return ''; |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | */ |
281 | 281 | public function getHasStyle() |
282 | 282 | { |
283 | - return $this->getViewState('Style',null)!==null; |
|
283 | + return $this->getViewState('Style', null)!==null; |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | /** |
@@ -298,12 +298,12 @@ discard block |
||
298 | 298 | */ |
299 | 299 | public function getStyle() |
300 | 300 | { |
301 | - if($style=$this->getViewState('Style',null)) |
|
301 | + if($style=$this->getViewState('Style', null)) |
|
302 | 302 | return $style; |
303 | 303 | else |
304 | 304 | { |
305 | 305 | $style=$this->createStyle(); |
306 | - $this->setViewState('Style',$style,null); |
|
306 | + $this->setViewState('Style', $style, null); |
|
307 | 307 | return $style; |
308 | 308 | } |
309 | 309 | } |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | if(is_string($value)) |
320 | 320 | $this->getStyle()->setCustomStyle($value); |
321 | 321 | else |
322 | - throw new TInvalidDataValueException('webcontrol_style_invalid',get_class($this)); |
|
322 | + throw new TInvalidDataValueException('webcontrol_style_invalid', get_class($this)); |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | */ |
336 | 336 | public function getTabIndex() |
337 | 337 | { |
338 | - return $this->getViewState('TabIndex',0); |
|
338 | + return $this->getViewState('TabIndex', 0); |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | /** |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | */ |
346 | 346 | public function setTabIndex($value) |
347 | 347 | { |
348 | - $this->setViewState('TabIndex',TPropertyValue::ensureInteger($value),0); |
|
348 | + $this->setViewState('TabIndex', TPropertyValue::ensureInteger($value), 0); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | /** |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | */ |
365 | 365 | public function getToolTip() |
366 | 366 | { |
367 | - return $this->getViewState('ToolTip',''); |
|
367 | + return $this->getViewState('ToolTip', ''); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | */ |
375 | 375 | public function setToolTip($value) |
376 | 376 | { |
377 | - $this->setViewState('ToolTip',$value,''); |
|
377 | + $this->setViewState('ToolTip', $value, ''); |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | /** |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | */ |
383 | 383 | public function getWidth() |
384 | 384 | { |
385 | - if($style=$this->getViewState('Style',null)) |
|
385 | + if($style=$this->getViewState('Style', null)) |
|
386 | 386 | return $style->getWidth(); |
387 | 387 | else |
388 | 388 | return ''; |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | * @param TEventParameter event parameter to be passed to the event handlers |
405 | 405 | */ |
406 | 406 | public function onPreRender($param) { |
407 | - if($decorator = $this->getDecorator(false)) |
|
407 | + if($decorator=$this->getDecorator(false)) |
|
408 | 408 | $decorator->instantiate(); |
409 | 409 | |
410 | 410 | parent::onPreRender($param); |
@@ -420,21 +420,21 @@ discard block |
||
420 | 420 | protected function addAttributesToRender($writer) |
421 | 421 | { |
422 | 422 | if($this->getID()!=='' || $this->getEnsureId()) |
423 | - $writer->addAttribute('id',$this->getClientID()); |
|
423 | + $writer->addAttribute('id', $this->getClientID()); |
|
424 | 424 | if(($accessKey=$this->getAccessKey())!=='') |
425 | - $writer->addAttribute('accesskey',$accessKey); |
|
425 | + $writer->addAttribute('accesskey', $accessKey); |
|
426 | 426 | if(!$this->getEnabled()) |
427 | - $writer->addAttribute('disabled','disabled'); |
|
428 | - if(($tabIndex=$this->getTabIndex())>0) |
|
429 | - $writer->addAttribute('tabindex',"$tabIndex"); |
|
427 | + $writer->addAttribute('disabled', 'disabled'); |
|
428 | + if(($tabIndex=$this->getTabIndex()) > 0) |
|
429 | + $writer->addAttribute('tabindex', "$tabIndex"); |
|
430 | 430 | if(($toolTip=$this->getToolTip())!=='') |
431 | - $writer->addAttribute('title',$toolTip); |
|
432 | - if($style=$this->getViewState('Style',null)) |
|
431 | + $writer->addAttribute('title', $toolTip); |
|
432 | + if($style=$this->getViewState('Style', null)) |
|
433 | 433 | $style->addAttributesToRender($writer); |
434 | 434 | if($this->getHasAttributes()) |
435 | 435 | { |
436 | 436 | foreach($this->getAttributes() as $name=>$value) |
437 | - $writer->addAttribute($name,$value); |
|
437 | + $writer->addAttribute($name, $value); |
|
438 | 438 | } |
439 | 439 | } |
440 | 440 | |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | */ |
461 | 461 | public function renderBeginTag($writer) |
462 | 462 | { |
463 | - if($decorator = $this->getDecorator(false)) { |
|
463 | + if($decorator=$this->getDecorator(false)) { |
|
464 | 464 | $decorator->renderPreTagText($writer); |
465 | 465 | $this->addAttributesToRender($writer); |
466 | 466 | $writer->renderBeginTag($this->getTagName()); |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | */ |
489 | 489 | public function renderEndTag($writer) |
490 | 490 | { |
491 | - if($decorator = $this->getDecorator(false)) { |
|
491 | + if($decorator=$this->getDecorator(false)) { |
|
492 | 492 | $decorator->renderPostContentsText($writer); |
493 | 493 | $writer->renderEndTag(); |
494 | 494 | $decorator->renderPostTagText($writer); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function getDataType() |
61 | 61 | { |
62 | - return $this->getViewState('DataType',TValidationDataType::String); |
|
62 | + return $this->getViewState('DataType', TValidationDataType::String); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function setDataType($value) |
71 | 71 | { |
72 | - $this->setViewState('DataType',TPropertyValue::ensureEnum($value,'TValidationDataType'),TValidationDataType::String); |
|
72 | + $this->setViewState('DataType', TPropertyValue::ensureEnum($value, 'TValidationDataType'), TValidationDataType::String); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function getControlToCompare() |
79 | 79 | { |
80 | - return $this->getViewState('ControlToCompare',''); |
|
80 | + return $this->getViewState('ControlToCompare', ''); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function setControlToCompare($value) |
88 | 88 | { |
89 | - $this->setViewState('ControlToCompare',$value,''); |
|
89 | + $this->setViewState('ControlToCompare', $value, ''); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function getValueToCompare() |
96 | 96 | { |
97 | - return $this->getViewState('ValueToCompare',''); |
|
97 | + return $this->getViewState('ValueToCompare', ''); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function setValueToCompare($value) |
105 | 105 | { |
106 | - $this->setViewState('ValueToCompare',$value,''); |
|
106 | + $this->setViewState('ValueToCompare', $value, ''); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function getOperator() |
113 | 113 | { |
114 | - return $this->getViewState('Operator',TValidationCompareOperator::Equal); |
|
114 | + return $this->getViewState('Operator', TValidationCompareOperator::Equal); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function setOperator($value) |
122 | 122 | { |
123 | - $this->setViewState('Operator',TPropertyValue::ensureEnum($value,'TValidationCompareOperator'),TValidationCompareOperator::Equal); |
|
123 | + $this->setViewState('Operator', TPropertyValue::ensureEnum($value, 'TValidationCompareOperator'), TValidationCompareOperator::Equal); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
@@ -162,13 +162,13 @@ discard block |
||
162 | 162 | else |
163 | 163 | $value2=$this->getValueToCompare(); |
164 | 164 | |
165 | - $values = $this->getComparisonValues($value, $value2); |
|
165 | + $values=$this->getComparisonValues($value, $value2); |
|
166 | 166 | switch($this->getOperator()) |
167 | 167 | { |
168 | 168 | case TValidationCompareOperator::Equal: |
169 | - return $values[0] == $values[1]; |
|
169 | + return $values[0]==$values[1]; |
|
170 | 170 | case TValidationCompareOperator::NotEqual: |
171 | - return $values[0] != $values[1]; |
|
171 | + return $values[0]!=$values[1]; |
|
172 | 172 | case TValidationCompareOperator::GreaterThan: |
173 | 173 | return $values[0] > $values[1]; |
174 | 174 | case TValidationCompareOperator::GreaterThanEqual: |
@@ -197,10 +197,10 @@ discard block |
||
197 | 197 | case TValidationDataType::Float: |
198 | 198 | return array(floatval($value1), floatval($value2)); |
199 | 199 | case TValidationDataType::Date: |
200 | - $dateFormat = $this->getDateFormat(); |
|
200 | + $dateFormat=$this->getDateFormat(); |
|
201 | 201 | if($dateFormat!=='') |
202 | 202 | { |
203 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', $dateFormat); |
|
203 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $dateFormat); |
|
204 | 204 | return array($formatter->parse($value1), $formatter->parse($value2)); |
205 | 205 | } |
206 | 206 | else |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | */ |
216 | 216 | protected function getClientScriptOptions() |
217 | 217 | { |
218 | - $options = parent::getClientScriptOptions(); |
|
218 | + $options=parent::getClientScriptOptions(); |
|
219 | 219 | if(($name=$this->getControlToCompare())!=='') |
220 | 220 | { |
221 | 221 | if(($control=$this->findControl($name))!==null) |