@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function getControlToPaginate() |
82 | 82 | { |
83 | - return $this->getViewState('ControlToPaginate',''); |
|
83 | + return $this->getViewState('ControlToPaginate', ''); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function setControlToPaginate($value) |
93 | 93 | { |
94 | - $this->setViewState('ControlToPaginate',$value,''); |
|
94 | + $this->setViewState('ControlToPaginate', $value, ''); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function getButtonCssClass() |
102 | 102 | { |
103 | - return $this->getViewState('ButtonCssClass',''); |
|
103 | + return $this->getViewState('ButtonCssClass', ''); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function setButtonCssClass($value) |
111 | 111 | { |
112 | - $this->setViewState('ButtonCssClass',TPropertyValue::ensureString($value,''),''); |
|
112 | + $this->setViewState('ButtonCssClass', TPropertyValue::ensureString($value, ''), ''); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function getMode() |
119 | 119 | { |
120 | - return $this->getViewState('Mode',TPagerMode::NextPrev); |
|
120 | + return $this->getViewState('Mode', TPagerMode::NextPrev); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function setMode($value) |
127 | 127 | { |
128 | - $this->setViewState('Mode',TPropertyValue::ensureEnum($value,'TPagerMode'),TPagerMode::NextPrev); |
|
128 | + $this->setViewState('Mode', TPropertyValue::ensureEnum($value, 'TPagerMode'), TPagerMode::NextPrev); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function getButtonType() |
135 | 135 | { |
136 | - return $this->getViewState('ButtonType',TPagerButtonType::LinkButton); |
|
136 | + return $this->getViewState('ButtonType', TPagerButtonType::LinkButton); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function setButtonType($value) |
143 | 143 | { |
144 | - $this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'TPagerButtonType'),TPagerButtonType::LinkButton); |
|
144 | + $this->setViewState('ButtonType', TPropertyValue::ensureEnum($value, 'TPagerButtonType'), TPagerButtonType::LinkButton); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function getNextPageText() |
151 | 151 | { |
152 | - return $this->getViewState('NextPageText','>'); |
|
152 | + return $this->getViewState('NextPageText', '>'); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function setNextPageText($value) |
159 | 159 | { |
160 | - $this->setViewState('NextPageText',$value,'>'); |
|
160 | + $this->setViewState('NextPageText', $value, '>'); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public function getPrevPageText() |
167 | 167 | { |
168 | - return $this->getViewState('PrevPageText','<'); |
|
168 | + return $this->getViewState('PrevPageText', '<'); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | */ |
174 | 174 | public function setPrevPageText($value) |
175 | 175 | { |
176 | - $this->setViewState('PrevPageText',$value,'<'); |
|
176 | + $this->setViewState('PrevPageText', $value, '<'); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | */ |
182 | 182 | public function getFirstPageText() |
183 | 183 | { |
184 | - return $this->getViewState('FirstPageText','<<'); |
|
184 | + return $this->getViewState('FirstPageText', '<<'); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | public function setFirstPageText($value) |
191 | 191 | { |
192 | - $this->setViewState('FirstPageText',$value,'<<'); |
|
192 | + $this->setViewState('FirstPageText', $value, '<<'); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | */ |
198 | 198 | public function getLastPageText() |
199 | 199 | { |
200 | - return $this->getViewState('LastPageText','>>'); |
|
200 | + return $this->getViewState('LastPageText', '>>'); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | /** |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | public function setLastPageText($value) |
207 | 207 | { |
208 | - $this->setViewState('LastPageText',$value,'>>'); |
|
208 | + $this->setViewState('LastPageText', $value, '>>'); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | */ |
215 | 215 | public function getFirstPageImageUrl() |
216 | 216 | { |
217 | - return $this->getViewState('FirstPageImageUrl',''); |
|
217 | + return $this->getViewState('FirstPageImageUrl', ''); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | /** |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function setFirstPageImageUrl($value) |
225 | 225 | { |
226 | - $this->setViewState('FirstPageImageUrl',$value); |
|
226 | + $this->setViewState('FirstPageImageUrl', $value); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | */ |
233 | 233 | public function getLastPageImageUrl() |
234 | 234 | { |
235 | - return $this->getViewState('LastPageImageUrl',''); |
|
235 | + return $this->getViewState('LastPageImageUrl', ''); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | /** |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | */ |
242 | 242 | public function setLastPageImageUrl($value) |
243 | 243 | { |
244 | - $this->setViewState('LastPageImageUrl',$value); |
|
244 | + $this->setViewState('LastPageImageUrl', $value); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | /** |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | */ |
251 | 251 | public function getNextPageImageUrl() |
252 | 252 | { |
253 | - return $this->getViewState('NextPageImageUrl',''); |
|
253 | + return $this->getViewState('NextPageImageUrl', ''); |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | /** |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | */ |
260 | 260 | public function setNextPageImageUrl($value) |
261 | 261 | { |
262 | - $this->setViewState('NextPageImageUrl',$value); |
|
262 | + $this->setViewState('NextPageImageUrl', $value); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | /** |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | */ |
269 | 269 | public function getPrevPageImageUrl() |
270 | 270 | { |
271 | - return $this->getViewState('PrevPageImageUrl',''); |
|
271 | + return $this->getViewState('PrevPageImageUrl', ''); |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | /** |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | */ |
278 | 278 | public function setPrevPageImageUrl($value) |
279 | 279 | { |
280 | - $this->setViewState('PrevPageImageUrl',$value); |
|
280 | + $this->setViewState('PrevPageImageUrl', $value); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | */ |
288 | 288 | public function getNumericPageImageUrl() |
289 | 289 | { |
290 | - return $this->getViewState('NumericPageImageUrl',''); |
|
290 | + return $this->getViewState('NumericPageImageUrl', ''); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | /** |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | */ |
302 | 302 | public function setNumericPageImageUrl($value) |
303 | 303 | { |
304 | - $this->setViewState('NumericPageImageUrl',$value); |
|
304 | + $this->setViewState('NumericPageImageUrl', $value); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /** |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | */ |
310 | 310 | public function getPageButtonCount() |
311 | 311 | { |
312 | - return $this->getViewState('PageButtonCount',10); |
|
312 | + return $this->getViewState('PageButtonCount', 10); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | /** |
@@ -318,9 +318,9 @@ discard block |
||
318 | 318 | */ |
319 | 319 | public function setPageButtonCount($value) |
320 | 320 | { |
321 | - if(($value=TPropertyValue::ensureInteger($value))<1) |
|
321 | + if(($value=TPropertyValue::ensureInteger($value)) < 1) |
|
322 | 322 | throw new TInvalidDataValueException('pager_pagebuttoncount_invalid'); |
323 | - $this->setViewState('PageButtonCount',$value,10); |
|
323 | + $this->setViewState('PageButtonCount', $value, 10); |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | /** |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | */ |
329 | 329 | public function getCurrentPageIndex() |
330 | 330 | { |
331 | - return $this->getViewState('CurrentPageIndex',0); |
|
331 | + return $this->getViewState('CurrentPageIndex', 0); |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | /** |
@@ -337,9 +337,9 @@ discard block |
||
337 | 337 | */ |
338 | 338 | protected function setCurrentPageIndex($value) |
339 | 339 | { |
340 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
340 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
341 | 341 | throw new TInvalidDataValueException('pager_currentpageindex_invalid'); |
342 | - $this->setViewState('CurrentPageIndex',$value,0); |
|
342 | + $this->setViewState('CurrentPageIndex', $value, 0); |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | /** |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | */ |
348 | 348 | public function getPageCount() |
349 | 349 | { |
350 | - return $this->getViewState('PageCount',0); |
|
350 | + return $this->getViewState('PageCount', 0); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | /** |
@@ -356,9 +356,9 @@ discard block |
||
356 | 356 | */ |
357 | 357 | protected function setPageCount($value) |
358 | 358 | { |
359 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
359 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
360 | 360 | throw new TInvalidDataValueException('pager_pagecount_invalid'); |
361 | - $this->setViewState('PageCount',$value,0); |
|
361 | + $this->setViewState('PageCount', $value, 0); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | /** |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | */ |
375 | 375 | public function getIsLastPage() |
376 | 376 | { |
377 | - return $this->getCurrentPageIndex()===$this->getPageCount()-1; |
|
377 | + return $this->getCurrentPageIndex()===$this->getPageCount() - 1; |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | /** |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | |
390 | 390 | $controlID=$this->getControlToPaginate(); |
391 | 391 | if(($targetControl=$this->getNamingContainer()->findControl($controlID))===null || !($targetControl instanceof TDataBoundControl)) |
392 | - throw new TConfigurationException('pager_controltopaginate_invalid',$controlID); |
|
392 | + throw new TConfigurationException('pager_controltopaginate_invalid', $controlID); |
|
393 | 393 | |
394 | 394 | if($targetControl->getAllowPaging()) |
395 | 395 | { |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | */ |
412 | 412 | public function render($writer) |
413 | 413 | { |
414 | - if($this->_pageCount>1) |
|
414 | + if($this->_pageCount > 1) |
|
415 | 415 | parent::render($writer); |
416 | 416 | } |
417 | 417 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | * @param string CommandParameter corresponding to the OnCommand event of the button |
449 | 449 | * @return mixed the button instance |
450 | 450 | */ |
451 | - protected function createPagerButton($buttonType,$enabled,$text,$commandName,$commandParameter) |
|
451 | + protected function createPagerButton($buttonType, $enabled, $text, $commandName, $commandParameter) |
|
452 | 452 | { |
453 | 453 | if($buttonType===TPagerButtonType::LinkButton) |
454 | 454 | { |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | if($buttonType===TPagerButtonType::ImageButton) |
468 | 468 | { |
469 | 469 | $button=new TImageButton; |
470 | - $button->setImageUrl($this->getPageImageUrl($text,$commandName)); |
|
470 | + $button->setImageUrl($this->getPageImageUrl($text, $commandName)); |
|
471 | 471 | } |
472 | 472 | else |
473 | 473 | $button=new TButton; |
@@ -487,13 +487,13 @@ discard block |
||
487 | 487 | * @param string the command name associated with the image button |
488 | 488 | * @since 3.1.1 |
489 | 489 | */ |
490 | - protected function getPageImageUrl($text,$commandName) |
|
490 | + protected function getPageImageUrl($text, $commandName) |
|
491 | 491 | { |
492 | 492 | switch($commandName) |
493 | 493 | { |
494 | 494 | case self::CMD_PAGE: |
495 | 495 | $url=$this->getNumericPageImageUrl(); |
496 | - return str_replace('{0}',$text,$url); |
|
496 | + return str_replace('{0}', $text, $url); |
|
497 | 497 | case self::CMD_PAGE_NEXT: |
498 | 498 | return $this->getNextPageImageUrl(); |
499 | 499 | case self::CMD_PAGE_PREV: |
@@ -518,44 +518,44 @@ discard block |
||
518 | 518 | { |
519 | 519 | if(($text=$this->getFirstPageText())!=='') |
520 | 520 | { |
521 | - $label=$this->createPagerButton($buttonType,false,$text,self::CMD_PAGE_FIRST,''); |
|
521 | + $label=$this->createPagerButton($buttonType, false, $text, self::CMD_PAGE_FIRST, ''); |
|
522 | 522 | $controls->add($label); |
523 | 523 | $controls->add("\n"); |
524 | 524 | } |
525 | - $label=$this->createPagerButton($buttonType,false,$this->getPrevPageText(),self::CMD_PAGE_PREV,''); |
|
525 | + $label=$this->createPagerButton($buttonType, false, $this->getPrevPageText(), self::CMD_PAGE_PREV, ''); |
|
526 | 526 | $controls->add($label); |
527 | 527 | } |
528 | 528 | else |
529 | 529 | { |
530 | 530 | if(($text=$this->getFirstPageText())!=='') |
531 | 531 | { |
532 | - $button=$this->createPagerButton($buttonType,true,$text,self::CMD_PAGE_FIRST,''); |
|
532 | + $button=$this->createPagerButton($buttonType, true, $text, self::CMD_PAGE_FIRST, ''); |
|
533 | 533 | $controls->add($button); |
534 | 534 | $controls->add("\n"); |
535 | 535 | } |
536 | - $button=$this->createPagerButton($buttonType,true,$this->getPrevPageText(),self::CMD_PAGE_PREV,''); |
|
536 | + $button=$this->createPagerButton($buttonType, true, $this->getPrevPageText(), self::CMD_PAGE_PREV, ''); |
|
537 | 537 | $controls->add($button); |
538 | 538 | } |
539 | 539 | $controls->add("\n"); |
540 | 540 | if($this->getIsLastPage()) |
541 | 541 | { |
542 | - $label=$this->createPagerButton($buttonType,false,$this->getNextPageText(),self::CMD_PAGE_NEXT,''); |
|
542 | + $label=$this->createPagerButton($buttonType, false, $this->getNextPageText(), self::CMD_PAGE_NEXT, ''); |
|
543 | 543 | $controls->add($label); |
544 | 544 | if(($text=$this->getLastPageText())!=='') |
545 | 545 | { |
546 | 546 | $controls->add("\n"); |
547 | - $label=$this->createPagerButton($buttonType,false,$text,self::CMD_PAGE_LAST,''); |
|
547 | + $label=$this->createPagerButton($buttonType, false, $text, self::CMD_PAGE_LAST, ''); |
|
548 | 548 | $controls->add($label); |
549 | 549 | } |
550 | 550 | } |
551 | 551 | else |
552 | 552 | { |
553 | - $button=$this->createPagerButton($buttonType,true,$this->getNextPageText(),self::CMD_PAGE_NEXT,''); |
|
553 | + $button=$this->createPagerButton($buttonType, true, $this->getNextPageText(), self::CMD_PAGE_NEXT, ''); |
|
554 | 554 | $controls->add($button); |
555 | 555 | if(($text=$this->getLastPageText())!=='') |
556 | 556 | { |
557 | 557 | $controls->add("\n"); |
558 | - $button=$this->createPagerButton($buttonType,true,$text,self::CMD_PAGE_LAST,''); |
|
558 | + $button=$this->createPagerButton($buttonType, true, $text, self::CMD_PAGE_LAST, ''); |
|
559 | 559 | $controls->add($button); |
560 | 560 | } |
561 | 561 | } |
@@ -569,63 +569,63 @@ discard block |
||
569 | 569 | $buttonType=$this->getButtonType(); |
570 | 570 | $controls=$this->getControls(); |
571 | 571 | $pageCount=$this->getPageCount(); |
572 | - $pageIndex=$this->getCurrentPageIndex()+1; |
|
572 | + $pageIndex=$this->getCurrentPageIndex() + 1; |
|
573 | 573 | $maxButtonCount=$this->getPageButtonCount(); |
574 | - $buttonCount=$maxButtonCount>$pageCount?$pageCount:$maxButtonCount; |
|
574 | + $buttonCount=$maxButtonCount > $pageCount ? $pageCount : $maxButtonCount; |
|
575 | 575 | $startPageIndex=1; |
576 | 576 | $endPageIndex=$buttonCount; |
577 | - if($pageIndex>$endPageIndex) |
|
577 | + if($pageIndex > $endPageIndex) |
|
578 | 578 | { |
579 | - $startPageIndex=((int)(($pageIndex-1)/$maxButtonCount))*$maxButtonCount+1; |
|
580 | - if(($endPageIndex=$startPageIndex+$maxButtonCount-1)>$pageCount) |
|
579 | + $startPageIndex=((int) (($pageIndex - 1) / $maxButtonCount)) * $maxButtonCount + 1; |
|
580 | + if(($endPageIndex=$startPageIndex + $maxButtonCount - 1) > $pageCount) |
|
581 | 581 | $endPageIndex=$pageCount; |
582 | - if($endPageIndex-$startPageIndex+1<$maxButtonCount) |
|
582 | + if($endPageIndex - $startPageIndex + 1 < $maxButtonCount) |
|
583 | 583 | { |
584 | - if(($startPageIndex=$endPageIndex-$maxButtonCount+1)<1) |
|
584 | + if(($startPageIndex=$endPageIndex - $maxButtonCount + 1) < 1) |
|
585 | 585 | $startPageIndex=1; |
586 | 586 | } |
587 | 587 | } |
588 | 588 | |
589 | - if($startPageIndex>1) |
|
589 | + if($startPageIndex > 1) |
|
590 | 590 | { |
591 | 591 | if(($text=$this->getFirstPageText())!=='') |
592 | 592 | { |
593 | - $button=$this->createPagerButton($buttonType,true,$text,self::CMD_PAGE_FIRST,''); |
|
593 | + $button=$this->createPagerButton($buttonType, true, $text, self::CMD_PAGE_FIRST, ''); |
|
594 | 594 | $controls->add($button); |
595 | 595 | $controls->add("\n"); |
596 | 596 | } |
597 | - $prevPageIndex=$startPageIndex-1; |
|
598 | - $button=$this->createPagerButton($buttonType,true,$this->getPrevPageText(),self::CMD_PAGE,"$prevPageIndex"); |
|
597 | + $prevPageIndex=$startPageIndex - 1; |
|
598 | + $button=$this->createPagerButton($buttonType, true, $this->getPrevPageText(), self::CMD_PAGE, "$prevPageIndex"); |
|
599 | 599 | $controls->add($button); |
600 | 600 | $controls->add("\n"); |
601 | 601 | } |
602 | 602 | |
603 | - for($i=$startPageIndex;$i<=$endPageIndex;++$i) |
|
603 | + for($i=$startPageIndex; $i <= $endPageIndex; ++$i) |
|
604 | 604 | { |
605 | 605 | if($i===$pageIndex) |
606 | 606 | { |
607 | - $label=$this->createPagerButton($buttonType,false,"$i",self::CMD_PAGE,''); |
|
607 | + $label=$this->createPagerButton($buttonType, false, "$i", self::CMD_PAGE, ''); |
|
608 | 608 | $controls->add($label); |
609 | 609 | } |
610 | 610 | else |
611 | 611 | { |
612 | - $button=$this->createPagerButton($buttonType,true,"$i",self::CMD_PAGE,"$i"); |
|
612 | + $button=$this->createPagerButton($buttonType, true, "$i", self::CMD_PAGE, "$i"); |
|
613 | 613 | $controls->add($button); |
614 | 614 | } |
615 | - if($i<$endPageIndex) |
|
615 | + if($i < $endPageIndex) |
|
616 | 616 | $controls->add("\n"); |
617 | 617 | } |
618 | 618 | |
619 | - if($pageCount>$endPageIndex) |
|
619 | + if($pageCount > $endPageIndex) |
|
620 | 620 | { |
621 | 621 | $controls->add("\n"); |
622 | - $nextPageIndex=$endPageIndex+1; |
|
623 | - $button=$this->createPagerButton($buttonType,true,$this->getNextPageText(),self::CMD_PAGE,"$nextPageIndex"); |
|
622 | + $nextPageIndex=$endPageIndex + 1; |
|
623 | + $button=$this->createPagerButton($buttonType, true, $this->getNextPageText(), self::CMD_PAGE, "$nextPageIndex"); |
|
624 | 624 | $controls->add($button); |
625 | 625 | if(($text=$this->getLastPageText())!=='') |
626 | 626 | { |
627 | 627 | $controls->add("\n"); |
628 | - $button=$this->createPagerButton($buttonType,true,$text,self::CMD_PAGE_LAST,''); |
|
628 | + $button=$this->createPagerButton($buttonType, true, $text, self::CMD_PAGE_LAST, ''); |
|
629 | 629 | $controls->add($button); |
630 | 630 | } |
631 | 631 | } |
@@ -638,11 +638,11 @@ discard block |
||
638 | 638 | { |
639 | 639 | $list=new TDropDownList; |
640 | 640 | $this->getControls()->add($list); |
641 | - $list->setDataSource(range(1,$this->getPageCount())); |
|
641 | + $list->setDataSource(range(1, $this->getPageCount())); |
|
642 | 642 | $list->dataBind(); |
643 | 643 | $list->setSelectedIndex($this->getCurrentPageIndex()); |
644 | 644 | $list->setAutoPostBack(true); |
645 | - $list->attachEventHandler('OnSelectedIndexChanged',array($this,'listIndexChanged')); |
|
645 | + $list->attachEventHandler('OnSelectedIndexChanged', array($this, 'listIndexChanged')); |
|
646 | 646 | } |
647 | 647 | |
648 | 648 | /** |
@@ -651,10 +651,10 @@ discard block |
||
651 | 651 | * @param TDropDownList the dropdown list control raising the event |
652 | 652 | * @param TEventParameter event parameter |
653 | 653 | */ |
654 | - public function listIndexChanged($sender,$param) |
|
654 | + public function listIndexChanged($sender, $param) |
|
655 | 655 | { |
656 | 656 | $pageIndex=$sender->getSelectedIndex(); |
657 | - $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender,$pageIndex)); |
|
657 | + $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex)); |
|
658 | 658 | } |
659 | 659 | |
660 | 660 | /** |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | */ |
664 | 664 | public function onPageIndexChanged($param) |
665 | 665 | { |
666 | - $this->raiseEvent('OnPageIndexChanged',$this,$param); |
|
666 | + $this->raiseEvent('OnPageIndexChanged', $this, $param); |
|
667 | 667 | } |
668 | 668 | |
669 | 669 | /** |
@@ -674,37 +674,37 @@ discard block |
||
674 | 674 | * @param TEventParameter event parameter |
675 | 675 | * @return boolean whether the event bubbling should stop here. |
676 | 676 | */ |
677 | - public function bubbleEvent($sender,$param) |
|
677 | + public function bubbleEvent($sender, $param) |
|
678 | 678 | { |
679 | 679 | if($param instanceof TCommandEventParameter) |
680 | 680 | { |
681 | 681 | $command=$param->getCommandName(); |
682 | - if(strcasecmp($command,self::CMD_PAGE)===0) |
|
682 | + if(strcasecmp($command, self::CMD_PAGE)===0) |
|
683 | 683 | { |
684 | - $pageIndex=TPropertyValue::ensureInteger($param->getCommandParameter())-1; |
|
685 | - $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender,$pageIndex)); |
|
684 | + $pageIndex=TPropertyValue::ensureInteger($param->getCommandParameter()) - 1; |
|
685 | + $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex)); |
|
686 | 686 | return true; |
687 | 687 | } |
688 | - else if(strcasecmp($command,self::CMD_PAGE_NEXT)===0) |
|
688 | + else if(strcasecmp($command, self::CMD_PAGE_NEXT)===0) |
|
689 | 689 | { |
690 | - $pageIndex=$this->getCurrentPageIndex()+1; |
|
691 | - $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender,$pageIndex)); |
|
690 | + $pageIndex=$this->getCurrentPageIndex() + 1; |
|
691 | + $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex)); |
|
692 | 692 | return true; |
693 | 693 | } |
694 | - else if(strcasecmp($command,self::CMD_PAGE_PREV)===0) |
|
694 | + else if(strcasecmp($command, self::CMD_PAGE_PREV)===0) |
|
695 | 695 | { |
696 | - $pageIndex=$this->getCurrentPageIndex()-1; |
|
697 | - $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender,$pageIndex)); |
|
696 | + $pageIndex=$this->getCurrentPageIndex() - 1; |
|
697 | + $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex)); |
|
698 | 698 | return true; |
699 | 699 | } |
700 | - else if(strcasecmp($command,self::CMD_PAGE_FIRST)===0) |
|
700 | + else if(strcasecmp($command, self::CMD_PAGE_FIRST)===0) |
|
701 | 701 | { |
702 | - $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender,0)); |
|
702 | + $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, 0)); |
|
703 | 703 | return true; |
704 | 704 | } |
705 | - else if(strcasecmp($command,self::CMD_PAGE_LAST)===0) |
|
705 | + else if(strcasecmp($command, self::CMD_PAGE_LAST)===0) |
|
706 | 706 | { |
707 | - $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender,$this->getPageCount()-1)); |
|
707 | + $this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $this->getPageCount() - 1)); |
|
708 | 708 | return true; |
709 | 709 | } |
710 | 710 | return false; |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | * @param TControl the control originally raises the <b>OnCommand</b> event. |
745 | 745 | * @param integer new page index |
746 | 746 | */ |
747 | - public function __construct($source,$newPageIndex) |
|
747 | + public function __construct($source, $newPageIndex) |
|
748 | 748 | { |
749 | 749 | $this->_source=$source; |
750 | 750 | $this->_newIndex=$newPageIndex; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function setRepackUTF7($value) |
47 | 47 | { |
48 | - $this->setViewState('RepackUTF7',TPropertyValue::ensureBoolean($value),false); |
|
48 | + $this->setViewState('RepackUTF7', TPropertyValue::ensureBoolean($value), false); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function getRepackUTF7() |
55 | 55 | { |
56 | - return $this->getViewState('RepackUTF7',false); |
|
56 | + return $this->getViewState('RepackUTF7', false); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function render($writer) |
66 | 66 | { |
67 | - $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
67 | + $htmlWriter=Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
68 | 68 | parent::render($htmlWriter); |
69 | 69 | $writer->write($this->parseSafeHtml($htmlWriter->flush())); |
70 | 70 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | protected function parseSafeHtml($text) |
78 | 78 | { |
79 | - $renderer = Prado::createComponent('System.3rdParty.SafeHtml.TSafeHtmlParser'); |
|
79 | + $renderer=Prado::createComponent('System.3rdParty.SafeHtml.TSafeHtmlParser'); |
|
80 | 80 | return $renderer->parse($text, $this->getRepackUTF7()); |
81 | 81 | } |
82 | 82 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | /** |
80 | 80 | * @var array list of locale => language file pairs. |
81 | 81 | */ |
82 | - private static $_langs = array( |
|
82 | + private static $_langs=array( |
|
83 | 83 | 'ar' => 'ar', |
84 | 84 | 'az' => 'az', |
85 | 85 | 'be' => 'be', |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | /** |
165 | 165 | * @var array list of default plugins to load, override using getAvailablePlugins(); |
166 | 166 | */ |
167 | - private static $_plugins = array( |
|
167 | + private static $_plugins=array( |
|
168 | 168 | 'advhr', |
169 | 169 | 'advimage', |
170 | 170 | 'advlink', |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | /** |
209 | 209 | * @var array default themes to load |
210 | 210 | */ |
211 | - private static $_themes = array( |
|
211 | + private static $_themes=array( |
|
212 | 212 | 'simple', |
213 | 213 | 'advanced' |
214 | 214 | ); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | */ |
257 | 257 | public function getEnableVisualEdit() |
258 | 258 | { |
259 | - return $this->getViewState('EnableVisualEdit',true); |
|
259 | + return $this->getViewState('EnableVisualEdit', true); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | /** |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | */ |
266 | 266 | public function setEnableVisualEdit($value) |
267 | 267 | { |
268 | - $this->setViewState('EnableVisualEdit',TPropertyValue::ensureBoolean($value),true); |
|
268 | + $this->setViewState('EnableVisualEdit', TPropertyValue::ensureBoolean($value), true); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | { |
349 | 349 | if($this->getEnableVisualEdit() && $this->getEnabled(true)) |
350 | 350 | { |
351 | - $writer->addAttribute('id',$this->getClientID()); |
|
351 | + $writer->addAttribute('id', $this->getClientID()); |
|
352 | 352 | $this->registerEditorClientScript($writer); |
353 | 353 | } |
354 | 354 | |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | |
387 | 387 | protected function loadJavascriptLibrary() |
388 | 388 | { |
389 | - $scripts = $this->getPage()->getClientScript(); |
|
389 | + $scripts=$this->getPage()->getClientScript(); |
|
390 | 390 | $scripts->registerPradoScript('htmlarea'); |
391 | 391 | $scripts->registerScriptFile('prado:THtmlArea', $this->getScriptUrl()); |
392 | 392 | } |
@@ -397,16 +397,16 @@ discard block |
||
397 | 397 | protected function registerEditorClientScript($writer) |
398 | 398 | { |
399 | 399 | $this->loadJavascriptLibrary(); |
400 | - $scripts = $this->getPage()->getClientScript(); |
|
401 | - $options = array( |
|
400 | + $scripts=$this->getPage()->getClientScript(); |
|
401 | + $options=array( |
|
402 | 402 | 'EditorOptions' => $this->getEditorOptions() |
403 | 403 | ); |
404 | 404 | if($this->getEnableCompression()) |
405 | - $options['CompressionOptions'] = $this->getCompressionOptions(); |
|
405 | + $options['CompressionOptions']=$this->getCompressionOptions(); |
|
406 | 406 | |
407 | - $options = TJavaScript::encode($options,true,true); |
|
408 | - $script = "new {$this->getClientClassName()}($options)"; |
|
409 | - $scripts->registerEndScript('prado:THtmlArea'.$this->ClientID,$script); |
|
407 | + $options=TJavaScript::encode($options, true, true); |
|
408 | + $script="new {$this->getClientClassName()}($options)"; |
|
409 | + $scripts->registerEndScript('prado:THtmlArea'.$this->ClientID, $script); |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | /** |
@@ -426,22 +426,22 @@ discard block |
||
426 | 426 | */ |
427 | 427 | protected function getScriptDeploymentPath() |
428 | 428 | { |
429 | - $tarfile = Prado::getPathOfNamespace('System.3rdParty.TinyMCE.tiny_mce', '.tar'); |
|
430 | - $md5sum = Prado::getPathOfNamespace('System.3rdParty.TinyMCE.tiny_mce', '.md5'); |
|
429 | + $tarfile=Prado::getPathOfNamespace('System.3rdParty.TinyMCE.tiny_mce', '.tar'); |
|
430 | + $md5sum=Prado::getPathOfNamespace('System.3rdParty.TinyMCE.tiny_mce', '.md5'); |
|
431 | 431 | if($tarfile===null || $md5sum===null) |
432 | 432 | throw new TConfigurationException('htmlarea_tarfile_invalid'); |
433 | - $url = $this->getApplication()->getAssetManager()->publishTarFile($tarfile, $md5sum); |
|
433 | + $url=$this->getApplication()->getAssetManager()->publishTarFile($tarfile, $md5sum); |
|
434 | 434 | $this->copyCustomPlugins($url); |
435 | 435 | return $url; |
436 | 436 | } |
437 | 437 | |
438 | 438 | protected function copyCustomPlugins($url) |
439 | 439 | { |
440 | - if($plugins = $this->getCustomPluginPath()) |
|
440 | + if($plugins=$this->getCustomPluginPath()) |
|
441 | 441 | { |
442 | - $assets = $this->getApplication()->getAssetManager(); |
|
443 | - $path = is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins); |
|
444 | - $dest = $assets->getBasePath().'/'.basename($url).'/tiny_mce/plugins/'; |
|
442 | + $assets=$this->getApplication()->getAssetManager(); |
|
443 | + $path=is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins); |
|
444 | + $dest=$assets->getBasePath().'/'.basename($url).'/tiny_mce/plugins/'; |
|
445 | 445 | if(!is_dir($dest) || $this->getApplication()->getMode()!==TApplicationMode::Performance) |
446 | 446 | $assets->copyDirectory($path, $dest); |
447 | 447 | } |
@@ -453,26 +453,26 @@ discard block |
||
453 | 453 | */ |
454 | 454 | protected function getEditorOptions() |
455 | 455 | { |
456 | - $options['mode'] = 'exact'; |
|
457 | - $options['elements'] = $this->getClientID(); |
|
458 | - $options['language'] = $this->getLanguageSuffix($this->getCulture()); |
|
459 | - $options['theme'] = 'advanced'; |
|
456 | + $options['mode']='exact'; |
|
457 | + $options['elements']=$this->getClientID(); |
|
458 | + $options['language']=$this->getLanguageSuffix($this->getCulture()); |
|
459 | + $options['theme']='advanced'; |
|
460 | 460 | |
461 | 461 | //make it basic advanced to fit into 1 line of buttons. |
462 | 462 | //$options['theme_advanced_buttons1'] = 'bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright, justifyfull,separator,bullist,numlist,separator,undo,redo,separator,link,unlink,separator,charmap,separator,code,help'; |
463 | 463 | //$options['theme_advanced_buttons2'] = ' '; |
464 | - $options['theme_advanced_buttons1'] = 'formatselect,fontselect,fontsizeselect,separator,bold,italic,underline,strikethrough,sub,sup'; |
|
465 | - $options['theme_advanced_buttons2'] = 'justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,outdent,indent,separator,forecolor,backcolor,separator,hr,link,unlink,image,charmap,separator,removeformat,code,help'; |
|
466 | - $options['theme_advanced_buttons3'] = ''; |
|
467 | - |
|
468 | - $options['theme_advanced_toolbar_location'] = 'top'; |
|
469 | - $options['theme_advanced_toolbar_align'] = 'left'; |
|
470 | - $options['theme_advanced_path_location'] = 'bottom'; |
|
471 | - $options['extended_valid_elements'] = 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'; |
|
464 | + $options['theme_advanced_buttons1']='formatselect,fontselect,fontsizeselect,separator,bold,italic,underline,strikethrough,sub,sup'; |
|
465 | + $options['theme_advanced_buttons2']='justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,outdent,indent,separator,forecolor,backcolor,separator,hr,link,unlink,image,charmap,separator,removeformat,code,help'; |
|
466 | + $options['theme_advanced_buttons3']=''; |
|
467 | + |
|
468 | + $options['theme_advanced_toolbar_location']='top'; |
|
469 | + $options['theme_advanced_toolbar_align']='left'; |
|
470 | + $options['theme_advanced_path_location']='bottom'; |
|
471 | + $options['extended_valid_elements']='a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'; |
|
472 | 472 | if($this->getReadOnly()) |
473 | - $options['readonly'] = true; |
|
473 | + $options['readonly']=true; |
|
474 | 474 | |
475 | - $options = array_merge($options, $this->parseEditorOptions($this->getOptions())); |
|
475 | + $options=array_merge($options, $this->parseEditorOptions($this->getOptions())); |
|
476 | 476 | return $options; |
477 | 477 | } |
478 | 478 | |
@@ -482,20 +482,20 @@ discard block |
||
482 | 482 | */ |
483 | 483 | protected function parseEditorOptions($string) |
484 | 484 | { |
485 | - $options = array(); |
|
486 | - $substrings = preg_split('/,\s*\n|\n/', trim($string)); |
|
485 | + $options=array(); |
|
486 | + $substrings=preg_split('/,\s*\n|\n/', trim($string)); |
|
487 | 487 | foreach($substrings as $bits) |
488 | 488 | { |
489 | - $option = explode(":",$bits,2); |
|
489 | + $option=explode(":", $bits, 2); |
|
490 | 490 | |
491 | - if(count($option) == 2) |
|
491 | + if(count($option)==2) |
|
492 | 492 | { |
493 | - $value=trim(trim($option[1]),"'\""); |
|
494 | - if (($s=strtolower($value))==='false') |
|
493 | + $value=trim(trim($option[1]), "'\""); |
|
494 | + if(($s=strtolower($value))==='false') |
|
495 | 495 | $value=false; |
496 | - elseif ($s==='true') |
|
496 | + elseif($s==='true') |
|
497 | 497 | $value=true; |
498 | - $options[trim($option[0])] = $value; |
|
498 | + $options[trim($option[0])]=$value; |
|
499 | 499 | } |
500 | 500 | } |
501 | 501 | return $options; |
@@ -506,12 +506,12 @@ discard block |
||
506 | 506 | */ |
507 | 507 | protected function getLanguageSuffix($culture) |
508 | 508 | { |
509 | - $app = $this->getApplication()->getGlobalization(); |
|
509 | + $app=$this->getApplication()->getGlobalization(); |
|
510 | 510 | if(empty($culture) && ($app!==null)) |
511 | - $culture = $app->getCulture(); |
|
512 | - $variants = array(); |
|
511 | + $culture=$app->getCulture(); |
|
512 | + $variants=array(); |
|
513 | 513 | if($app!==null) |
514 | - $variants = $app->getCultureVariants($culture); |
|
514 | + $variants=$app->getCultureVariants($culture); |
|
515 | 515 | |
516 | 516 | foreach($variants as $variant) |
517 | 517 | { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function getButtonTag() |
62 | 62 | { |
63 | - return $this->getViewState('ButtonTag',TButtonTag::Input); |
|
63 | + return $this->getViewState('ButtonTag', TButtonTag::Input); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function setButtonTag($value) |
70 | 70 | { |
71 | - $this->setViewState('ButtonTag',TPropertyValue::ensureEnum($value,'TButtonTag'),TButtonTag::Input); |
|
71 | + $this->setViewState('ButtonTag', TPropertyValue::ensureEnum($value, 'TButtonTag'), TButtonTag::Input); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function getEnableClientScript() |
78 | 78 | { |
79 | - return $this->getViewState('EnableClientScript',true); |
|
79 | + return $this->getViewState('EnableClientScript', true); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function setEnableClientScript($value) |
86 | 86 | { |
87 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
87 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -96,20 +96,20 @@ discard block |
||
96 | 96 | { |
97 | 97 | $page=$this->getPage(); |
98 | 98 | $page->ensureRenderInForm($this); |
99 | - $writer->addAttribute('type',strtolower($this->getButtonType())); |
|
99 | + $writer->addAttribute('type', strtolower($this->getButtonType())); |
|
100 | 100 | if(($uniqueID=$this->getUniqueID())!=='') |
101 | - $writer->addAttribute('name',$uniqueID); |
|
101 | + $writer->addAttribute('name', $uniqueID); |
|
102 | 102 | if($this->getButtonTag()===TButtonTag::Button) |
103 | 103 | $this->addParsedObject($this->getText()); |
104 | 104 | else |
105 | - $writer->addAttribute('value',$this->getText()); |
|
105 | + $writer->addAttribute('value', $this->getText()); |
|
106 | 106 | if($this->getEnabled(true)) |
107 | 107 | { |
108 | 108 | if($this->getEnableClientScript() && $this->needPostBackScript()) |
109 | 109 | $this->renderClientControlScript($writer); |
110 | 110 | } |
111 | 111 | else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
112 | - $writer->addAttribute('disabled','disabled'); |
|
112 | + $writer->addAttribute('disabled', 'disabled'); |
|
113 | 113 | |
114 | 114 | parent::addAttributesToRender($writer); |
115 | 115 | } |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | */ |
120 | 120 | protected function renderClientControlScript($writer) |
121 | 121 | { |
122 | - $writer->addAttribute('id',$this->getClientID()); |
|
123 | - $this->getPage()->getClientScript()->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions()); |
|
122 | + $writer->addAttribute('id', $this->getClientID()); |
|
123 | + $this->getPage()->getClientScript()->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | if($this->getCausesValidation()) |
142 | 142 | { |
143 | 143 | $group=$this->getValidationGroup(); |
144 | - return $this->getPage()->getValidators($group)->getCount()>0; |
|
144 | + return $this->getPage()->getValidators($group)->getCount() > 0; |
|
145 | 145 | } |
146 | 146 | else |
147 | 147 | return false; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function setIsDefaultButton($value) |
154 | 154 | { |
155 | - $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value),false); |
|
155 | + $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value), false); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | { |
183 | 183 | $options['ID']=$this->getClientID(); |
184 | 184 | $options['CausesValidation']=$this->getCausesValidation(); |
185 | - $options['EventTarget'] = $this->getUniqueID(); |
|
185 | + $options['EventTarget']=$this->getUniqueID(); |
|
186 | 186 | $options['ValidationGroup']=$this->getValidationGroup(); |
187 | 187 | |
188 | 188 | return $options; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function onClick($param) |
211 | 211 | { |
212 | - $this->raiseEvent('OnClick',$this,$param); |
|
212 | + $this->raiseEvent('OnClick', $this, $param); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function onCommand($param) |
223 | 223 | { |
224 | - $this->raiseEvent('OnCommand',$this,$param); |
|
225 | - $this->raiseBubbleEvent($this,$param); |
|
224 | + $this->raiseEvent('OnCommand', $this, $param); |
|
225 | + $this->raiseBubbleEvent($this, $param); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | if($this->getCausesValidation()) |
240 | 240 | $this->getPage()->validate($this->getValidationGroup()); |
241 | 241 | $this->onClick(null); |
242 | - $this->onCommand(new TCommandEventParameter($this->getCommandName(),$this->getCommandParameter())); |
|
242 | + $this->onCommand(new TCommandEventParameter($this->getCommandName(), $this->getCommandParameter())); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | /** |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function getText() |
249 | 249 | { |
250 | - return $this->getViewState('Text',''); |
|
250 | + return $this->getViewState('Text', ''); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | */ |
256 | 256 | public function setText($value) |
257 | 257 | { |
258 | - $this->setViewState('Text',$value,''); |
|
258 | + $this->setViewState('Text', $value, ''); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | */ |
290 | 290 | public function getCausesValidation() |
291 | 291 | { |
292 | - return $this->getViewState('CausesValidation',true); |
|
292 | + return $this->getViewState('CausesValidation', true); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | /** |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | */ |
298 | 298 | public function setCausesValidation($value) |
299 | 299 | { |
300 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
300 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | */ |
306 | 306 | public function getCommandName() |
307 | 307 | { |
308 | - return $this->getViewState('CommandName',''); |
|
308 | + return $this->getViewState('CommandName', ''); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | /** |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | */ |
314 | 314 | public function setCommandName($value) |
315 | 315 | { |
316 | - $this->setViewState('CommandName',$value,''); |
|
316 | + $this->setViewState('CommandName', $value, ''); |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | /** |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | */ |
322 | 322 | public function getCommandParameter() |
323 | 323 | { |
324 | - return $this->getViewState('CommandParameter',''); |
|
324 | + return $this->getViewState('CommandParameter', ''); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | /** |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | */ |
330 | 330 | public function setCommandParameter($value) |
331 | 331 | { |
332 | - $this->setViewState('CommandParameter',$value,''); |
|
332 | + $this->setViewState('CommandParameter', $value, ''); |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | /** |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | */ |
338 | 338 | public function getValidationGroup() |
339 | 339 | { |
340 | - return $this->getViewState('ValidationGroup',''); |
|
340 | + return $this->getViewState('ValidationGroup', ''); |
|
341 | 341 | } |
342 | 342 | |
343 | 343 | /** |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | */ |
346 | 346 | public function setValidationGroup($value) |
347 | 347 | { |
348 | - $this->setViewState('ValidationGroup',$value,''); |
|
348 | + $this->setViewState('ValidationGroup', $value, ''); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | /** |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | */ |
354 | 354 | public function getButtonType() |
355 | 355 | { |
356 | - return $this->getViewState('ButtonType',TButtonType::Submit); |
|
356 | + return $this->getViewState('ButtonType', TButtonType::Submit); |
|
357 | 357 | } |
358 | 358 | |
359 | 359 | /** |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | */ |
362 | 362 | public function setButtonType($value) |
363 | 363 | { |
364 | - $this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'TButtonType'),TButtonType::Submit); |
|
364 | + $this->setViewState('ButtonType', TPropertyValue::ensureEnum($value, 'TButtonType'), TButtonType::Submit); |
|
365 | 365 | } |
366 | 366 | } |
367 | 367 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function getItemRenderer() |
55 | 55 | { |
56 | - return $this->getViewState('ItemRenderer',''); |
|
56 | + return $this->getViewState('ItemRenderer', ''); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function setItemRenderer($value) |
71 | 71 | { |
72 | - $this->setViewState('ItemRenderer',$value,''); |
|
72 | + $this->setViewState('ItemRenderer', $value, ''); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function getEditItemRenderer() |
80 | 80 | { |
81 | - return $this->getViewState('EditItemRenderer',''); |
|
81 | + return $this->getViewState('EditItemRenderer', ''); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function setEditItemRenderer($value) |
96 | 96 | { |
97 | - $this->setViewState('EditItemRenderer',$value,''); |
|
97 | + $this->setViewState('EditItemRenderer', $value, ''); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | if($value instanceof ITemplate || $value===null) |
115 | 115 | $this->_editItemTemplate=$value; |
116 | 116 | else |
117 | - throw new TInvalidDataTypeException('templatecolumn_template_required','EditItemTemplate'); |
|
117 | + throw new TInvalidDataTypeException('templatecolumn_template_required', 'EditItemTemplate'); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | if($value instanceof ITemplate || $value===null) |
135 | 135 | $this->_itemTemplate=$value; |
136 | 136 | else |
137 | - throw new TInvalidDataTypeException('templatecolumn_template_required','ItemTemplate'); |
|
137 | + throw new TInvalidDataTypeException('templatecolumn_template_required', 'ItemTemplate'); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | if($value instanceof ITemplate || $value===null) |
155 | 155 | $this->_headerTemplate=$value; |
156 | 156 | else |
157 | - throw new TInvalidDataTypeException('templatecolumn_template_required','HeaderTemplate'); |
|
157 | + throw new TInvalidDataTypeException('templatecolumn_template_required', 'HeaderTemplate'); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | if($value instanceof ITemplate || $value===null) |
175 | 175 | $this->_footerTemplate=$value; |
176 | 176 | else |
177 | - throw new TInvalidDataTypeException('templatecolumn_template_required','FooterTemplate'); |
|
177 | + throw new TInvalidDataTypeException('templatecolumn_template_required', 'FooterTemplate'); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | * @param integer the index to the Columns property that the cell resides in. |
187 | 187 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
188 | 188 | */ |
189 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
189 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
190 | 190 | { |
191 | 191 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem) |
192 | 192 | { |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $control->setItemType($itemType); |
214 | 214 | } |
215 | 215 | if($control instanceof IDataRenderer) |
216 | - $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
216 | + $control->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
217 | 217 | } |
218 | 218 | else if($template!==null) |
219 | 219 | $template->instantiateIn($cell); |
@@ -223,20 +223,20 @@ discard block |
||
223 | 223 | else if($itemType===TListItemType::Header) |
224 | 224 | { |
225 | 225 | if(($classPath=$this->getHeaderRenderer())!=='') |
226 | - $this->initializeHeaderCell($cell,$columnIndex); |
|
226 | + $this->initializeHeaderCell($cell, $columnIndex); |
|
227 | 227 | else if($this->_headerTemplate!==null) |
228 | 228 | $this->_headerTemplate->instantiateIn($cell); |
229 | 229 | else |
230 | - $this->initializeHeaderCell($cell,$columnIndex); |
|
230 | + $this->initializeHeaderCell($cell, $columnIndex); |
|
231 | 231 | } |
232 | 232 | else if($itemType===TListItemType::Footer) |
233 | 233 | { |
234 | 234 | if(($classPath=$this->getFooterRenderer())!=='') |
235 | - $this->initializeFooterCell($cell,$columnIndex); |
|
235 | + $this->initializeFooterCell($cell, $columnIndex); |
|
236 | 236 | else if($this->_footerTemplate!==null) |
237 | 237 | $this->_footerTemplate->instantiateIn($cell); |
238 | 238 | else |
239 | - $this->initializeFooterCell($cell,$columnIndex); |
|
239 | + $this->initializeFooterCell($cell, $columnIndex); |
|
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * This method is invoked when datagrid performs databinding. |
246 | 246 | * It populates the content of the cell with the relevant data from data source. |
247 | 247 | */ |
248 | - public function dataBindColumn($sender,$param) |
|
248 | + public function dataBindColumn($sender, $param) |
|
249 | 249 | { |
250 | 250 | $item=$sender->getNamingContainer(); |
251 | 251 | $sender->setData($item->getData()); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function getInitialValue() |
53 | 53 | { |
54 | - return $this->getViewState('InitialValue',$this->getControlPromptValue()); |
|
54 | + return $this->getViewState('InitialValue', $this->getControlPromptValue()); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | protected function getControlPromptValue() |
63 | 63 | { |
64 | - $control = $this->getValidationTarget(); |
|
64 | + $control=$this->getValidationTarget(); |
|
65 | 65 | if($control instanceof TListControl) |
66 | 66 | return $control->getPromptValue(); |
67 | 67 | return ''; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function setInitialValue($value) |
75 | 75 | { |
76 | - $this->setViewState('InitialValue',TPropertyValue::ensureString($value),''); |
|
76 | + $this->setViewState('InitialValue', TPropertyValue::ensureString($value), ''); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | protected function evaluateIsValid() |
91 | 91 | { |
92 | - $control = $this->getValidationTarget(); |
|
92 | + $control=$this->getValidationTarget(); |
|
93 | 93 | if($control instanceof TListControl) |
94 | 94 | return $this->validateListControl($control); |
95 | 95 | else if($control instanceof TRadioButton && strlen($control->getGroupName()) > 0) |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | |
101 | 101 | private function validateListControl($control) |
102 | 102 | { |
103 | - $initial = trim($this->getInitialValue()); |
|
104 | - $count = 0; |
|
103 | + $initial=trim($this->getInitialValue()); |
|
104 | + $count=0; |
|
105 | 105 | foreach($control->getItems() as $item) |
106 | 106 | { |
107 | - if($item->getSelected() && $item->getValue() != $initial) |
|
107 | + if($item->getSelected() && $item->getValue()!=$initial) |
|
108 | 108 | $count++; |
109 | 109 | } |
110 | 110 | return $count > 0; |
@@ -112,13 +112,13 @@ discard block |
||
112 | 112 | |
113 | 113 | private function validateRadioButtonGroup($control) |
114 | 114 | { |
115 | - $initial = trim($this->getInitialValue()); |
|
115 | + $initial=trim($this->getInitialValue()); |
|
116 | 116 | foreach($control->getRadioButtonsInGroup() as $radio) |
117 | 117 | { |
118 | 118 | if($radio->getChecked()) |
119 | 119 | { |
120 | - if(strlen($value = $radio->getValue()) > 0) |
|
121 | - return $value !== $initial; |
|
120 | + if(strlen($value=$radio->getValue()) > 0) |
|
121 | + return $value!==$initial; |
|
122 | 122 | else |
123 | 123 | return true; |
124 | 124 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | private function validateStandardControl($control) |
130 | 130 | { |
131 | - $initial = trim($this->getInitialValue()); |
|
131 | + $initial=trim($this->getInitialValue()); |
|
132 | 132 | $value=$this->getValidationValue($control); |
133 | 133 | return (is_bool($value) && $value) || trim($value)!==$initial; |
134 | 134 | } |
@@ -139,13 +139,13 @@ discard block |
||
139 | 139 | */ |
140 | 140 | protected function getClientScriptOptions() |
141 | 141 | { |
142 | - $options = parent::getClientScriptOptions(); |
|
142 | + $options=parent::getClientScriptOptions(); |
|
143 | 143 | $options['InitialValue']=$this->getInitialValue(); |
144 | - $control = $this->getValidationTarget(); |
|
144 | + $control=$this->getValidationTarget(); |
|
145 | 145 | if($control instanceof TListControl) |
146 | - $options['TotalItems'] = $control->getItemCount(); |
|
146 | + $options['TotalItems']=$control->getItemCount(); |
|
147 | 147 | if($control instanceof TRadioButton && strlen($control->getGroupName()) > 0) |
148 | - $options['GroupName'] = $control->getGroupName(); |
|
148 | + $options['GroupName']=$control->getGroupName(); |
|
149 | 149 | return $options; |
150 | 150 | } |
151 | 151 | } |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | */ |
37 | 37 | class TXmlTransform extends TControl { |
38 | 38 | |
39 | - const EXT_XML_FILE = '.xml'; |
|
40 | - const EXT_XSL_FILE = '.xsl'; |
|
39 | + const EXT_XML_FILE='.xml'; |
|
40 | + const EXT_XSL_FILE='.xsl'; |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Constructor |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function setTransformPath($value) { |
65 | 65 | if(!is_file($value)) { |
66 | - $value = Prado::getPathOfNamespace($value, self::EXT_XSL_FILE); |
|
67 | - if($value === null) { |
|
66 | + $value=Prado::getPathOfNamespace($value, self::EXT_XSL_FILE); |
|
67 | + if($value===null) { |
|
68 | 68 | throw new TInvalidDataValueException('xmltransform_transformpath_invalid', $value); |
69 | 69 | } |
70 | 70 | } |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function setDocumentPath($value) { |
100 | 100 | if(!is_file($value)) { |
101 | - $value = Prado::getPathOfNamespace($value, self::EXT_XML_FILE); |
|
102 | - if($value === null) { |
|
101 | + $value=Prado::getPathOfNamespace($value, self::EXT_XML_FILE); |
|
102 | + if($value===null) { |
|
103 | 103 | throw new TInvalidDataValueException('xmltransform_documentpath_invalid', $value); |
104 | 104 | } |
105 | 105 | } |
@@ -125,22 +125,22 @@ discard block |
||
125 | 125 | * @return TAttributeCollection the list of custom parameters |
126 | 126 | */ |
127 | 127 | public function getParameters() { |
128 | - if($params = $this->getViewState('Parameters',null)) { |
|
128 | + if($params=$this->getViewState('Parameters', null)) { |
|
129 | 129 | return $params; |
130 | 130 | } else { |
131 | - $params = new TAttributeCollection(); |
|
131 | + $params=new TAttributeCollection(); |
|
132 | 132 | $this->setViewState('Parameters', $params, null); |
133 | 133 | return $params; |
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | 137 | private function getTransformXmlDocument() { |
138 | - if(($content = $this->getTransformContent()) !== '') { |
|
139 | - $document = new DOMDocument(); |
|
138 | + if(($content=$this->getTransformContent())!=='') { |
|
139 | + $document=new DOMDocument(); |
|
140 | 140 | $document->loadXML($content); |
141 | 141 | return $document; |
142 | - } else if(($path = $this->getTransformPath()) !== '') { |
|
143 | - $document = new DOMDocument(); |
|
142 | + } else if(($path=$this->getTransformPath())!=='') { |
|
143 | + $document=new DOMDocument(); |
|
144 | 144 | $document->load($path); |
145 | 145 | return $document; |
146 | 146 | } else { |
@@ -149,12 +149,12 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | private function getSourceXmlDocument() { |
152 | - if(($content = $this->getDocumentContent()) !== '') { |
|
153 | - $document = new DOMDocument(); |
|
152 | + if(($content=$this->getDocumentContent())!=='') { |
|
153 | + $document=new DOMDocument(); |
|
154 | 154 | $document->loadXML($content); |
155 | 155 | return $document; |
156 | - } else if(($path = $this->getDocumentPath()) !== '') { |
|
157 | - $document = new DOMDocument(); |
|
156 | + } else if(($path=$this->getDocumentPath())!=='') { |
|
157 | + $document=new DOMDocument(); |
|
158 | 158 | $document->load($path); |
159 | 159 | return $document; |
160 | 160 | } else { |
@@ -167,24 +167,24 @@ discard block |
||
167 | 167 | * @param THtmlWriter The writer used for the rendering purpose |
168 | 168 | */ |
169 | 169 | public function render($writer) { |
170 | - if(($document=$this->getSourceXmlDocument()) === null) { |
|
171 | - $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
170 | + if(($document=$this->getSourceXmlDocument())===null) { |
|
171 | + $htmlWriter=Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
172 | 172 | parent::render($htmlWriter); |
173 | - $document = new DOMDocument(); |
|
173 | + $document=new DOMDocument(); |
|
174 | 174 | $document->loadXML($htmlWriter->flush()); |
175 | 175 | } |
176 | - $stylesheet = $this->getTransformXmlDocument(); |
|
176 | + $stylesheet=$this->getTransformXmlDocument(); |
|
177 | 177 | |
178 | 178 | // Perform XSL transformation |
179 | - $xslt = new XSLTProcessor(); |
|
179 | + $xslt=new XSLTProcessor(); |
|
180 | 180 | $xslt->importStyleSheet($stylesheet); |
181 | 181 | |
182 | 182 | // Check for parameters |
183 | - $parameters = $this->getParameters(); |
|
183 | + $parameters=$this->getParameters(); |
|
184 | 184 | foreach($parameters as $name => $value) { |
185 | 185 | $xslt->setParameter('', $name, $value); |
186 | 186 | } |
187 | - $output = $xslt->transformToXML($document); |
|
187 | + $output=$xslt->transformToXML($document); |
|
188 | 188 | |
189 | 189 | // Write output |
190 | 190 | $writer->write($output); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @param array the input data collection |
59 | 59 | * @return boolean whether the data of the control has been changed |
60 | 60 | */ |
61 | - public function loadPostData($key,$values) |
|
61 | + public function loadPostData($key, $values) |
|
62 | 62 | { |
63 | 63 | $checked=$this->getChecked(); |
64 | 64 | if($newChecked=isset($values[$key])) |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function onCheckedChanged($param) |
89 | 89 | { |
90 | - $this->raiseEvent('OnCheckedChanged',$this,$param); |
|
90 | + $this->raiseEvent('OnCheckedChanged', $this, $param); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function getText() |
148 | 148 | { |
149 | - return $this->getViewState('Text',''); |
|
149 | + return $this->getViewState('Text', ''); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function setText($value) |
157 | 157 | { |
158 | - $this->setViewState('Text',$value,''); |
|
158 | + $this->setViewState('Text', $value, ''); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function getValue() |
165 | 165 | { |
166 | - return $this->getViewState('Value',''); |
|
166 | + return $this->getViewState('Value', ''); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | public function setValue($value) |
173 | 173 | { |
174 | - $this->setViewState('Value',TPropertyValue::ensureString($value),''); |
|
174 | + $this->setViewState('Value', TPropertyValue::ensureString($value), ''); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public function getTextAlign() |
181 | 181 | { |
182 | - return $this->getViewState('TextAlign',TTextAlign::Right); |
|
182 | + return $this->getViewState('TextAlign', TTextAlign::Right); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | */ |
188 | 188 | public function setTextAlign($value) |
189 | 189 | { |
190 | - $this->setViewState('TextAlign',TPropertyValue::ensureEnum($value,'TTextAlign'),TTextAlign::Right); |
|
190 | + $this->setViewState('TextAlign', TPropertyValue::ensureEnum($value, 'TTextAlign'), TTextAlign::Right); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function getChecked() |
197 | 197 | { |
198 | - return $this->getViewState('Checked',false); |
|
198 | + return $this->getViewState('Checked', false); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public function setChecked($value) |
206 | 206 | { |
207 | - $this->setViewState('Checked',TPropertyValue::ensureBoolean($value),false); |
|
207 | + $this->setViewState('Checked', TPropertyValue::ensureBoolean($value), false); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | */ |
239 | 239 | public function getAutoPostBack() |
240 | 240 | { |
241 | - return $this->getViewState('AutoPostBack',false); |
|
241 | + return $this->getViewState('AutoPostBack', false); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function setAutoPostBack($value) |
249 | 249 | { |
250 | - $this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),false); |
|
250 | + $this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), false); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | */ |
256 | 256 | public function getCausesValidation() |
257 | 257 | { |
258 | - return $this->getViewState('CausesValidation',true); |
|
258 | + return $this->getViewState('CausesValidation', true); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | */ |
265 | 265 | public function setCausesValidation($value) |
266 | 266 | { |
267 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
267 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | /** |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | */ |
273 | 273 | public function getValidationGroup() |
274 | 274 | { |
275 | - return $this->getViewState('ValidationGroup',''); |
|
275 | + return $this->getViewState('ValidationGroup', ''); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | /** |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | */ |
281 | 281 | public function setValidationGroup($value) |
282 | 282 | { |
283 | - $this->setViewState('ValidationGroup',$value,''); |
|
283 | + $this->setViewState('ValidationGroup', $value, ''); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | /** |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | if($this->getHasStyle()) |
312 | 312 | $this->getStyle()->addAttributesToRender($writer); |
313 | 313 | if(($tooltip=$this->getToolTip())!=='') |
314 | - $writer->addAttribute('title',$tooltip); |
|
314 | + $writer->addAttribute('title', $tooltip); |
|
315 | 315 | if($this->getHasAttributes()) |
316 | 316 | { |
317 | 317 | $attributes=$this->getAttributes(); |
@@ -322,13 +322,13 @@ discard block |
||
322 | 322 | if($attributes->getCount()) |
323 | 323 | $writer->addAttributes($attributes); |
324 | 324 | if($value!==null) |
325 | - $attributes->add('value',$value); |
|
325 | + $attributes->add('value', $value); |
|
326 | 326 | } |
327 | 327 | else |
328 | 328 | $onclick=''; |
329 | 329 | if($needspan=$this->getSpanNeeded()) |
330 | 330 | { |
331 | - $writer->addAttribute('id',$this->getSurroundingTagID()); |
|
331 | + $writer->addAttribute('id', $this->getSurroundingTagID()); |
|
332 | 332 | $writer->renderBeginTag($this->getSurroundingTag()); |
333 | 333 | } |
334 | 334 | $clientID=$this->getClientID(); |
@@ -336,17 +336,17 @@ discard block |
||
336 | 336 | { |
337 | 337 | if($this->getTextAlign()===TTextAlign::Left) |
338 | 338 | { |
339 | - $this->renderLabel($writer,$clientID,$text); |
|
340 | - $this->renderInputTag($writer,$clientID,$onclick); |
|
339 | + $this->renderLabel($writer, $clientID, $text); |
|
340 | + $this->renderInputTag($writer, $clientID, $onclick); |
|
341 | 341 | } |
342 | 342 | else |
343 | 343 | { |
344 | - $this->renderInputTag($writer,$clientID,$onclick); |
|
345 | - $this->renderLabel($writer,$clientID,$text); |
|
344 | + $this->renderInputTag($writer, $clientID, $onclick); |
|
345 | + $this->renderLabel($writer, $clientID, $text); |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 | else |
349 | - $this->renderInputTag($writer,$clientID,$onclick); |
|
349 | + $this->renderInputTag($writer, $clientID, $onclick); |
|
350 | 350 | if($needspan) |
351 | 351 | $writer->renderEndTag(); |
352 | 352 | } |
@@ -356,12 +356,12 @@ discard block |
||
356 | 356 | */ |
357 | 357 | public function getLabelAttributes() |
358 | 358 | { |
359 | - if($attributes=$this->getViewState('LabelAttributes',null)) |
|
359 | + if($attributes=$this->getViewState('LabelAttributes', null)) |
|
360 | 360 | return $attributes; |
361 | 361 | else |
362 | 362 | { |
363 | 363 | $attributes=new TAttributeCollection; |
364 | - $this->setViewState('LabelAttributes',$attributes,null); |
|
364 | + $this->setViewState('LabelAttributes', $attributes, null); |
|
365 | 365 | return $attributes; |
366 | 366 | } |
367 | 367 | } |
@@ -371,12 +371,12 @@ discard block |
||
371 | 371 | */ |
372 | 372 | public function getInputAttributes() |
373 | 373 | { |
374 | - if($attributes=$this->getViewState('InputAttributes',null)) |
|
374 | + if($attributes=$this->getViewState('InputAttributes', null)) |
|
375 | 375 | return $attributes; |
376 | 376 | else |
377 | 377 | { |
378 | 378 | $attributes=new TAttributeCollection; |
379 | - $this->setViewState('InputAttributes',$attributes,null); |
|
379 | + $this->setViewState('InputAttributes', $attributes, null); |
|
380 | 380 | return $attributes; |
381 | 381 | } |
382 | 382 | } |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | return $value; |
391 | 391 | else |
392 | 392 | { |
393 | - $attributes=$this->getViewState('InputAttributes',null); |
|
393 | + $attributes=$this->getViewState('InputAttributes', null); |
|
394 | 394 | if($attributes && $attributes->contains('value')) |
395 | 395 | return $attributes->itemAt('value'); |
396 | 396 | else if($this->hasAttribute('value')) |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | */ |
406 | 406 | public function getEnableClientScript() |
407 | 407 | { |
408 | - return $this->getViewState('EnableClientScript',true); |
|
408 | + return $this->getViewState('EnableClientScript', true); |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | /** |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | */ |
414 | 414 | public function setEnableClientScript($value) |
415 | 415 | { |
416 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
416 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | /** |
@@ -432,10 +432,10 @@ discard block |
||
432 | 432 | * @param string checkbox id |
433 | 433 | * @param string label text |
434 | 434 | */ |
435 | - protected function renderLabel($writer,$clientID,$text) |
|
435 | + protected function renderLabel($writer, $clientID, $text) |
|
436 | 436 | { |
437 | - $writer->addAttribute('for',$clientID); |
|
438 | - if($attributes=$this->getViewState('LabelAttributes',null)) |
|
437 | + $writer->addAttribute('for', $clientID); |
|
438 | + if($attributes=$this->getViewState('LabelAttributes', null)) |
|
439 | 439 | $writer->addAttributes($attributes); |
440 | 440 | $writer->renderBeginTag('label'); |
441 | 441 | $writer->write($text); |
@@ -448,21 +448,21 @@ discard block |
||
448 | 448 | * @param string checkbox id |
449 | 449 | * @param string onclick js |
450 | 450 | */ |
451 | - protected function renderInputTag($writer,$clientID,$onclick) |
|
451 | + protected function renderInputTag($writer, $clientID, $onclick) |
|
452 | 452 | { |
453 | 453 | if($clientID!=='') |
454 | - $writer->addAttribute('id',$clientID); |
|
455 | - $writer->addAttribute('type','checkbox'); |
|
454 | + $writer->addAttribute('id', $clientID); |
|
455 | + $writer->addAttribute('type', 'checkbox'); |
|
456 | 456 | if(($value=$this->getValueAttribute())!=='') |
457 | - $writer->addAttribute('value',$value); |
|
457 | + $writer->addAttribute('value', $value); |
|
458 | 458 | if(!empty($onclick)) |
459 | - $writer->addAttribute('onclick',$onclick); |
|
459 | + $writer->addAttribute('onclick', $onclick); |
|
460 | 460 | if(($uniqueID=$this->getUniqueID())!=='') |
461 | - $writer->addAttribute('name',$uniqueID); |
|
461 | + $writer->addAttribute('name', $uniqueID); |
|
462 | 462 | if($this->getChecked()) |
463 | - $writer->addAttribute('checked','checked'); |
|
463 | + $writer->addAttribute('checked', 'checked'); |
|
464 | 464 | if(!$this->getEnabled(true)) |
465 | - $writer->addAttribute('disabled','disabled'); |
|
465 | + $writer->addAttribute('disabled', 'disabled'); |
|
466 | 466 | |
467 | 467 | $page=$this->getPage(); |
468 | 468 | if($this->getEnabled(true) |
@@ -474,10 +474,10 @@ discard block |
||
474 | 474 | } |
475 | 475 | |
476 | 476 | if(($accesskey=$this->getAccessKey())!=='') |
477 | - $writer->addAttribute('accesskey',$accesskey); |
|
478 | - if(($tabindex=$this->getTabIndex())>0) |
|
479 | - $writer->addAttribute('tabindex',"$tabindex"); |
|
480 | - if($attributes=$this->getViewState('InputAttributes',null)) |
|
477 | + $writer->addAttribute('accesskey', $accesskey); |
|
478 | + if(($tabindex=$this->getTabIndex()) > 0) |
|
479 | + $writer->addAttribute('tabindex', "$tabindex"); |
|
480 | + if($attributes=$this->getViewState('InputAttributes', null)) |
|
481 | 481 | $writer->addAttributes($attributes); |
482 | 482 | $writer->renderBeginTag('input'); |
483 | 483 | $writer->renderEndTag(); |
@@ -488,8 +488,8 @@ discard block |
||
488 | 488 | */ |
489 | 489 | protected function renderClientControlScript($writer) |
490 | 490 | { |
491 | - $cs = $this->getPage()->getClientScript(); |
|
492 | - $cs->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions()); |
|
491 | + $cs=$this->getPage()->getClientScript(); |
|
492 | + $cs->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions()); |
|
493 | 493 | } |
494 | 494 | |
495 | 495 | /** |
@@ -508,10 +508,10 @@ discard block |
||
508 | 508 | */ |
509 | 509 | protected function getPostBackOptions() |
510 | 510 | { |
511 | - $options['ID'] = $this->getClientID(); |
|
512 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
513 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
514 | - $options['EventTarget'] = $this->getUniqueID(); |
|
511 | + $options['ID']=$this->getClientID(); |
|
512 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
513 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
514 | + $options['EventTarget']=$this->getUniqueID(); |
|
515 | 515 | return $options; |
516 | 516 | } |
517 | 517 | } |
@@ -54,16 +54,16 @@ discard block |
||
54 | 54 | protected function __getZappableSleepProps(&$exprops) |
55 | 55 | { |
56 | 56 | parent::__getZappableSleepProps($exprops); |
57 | - if ($this->_backImageUrl===null) |
|
58 | - $exprops[] = "\0TPanelStyle\0_backImageUrl"; |
|
59 | - if ($this->_direction===null) |
|
60 | - $exprops[] = "\0TPanelStyle\0_direction"; |
|
61 | - if ($this->_horizontalAlign===null) |
|
62 | - $exprops[] = "\0TPanelStyle\0_horizontalAlign"; |
|
63 | - if ($this->_scrollBars===null) |
|
64 | - $exprops[] = "\0TPanelStyle\0_scrollBars"; |
|
65 | - if ($this->_wrap===null) |
|
66 | - $exprops[] = "\0TPanelStyle\0_wrap"; |
|
57 | + if($this->_backImageUrl===null) |
|
58 | + $exprops[]="\0TPanelStyle\0_backImageUrl"; |
|
59 | + if($this->_direction===null) |
|
60 | + $exprops[]="\0TPanelStyle\0_direction"; |
|
61 | + if($this->_horizontalAlign===null) |
|
62 | + $exprops[]="\0TPanelStyle\0_horizontalAlign"; |
|
63 | + if($this->_scrollBars===null) |
|
64 | + $exprops[]="\0TPanelStyle\0_scrollBars"; |
|
65 | + if($this->_wrap===null) |
|
66 | + $exprops[]="\0TPanelStyle\0_wrap"; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -74,28 +74,28 @@ discard block |
||
74 | 74 | public function addAttributesToRender($writer) |
75 | 75 | { |
76 | 76 | if(($url=trim($this->getBackImageUrl()))!=='') |
77 | - $this->setStyleField('background-image','url('.$url.')'); |
|
77 | + $this->setStyleField('background-image', 'url('.$url.')'); |
|
78 | 78 | |
79 | 79 | switch($this->getScrollBars()) |
80 | 80 | { |
81 | - case TScrollBars::Horizontal: $this->setStyleField('overflow-x','scroll'); break; |
|
82 | - case TScrollBars::Vertical: $this->setStyleField('overflow-y','scroll'); break; |
|
83 | - case TScrollBars::Both: $this->setStyleField('overflow','scroll'); break; |
|
84 | - case TScrollBars::Auto: $this->setStyleField('overflow','auto'); break; |
|
81 | + case TScrollBars::Horizontal: $this->setStyleField('overflow-x', 'scroll'); break; |
|
82 | + case TScrollBars::Vertical: $this->setStyleField('overflow-y', 'scroll'); break; |
|
83 | + case TScrollBars::Both: $this->setStyleField('overflow', 'scroll'); break; |
|
84 | + case TScrollBars::Auto: $this->setStyleField('overflow', 'auto'); break; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | if(($align=$this->getHorizontalAlign())!==THorizontalAlign::NotSet) |
88 | - $this->setStyleField('text-align',strtolower($align)); |
|
88 | + $this->setStyleField('text-align', strtolower($align)); |
|
89 | 89 | |
90 | 90 | if(!$this->getWrap()) |
91 | - $this->setStyleField('white-space','nowrap'); |
|
91 | + $this->setStyleField('white-space', 'nowrap'); |
|
92 | 92 | |
93 | 93 | if(($direction=$this->getDirection())!==TContentDirection::NotSet) |
94 | 94 | { |
95 | 95 | if($direction===TContentDirection::LeftToRight) |
96 | - $this->setStyleField('direction','ltr'); |
|
96 | + $this->setStyleField('direction', 'ltr'); |
|
97 | 97 | else |
98 | - $this->setStyleField('direction','rtl'); |
|
98 | + $this->setStyleField('direction', 'rtl'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | parent::addAttributesToRender($writer); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function getBackImageUrl() |
108 | 108 | { |
109 | - return $this->_backImageUrl===null?'':$this->_backImageUrl; |
|
109 | + return $this->_backImageUrl===null ? '' : $this->_backImageUrl; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function getDirection() |
125 | 125 | { |
126 | - return $this->_direction===null?TContentDirection::NotSet:$this->_direction; |
|
126 | + return $this->_direction===null ? TContentDirection::NotSet : $this->_direction; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function setDirection($value) |
133 | 133 | { |
134 | - $this->_direction=TPropertyValue::ensureEnum($value,'TContentDirection'); |
|
134 | + $this->_direction=TPropertyValue::ensureEnum($value, 'TContentDirection'); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function getWrap() |
141 | 141 | { |
142 | - return $this->_wrap===null?true:$this->_wrap; |
|
142 | + return $this->_wrap===null ? true : $this->_wrap; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public function getHorizontalAlign() |
158 | 158 | { |
159 | - return $this->_horizontalAlign===null?THorizontalAlign::NotSet:$this->_horizontalAlign; |
|
159 | + return $this->_horizontalAlign===null ? THorizontalAlign::NotSet : $this->_horizontalAlign; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public function setHorizontalAlign($value) |
167 | 167 | { |
168 | - $this->_horizontalAlign=TPropertyValue::ensureEnum($value,'THorizontalAlign'); |
|
168 | + $this->_horizontalAlign=TPropertyValue::ensureEnum($value, 'THorizontalAlign'); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | */ |
174 | 174 | public function getScrollBars() |
175 | 175 | { |
176 | - return $this->_scrollBars===null?TScrollBars::None:$this->_scrollBars; |
|
176 | + return $this->_scrollBars===null ? TScrollBars::None : $this->_scrollBars; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | */ |
182 | 182 | public function setScrollBars($value) |
183 | 183 | { |
184 | - $this->_scrollBars=TPropertyValue::ensureEnum($value,'TScrollBars'); |
|
184 | + $this->_scrollBars=TPropertyValue::ensureEnum($value, 'TScrollBars'); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |