@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function getActiveViewIndex() |
96 | 96 | { |
97 | - return $this->getViewState('ActiveViewIndex',0); |
|
97 | + return $this->getViewState('ActiveViewIndex', 0); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function setActiveViewIndex($value) |
105 | 105 | { |
106 | - $this->setViewState('ActiveViewIndex',TPropertyValue::ensureInteger($value),0); |
|
106 | + $this->setViewState('ActiveViewIndex', TPropertyValue::ensureInteger($value), 0); |
|
107 | 107 | $this->setActiveViewID(''); |
108 | 108 | } |
109 | 109 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function getActiveViewID() |
117 | 117 | { |
118 | - return $this->getViewState('ActiveViewID',''); |
|
118 | + return $this->getViewState('ActiveViewID', ''); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function setActiveViewID($value) |
125 | 125 | { |
126 | - $this->setViewState('ActiveViewID',$value,''); |
|
126 | + $this->setViewState('ActiveViewID', $value, ''); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -139,17 +139,17 @@ discard block |
||
139 | 139 | $views=$this->getViews(); |
140 | 140 | if(($id=$this->getActiveViewID())!=='') |
141 | 141 | { |
142 | - if(($index=$views->findIndexByID($id))>=0) |
|
142 | + if(($index=$views->findIndexByID($id)) >= 0) |
|
143 | 143 | $activeView=$views->itemAt($index); |
144 | 144 | else |
145 | - throw new TInvalidDataValueException('accordion_activeviewid_invalid',$id); |
|
145 | + throw new TInvalidDataValueException('accordion_activeviewid_invalid', $id); |
|
146 | 146 | } |
147 | - else if(($index=$this->getActiveViewIndex())>=0) |
|
147 | + else if(($index=$this->getActiveViewIndex()) >= 0) |
|
148 | 148 | { |
149 | - if($index<$views->getCount()) |
|
149 | + if($index < $views->getCount()) |
|
150 | 150 | $activeView=$views->itemAt($index); |
151 | 151 | else |
152 | - throw new TInvalidDataValueException('accordion_activeviewindex_invalid',$index); |
|
152 | + throw new TInvalidDataValueException('accordion_activeviewindex_invalid', $index); |
|
153 | 153 | } |
154 | 154 | else |
155 | 155 | { |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | */ |
174 | 174 | public function setActiveView($view) |
175 | 175 | { |
176 | - if($this->getViews()->indexOf($view)>=0) |
|
176 | + if($this->getViews()->indexOf($view) >= 0) |
|
177 | 177 | $this->activateView($view); |
178 | 178 | else |
179 | 179 | throw new TInvalidOperationException('accordion_view_inexistent'); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function getCssUrl() |
186 | 186 | { |
187 | - return $this->getViewState('CssUrl','default'); |
|
187 | + return $this->getViewState('CssUrl', 'default'); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function setCssUrl($value) |
194 | 194 | { |
195 | - $this->setViewState('CssUrl',TPropertyValue::ensureString($value),''); |
|
195 | + $this->setViewState('CssUrl', TPropertyValue::ensureString($value), ''); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | public function getCssClass() |
202 | 202 | { |
203 | 203 | $cssClass=parent::getCssClass(); |
204 | - return $cssClass===''?'accordion':$cssClass; |
|
204 | + return $cssClass==='' ? 'accordion' : $cssClass; |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | public function getAnimationDuration() |
227 | 227 | { |
228 | - return $this->getViewState('AnimationDuration','1'); |
|
228 | + return $this->getViewState('AnimationDuration', '1'); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function setAnimationDuration($value) |
235 | 235 | { |
236 | - $this->setViewState('AnimationDuration',$value); |
|
236 | + $this->setViewState('AnimationDuration', $value); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | /** |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | */ |
242 | 242 | public function getViewStyle() |
243 | 243 | { |
244 | - if(($style=$this->getViewState('ViewStyle',null))===null) |
|
244 | + if(($style=$this->getViewState('ViewStyle', null))===null) |
|
245 | 245 | { |
246 | 246 | $style=new TStyle; |
247 | 247 | $style->setCssClass('accordion-view'); |
248 | - $this->setViewState('ViewStyle',$style,null); |
|
248 | + $this->setViewState('ViewStyle', $style, null); |
|
249 | 249 | } |
250 | 250 | return $style; |
251 | 251 | } |
@@ -271,11 +271,11 @@ discard block |
||
271 | 271 | */ |
272 | 272 | public function getHeaderStyle() |
273 | 273 | { |
274 | - if(($style=$this->getViewState('HeaderStyle',null))===null) |
|
274 | + if(($style=$this->getViewState('HeaderStyle', null))===null) |
|
275 | 275 | { |
276 | 276 | $style=new TStyle; |
277 | 277 | $style->setCssClass('accordion-header'); |
278 | - $this->setViewState('HeaderStyle',$style,null); |
|
278 | + $this->setViewState('HeaderStyle', $style, null); |
|
279 | 279 | } |
280 | 280 | return $style; |
281 | 281 | } |
@@ -301,11 +301,11 @@ discard block |
||
301 | 301 | */ |
302 | 302 | public function getActiveHeaderStyle() |
303 | 303 | { |
304 | - if(($style=$this->getViewState('ActiveHeaderStyle',null))===null) |
|
304 | + if(($style=$this->getViewState('ActiveHeaderStyle', null))===null) |
|
305 | 305 | { |
306 | 306 | $style=new TStyle; |
307 | 307 | $style->setCssClass('accordion-header-active'); |
308 | - $this->setViewState('ActiveHeaderStyle',$style,null); |
|
308 | + $this->setViewState('ActiveHeaderStyle', $style, null); |
|
309 | 309 | } |
310 | 310 | return $style; |
311 | 311 | } |
@@ -355,11 +355,11 @@ discard block |
||
355 | 355 | * @param array the input data collection |
356 | 356 | * @return boolean whether the data of the control has been changed |
357 | 357 | */ |
358 | - public function loadPostData($key,$values) |
|
358 | + public function loadPostData($key, $values) |
|
359 | 359 | { |
360 | 360 | if(($index=$values[$this->getClientID().'_1'])!==null) |
361 | 361 | { |
362 | - $index=(int)$index; |
|
362 | + $index=(int) $index; |
|
363 | 363 | $currentIndex=$this->getActiveViewIndex(); |
364 | 364 | if($currentIndex!==$index) |
365 | 365 | { |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | */ |
400 | 400 | protected function addAttributesToRender($writer) |
401 | 401 | { |
402 | - $writer->addAttribute('id',$this->getClientID()); |
|
402 | + $writer->addAttribute('id', $this->getClientID()); |
|
403 | 403 | $this->setCssClass($this->getCssClass()); |
404 | 404 | parent::addAttributesToRender($writer); |
405 | 405 | } |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | public function onPreRender($param) |
413 | 413 | { |
414 | 414 | parent::onPreRender($param); |
415 | - $this->getActiveView(); // determine the active view |
|
415 | + $this->getActiveView(); // determine the active view |
|
416 | 416 | $this->registerStyleSheet(); |
417 | 417 | } |
418 | 418 | |
@@ -423,17 +423,17 @@ discard block |
||
423 | 423 | */ |
424 | 424 | protected function registerStyleSheet() |
425 | 425 | { |
426 | - $url = $this->getCssUrl(); |
|
426 | + $url=$this->getCssUrl(); |
|
427 | 427 | |
428 | - if($url === '') { |
|
428 | + if($url==='') { |
|
429 | 429 | return; |
430 | 430 | } |
431 | 431 | |
432 | - if($url === 'default') { |
|
433 | - $url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'accordion.css'); |
|
432 | + if($url==='default') { |
|
433 | + $url=$this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'accordion.css'); |
|
434 | 434 | } |
435 | 435 | |
436 | - if($url !== '') { |
|
436 | + if($url!=='') { |
|
437 | 437 | $this->getPage()->getClientScript()->registerStyleSheetFile($url, $url); |
438 | 438 | } |
439 | 439 | } |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | $code="new $className($options);"; |
453 | 453 | $cs->registerEndScript("prado:$id", $code); |
454 | 454 | // ensure an item is always active and visible |
455 | - $index = $this->getActiveViewIndex(); |
|
455 | + $index=$this->getActiveViewIndex(); |
|
456 | 456 | if(!$this->getViews()->itemAt($index)->Visible) |
457 | 457 | $index=0; |
458 | 458 | $cs->registerHiddenField($id.'_1', $index); |
@@ -475,17 +475,17 @@ discard block |
||
475 | 475 | */ |
476 | 476 | protected function getClientOptions() |
477 | 477 | { |
478 | - $options['ID'] = $this->getClientID(); |
|
479 | - $options['ActiveHeaderCssClass'] = $this->getActiveHeaderCssClass(); |
|
480 | - $options['HeaderCssClass'] = $this->getHeaderCssClass(); |
|
481 | - $options['Duration'] = $this->getAnimationDuration(); |
|
478 | + $options['ID']=$this->getClientID(); |
|
479 | + $options['ActiveHeaderCssClass']=$this->getActiveHeaderCssClass(); |
|
480 | + $options['HeaderCssClass']=$this->getHeaderCssClass(); |
|
481 | + $options['Duration']=$this->getAnimationDuration(); |
|
482 | 482 | |
483 | - if (($viewheight = $this->getViewHeight())>0) |
|
484 | - $options['maxHeight'] = $viewheight; |
|
485 | - $views = array(); |
|
483 | + if(($viewheight=$this->getViewHeight()) > 0) |
|
484 | + $options['maxHeight']=$viewheight; |
|
485 | + $views=array(); |
|
486 | 486 | foreach($this->getViews() as $view) |
487 | - $views[$view->getClientID()] = $view->getVisible() ? '1': '0'; |
|
488 | - $options['Views'] = $views; |
|
487 | + $views[$view->getClientID()]=$view->getVisible() ? '1' : '0'; |
|
488 | + $options['Views']=$views; |
|
489 | 489 | |
490 | 490 | return $options; |
491 | 491 | } |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | public function renderContents($writer) |
521 | 521 | { |
522 | 522 | $views=$this->getViews(); |
523 | - if($views->getCount()>0) |
|
523 | + if($views->getCount() > 0) |
|
524 | 524 | { |
525 | 525 | $writer->writeLine(); |
526 | 526 | foreach($views as $view) |
@@ -566,13 +566,13 @@ discard block |
||
566 | 566 | protected function addAttributesToRender($writer) |
567 | 567 | { |
568 | 568 | if(!$this->getActive() && $this->getPage()->getClientSupportsJavaScript()) |
569 | - $this->getStyle()->setStyleField('display','none'); |
|
569 | + $this->getStyle()->setStyleField('display', 'none'); |
|
570 | 570 | |
571 | 571 | $this->getStyle()->mergeWith($this->getParent()->getViewStyle()); |
572 | 572 | |
573 | 573 | parent::addAttributesToRender($writer); |
574 | 574 | |
575 | - $writer->addAttribute('id',$this->getClientID()); |
|
575 | + $writer->addAttribute('id', $this->getClientID()); |
|
576 | 576 | } |
577 | 577 | |
578 | 578 | /** |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | */ |
581 | 581 | public function getCaption() |
582 | 582 | { |
583 | - return $this->getViewState('Caption',''); |
|
583 | + return $this->getViewState('Caption', ''); |
|
584 | 584 | } |
585 | 585 | |
586 | 586 | /** |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | */ |
589 | 589 | public function setCaption($value) |
590 | 590 | { |
591 | - $this->setViewState('Caption',TPropertyValue::ensureString($value),''); |
|
591 | + $this->setViewState('Caption', TPropertyValue::ensureString($value), ''); |
|
592 | 592 | } |
593 | 593 | |
594 | 594 | /** |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | */ |
597 | 597 | public function getNavigateUrl() |
598 | 598 | { |
599 | - return $this->getViewState('NavigateUrl',''); |
|
599 | + return $this->getViewState('NavigateUrl', ''); |
|
600 | 600 | } |
601 | 601 | |
602 | 602 | /** |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | */ |
607 | 607 | public function setNavigateUrl($value) |
608 | 608 | { |
609 | - $this->setViewState('NavigateUrl',TPropertyValue::ensureString($value),''); |
|
609 | + $this->setViewState('NavigateUrl', TPropertyValue::ensureString($value), ''); |
|
610 | 610 | } |
611 | 611 | |
612 | 612 | /** |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | */ |
615 | 615 | public function getText() |
616 | 616 | { |
617 | - return $this->getViewState('Text',''); |
|
617 | + return $this->getViewState('Text', ''); |
|
618 | 618 | } |
619 | 619 | |
620 | 620 | /** |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | */ |
625 | 625 | public function setText($value) |
626 | 626 | { |
627 | - $this->setViewState('Text',TPropertyValue::ensureString($value),''); |
|
627 | + $this->setViewState('Text', TPropertyValue::ensureString($value), ''); |
|
628 | 628 | } |
629 | 629 | |
630 | 630 | /** |
@@ -663,9 +663,9 @@ discard block |
||
663 | 663 | { |
664 | 664 | if($this->getVisible(false) && $this->getPage()->getClientSupportsJavaScript()) |
665 | 665 | { |
666 | - $writer->addAttribute('id',$this->getClientID().'_0'); |
|
666 | + $writer->addAttribute('id', $this->getClientID().'_0'); |
|
667 | 667 | |
668 | - $style=$this->getActive()?$this->getParent()->getActiveHeaderStyle():$this->getParent()->getHeaderStyle(); |
|
668 | + $style=$this->getActive() ? $this->getParent()->getActiveHeaderStyle() : $this->getParent()->getHeaderStyle(); |
|
669 | 669 | |
670 | 670 | $style->addAttributesToRender($writer); |
671 | 671 | |
@@ -684,14 +684,14 @@ discard block |
||
684 | 684 | */ |
685 | 685 | protected function renderHeaderContent($writer) |
686 | 686 | { |
687 | - $url = $this->getNavigateUrl(); |
|
687 | + $url=$this->getNavigateUrl(); |
|
688 | 688 | if(($caption=$this->getCaption())==='') |
689 | 689 | $caption=' '; |
690 | 690 | |
691 | - if ($url!='') |
|
691 | + if($url!='') |
|
692 | 692 | $writer->write("<a href=\"{$url}\">"); |
693 | 693 | $writer->write("{$caption}"); |
694 | - if ($url!='') |
|
694 | + if($url!='') |
|
695 | 695 | $writer->write("</a>"); |
696 | 696 | } |
697 | 697 | } |
@@ -714,10 +714,10 @@ discard block |
||
714 | 714 | * @param mixed new item |
715 | 715 | * @throws TInvalidDataTypeException if the item to be inserted is not a {@link TAccordionView} object. |
716 | 716 | */ |
717 | - public function insertAt($index,$item) |
|
717 | + public function insertAt($index, $item) |
|
718 | 718 | { |
719 | 719 | if($item instanceof TAccordionView) |
720 | - parent::insertAt($index,$item); |
|
720 | + parent::insertAt($index, $item); |
|
721 | 721 | else |
722 | 722 | throw new TInvalidDataTypeException('tabviewcollection_tabview_required'); |
723 | 723 | } |
@@ -101,13 +101,13 @@ discard block |
||
101 | 101 | if(!$this->_cacheChecked) |
102 | 102 | { |
103 | 103 | $this->_cacheChecked=true; |
104 | - if($this->_duration>0 && ($this->_cachePostBack || !$this->getPage()->getIsPostBack())) |
|
104 | + if($this->_duration > 0 && ($this->_cachePostBack || !$this->getPage()->getIsPostBack())) |
|
105 | 105 | { |
106 | 106 | if($this->_cacheModuleID!=='') |
107 | 107 | { |
108 | 108 | $this->_cache=$this->getApplication()->getModule($this->_cacheModuleID); |
109 | 109 | if(!($this->_cache instanceof ICache)) |
110 | - throw new TConfigurationException('outputcache_cachemoduleid_invalid',$this->_cacheModuleID); |
|
110 | + throw new TConfigurationException('outputcache_cachemoduleid_invalid', $this->_cacheModuleID); |
|
111 | 111 | } |
112 | 112 | else |
113 | 113 | $this->_cache=$this->getApplication()->getCache(); |
@@ -118,14 +118,14 @@ discard block |
||
118 | 118 | if(is_array($data)) |
119 | 119 | { |
120 | 120 | $param=new TOutputCacheCheckDependencyEventParameter; |
121 | - $param->setCacheTime(isset($data[3])?$data[3]:0); |
|
121 | + $param->setCacheTime(isset($data[3]) ? $data[3] : 0); |
|
122 | 122 | $this->onCheckDependency($param); |
123 | 123 | $this->_dataCached=$param->getIsValid(); |
124 | 124 | } |
125 | 125 | else |
126 | 126 | $this->_dataCached=false; |
127 | 127 | if($this->_dataCached) |
128 | - list($this->_contents,$this->_state,$this->_actions,$this->_cacheTime)=$data; |
|
128 | + list($this->_contents, $this->_state, $this->_actions, $this->_cacheTime)=$data; |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | } |
@@ -183,11 +183,11 @@ discard block |
||
183 | 183 | foreach($this->_actions as $action) |
184 | 184 | { |
185 | 185 | if($action[0]==='Page.ClientScript') |
186 | - call_user_func_array(array($cs,$action[1]),$action[2]); |
|
186 | + call_user_func_array(array($cs, $action[1]), $action[2]); |
|
187 | 187 | else if($action[0]==='Page') |
188 | - call_user_func_array(array($page,$action[1]),$action[2]); |
|
188 | + call_user_func_array(array($page, $action[1]), $action[2]); |
|
189 | 189 | else |
190 | - call_user_func_array(array($this->getSubProperty($action[0]),$action[1]),$action[2]); |
|
190 | + call_user_func_array(array($this->getSubProperty($action[0]), $action[1]), $action[2]); |
|
191 | 191 | } |
192 | 192 | } |
193 | 193 | |
@@ -219,10 +219,10 @@ discard block |
||
219 | 219 | * @param array the collection of the state |
220 | 220 | * @param boolean whether the viewstate should be loaded |
221 | 221 | */ |
222 | - protected function loadStateRecursive(&$state,$needViewState=true) |
|
222 | + protected function loadStateRecursive(&$state, $needViewState=true) |
|
223 | 223 | { |
224 | 224 | $st=unserialize($state); |
225 | - parent::loadStateRecursive($st,$needViewState); |
|
225 | + parent::loadStateRecursive($st, $needViewState); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
@@ -255,9 +255,9 @@ discard block |
||
255 | 255 | * @param string method name of the context object |
256 | 256 | * @param array list of parameters to be passed to the action method |
257 | 257 | */ |
258 | - public function registerAction($context,$funcName,$funcParams) |
|
258 | + public function registerAction($context, $funcName, $funcParams) |
|
259 | 259 | { |
260 | - $this->_actions[]=array($context,$funcName,$funcParams); |
|
260 | + $this->_actions[]=array($context, $funcName, $funcParams); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | public function getCacheKey() |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | { |
287 | 287 | $params=array(); |
288 | 288 | $request=$this->getRequest(); |
289 | - foreach(explode(',',$this->_varyByParam) as $name) |
|
289 | + foreach(explode(',', $this->_varyByParam) as $name) |
|
290 | 290 | { |
291 | 291 | $name=trim($name); |
292 | 292 | $params[$name]=$request->itemAt($name); |
@@ -378,8 +378,8 @@ discard block |
||
378 | 378 | */ |
379 | 379 | public function setDuration($value) |
380 | 380 | { |
381 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
382 | - throw new TInvalidDataValueException('outputcache_duration_invalid',get_class($this)); |
|
381 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
382 | + throw new TInvalidDataValueException('outputcache_duration_invalid', get_class($this)); |
|
383 | 383 | $this->_duration=$value; |
384 | 384 | } |
385 | 385 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | */ |
449 | 449 | public function onCheckDependency($param) |
450 | 450 | { |
451 | - $this->raiseEvent('OnCheckDependency',$this,$param); |
|
451 | + $this->raiseEvent('OnCheckDependency', $this, $param); |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | /** |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | */ |
462 | 462 | public function onCalculateKey($param) |
463 | 463 | { |
464 | - $this->raiseEvent('OnCalculateKey',$this,$param); |
|
464 | + $this->raiseEvent('OnCalculateKey', $this, $param); |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | /** |
@@ -476,9 +476,9 @@ discard block |
||
476 | 476 | $writer->write($this->_contents); |
477 | 477 | else if($this->_cacheAvailable) |
478 | 478 | { |
479 | - $textwriter = new TTextWriter(); |
|
480 | - $multiwriter = new TOutputCacheTextWriterMulti(array($writer->getWriter(),$textwriter)); |
|
481 | - $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $multiwriter); |
|
479 | + $textwriter=new TTextWriter(); |
|
480 | + $multiwriter=new TOutputCacheTextWriterMulti(array($writer->getWriter(), $textwriter)); |
|
481 | + $htmlWriter=Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $multiwriter); |
|
482 | 482 | |
483 | 483 | $stack=$this->getPage()->getCachingStack(); |
484 | 484 | $stack->push($this); |
@@ -486,8 +486,8 @@ discard block |
||
486 | 486 | $stack->pop(); |
487 | 487 | |
488 | 488 | $content=$textwriter->flush(); |
489 | - $data=array($content,$this->_state,$this->_actions,time()); |
|
490 | - $this->_cache->set($this->getCacheKey(),$data,$this->getDuration(),$this->getCacheDependency()); |
|
489 | + $data=array($content, $this->_state, $this->_actions, time()); |
|
490 | + $this->_cache->set($this->getCacheKey(), $data, $this->getDuration(), $this->getCacheDependency()); |
|
491 | 491 | } |
492 | 492 | else |
493 | 493 | parent::render($writer); |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | public function __construct(Array $writers) |
598 | 598 | { |
599 | 599 | //parent::__construct(); |
600 | - $this->_writers = $writers; |
|
600 | + $this->_writers=$writers; |
|
601 | 601 | } |
602 | 602 | |
603 | 603 | public function write($s) |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | public function flush() |
610 | 610 | { |
611 | 611 | foreach($this->_writers as $writer) |
612 | - $s = $writer->flush(); |
|
612 | + $s=$writer->flush(); |
|
613 | 613 | return $s; |
614 | 614 | } |
615 | 615 | } |
@@ -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); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | public function onDataSourceChanged($param) |
46 | 46 | { |
47 | - $this->raiseEvent('OnDataSourceChanged',$this,$param); |
|
47 | + $this->raiseEvent('OnDataSourceChanged', $this, $param); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | public function focus() |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | private $_dataSource; |
96 | 96 | private $_dataMember; |
97 | 97 | |
98 | - public function __construct($dataSource,$dataMember) |
|
98 | + public function __construct($dataSource, $dataMember) |
|
99 | 99 | { |
100 | 100 | if(!is_array($dataSource) && !($dataSource instanceof IDataSource) && !($dataSource instanceof Traversable)) |
101 | 101 | throw new TInvalidDataTypeException('readonlydatasource_datasource_invalid'); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | if($this->_dataSource instanceof IDataSource) |
109 | 109 | return $this->_dataSource->getView($viewName); |
110 | 110 | else |
111 | - return new TReadOnlyDataSourceView($this,$this->_dataMember,$this->_dataSource); |
|
111 | + return new TReadOnlyDataSourceView($this, $this->_dataMember, $this->_dataSource); |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 |
@@ -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 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | public function setStartRowIndex($value) |
32 | 32 | { |
33 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
33 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
34 | 34 | $value=0; |
35 | 35 | $this->_startRowIndex=$value; |
36 | 36 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function setMaximumRows($value) |
44 | 44 | { |
45 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
45 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
46 | 46 | $value=0; |
47 | 47 | $this->_maximumRows=$value; |
48 | 48 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | public function setTotalRowCount($value) |
66 | 66 | { |
67 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
67 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
68 | 68 | $value=0; |
69 | 69 | $this->_totalRowCount=$value; |
70 | 70 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | private $_owner; |
83 | 83 | private $_name; |
84 | 84 | |
85 | - public function __construct(IDataSource $owner,$viewName) |
|
85 | + public function __construct(IDataSource $owner, $viewName) |
|
86 | 86 | { |
87 | 87 | $this->_owner=$owner; |
88 | 88 | $this->_name=$viewName; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @param array|TMap new values |
112 | 112 | * @return integer affected rows |
113 | 113 | */ |
114 | - public function update($keys,$values) |
|
114 | + public function update($keys, $values) |
|
115 | 115 | { |
116 | 116 | throw new TNotSupportedException('datasourceview_update_unsupported'); |
117 | 117 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | public function onDataSourceViewChanged($param) |
170 | 170 | { |
171 | - $this->raiseEvent('OnDataSourceViewChanged',$this,$param); |
|
171 | + $this->raiseEvent('OnDataSourceViewChanged', $this, $param); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
@@ -183,9 +183,9 @@ discard block |
||
183 | 183 | { |
184 | 184 | private $_dataSource=null; |
185 | 185 | |
186 | - public function __construct(IDataSource $owner,$viewName,$dataSource) |
|
186 | + public function __construct(IDataSource $owner, $viewName, $dataSource) |
|
187 | 187 | { |
188 | - parent::__construct($owner,$viewName); |
|
188 | + parent::__construct($owner, $viewName); |
|
189 | 189 | if($dataSource===null || is_array($dataSource)) |
190 | 190 | $this->_dataSource=new TMap($dataSource); |
191 | 191 | else if($dataSource instanceof Traversable) |
@@ -59,13 +59,13 @@ discard block |
||
59 | 59 | protected function addAttributesToRender($writer) |
60 | 60 | { |
61 | 61 | parent::addAttributesToRender($writer); |
62 | - if($this->getHotSpots()->getCount()>0) |
|
62 | + if($this->getHotSpots()->getCount() > 0) |
|
63 | 63 | { |
64 | - $writer->addAttribute('usemap','#'.self::MAP_NAME_PREFIX.$this->getClientID()); |
|
65 | - $writer->addAttribute('id',$this->getUniqueID()); |
|
64 | + $writer->addAttribute('usemap', '#'.self::MAP_NAME_PREFIX.$this->getClientID()); |
|
65 | + $writer->addAttribute('id', $this->getUniqueID()); |
|
66 | 66 | } |
67 | 67 | if($this->getEnabled() && !$this->getEnabled(true)) |
68 | - $writer->addAttribute('disabled','disabled'); |
|
68 | + $writer->addAttribute('disabled', 'disabled'); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -78,20 +78,20 @@ discard block |
||
78 | 78 | |
79 | 79 | $hotspots=$this->getHotSpots(); |
80 | 80 | |
81 | - if($hotspots->getCount()>0) |
|
81 | + if($hotspots->getCount() > 0) |
|
82 | 82 | { |
83 | 83 | $clientID=$this->getClientID(); |
84 | 84 | $cs=$this->getPage()->getClientScript(); |
85 | 85 | $writer->writeLine(); |
86 | - $writer->addAttribute('name',self::MAP_NAME_PREFIX.$clientID); |
|
86 | + $writer->addAttribute('name', self::MAP_NAME_PREFIX.$clientID); |
|
87 | 87 | $writer->renderBeginTag('map'); |
88 | 88 | $writer->writeLine(); |
89 | 89 | if(($mode=$this->getHotSpotMode())===THotSpotMode::NotSet) |
90 | 90 | $mode=THotSpotMode::Navigate; |
91 | 91 | $target=$this->getTarget(); |
92 | 92 | $i=0; |
93 | - $options['EventTarget'] = $this->getUniqueID(); |
|
94 | - $options['StopEvent'] = true; |
|
93 | + $options['EventTarget']=$this->getUniqueID(); |
|
94 | + $options['StopEvent']=true; |
|
95 | 95 | $cs=$this->getPage()->getClientScript(); |
96 | 96 | foreach($hotspots as $hotspot) |
97 | 97 | { |
@@ -102,13 +102,13 @@ discard block |
||
102 | 102 | if($hotspot->getHotSpotMode()===THotSpotMode::PostBack) |
103 | 103 | { |
104 | 104 | $id=$clientID.'_'.$i; |
105 | - $writer->addAttribute('id',$id); |
|
106 | - $writer->addAttribute('href','#'.$id); //create unique no-op url references |
|
105 | + $writer->addAttribute('id', $id); |
|
106 | + $writer->addAttribute('href', '#'.$id); //create unique no-op url references |
|
107 | 107 | $options['ID']=$id; |
108 | 108 | $options['EventParameter']="$i"; |
109 | 109 | $options['CausesValidation']=$hotspot->getCausesValidation(); |
110 | 110 | $options['ValidationGroup']=$hotspot->getValidationGroup(); |
111 | - $cs->registerPostBackControl($this->getClientClassName(),$options); |
|
111 | + $cs->registerPostBackControl($this->getClientClassName(), $options); |
|
112 | 112 | } |
113 | 113 | $hotspot->render($writer); |
114 | 114 | $writer->writeLine(); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | { |
142 | 142 | $index=TPropertyValue::ensureInteger($param); |
143 | 143 | $hotspots=$this->getHotSpots(); |
144 | - if($index>=0 && $index<$hotspots->getCount()) |
|
144 | + if($index >= 0 && $index < $hotspots->getCount()) |
|
145 | 145 | { |
146 | 146 | $hotspot=$hotspots->itemAt($index); |
147 | 147 | if(($mode=$hotspot->getHotSpotMode())===THotSpotMode::NotSet) |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function getHotSpotMode() |
165 | 165 | { |
166 | - return $this->getViewState('HotSpotMode',THotSpotMode::NotSet); |
|
166 | + return $this->getViewState('HotSpotMode', THotSpotMode::NotSet); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function setHotSpotMode($value) |
176 | 176 | { |
177 | - $this->setViewState('HotSpotMode',TPropertyValue::ensureEnum($value,'THotSpotMode'),THotSpotMode::NotSet); |
|
177 | + $this->setViewState('HotSpotMode', TPropertyValue::ensureEnum($value, 'THotSpotMode'), THotSpotMode::NotSet); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
@@ -182,10 +182,10 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function getHotSpots() |
184 | 184 | { |
185 | - if(($hotspots=$this->getViewState('HotSpots',null))===null) |
|
185 | + if(($hotspots=$this->getViewState('HotSpots', null))===null) |
|
186 | 186 | { |
187 | 187 | $hotspots=new THotSpotCollection; |
188 | - $this->setViewState('HotSpots',$hotspots); |
|
188 | + $this->setViewState('HotSpots', $hotspots); |
|
189 | 189 | } |
190 | 190 | return $hotspots; |
191 | 191 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function getTarget() |
197 | 197 | { |
198 | - return $this->getViewState('Target',''); |
|
198 | + return $this->getViewState('Target', ''); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function setTarget($value) |
205 | 205 | { |
206 | - $this->setViewState('Target',TPropertyValue::ensureString($value),''); |
|
206 | + $this->setViewState('Target', TPropertyValue::ensureString($value), ''); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public function onClick($param) |
217 | 217 | { |
218 | - $this->raiseEvent('OnClick',$this,$param); |
|
218 | + $this->raiseEvent('OnClick', $this, $param); |
|
219 | 219 | } |
220 | 220 | } |
221 | 221 | |
@@ -271,10 +271,10 @@ discard block |
||
271 | 271 | * @param mixed new item |
272 | 272 | * @throws TInvalidDataTypeException if the item to be inserted is not a THotSpot. |
273 | 273 | */ |
274 | - public function insertAt($index,$item) |
|
274 | + public function insertAt($index, $item) |
|
275 | 275 | { |
276 | 276 | if($item instanceof THotSpot) |
277 | - parent::insertAt($index,$item); |
|
277 | + parent::insertAt($index, $item); |
|
278 | 278 | else |
279 | 279 | throw new TInvalidDataTypeException('hotspotcollection_hotspot_required'); |
280 | 280 | } |
@@ -305,9 +305,9 @@ discard block |
||
305 | 305 | * @param mixed the default value. If $key is not found in viewstate, $defaultValue will be returned |
306 | 306 | * @return mixed the viewstate value corresponding to $key |
307 | 307 | */ |
308 | - protected function getViewState($key,$defaultValue=null) |
|
308 | + protected function getViewState($key, $defaultValue=null) |
|
309 | 309 | { |
310 | - return isset($this->_viewState[$key])?$this->_viewState[$key]:$defaultValue; |
|
310 | + return isset($this->_viewState[$key]) ? $this->_viewState[$key] : $defaultValue; |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | * @param mixed the viewstate value to be set |
321 | 321 | * @param mixed default value. If $value===$defaultValue, the item will be cleared from the viewstate. |
322 | 322 | */ |
323 | - protected function setViewState($key,$value,$defaultValue=null) |
|
323 | + protected function setViewState($key, $value, $defaultValue=null) |
|
324 | 324 | { |
325 | 325 | if($value===$defaultValue) |
326 | 326 | unset($this->_viewState[$key]); |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | */ |
343 | 343 | public function getAccessKey() |
344 | 344 | { |
345 | - return $this->getViewState('AccessKey',''); |
|
345 | + return $this->getViewState('AccessKey', ''); |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | /** |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | */ |
351 | 351 | public function setAccessKey($value) |
352 | 352 | { |
353 | - $this->setViewState('AccessKey',TPropertyValue::ensureString($value),''); |
|
353 | + $this->setViewState('AccessKey', TPropertyValue::ensureString($value), ''); |
|
354 | 354 | } |
355 | 355 | |
356 | 356 | /** |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public function getAlternateText() |
360 | 360 | { |
361 | - return $this->getViewState('AlternateText',''); |
|
361 | + return $this->getViewState('AlternateText', ''); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | /** |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | */ |
367 | 367 | public function setAlternateText($value) |
368 | 368 | { |
369 | - $this->setViewState('AlternateText',TPropertyValue::ensureString($value),''); |
|
369 | + $this->setViewState('AlternateText', TPropertyValue::ensureString($value), ''); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | /** |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | */ |
375 | 375 | public function getHotSpotMode() |
376 | 376 | { |
377 | - return $this->getViewState('HotSpotMode',THotSpotMode::NotSet); |
|
377 | + return $this->getViewState('HotSpotMode', THotSpotMode::NotSet); |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | /** |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | */ |
383 | 383 | public function setHotSpotMode($value) |
384 | 384 | { |
385 | - $this->setViewState('HotSpotMode',TPropertyValue::ensureEnum($value,'THotSpotMode'),THotSpotMode::NotSet); |
|
385 | + $this->setViewState('HotSpotMode', TPropertyValue::ensureEnum($value, 'THotSpotMode'), THotSpotMode::NotSet); |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | /** |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | */ |
391 | 391 | public function getNavigateUrl() |
392 | 392 | { |
393 | - return $this->getViewState('NavigateUrl',''); |
|
393 | + return $this->getViewState('NavigateUrl', ''); |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | /** |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | */ |
399 | 399 | public function setNavigateUrl($value) |
400 | 400 | { |
401 | - $this->setViewState('NavigateUrl',TPropertyValue::ensureString($value),''); |
|
401 | + $this->setViewState('NavigateUrl', TPropertyValue::ensureString($value), ''); |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | /** |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | */ |
407 | 407 | public function getPostBackValue() |
408 | 408 | { |
409 | - return $this->getViewState('PostBackValue',''); |
|
409 | + return $this->getViewState('PostBackValue', ''); |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | /** |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | */ |
415 | 415 | public function setPostBackValue($value) |
416 | 416 | { |
417 | - $this->setViewState('PostBackValue',TPropertyValue::ensureString($value),''); |
|
417 | + $this->setViewState('PostBackValue', TPropertyValue::ensureString($value), ''); |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | /** |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | */ |
423 | 423 | public function getTabIndex() |
424 | 424 | { |
425 | - return $this->getViewState('TabIndex',0); |
|
425 | + return $this->getViewState('TabIndex', 0); |
|
426 | 426 | } |
427 | 427 | |
428 | 428 | /** |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | */ |
431 | 431 | public function setTabIndex($value) |
432 | 432 | { |
433 | - $this->setViewState('TabIndex',TPropertyValue::ensureInteger($value),0); |
|
433 | + $this->setViewState('TabIndex', TPropertyValue::ensureInteger($value), 0); |
|
434 | 434 | } |
435 | 435 | |
436 | 436 | /** |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | */ |
439 | 439 | public function getCausesValidation() |
440 | 440 | { |
441 | - return $this->getViewState('CausesValidation',true); |
|
441 | + return $this->getViewState('CausesValidation', true); |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | /** |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | */ |
447 | 447 | public function setCausesValidation($value) |
448 | 448 | { |
449 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
449 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | /** |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | */ |
455 | 455 | public function getValidationGroup() |
456 | 456 | { |
457 | - return $this->getViewState('ValidationGroup',''); |
|
457 | + return $this->getViewState('ValidationGroup', ''); |
|
458 | 458 | } |
459 | 459 | |
460 | 460 | /** |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | */ |
463 | 463 | public function setValidationGroup($value) |
464 | 464 | { |
465 | - $this->setViewState('ValidationGroup',$value,''); |
|
465 | + $this->setViewState('ValidationGroup', $value, ''); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | /** |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | */ |
472 | 472 | public function getTarget() |
473 | 473 | { |
474 | - return $this->getViewState('Target',''); |
|
474 | + return $this->getViewState('Target', ''); |
|
475 | 475 | } |
476 | 476 | |
477 | 477 | /** |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | */ |
481 | 481 | public function setTarget($value) |
482 | 482 | { |
483 | - $this->setViewState('Target',TPropertyValue::ensureString($value),''); |
|
483 | + $this->setViewState('Target', TPropertyValue::ensureString($value), ''); |
|
484 | 484 | } |
485 | 485 | |
486 | 486 | /** |
@@ -488,8 +488,8 @@ discard block |
||
488 | 488 | */ |
489 | 489 | public function getHasAttributes() |
490 | 490 | { |
491 | - if($attributes=$this->getViewState('Attributes',null)) |
|
492 | - return $attributes->getCount()>0; |
|
491 | + if($attributes=$this->getViewState('Attributes', null)) |
|
492 | + return $attributes->getCount() > 0; |
|
493 | 493 | else |
494 | 494 | return false; |
495 | 495 | } |
@@ -502,12 +502,12 @@ discard block |
||
502 | 502 | */ |
503 | 503 | public function getAttributes() |
504 | 504 | { |
505 | - if($attributes=$this->getViewState('Attributes',null)) |
|
505 | + if($attributes=$this->getViewState('Attributes', null)) |
|
506 | 506 | return $attributes; |
507 | 507 | else |
508 | 508 | { |
509 | 509 | $attributes=new TAttributeCollection; |
510 | - $this->setViewState('Attributes',$attributes,null); |
|
510 | + $this->setViewState('Attributes', $attributes, null); |
|
511 | 511 | return $attributes; |
512 | 512 | } |
513 | 513 | } |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | */ |
518 | 518 | public function hasAttribute($name) |
519 | 519 | { |
520 | - if($attributes=$this->getViewState('Attributes',null)) |
|
520 | + if($attributes=$this->getViewState('Attributes', null)) |
|
521 | 521 | return $attributes->contains($name); |
522 | 522 | else |
523 | 523 | return false; |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | */ |
529 | 529 | public function getAttribute($name) |
530 | 530 | { |
531 | - if($attributes=$this->getViewState('Attributes',null)) |
|
531 | + if($attributes=$this->getViewState('Attributes', null)) |
|
532 | 532 | return $attributes->itemAt($name); |
533 | 533 | else |
534 | 534 | return null; |
@@ -539,9 +539,9 @@ discard block |
||
539 | 539 | * @param string attribute name |
540 | 540 | * @param string value of the attribute |
541 | 541 | */ |
542 | - public function setAttribute($name,$value) |
|
542 | + public function setAttribute($name, $value) |
|
543 | 543 | { |
544 | - $this->getAttributes()->add($name,$value); |
|
544 | + $this->getAttributes()->add($name, $value); |
|
545 | 545 | } |
546 | 546 | |
547 | 547 | /** |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | */ |
552 | 552 | public function removeAttribute($name) |
553 | 553 | { |
554 | - if($attributes=$this->getViewState('Attributes',null)) |
|
554 | + if($attributes=$this->getViewState('Attributes', null)) |
|
555 | 555 | return $attributes->remove($name); |
556 | 556 | else |
557 | 557 | return null; |
@@ -563,29 +563,29 @@ discard block |
||
563 | 563 | */ |
564 | 564 | public function render($writer) |
565 | 565 | { |
566 | - $writer->addAttribute('shape',$this->getShape()); |
|
567 | - $writer->addAttribute('coords',$this->getCoordinates()); |
|
566 | + $writer->addAttribute('shape', $this->getShape()); |
|
567 | + $writer->addAttribute('coords', $this->getCoordinates()); |
|
568 | 568 | if(($mode=$this->getHotSpotMode())===THotSpotMode::NotSet) |
569 | 569 | $mode=THotSpotMode::Navigate; |
570 | 570 | if($mode===THotSpotMode::Navigate) |
571 | 571 | { |
572 | - $writer->addAttribute('href',$this->getNavigateUrl()); |
|
572 | + $writer->addAttribute('href', $this->getNavigateUrl()); |
|
573 | 573 | if(($target=$this->getTarget())!=='') |
574 | - $writer->addAttribute('target',$target); |
|
574 | + $writer->addAttribute('target', $target); |
|
575 | 575 | } |
576 | 576 | else if($mode===THotSpotMode::Inactive) |
577 | - $writer->addAttribute('nohref','true'); |
|
577 | + $writer->addAttribute('nohref', 'true'); |
|
578 | 578 | $text=$this->getAlternateText(); |
579 | - $writer->addAttribute('title',$text); |
|
580 | - $writer->addAttribute('alt',$text); |
|
579 | + $writer->addAttribute('title', $text); |
|
580 | + $writer->addAttribute('alt', $text); |
|
581 | 581 | if(($accessKey=$this->getAccessKey())!=='') |
582 | - $writer->addAttribute('accesskey',$accessKey); |
|
582 | + $writer->addAttribute('accesskey', $accessKey); |
|
583 | 583 | if(($tabIndex=$this->getTabIndex())!==0) |
584 | - $writer->addAttribute('tabindex',"$tabIndex"); |
|
584 | + $writer->addAttribute('tabindex', "$tabIndex"); |
|
585 | 585 | if($this->getHasAttributes()) |
586 | 586 | { |
587 | 587 | foreach($this->getAttributes() as $name=>$value) |
588 | - $writer->addAttribute($name,$value); |
|
588 | + $writer->addAttribute($name, $value); |
|
589 | 589 | } |
590 | 590 | $writer->renderBeginTag('area'); |
591 | 591 | $writer->renderEndTag(); |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | */ |
626 | 626 | public function getRadius() |
627 | 627 | { |
628 | - return $this->getViewState('Radius',0); |
|
628 | + return $this->getViewState('Radius', 0); |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | /** |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | */ |
634 | 634 | public function setRadius($value) |
635 | 635 | { |
636 | - $this->setViewState('Radius',TPropertyValue::ensureInteger($value),0); |
|
636 | + $this->setViewState('Radius', TPropertyValue::ensureInteger($value), 0); |
|
637 | 637 | } |
638 | 638 | |
639 | 639 | /** |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | */ |
642 | 642 | public function getX() |
643 | 643 | { |
644 | - return $this->getViewState('X',0); |
|
644 | + return $this->getViewState('X', 0); |
|
645 | 645 | } |
646 | 646 | |
647 | 647 | /** |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | */ |
650 | 650 | public function setX($value) |
651 | 651 | { |
652 | - $this->setViewState('X',TPropertyValue::ensureInteger($value),0); |
|
652 | + $this->setViewState('X', TPropertyValue::ensureInteger($value), 0); |
|
653 | 653 | } |
654 | 654 | |
655 | 655 | /** |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | */ |
658 | 658 | public function getY() |
659 | 659 | { |
660 | - return $this->getViewState('Y',0); |
|
660 | + return $this->getViewState('Y', 0); |
|
661 | 661 | } |
662 | 662 | |
663 | 663 | /** |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | */ |
666 | 666 | public function setY($value) |
667 | 667 | { |
668 | - $this->setViewState('Y',TPropertyValue::ensureInteger($value),0); |
|
668 | + $this->setViewState('Y', TPropertyValue::ensureInteger($value), 0); |
|
669 | 669 | } |
670 | 670 | } |
671 | 671 | |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | */ |
703 | 703 | public function getBottom() |
704 | 704 | { |
705 | - return $this->getViewState('Bottom',0); |
|
705 | + return $this->getViewState('Bottom', 0); |
|
706 | 706 | } |
707 | 707 | |
708 | 708 | /** |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | */ |
711 | 711 | public function setBottom($value) |
712 | 712 | { |
713 | - $this->setViewState('Bottom',TPropertyValue::ensureInteger($value),0); |
|
713 | + $this->setViewState('Bottom', TPropertyValue::ensureInteger($value), 0); |
|
714 | 714 | } |
715 | 715 | |
716 | 716 | /** |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | */ |
719 | 719 | public function getLeft() |
720 | 720 | { |
721 | - return $this->getViewState('Left',0); |
|
721 | + return $this->getViewState('Left', 0); |
|
722 | 722 | } |
723 | 723 | |
724 | 724 | /** |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | */ |
727 | 727 | public function setLeft($value) |
728 | 728 | { |
729 | - $this->setViewState('Left',TPropertyValue::ensureInteger($value),0); |
|
729 | + $this->setViewState('Left', TPropertyValue::ensureInteger($value), 0); |
|
730 | 730 | } |
731 | 731 | |
732 | 732 | /** |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | */ |
735 | 735 | public function getRight() |
736 | 736 | { |
737 | - return $this->getViewState('Right',0); |
|
737 | + return $this->getViewState('Right', 0); |
|
738 | 738 | } |
739 | 739 | |
740 | 740 | /** |
@@ -742,7 +742,7 @@ discard block |
||
742 | 742 | */ |
743 | 743 | public function setRight($value) |
744 | 744 | { |
745 | - $this->setViewState('Right',TPropertyValue::ensureInteger($value),0); |
|
745 | + $this->setViewState('Right', TPropertyValue::ensureInteger($value), 0); |
|
746 | 746 | } |
747 | 747 | |
748 | 748 | /** |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | */ |
751 | 751 | public function getTop() |
752 | 752 | { |
753 | - return $this->getViewState('Top',0); |
|
753 | + return $this->getViewState('Top', 0); |
|
754 | 754 | } |
755 | 755 | |
756 | 756 | /** |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | */ |
759 | 759 | public function setTop($value) |
760 | 760 | { |
761 | - $this->setViewState('Top',TPropertyValue::ensureInteger($value),0); |
|
761 | + $this->setViewState('Top', TPropertyValue::ensureInteger($value), 0); |
|
762 | 762 | } |
763 | 763 | } |
764 | 764 | |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | */ |
790 | 790 | public function getCoordinates() |
791 | 791 | { |
792 | - return $this->getViewState('Coordinates',''); |
|
792 | + return $this->getViewState('Coordinates', ''); |
|
793 | 793 | } |
794 | 794 | |
795 | 795 | /** |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | */ |
800 | 800 | public function setCoordinates($value) |
801 | 801 | { |
802 | - $this->setViewState('Coordinates',$value,''); |
|
802 | + $this->setViewState('Coordinates', $value, ''); |
|
803 | 803 | } |
804 | 804 | } |
805 | 805 |
@@ -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 |