@@ -57,9 +57,9 @@ |
||
57 | 57 | * @param array the input data collection |
58 | 58 | * @return boolean whether the data of the control has been changed |
59 | 59 | */ |
60 | - public function loadPostData($key,$values) |
|
60 | + public function loadPostData($key, $values) |
|
61 | 61 | { |
62 | - $value=isset($values[$key])?$values[$key]:''; |
|
62 | + $value=isset($values[$key]) ? $values[$key] : ''; |
|
63 | 63 | $oldSelection=$this->getSelectedIndex(); |
64 | 64 | $this->ensureDataBound(); |
65 | 65 | foreach($this->getItems() as $index=>$item) |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function getText() |
153 | 153 | { |
154 | - return $this->getViewState('Text',''); |
|
154 | + return $this->getViewState('Text', ''); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | */ |
162 | 162 | public function setText($value) |
163 | 163 | { |
164 | - $this->setViewState('Text',$value,''); |
|
164 | + $this->setViewState('Text', $value, ''); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
@@ -197,10 +197,10 @@ discard block |
||
197 | 197 | protected function addAttributesToRender($writer) |
198 | 198 | { |
199 | 199 | parent::addAttributesToRender($writer); |
200 | - if(($colspan=$this->getColumnSpan())>0) |
|
201 | - $writer->addAttribute('colspan',"$colspan"); |
|
202 | - if(($rowspan=$this->getRowSpan())>0) |
|
203 | - $writer->addAttribute('rowspan',"$rowspan"); |
|
200 | + if(($colspan=$this->getColumnSpan()) > 0) |
|
201 | + $writer->addAttribute('colspan', "$colspan"); |
|
202 | + if(($rowspan=$this->getRowSpan()) > 0) |
|
203 | + $writer->addAttribute('rowspan', "$rowspan"); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -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() |
@@ -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 | } |
@@ -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); |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | public function onPreRender($param) |
106 | 106 | { |
107 | 107 | parent::onPreRender($param); |
108 | - $scripts = preg_split('/,|\s+/', $this->getPradoScripts()); |
|
109 | - $cs = $this->getPage()->getClientScript(); |
|
108 | + $scripts=preg_split('/,|\s+/', $this->getPradoScripts()); |
|
109 | + $cs=$this->getPage()->getClientScript(); |
|
110 | 110 | foreach($scripts as $script) |
111 | 111 | { |
112 | - if(($script = trim($script))!=='') |
|
112 | + if(($script=trim($script))!=='') |
|
113 | 113 | $cs->registerPradoScript($script); |
114 | 114 | } |
115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function render($writer) |
124 | 124 | { |
125 | - if ($this->getFlushScriptFiles()) |
|
125 | + if($this->getFlushScriptFiles()) |
|
126 | 126 | $this->getPage()->getClientScript()->flushScriptFiles($writer, $this); |
127 | 127 | $this->renderCustomScriptFile($writer); |
128 | 128 | $this->renderCustomScript($writer); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | protected function renderCustomScriptFile($writer) |
136 | 136 | { |
137 | - if(($scriptUrl = $this->getScriptUrl())!=='') |
|
137 | + if(($scriptUrl=$this->getScriptUrl())!=='') |
|
138 | 138 | $writer->write("<script type=\"text/javascript\" src=\"$scriptUrl\"></script>\n"); |
139 | 139 | } |
140 | 140 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | /** |
35 | 35 | * @var array list of published rating images. |
36 | 36 | */ |
37 | - private $_ratingImages = array(); |
|
37 | + private $_ratingImages=array(); |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Sets the default repeat direction to horizontal. |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function getReadOnly() |
52 | 52 | { |
53 | - return $this->getViewState('ReadOnly',false); |
|
53 | + return $this->getViewState('ReadOnly', false); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function setReadOnly($value) |
60 | 60 | { |
61 | - $this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false); |
|
61 | + $this->setViewState('ReadOnly', TPropertyValue::ensureBoolean($value), false); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function getRating() |
108 | 108 | { |
109 | - $rating = $this->getViewState('Rating', null); |
|
110 | - if ($rating === null) |
|
111 | - return $this->getSelectedIndex()+1; |
|
109 | + $rating=$this->getViewState('Rating', null); |
|
110 | + if($rating===null) |
|
111 | + return $this->getSelectedIndex() + 1; |
|
112 | 112 | else |
113 | 113 | return $rating; |
114 | 114 | } |
@@ -118,15 +118,15 @@ discard block |
||
118 | 118 | */ |
119 | 119 | public function setRating($value) |
120 | 120 | { |
121 | - $value = TPropertyValue::ensureFloat($value); |
|
121 | + $value=TPropertyValue::ensureFloat($value); |
|
122 | 122 | $this->setViewState('Rating', $value, null); |
123 | - $index = $this->getRatingIndex($value); |
|
123 | + $index=$this->getRatingIndex($value); |
|
124 | 124 | parent::setSelectedIndex($index); |
125 | 125 | } |
126 | 126 | |
127 | 127 | public function setSelectedIndex($value) |
128 | 128 | { |
129 | - $this->setRating($value+1); |
|
129 | + $this->setRating($value + 1); |
|
130 | 130 | parent::setSelectedIndex($value); |
131 | 131 | } |
132 | 132 | |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | */ |
137 | 137 | protected function getRatingIndex($rating) |
138 | 138 | { |
139 | - $interval = $this->getHalfRatingInterval(); |
|
140 | - $base = intval($rating)-1; |
|
141 | - $remainder = $rating-$base-1; |
|
142 | - return $remainder > $interval[1] ? $base+1 : $base; |
|
139 | + $interval=$this->getHalfRatingInterval(); |
|
140 | + $base=intval($rating) - 1; |
|
141 | + $remainder=$rating - $base - 1; |
|
142 | + return $remainder > $interval[1] ? $base + 1 : $base; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -147,8 +147,8 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function onSelectedIndexChanged($param) |
149 | 149 | { |
150 | - $value = $this->getRating(); |
|
151 | - $value = TPropertyValue::ensureInteger($value); |
|
150 | + $value=$this->getRating(); |
|
151 | + $value=TPropertyValue::ensureInteger($value); |
|
152 | 152 | $this->setRating($value); |
153 | 153 | parent::onSelectedIndexChanged($param); |
154 | 154 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | return $control; |
180 | 180 | } |
181 | 181 | throw new TInvalidDataValueException( |
182 | - 'ratinglist_invalid_caption_id',$id,$this->getID()); |
|
182 | + 'ratinglist_invalid_caption_id', $id, $this->getID()); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | */ |
247 | 247 | protected function getPostBackOptions() |
248 | 248 | { |
249 | - $options = parent::getPostBackOptions(); |
|
250 | - $options['AutoPostBack'] = $this->getAutoPostBack(); |
|
251 | - $options['ReadOnly'] = $this->getReadOnly(); |
|
252 | - $options['Style'] = $this->getRatingStyleCssClass(); |
|
253 | - $options['CaptionID'] = $this->getCaptionControlID(); |
|
254 | - $options['SelectedIndex'] = $this->getSelectedIndex(); |
|
255 | - $options['Rating'] = $this->getRating(); |
|
256 | - $options['HalfRating'] = $this->getHalfRatingInterval(); |
|
249 | + $options=parent::getPostBackOptions(); |
|
250 | + $options['AutoPostBack']=$this->getAutoPostBack(); |
|
251 | + $options['ReadOnly']=$this->getReadOnly(); |
|
252 | + $options['Style']=$this->getRatingStyleCssClass(); |
|
253 | + $options['CaptionID']=$this->getCaptionControlID(); |
|
254 | + $options['SelectedIndex']=$this->getSelectedIndex(); |
|
255 | + $options['Rating']=$this->getRating(); |
|
256 | + $options['HalfRating']=$this->getHalfRatingInterval(); |
|
257 | 257 | return $options; |
258 | 258 | } |
259 | 259 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | { |
283 | 283 | parent::onPreRender($param); |
284 | 284 | $this->publishStyle($this->getRatingStyle()); |
285 | - $this->_ratingImages = $this->publishImages($this->getRatingStyle()); |
|
285 | + $this->_ratingImages=$this->publishImages($this->getRatingStyle()); |
|
286 | 286 | $this->registerClientScript(); |
287 | 287 | } |
288 | 288 | |
@@ -292,8 +292,8 @@ discard block |
||
292 | 292 | */ |
293 | 293 | protected function publishStyle($style) |
294 | 294 | { |
295 | - $cs = $this->getPage()->getClientScript(); |
|
296 | - $url = $this->getAssetUrl($style.'.css'); |
|
295 | + $cs=$this->getPage()->getClientScript(); |
|
296 | + $url=$this->getAssetUrl($style.'.css'); |
|
297 | 297 | if(!$cs->isStyleSheetFileRegistered($url)) |
298 | 298 | $cs->registerStyleSheetFile($url, $url); |
299 | 299 | return $url; |
@@ -306,10 +306,10 @@ discard block |
||
306 | 306 | */ |
307 | 307 | protected function publishImages($style, $fileExt='.gif') |
308 | 308 | { |
309 | - $types = array('blank', 'selected', 'half', 'combined'); |
|
310 | - $files = array(); |
|
309 | + $types=array('blank', 'selected', 'half', 'combined'); |
|
310 | + $files=array(); |
|
311 | 311 | foreach($types as $type) |
312 | - $files[$type] = $this->getAssetUrl("{$style}_{$type}{$fileExt}"); |
|
312 | + $files[$type]=$this->getAssetUrl("{$style}_{$type}{$fileExt}"); |
|
313 | 313 | return $files; |
314 | 314 | } |
315 | 315 | |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | */ |
329 | 329 | protected function getAssetUrl($file='') |
330 | 330 | { |
331 | - $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
331 | + $base=$this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
332 | 332 | return $base.'/'.self::SCRIPT_PATH.'/'.$file; |
333 | 333 | } |
334 | 334 | |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | */ |
341 | 341 | public function render($writer) |
342 | 342 | { |
343 | - $writer->addAttribute('id',$this->getClientID()); |
|
343 | + $writer->addAttribute('id', $this->getClientID()); |
|
344 | 344 | $this->getPage()->getClientScript()->registerPostBackControl( |
345 | 345 | $this->getClientClassName(), $this->getPostBackOptions()); |
346 | 346 | parent::render($writer); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function processText($text) |
53 | 53 | { |
54 | - $result = Parsedown::instance()->parse($text); |
|
54 | + $result=Parsedown::instance()->parse($text); |
|
55 | 55 | return preg_replace_callback( |
56 | 56 | '/<pre><code class="language-(\w+)">((.|\n)*?)<\\/code><\\/pre>/im', |
57 | 57 | array($this, 'highlightCode'), $result); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | protected function highlightCode($matches) |
66 | 66 | { |
67 | - $text = html_entity_decode($matches[2],ENT_QUOTES,'UTF-8'); |
|
67 | + $text=html_entity_decode($matches[2], ENT_QUOTES, 'UTF-8'); |
|
68 | 68 | $this->setLanguage($matches[1]); |
69 | 69 | return parent::processText($text); |
70 | 70 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | protected function getTagName() |
39 | 39 | { |
40 | - return ($this->getForControl()==='')?'span':'label'; |
|
40 | + return ($this->getForControl()==='') ? 'span' : 'label'; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | protected function addAttributesToRender($writer) |
49 | 49 | { |
50 | 50 | if($this->_forControl!=='') |
51 | - $writer->addAttribute('for',$this->_forControl); |
|
51 | + $writer->addAttribute('for', $this->_forControl); |
|
52 | 52 | parent::addAttributesToRender($writer); |
53 | 53 | } |
54 | 54 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | } |
73 | 73 | else |
74 | - throw new TInvalidDataValueException('label_associatedcontrol_invalid',$aid); |
|
74 | + throw new TInvalidDataValueException('label_associatedcontrol_invalid', $aid); |
|
75 | 75 | } |
76 | 76 | else |
77 | 77 | parent::render($writer); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function getText() |
96 | 96 | { |
97 | - return $this->getViewState('Text',''); |
|
97 | + return $this->getViewState('Text', ''); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function setText($value) |
104 | 104 | { |
105 | - $this->setViewState('Text',TPropertyValue::ensureString($value),''); |
|
105 | + $this->setViewState('Text', TPropertyValue::ensureString($value), ''); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function getForControl() |
138 | 138 | { |
139 | - return $this->getViewState('ForControl',''); |
|
139 | + return $this->getViewState('ForControl', ''); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function setForControl($value) |
148 | 148 | { |
149 | - $this->setViewState('ForControl',$value,''); |
|
149 | + $this->setViewState('ForControl', $value, ''); |
|
150 | 150 | } |
151 | 151 | } |
152 | 152 |