@@ -98,6 +98,9 @@ discard block |
||
| 98 | 98 | return $this->validateStandardControl($control); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | + /** |
|
| 102 | + * @param TListControl $control |
|
| 103 | + */ |
|
| 101 | 104 | private function validateListControl($control) |
| 102 | 105 | { |
| 103 | 106 | $initial = trim($this->getInitialValue()); |
@@ -110,6 +113,9 @@ discard block |
||
| 110 | 113 | return $count > 0; |
| 111 | 114 | } |
| 112 | 115 | |
| 116 | + /** |
|
| 117 | + * @param TRadioButton $control |
|
| 118 | + */ |
|
| 113 | 119 | private function validateRadioButtonGroup($control) |
| 114 | 120 | { |
| 115 | 121 | $initial = trim($this->getInitialValue()); |
@@ -126,6 +132,9 @@ discard block |
||
| 126 | 132 | return false; |
| 127 | 133 | } |
| 128 | 134 | |
| 135 | + /** |
|
| 136 | + * @param TControl $control |
|
| 137 | + */ |
|
| 129 | 138 | private function validateStandardControl($control) |
| 130 | 139 | { |
| 131 | 140 | $initial = trim($this->getInitialValue()); |
@@ -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 | } |
@@ -179,7 +179,7 @@ |
||
| 179 | 179 | * Returns the value of the TSlider control. |
| 180 | 180 | * This method is required by {@link IDataRenderer}. |
| 181 | 181 | * It is the same as {@link getValue()}. |
| 182 | - * @return string the value of the TSlider control. |
|
| 182 | + * @return double the value of the TSlider control. |
|
| 183 | 183 | * @see getValue |
| 184 | 184 | */ |
| 185 | 185 | public function getData() |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function setDirection($value) |
| 75 | 75 | { |
| 76 | - $this->setViewState('Direction', TPropertyValue::ensureEnum($value,'TSliderDirection'),TSliderDirection::Horizontal); |
|
| 76 | + $this->setViewState('Direction', TPropertyValue::ensureEnum($value, 'TSliderDirection'), TSliderDirection::Horizontal); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function getCssUrl() |
| 83 | 83 | { |
| 84 | - return $this->getViewState('CssUrl',''); |
|
| 84 | + return $this->getViewState('CssUrl', ''); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function setCssUrl($value) |
| 91 | 91 | { |
| 92 | - $this->setViewState('CssUrl',TPropertyValue::ensureString($value),''); |
|
| 92 | + $this->setViewState('CssUrl', TPropertyValue::ensureString($value), ''); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function getMaxValue() |
| 99 | 99 | { |
| 100 | - return $this->getViewState('MaxValue',100.0); |
|
| 100 | + return $this->getViewState('MaxValue', 100.0); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | public function setMaxValue($value) |
| 107 | 107 | { |
| 108 | - $this->setViewState('MaxValue', TPropertyValue::ensureFloat($value),100.0); |
|
| 108 | + $this->setViewState('MaxValue', TPropertyValue::ensureFloat($value), 100.0); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function getMinValue() |
| 115 | 115 | { |
| 116 | - return $this->getViewState('MinValue',0.0); |
|
| 116 | + return $this->getViewState('MinValue', 0.0); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function setMinValue($value) |
| 123 | 123 | { |
| 124 | - $this->setViewState('MinValue', TPropertyValue::ensureFloat($value),0.0); |
|
| 124 | + $this->setViewState('MinValue', TPropertyValue::ensureFloat($value), 0.0); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | /** |
| 148 | 148 | * @return boolean wether to display a progress indicator or not. Defaults to true. |
| 149 | 149 | */ |
| 150 | - public function getProgressIndicator () |
|
| 150 | + public function getProgressIndicator() |
|
| 151 | 151 | { |
| 152 | 152 | return $this->getViewState('ProgressIndicator', true); |
| 153 | 153 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | /** |
| 156 | 156 | * @param boolean wether to display a progress indicator or not. Defaults to true. |
| 157 | 157 | */ |
| 158 | - public function setProgressIndicator ($value) |
|
| 158 | + public function setProgressIndicator($value) |
|
| 159 | 159 | { |
| 160 | 160 | $this->setViewState('ProgressIndicator', TPropertyValue::ensureBoolean($value), true); |
| 161 | 161 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | */ |
| 165 | 165 | public function getValue() |
| 166 | 166 | { |
| 167 | - return $this->getViewState('Value',0.0); |
|
| 167 | + return $this->getViewState('Value', 0.0); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /** |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | public function setValue($value) |
| 174 | 174 | { |
| 175 | - $this->setViewState('Value', TPropertyValue::ensureFloat($value),0.0); |
|
| 175 | + $this->setViewState('Value', TPropertyValue::ensureFloat($value), 0.0); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | /** |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | public function getAutoPostBack() |
| 226 | 226 | { |
| 227 | - return $this->getViewState('AutoPostBack',false); |
|
| 227 | + return $this->getViewState('AutoPostBack', false); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /** |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | public function setAutoPostBack($value) |
| 237 | 237 | { |
| 238 | - $this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),false); |
|
| 238 | + $this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), false); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | */ |
| 281 | 281 | public function onValueChanged($param) |
| 282 | 282 | { |
| 283 | - $this->raiseEvent('OnValueChanged',$this,$param); |
|
| 283 | + $this->raiseEvent('OnValueChanged', $this, $param); |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /** |
@@ -290,9 +290,9 @@ discard block |
||
| 290 | 290 | * @param array the input data collection |
| 291 | 291 | * @return boolean whether the data of the component has been changed |
| 292 | 292 | */ |
| 293 | - public function loadPostData($key,$values) |
|
| 293 | + public function loadPostData($key, $values) |
|
| 294 | 294 | { |
| 295 | - $value=(float)$values[$this->getClientID().'_1']; |
|
| 295 | + $value=(float) $values[$this->getClientID().'_1']; |
|
| 296 | 296 | if($this->getValue()!==$value) |
| 297 | 297 | { |
| 298 | 298 | $this->setValue($value); |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | public function getClientSide() |
| 317 | 317 | { |
| 318 | 318 | if($this->_clientScript===null) |
| 319 | - $this->_clientScript = $this->createClientScript(); |
|
| 319 | + $this->_clientScript=$this->createClientScript(); |
|
| 320 | 320 | return $this->_clientScript; |
| 321 | 321 | } |
| 322 | 322 | |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | /** |
| 332 | 332 | * @return string the HTML tag name for slider. Defaults to div. |
| 333 | 333 | */ |
| 334 | - public function getTagName () |
|
| 334 | + public function getTagName() |
|
| 335 | 335 | { |
| 336 | 336 | return "div"; |
| 337 | 337 | } |
@@ -343,10 +343,10 @@ discard block |
||
| 343 | 343 | protected function addAttributesToRender($writer) |
| 344 | 344 | { |
| 345 | 345 | parent::addAttributesToRender($writer); |
| 346 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 347 | - if ($this->getCssClass()==='') |
|
| 346 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 347 | + if($this->getCssClass()==='') |
|
| 348 | 348 | { |
| 349 | - $class=($this->getDirection()==TSliderDirection::Horizontal)?'HorizontalSlider':'VerticalSlider'; |
|
| 349 | + $class=($this->getDirection()==TSliderDirection::Horizontal) ? 'HorizontalSlider' : 'VerticalSlider'; |
|
| 350 | 350 | $writer->addAttribute('class', 'Slider '.$class); |
| 351 | 351 | } |
| 352 | 352 | |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | $writer->addAttribute('id', $this->getClientID().'_track'); |
| 363 | 363 | $writer->renderBeginTag('div'); |
| 364 | 364 | // Render the 'Progress Indicator' |
| 365 | - if ($this->getProgressIndicator()) |
|
| 365 | + if($this->getProgressIndicator()) |
|
| 366 | 366 | { |
| 367 | 367 | $writer->addAttribute('class', 'Progress'); |
| 368 | 368 | $writer->addAttribute('id', $this->getClientID().'_progress'); |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | * This method is invoked right before the control rendering, if the control is visible. |
| 400 | 400 | * @param mixed event parameter |
| 401 | 401 | */ |
| 402 | - public function onPreRender ($param) |
|
| 402 | + public function onPreRender($param) |
|
| 403 | 403 | { |
| 404 | 404 | parent::onPreRender($param); |
| 405 | 405 | $this->registerStyleSheet(); |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | $url=$manager->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'TSlider'); |
| 422 | 422 | $url.='/TSlider.css'; |
| 423 | 423 | } |
| 424 | - $this->getPage()->getClientScript()->registerStyleSheetFile($url,$url); |
|
| 424 | + $this->getPage()->getClientScript()->registerStyleSheetFile($url, $url); |
|
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | /** |
@@ -430,12 +430,12 @@ discard block |
||
| 430 | 430 | protected function registerSliderClientScript() |
| 431 | 431 | { |
| 432 | 432 | $page=$this->getPage(); |
| 433 | - $cs = $page->getClientScript(); |
|
| 433 | + $cs=$page->getClientScript(); |
|
| 434 | 434 | $cs->registerPradoScript("slider"); |
| 435 | 435 | $id=$this->getClientID(); |
| 436 | - $cs->registerHiddenField($id.'_1',$this->getValue()); |
|
| 436 | + $cs->registerHiddenField($id.'_1', $this->getValue()); |
|
| 437 | 437 | $page->registerRequiresPostData($this); |
| 438 | - $cs->registerPostBackControl($this->getClientClassName(),$this->getSliderOptions()); |
|
| 438 | + $cs->registerPostBackControl($this->getClientClassName(), $this->getSliderOptions()); |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | /** |
@@ -445,30 +445,30 @@ discard block |
||
| 445 | 445 | protected function getSliderOptions() |
| 446 | 446 | { |
| 447 | 447 | // PostBack Options : |
| 448 | - $options['ID'] = $this->getClientID(); |
|
| 449 | - $options['EventTarget'] = $this->getUniqueID(); |
|
| 450 | - $options['AutoPostBack'] = $this->getAutoPostBack(); |
|
| 448 | + $options['ID']=$this->getClientID(); |
|
| 449 | + $options['EventTarget']=$this->getUniqueID(); |
|
| 450 | + $options['AutoPostBack']=$this->getAutoPostBack(); |
|
| 451 | 451 | |
| 452 | 452 | // Slider Control options |
| 453 | 453 | $minValue=$this->getMinValue(); |
| 454 | 454 | $maxValue=$this->getMaxValue(); |
| 455 | - $options['axis'] = strtolower($this->getDirection()); |
|
| 456 | - $options['maximum'] = $maxValue; |
|
| 457 | - $options['minimum'] = $minValue; |
|
| 458 | - $options['range'] = array($minValue, $maxValue); |
|
| 459 | - $options['sliderValue'] = $this->getValue(); |
|
| 460 | - $options['disabled'] = !$this->getEnabled(); |
|
| 455 | + $options['axis']=strtolower($this->getDirection()); |
|
| 456 | + $options['maximum']=$maxValue; |
|
| 457 | + $options['minimum']=$minValue; |
|
| 458 | + $options['range']=array($minValue, $maxValue); |
|
| 459 | + $options['sliderValue']=$this->getValue(); |
|
| 460 | + $options['disabled']=!$this->getEnabled(); |
|
| 461 | 461 | $values=$this->getValues(); |
| 462 | - if (!empty($values)) |
|
| 462 | + if(!empty($values)) |
|
| 463 | 463 | { |
| 464 | 464 | // Values are provided. Check if min/max are present in them |
| 465 | - if (!in_array($minValue, $values)) $values[]=$minValue; |
|
| 466 | - if (!in_array($maxValue, $values)) $values[]=$maxValue; |
|
| 465 | + if(!in_array($minValue, $values)) $values[]=$minValue; |
|
| 466 | + if(!in_array($maxValue, $values)) $values[]=$maxValue; |
|
| 467 | 467 | // Remove all values outsize the range [min..max] |
| 468 | - foreach ($values as $idx=>$value) |
|
| 468 | + foreach($values as $idx=>$value) |
|
| 469 | 469 | { |
| 470 | - if ($value < $minValue) unset ($values[$idx]); |
|
| 471 | - if ($value > $maxValue) unset ($values[$idx]); |
|
| 470 | + if($value < $minValue) unset ($values[$idx]); |
|
| 471 | + if($value > $maxValue) unset ($values[$idx]); |
|
| 472 | 472 | } |
| 473 | 473 | } |
| 474 | 474 | else |
@@ -476,19 +476,19 @@ discard block |
||
| 476 | 476 | // Values are not provided, generate automatically using stepsize |
| 477 | 477 | $step=$this->getStepSize(); |
| 478 | 478 | // We want at most self::MAX_STEPS values, so, change the step if necessary |
| 479 | - if (($maxValue-$minValue)/$step > self::MAX_STEPS) |
|
| 479 | + if(($maxValue - $minValue) / $step > self::MAX_STEPS) |
|
| 480 | 480 | { |
| 481 | - $step=($maxValue-$minValue)/self::MAX_STEPS; |
|
| 481 | + $step=($maxValue - $minValue) / self::MAX_STEPS; |
|
| 482 | 482 | } |
| 483 | 483 | $values=array(); |
| 484 | - for ($i=$minValue;$i<=$maxValue;$i+=$step) |
|
| 484 | + for($i=$minValue; $i <= $maxValue; $i+=$step) |
|
| 485 | 485 | $values[]=$i; |
| 486 | 486 | // Add max if it's not in the array because of step |
| 487 | - if (!in_array($maxValue, $values)) $values[]=$maxValue; |
|
| 487 | + if(!in_array($maxValue, $values)) $values[]=$maxValue; |
|
| 488 | 488 | } |
| 489 | - $options['values'] = $values; |
|
| 489 | + $options['values']=$values; |
|
| 490 | 490 | if($this->_clientScript!==null) |
| 491 | - $options = array_merge($options,$this->_clientScript->getOptions()->toArray()); |
|
| 491 | + $options=array_merge($options, $this->_clientScript->getOptions()->toArray()); |
|
| 492 | 492 | return $options; |
| 493 | 493 | } |
| 494 | 494 | } |
@@ -189,8 +189,7 @@ discard block |
||
| 189 | 189 | return file_put_contents($fileName,file_get_contents($this->_localName))!==false; |
| 190 | 190 | else |
| 191 | 191 | return false; |
| 192 | - } |
|
| 193 | - else |
|
| 192 | + } else |
|
| 194 | 193 | return false; |
| 195 | 194 | } |
| 196 | 195 | |
@@ -211,8 +210,7 @@ discard block |
||
| 211 | 210 | $this->_errorCode=$_FILES[$key]['error']; |
| 212 | 211 | $this->_localName=$_FILES[$key]['tmp_name']; |
| 213 | 212 | return $this->_dataChanged=true; |
| 214 | - } |
|
| 215 | - else |
|
| 213 | + } else |
|
| 216 | 214 | return false; |
| 217 | 215 | } |
| 218 | 216 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |
| 232 | - * @return TDisplayStyle display style |
|
| 232 | + * @return string display style |
|
| 233 | 233 | */ |
| 234 | 234 | public function getDisplayStyle() |
| 235 | 235 | { |
@@ -286,6 +286,7 @@ discard block |
||
| 286 | 286 | * Sets custom style fields from a string. |
| 287 | 287 | * Custom style fields will be overwritten by style fields explicitly defined. |
| 288 | 288 | * @param string the custom style of the control |
| 289 | + * @param string $value |
|
| 289 | 290 | */ |
| 290 | 291 | public function setCustomStyle($value) |
| 291 | 292 | { |
@@ -305,6 +306,8 @@ discard block |
||
| 305 | 306 | * Style fields set by this method will overwrite those set by {@link setCustomStyle}. |
| 306 | 307 | * @param string style field name |
| 307 | 308 | * @param string style field value |
| 309 | + * @param string $name |
|
| 310 | + * @param string $value |
|
| 308 | 311 | */ |
| 309 | 312 | public function setStyleField($name,$value) |
| 310 | 313 | { |
@@ -695,7 +698,7 @@ discard block |
||
| 695 | 698 | |
| 696 | 699 | |
| 697 | 700 | /** |
| 698 | - * @return boolean whether the table borders should be collapsed. Defaults to false. |
|
| 701 | + * @return boolean|null whether the table borders should be collapsed. Defaults to false. |
|
| 699 | 702 | */ |
| 700 | 703 | public function getBorderCollapse() |
| 701 | 704 | { |
@@ -858,7 +861,7 @@ discard block |
||
| 858 | 861 | } |
| 859 | 862 | |
| 860 | 863 | /** |
| 861 | - * @return boolean whether the content wraps within the table item. Defaults to true. |
|
| 864 | + * @return boolean|null whether the content wraps within the table item. Defaults to true. |
|
| 862 | 865 | */ |
| 863 | 866 | public function getWrap() |
| 864 | 867 | { |
@@ -55,16 +55,16 @@ discard block |
||
| 55 | 55 | protected function __getZappableSleepProps(&$exprops) |
| 56 | 56 | { |
| 57 | 57 | parent::__getZappableSleepProps($exprops); |
| 58 | - if ($this->_fields===array()) |
|
| 59 | - $exprops[] = "\0TStyle\0_fields"; |
|
| 58 | + if($this->_fields===array()) |
|
| 59 | + $exprops[]="\0TStyle\0_fields"; |
|
| 60 | 60 | if($this->_font===null) |
| 61 | - $exprops[] = "\0TStyle\0_font"; |
|
| 61 | + $exprops[]="\0TStyle\0_font"; |
|
| 62 | 62 | if($this->_class===null) |
| 63 | - $exprops[] = "\0TStyle\0_class"; |
|
| 64 | - if ($this->_customStyle===null) |
|
| 65 | - $exprops[] = "\0TStyle\0_customStyle"; |
|
| 66 | - if ($this->_displayStyle==='Fixed') |
|
| 67 | - $exprops[] = "\0TStyle\0_displayStyle"; |
|
| 63 | + $exprops[]="\0TStyle\0_class"; |
|
| 64 | + if($this->_customStyle===null) |
|
| 65 | + $exprops[]="\0TStyle\0_customStyle"; |
|
| 66 | + if($this->_displayStyle==='Fixed') |
|
| 67 | + $exprops[]="\0TStyle\0_displayStyle"; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | public function __clone() |
| 84 | 84 | { |
| 85 | 85 | if($this->_font!==null) |
| 86 | - $this->_font = clone($this->_font); |
|
| 86 | + $this->_font=clone($this->_font); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function getBackColor() |
| 93 | 93 | { |
| 94 | - return isset($this->_fields['background-color'])?$this->_fields['background-color']:''; |
|
| 94 | + return isset($this->_fields['background-color']) ? $this->_fields['background-color'] : ''; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function getBorderColor() |
| 112 | 112 | { |
| 113 | - return isset($this->_fields['border-color'])?$this->_fields['border-color']:''; |
|
| 113 | + return isset($this->_fields['border-color']) ? $this->_fields['border-color'] : ''; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | public function getBorderStyle() |
| 131 | 131 | { |
| 132 | - return isset($this->_fields['border-style'])?$this->_fields['border-style']:''; |
|
| 132 | + return isset($this->_fields['border-style']) ? $this->_fields['border-style'] : ''; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | public function getBorderWidth() |
| 151 | 151 | { |
| 152 | - return isset($this->_fields['border-width'])?$this->_fields['border-width']:''; |
|
| 152 | + return isset($this->_fields['border-width']) ? $this->_fields['border-width'] : ''; |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | public function getCssClass() |
| 170 | 170 | { |
| 171 | - return $this->_class===null?'':$this->_class; |
|
| 171 | + return $this->_class===null ? '' : $this->_class; |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | /** |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | public function hasFont() |
| 204 | 204 | { |
| 205 | - return $this->_font !== null; |
|
| 205 | + return $this->_font!==null; |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | /** |
@@ -210,20 +210,20 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | public function setDisplayStyle($value) |
| 212 | 212 | { |
| 213 | - $this->_displayStyle = TPropertyValue::ensureEnum($value, 'TDisplayStyle'); |
|
| 213 | + $this->_displayStyle=TPropertyValue::ensureEnum($value, 'TDisplayStyle'); |
|
| 214 | 214 | switch($this->_displayStyle) |
| 215 | 215 | { |
| 216 | 216 | case TDisplayStyle::None: |
| 217 | - $this->_fields['display'] = 'none'; |
|
| 217 | + $this->_fields['display']='none'; |
|
| 218 | 218 | break; |
| 219 | 219 | case TDisplayStyle::Dynamic: |
| 220 | - $this->_fields['display'] = ''; //remove the display property |
|
| 220 | + $this->_fields['display']=''; //remove the display property |
|
| 221 | 221 | break; |
| 222 | 222 | case TDisplayStyle::Fixed: |
| 223 | - $this->_fields['visibility'] = 'visible'; |
|
| 223 | + $this->_fields['visibility']='visible'; |
|
| 224 | 224 | break; |
| 225 | 225 | case TDisplayStyle::Hidden: |
| 226 | - $this->_fields['visibility'] = 'hidden'; |
|
| 226 | + $this->_fields['visibility']='hidden'; |
|
| 227 | 227 | break; |
| 228 | 228 | } |
| 229 | 229 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | public function getForeColor() |
| 243 | 243 | { |
| 244 | - return isset($this->_fields['color'])?$this->_fields['color']:''; |
|
| 244 | + return isset($this->_fields['color']) ? $this->_fields['color'] : ''; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | public function getHeight() |
| 262 | 262 | { |
| 263 | - return isset($this->_fields['height'])?$this->_fields['height']:''; |
|
| 263 | + return isset($this->_fields['height']) ? $this->_fields['height'] : ''; |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | /** |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | public function getCustomStyle() |
| 281 | 281 | { |
| 282 | - return $this->_customStyle===null?'':$this->_customStyle; |
|
| 282 | + return $this->_customStyle===null ? '' : $this->_customStyle; |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | /** |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | */ |
| 298 | 298 | public function getStyleField($name) |
| 299 | 299 | { |
| 300 | - return isset($this->_fields[$name])?$this->_fields[$name]:''; |
|
| 300 | + return isset($this->_fields[$name]) ? $this->_fields[$name] : ''; |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /** |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | * @param string style field name |
| 307 | 307 | * @param string style field value |
| 308 | 308 | */ |
| 309 | - public function setStyleField($name,$value) |
|
| 309 | + public function setStyleField($name, $value) |
|
| 310 | 310 | { |
| 311 | 311 | $this->_fields[$name]=$value; |
| 312 | 312 | } |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | */ |
| 334 | 334 | public function getWidth() |
| 335 | 335 | { |
| 336 | - return isset($this->_fields['width'])?$this->_fields['width']:''; |
|
| 336 | + return isset($this->_fields['width']) ? $this->_fields['width'] : ''; |
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | /** |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | { |
| 366 | 366 | if($style instanceof TStyle) |
| 367 | 367 | { |
| 368 | - $this->_fields=array_merge($this->_fields,$style->_fields); |
|
| 368 | + $this->_fields=array_merge($this->_fields, $style->_fields); |
|
| 369 | 369 | if($style->_class!==null) |
| 370 | 370 | $this->_class=$style->_class; |
| 371 | 371 | if($style->_customStyle!==null) |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | { |
| 386 | 386 | if($style instanceof TStyle) |
| 387 | 387 | { |
| 388 | - $this->_fields=array_merge($style->_fields,$this->_fields); |
|
| 388 | + $this->_fields=array_merge($style->_fields, $this->_fields); |
|
| 389 | 389 | if($this->_class===null) |
| 390 | 390 | $this->_class=$style->_class; |
| 391 | 391 | if($this->_customStyle===null) |
@@ -403,18 +403,18 @@ discard block |
||
| 403 | 403 | { |
| 404 | 404 | if($this->_customStyle!==null) |
| 405 | 405 | { |
| 406 | - foreach(explode(';',$this->_customStyle) as $style) |
|
| 406 | + foreach(explode(';', $this->_customStyle) as $style) |
|
| 407 | 407 | { |
| 408 | - $arr=explode(':',$style,2); |
|
| 408 | + $arr=explode(':', $style, 2); |
|
| 409 | 409 | if(isset($arr[1]) && trim($arr[0])!=='') |
| 410 | - $writer->addStyleAttribute(trim($arr[0]),trim($arr[1])); |
|
| 410 | + $writer->addStyleAttribute(trim($arr[0]), trim($arr[1])); |
|
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | $writer->addStyleAttributes($this->_fields); |
| 414 | 414 | if($this->_font!==null) |
| 415 | 415 | $this->_font->addAttributesToRender($writer); |
| 416 | 416 | if($this->_class!==null) |
| 417 | - $writer->addAttribute('class',$this->_class); |
|
| 417 | + $writer->addAttribute('class', $this->_class); |
|
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | /** |
@@ -492,18 +492,18 @@ discard block |
||
| 492 | 492 | protected function __getZappableSleepProps(&$exprops) |
| 493 | 493 | { |
| 494 | 494 | parent::__getZappableSleepProps($exprops); |
| 495 | - if ($this->_backImageUrl===null) |
|
| 496 | - $exprops[] = "\0TTableStyle\0_backImageUrl"; |
|
| 497 | - if ($this->_horizontalAlign===null) |
|
| 498 | - $exprops[] = "\0TTableStyle\0_horizontalAlign"; |
|
| 499 | - if ($this->_cellPadding===null) |
|
| 500 | - $exprops[] = "\0TTableStyle\0_cellPadding"; |
|
| 501 | - if ($this->_cellSpacing===null) |
|
| 502 | - $exprops[] = "\0TTableStyle\0_cellSpacing"; |
|
| 503 | - if ($this->_gridLines===null) |
|
| 504 | - $exprops[] = "\0TTableStyle\0_gridLines"; |
|
| 505 | - if ($this->_borderCollapse===null) |
|
| 506 | - $exprops[] = "\0TTableStyle\0_borderCollapse"; |
|
| 495 | + if($this->_backImageUrl===null) |
|
| 496 | + $exprops[]="\0TTableStyle\0_backImageUrl"; |
|
| 497 | + if($this->_horizontalAlign===null) |
|
| 498 | + $exprops[]="\0TTableStyle\0_horizontalAlign"; |
|
| 499 | + if($this->_cellPadding===null) |
|
| 500 | + $exprops[]="\0TTableStyle\0_cellPadding"; |
|
| 501 | + if($this->_cellSpacing===null) |
|
| 502 | + $exprops[]="\0TTableStyle\0_cellSpacing"; |
|
| 503 | + if($this->_gridLines===null) |
|
| 504 | + $exprops[]="\0TTableStyle\0_gridLines"; |
|
| 505 | + if($this->_borderCollapse===null) |
|
| 506 | + $exprops[]="\0TTableStyle\0_borderCollapse"; |
|
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | /** |
@@ -582,25 +582,25 @@ discard block |
||
| 582 | 582 | public function addAttributesToRender($writer) |
| 583 | 583 | { |
| 584 | 584 | if(($url=trim($this->getBackImageUrl()))!=='') |
| 585 | - $writer->addStyleAttribute('background-image','url('.$url.')'); |
|
| 585 | + $writer->addStyleAttribute('background-image', 'url('.$url.')'); |
|
| 586 | 586 | |
| 587 | 587 | if(($horizontalAlign=$this->getHorizontalAlign())!==THorizontalAlign::NotSet) |
| 588 | - $writer->addStyleAttribute('text-align',strtolower($horizontalAlign)); |
|
| 588 | + $writer->addStyleAttribute('text-align', strtolower($horizontalAlign)); |
|
| 589 | 589 | |
| 590 | - if(($cellPadding=$this->getCellPadding())>=0) |
|
| 591 | - $writer->addAttribute('cellpadding',"$cellPadding"); |
|
| 590 | + if(($cellPadding=$this->getCellPadding()) >= 0) |
|
| 591 | + $writer->addAttribute('cellpadding', "$cellPadding"); |
|
| 592 | 592 | |
| 593 | - if(($cellSpacing=$this->getCellSpacing())>=0) |
|
| 594 | - $writer->addAttribute('cellspacing',"$cellSpacing"); |
|
| 593 | + if(($cellSpacing=$this->getCellSpacing()) >= 0) |
|
| 594 | + $writer->addAttribute('cellspacing', "$cellSpacing"); |
|
| 595 | 595 | |
| 596 | 596 | if($this->getBorderCollapse()) |
| 597 | - $writer->addStyleAttribute('border-collapse','collapse'); |
|
| 597 | + $writer->addStyleAttribute('border-collapse', 'collapse'); |
|
| 598 | 598 | |
| 599 | 599 | switch($this->getGridLines()) |
| 600 | 600 | { |
| 601 | - case TTableGridLines::Horizontal : $writer->addAttribute('rules','rows'); break; |
|
| 602 | - case TTableGridLines::Vertical : $writer->addAttribute('rules','cols'); break; |
|
| 603 | - case TTableGridLines::Both : $writer->addAttribute('rules','all'); break; |
|
| 601 | + case TTableGridLines::Horizontal : $writer->addAttribute('rules', 'rows'); break; |
|
| 602 | + case TTableGridLines::Vertical : $writer->addAttribute('rules', 'cols'); break; |
|
| 603 | + case TTableGridLines::Both : $writer->addAttribute('rules', 'all'); break; |
|
| 604 | 604 | } |
| 605 | 605 | |
| 606 | 606 | parent::addAttributesToRender($writer); |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | */ |
| 612 | 612 | public function getBackImageUrl() |
| 613 | 613 | { |
| 614 | - return $this->_backImageUrl===null?'':$this->_backImageUrl; |
|
| 614 | + return $this->_backImageUrl===null ? '' : $this->_backImageUrl; |
|
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | /** |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | */ |
| 629 | 629 | public function getHorizontalAlign() |
| 630 | 630 | { |
| 631 | - return $this->_horizontalAlign===null?THorizontalAlign::NotSet:$this->_horizontalAlign; |
|
| 631 | + return $this->_horizontalAlign===null ? THorizontalAlign::NotSet : $this->_horizontalAlign; |
|
| 632 | 632 | } |
| 633 | 633 | |
| 634 | 634 | /** |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | */ |
| 638 | 638 | public function setHorizontalAlign($value) |
| 639 | 639 | { |
| 640 | - $this->_horizontalAlign=TPropertyValue::ensureEnum($value,'THorizontalAlign'); |
|
| 640 | + $this->_horizontalAlign=TPropertyValue::ensureEnum($value, 'THorizontalAlign'); |
|
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | /** |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | */ |
| 646 | 646 | public function getCellPadding() |
| 647 | 647 | { |
| 648 | - return $this->_cellPadding===null?-1:$this->_cellPadding; |
|
| 648 | + return $this->_cellPadding===null ?-1 : $this->_cellPadding; |
|
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | /** |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | */ |
| 655 | 655 | public function setCellPadding($value) |
| 656 | 656 | { |
| 657 | - if(($this->_cellPadding=TPropertyValue::ensureInteger($value))<-1) |
|
| 657 | + if(($this->_cellPadding=TPropertyValue::ensureInteger($value)) < -1) |
|
| 658 | 658 | throw new TInvalidDataValueException('tablestyle_cellpadding_invalid'); |
| 659 | 659 | } |
| 660 | 660 | |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | */ |
| 664 | 664 | public function getCellSpacing() |
| 665 | 665 | { |
| 666 | - return $this->_cellSpacing===null?-1:$this->_cellSpacing; |
|
| 666 | + return $this->_cellSpacing===null ?-1 : $this->_cellSpacing; |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | /** |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | */ |
| 673 | 673 | public function setCellSpacing($value) |
| 674 | 674 | { |
| 675 | - if(($this->_cellSpacing=TPropertyValue::ensureInteger($value))<-1) |
|
| 675 | + if(($this->_cellSpacing=TPropertyValue::ensureInteger($value)) < -1) |
|
| 676 | 676 | throw new TInvalidDataValueException('tablestyle_cellspacing_invalid'); |
| 677 | 677 | } |
| 678 | 678 | |
@@ -681,7 +681,7 @@ discard block |
||
| 681 | 681 | */ |
| 682 | 682 | public function getGridLines() |
| 683 | 683 | { |
| 684 | - return $this->_gridLines===null?TTableGridLines::None:$this->_gridLines; |
|
| 684 | + return $this->_gridLines===null ? TTableGridLines::None : $this->_gridLines; |
|
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | /** |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | */ |
| 691 | 691 | public function setGridLines($value) |
| 692 | 692 | { |
| 693 | - $this->_gridLines=TPropertyValue::ensureEnum($value,'TTableGridLines'); |
|
| 693 | + $this->_gridLines=TPropertyValue::ensureEnum($value, 'TTableGridLines'); |
|
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | |
@@ -699,7 +699,7 @@ discard block |
||
| 699 | 699 | */ |
| 700 | 700 | public function getBorderCollapse() |
| 701 | 701 | { |
| 702 | - return $this->_borderCollapse===null?false:$this->_borderCollapse; |
|
| 702 | + return $this->_borderCollapse===null ? false : $this->_borderCollapse; |
|
| 703 | 703 | } |
| 704 | 704 | |
| 705 | 705 | /** |
@@ -743,12 +743,12 @@ discard block |
||
| 743 | 743 | protected function __getZappableSleepProps(&$exprops) |
| 744 | 744 | { |
| 745 | 745 | parent::__getZappableSleepProps($exprops); |
| 746 | - if ($this->_horizontalAlign===null) |
|
| 747 | - $exprops[] = "\0TTableItemStyle\0_horizontalAlign"; |
|
| 748 | - if ($this->_verticalAlign===null) |
|
| 749 | - $exprops[] = "\0TTableItemStyle\0_verticalAlign"; |
|
| 750 | - if ($this->_wrap===null) |
|
| 751 | - $exprops[] = "\0TTableItemStyle\0_wrap"; |
|
| 746 | + if($this->_horizontalAlign===null) |
|
| 747 | + $exprops[]="\0TTableItemStyle\0_horizontalAlign"; |
|
| 748 | + if($this->_verticalAlign===null) |
|
| 749 | + $exprops[]="\0TTableItemStyle\0_verticalAlign"; |
|
| 750 | + if($this->_wrap===null) |
|
| 751 | + $exprops[]="\0TTableItemStyle\0_wrap"; |
|
| 752 | 752 | } |
| 753 | 753 | |
| 754 | 754 | /** |
@@ -812,13 +812,13 @@ discard block |
||
| 812 | 812 | public function addAttributesToRender($writer) |
| 813 | 813 | { |
| 814 | 814 | if(!$this->getWrap()) |
| 815 | - $writer->addStyleAttribute('white-space','nowrap'); |
|
| 815 | + $writer->addStyleAttribute('white-space', 'nowrap'); |
|
| 816 | 816 | |
| 817 | 817 | if(($horizontalAlign=$this->getHorizontalAlign())!==THorizontalAlign::NotSet) |
| 818 | - $writer->addAttribute('align',strtolower($horizontalAlign)); |
|
| 818 | + $writer->addAttribute('align', strtolower($horizontalAlign)); |
|
| 819 | 819 | |
| 820 | 820 | if(($verticalAlign=$this->getVerticalAlign())!==TVerticalAlign::NotSet) |
| 821 | - $writer->addAttribute('valign',strtolower($verticalAlign)); |
|
| 821 | + $writer->addAttribute('valign', strtolower($verticalAlign)); |
|
| 822 | 822 | |
| 823 | 823 | parent::addAttributesToRender($writer); |
| 824 | 824 | } |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | */ |
| 829 | 829 | public function getHorizontalAlign() |
| 830 | 830 | { |
| 831 | - return $this->_horizontalAlign===null?THorizontalAlign::NotSet:$this->_horizontalAlign; |
|
| 831 | + return $this->_horizontalAlign===null ? THorizontalAlign::NotSet : $this->_horizontalAlign; |
|
| 832 | 832 | } |
| 833 | 833 | |
| 834 | 834 | /** |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | */ |
| 838 | 838 | public function setHorizontalAlign($value) |
| 839 | 839 | { |
| 840 | - $this->_horizontalAlign=TPropertyValue::ensureEnum($value,'THorizontalAlign'); |
|
| 840 | + $this->_horizontalAlign=TPropertyValue::ensureEnum($value, 'THorizontalAlign'); |
|
| 841 | 841 | } |
| 842 | 842 | |
| 843 | 843 | /** |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | */ |
| 846 | 846 | public function getVerticalAlign() |
| 847 | 847 | { |
| 848 | - return $this->_verticalAlign===null?TVerticalAlign::NotSet:$this->_verticalAlign; |
|
| 848 | + return $this->_verticalAlign===null ? TVerticalAlign::NotSet : $this->_verticalAlign; |
|
| 849 | 849 | } |
| 850 | 850 | |
| 851 | 851 | /** |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | */ |
| 855 | 855 | public function setVerticalAlign($value) |
| 856 | 856 | { |
| 857 | - $this->_verticalAlign=TPropertyValue::ensureEnum($value,'TVerticalAlign'); |
|
| 857 | + $this->_verticalAlign=TPropertyValue::ensureEnum($value, 'TVerticalAlign'); |
|
| 858 | 858 | } |
| 859 | 859 | |
| 860 | 860 | /** |
@@ -862,7 +862,7 @@ discard block |
||
| 862 | 862 | */ |
| 863 | 863 | public function getWrap() |
| 864 | 864 | { |
| 865 | - return $this->_wrap===null?true:$this->_wrap; |
|
| 865 | + return $this->_wrap===null ? true : $this->_wrap; |
|
| 866 | 866 | } |
| 867 | 867 | |
| 868 | 868 | /** |
@@ -144,6 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | /** |
| 146 | 146 | * @param string table caption |
| 147 | + * @param string $value |
|
| 147 | 148 | */ |
| 148 | 149 | public function setCaption($value) |
| 149 | 150 | { |
@@ -160,6 +161,7 @@ discard block |
||
| 160 | 161 | |
| 161 | 162 | /** |
| 162 | 163 | * @param TTableCaptionAlign table caption alignment. |
| 164 | + * @param TTableCaptionAlign $value |
|
| 163 | 165 | */ |
| 164 | 166 | public function setCaptionAlign($value) |
| 165 | 167 | { |
@@ -306,8 +306,7 @@ discard block |
||
| 306 | 306 | { |
| 307 | 307 | if($index===0 && $currentSection===TTableRowSection::Header) |
| 308 | 308 | $writer->renderBeginTag('thead'); |
| 309 | - } |
|
| 310 | - else |
|
| 309 | + } else |
|
| 311 | 310 | { |
| 312 | 311 | if($currentSection===TTableRowSection::Header) |
| 313 | 312 | { |
@@ -318,8 +317,7 @@ discard block |
||
| 318 | 317 | else |
| 319 | 318 | $writer->renderBeginTag('tfoot'); |
| 320 | 319 | $currentSection=$section; |
| 321 | - } |
|
| 322 | - else if($currentSection===TTableRowSection::Body) |
|
| 320 | + } else if($currentSection===TTableRowSection::Body) |
|
| 323 | 321 | { |
| 324 | 322 | $writer->renderEndTag(); |
| 325 | 323 | if($section===TTableRowSection::Footer) |
@@ -327,16 +325,14 @@ discard block |
||
| 327 | 325 | else |
| 328 | 326 | throw new TConfigurationException('table_tablesection_outoforder'); |
| 329 | 327 | $currentSection=$section; |
| 330 | - } |
|
| 331 | - else // Footer |
|
| 328 | + } else // Footer |
|
| 332 | 329 | throw new TConfigurationException('table_tablesection_outoforder'); |
| 333 | 330 | } |
| 334 | 331 | $row->renderControl($writer); |
| 335 | 332 | $writer->writeLine(); |
| 336 | 333 | } |
| 337 | 334 | $writer->renderEndTag(); |
| 338 | - } |
|
| 339 | - else |
|
| 335 | + } else |
|
| 340 | 336 | { |
| 341 | 337 | $writer->writeLine(); |
| 342 | 338 | foreach($this->getControls() as $row) |
@@ -110,10 +110,10 @@ discard block |
||
| 110 | 110 | if(($border=$this->getBorderWidth())==='') |
| 111 | 111 | $border=1; |
| 112 | 112 | else |
| 113 | - $border=(int)$border; |
|
| 113 | + $border=(int) $border; |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | - $writer->addAttribute('border',"$border"); |
|
| 116 | + $writer->addAttribute('border', "$border"); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | public function getCaption() |
| 141 | 141 | { |
| 142 | - return $this->getViewState('Caption',''); |
|
| 142 | + return $this->getViewState('Caption', ''); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | public function setCaption($value) |
| 149 | 149 | { |
| 150 | - $this->setViewState('Caption',$value,''); |
|
| 150 | + $this->setViewState('Caption', $value, ''); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | public function getCaptionAlign() |
| 157 | 157 | { |
| 158 | - return $this->getViewState('CaptionAlign',TTableCaptionAlign::NotSet); |
|
| 158 | + return $this->getViewState('CaptionAlign', TTableCaptionAlign::NotSet); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | public function setCaptionAlign($value) |
| 165 | 165 | { |
| 166 | - $this->setViewState('CaptionAlign',TPropertyValue::ensureEnum($value,'TTableCaptionAlign'),TTableCaptionAlign::NotSet); |
|
| 166 | + $this->setViewState('CaptionAlign', TPropertyValue::ensureEnum($value, 'TTableCaptionAlign'), TTableCaptionAlign::NotSet); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | if(($caption=$this->getCaption())!=='') |
| 273 | 273 | { |
| 274 | 274 | if(($align=$this->getCaptionAlign())!==TTableCaptionAlign::NotSet) |
| 275 | - $writer->addAttribute('align',strtolower($align)); |
|
| 275 | + $writer->addAttribute('align', strtolower($align)); |
|
| 276 | 276 | $writer->renderBeginTag('caption'); |
| 277 | 277 | $writer->write($caption); |
| 278 | 278 | $writer->renderEndTag(); |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | { |
| 312 | 312 | if($currentSection===TTableRowSection::Header) |
| 313 | 313 | { |
| 314 | - if($index>0) |
|
| 314 | + if($index > 0) |
|
| 315 | 315 | $writer->renderEndTag(); |
| 316 | 316 | if($section===TTableRowSection::Body) |
| 317 | 317 | $writer->renderBeginTag('tbody'); |
@@ -369,10 +369,10 @@ discard block |
||
| 369 | 369 | * @param mixed new item |
| 370 | 370 | * @throws TInvalidDataTypeException if the item to be inserted is not a TTableRow object. |
| 371 | 371 | */ |
| 372 | - public function insertAt($index,$item) |
|
| 372 | + public function insertAt($index, $item) |
|
| 373 | 373 | { |
| 374 | 374 | if($item instanceof TTableRow) |
| 375 | - parent::insertAt($index,$item); |
|
| 375 | + parent::insertAt($index, $item); |
|
| 376 | 376 | else |
| 377 | 377 | throw new TInvalidDataTypeException('tablerowcollection_tablerow_required'); |
| 378 | 378 | } |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | private $_active=false; |
| 547 | 547 | |
| 548 | 548 | /** |
| 549 | - * @return the tag name for the view element |
|
| 549 | + * @return string tag name for the view element |
|
| 550 | 550 | */ |
| 551 | 551 | protected function getTagName() |
| 552 | 552 | { |
@@ -714,6 +714,7 @@ discard block |
||
| 714 | 714 | /** |
| 715 | 715 | * Finds the index of the tab view whose ID is the same as the one being looked for. |
| 716 | 716 | * @param string the explicit ID of the tab view to be looked for |
| 717 | + * @param string $id |
|
| 717 | 718 | * @return integer the index of the tab view found, -1 if not found. |
| 718 | 719 | */ |
| 719 | 720 | public function findIndexByID($id) |
@@ -81,9 +81,9 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | - * Returns the index of the active tab view. |
|
| 85 | - * Note, this property may not return the correct index. |
|
| 86 | - * To ensure the correctness, call {@link getActiveView()} first. |
|
| 84 | + * Returns the index of the active tab view. |
|
| 85 | + * Note, this property may not return the correct index. |
|
| 86 | + * To ensure the correctness, call {@link getActiveView()} first. |
|
| 87 | 87 | * @return integer the zero-based index of the active tab view. If -1, it means no active tab view. Default is 0 (the first view is active). |
| 88 | 88 | */ |
| 89 | 89 | public function getActiveViewIndex() |
@@ -100,24 +100,24 @@ discard block |
||
| 100 | 100 | $this->setViewState('ActiveViewIndex',TPropertyValue::ensureInteger($value),0); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - /** |
|
| 104 | - * Returns the ID of the active tab view. |
|
| 105 | - * Note, this property may not return the correct ID. |
|
| 106 | - * To ensure the correctness, call {@link getActiveView()} first. |
|
| 107 | - * @return string The ID of the active tab view. Defaults to '', meaning not set. |
|
| 108 | - */ |
|
| 109 | - public function getActiveViewID() |
|
| 110 | - { |
|
| 103 | + /** |
|
| 104 | + * Returns the ID of the active tab view. |
|
| 105 | + * Note, this property may not return the correct ID. |
|
| 106 | + * To ensure the correctness, call {@link getActiveView()} first. |
|
| 107 | + * @return string The ID of the active tab view. Defaults to '', meaning not set. |
|
| 108 | + */ |
|
| 109 | + public function getActiveViewID() |
|
| 110 | + { |
|
| 111 | 111 | return $this->getViewState('ActiveViewID',''); |
| 112 | - } |
|
| 112 | + } |
|
| 113 | 113 | |
| 114 | - /** |
|
| 115 | - * @param string The ID of the active tab view. |
|
| 116 | - */ |
|
| 117 | - public function setActiveViewID($value) |
|
| 118 | - { |
|
| 114 | + /** |
|
| 115 | + * @param string The ID of the active tab view. |
|
| 116 | + */ |
|
| 117 | + public function setActiveViewID($value) |
|
| 118 | + { |
|
| 119 | 119 | $this->setViewState('ActiveViewID',$value,''); |
| 120 | - } |
|
| 120 | + } |
|
| 121 | 121 | |
| 122 | 122 | /** |
| 123 | 123 | * Returns the currently active view. |
@@ -172,63 +172,63 @@ discard block |
||
| 172 | 172 | throw new TInvalidOperationException('tabpanel_view_inexistent'); |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - /** |
|
| 176 | - * @return bool status of automatic tab switch on hover |
|
| 177 | - */ |
|
| 178 | - public function getAutoSwitch() |
|
| 179 | - { |
|
| 180 | - return TPropertyValue::ensureBoolean($this->getViewState('AutoSwitch')); |
|
| 181 | - } |
|
| 182 | - |
|
| 183 | - /** |
|
| 184 | - * @param bool whether to enable automatic tab switch on hover |
|
| 185 | - */ |
|
| 186 | - public function setAutoSwitch($value) |
|
| 187 | - { |
|
| 188 | - $this->setViewState('AutoSwitch',TPropertyValue::ensureBoolean($value)); |
|
| 189 | - } |
|
| 190 | - |
|
| 191 | - |
|
| 192 | - /** |
|
| 193 | - * @return string URL for the CSS file including all relevant CSS class definitions. Defaults to ''. |
|
| 194 | - */ |
|
| 195 | - public function getCssUrl() |
|
| 196 | - { |
|
| 197 | - return $this->getViewState('CssUrl','default'); |
|
| 198 | - } |
|
| 199 | - |
|
| 200 | - /** |
|
| 201 | - * @param string URL for the CSS file including all relevant CSS class definitions. |
|
| 202 | - */ |
|
| 203 | - public function setCssUrl($value) |
|
| 204 | - { |
|
| 205 | - $this->setViewState('CssUrl',TPropertyValue::ensureString($value),''); |
|
| 206 | - } |
|
| 207 | - |
|
| 208 | - /** |
|
| 209 | - * @return string CSS class for the whole tab control div. Defaults to 'tab-panel'. |
|
| 210 | - */ |
|
| 211 | - public function getCssClass() |
|
| 212 | - { |
|
| 213 | - $cssClass=parent::getCssClass(); |
|
| 214 | - return $cssClass===''?'tab-panel':$cssClass; |
|
| 215 | - } |
|
| 216 | - |
|
| 217 | - /** |
|
| 218 | - * @return string CSS class for the currently displayed view div. Defaults to 'tab-view'. |
|
| 219 | - */ |
|
| 220 | - public function getViewCssClass() |
|
| 221 | - { |
|
| 222 | - return $this->getViewStyle()->getCssClass(); |
|
| 223 | - } |
|
| 224 | - |
|
| 225 | - /** |
|
| 226 | - * @param string CSS class for the currently displayed view div. |
|
| 227 | - */ |
|
| 228 | - public function setViewCssClass($value) |
|
| 229 | - { |
|
| 230 | - $this->getViewStyle()->setCssClass($value); |
|
| 231 | - } |
|
| 175 | + /** |
|
| 176 | + * @return bool status of automatic tab switch on hover |
|
| 177 | + */ |
|
| 178 | + public function getAutoSwitch() |
|
| 179 | + { |
|
| 180 | + return TPropertyValue::ensureBoolean($this->getViewState('AutoSwitch')); |
|
| 181 | + } |
|
| 182 | + |
|
| 183 | + /** |
|
| 184 | + * @param bool whether to enable automatic tab switch on hover |
|
| 185 | + */ |
|
| 186 | + public function setAutoSwitch($value) |
|
| 187 | + { |
|
| 188 | + $this->setViewState('AutoSwitch',TPropertyValue::ensureBoolean($value)); |
|
| 189 | + } |
|
| 190 | + |
|
| 191 | + |
|
| 192 | + /** |
|
| 193 | + * @return string URL for the CSS file including all relevant CSS class definitions. Defaults to ''. |
|
| 194 | + */ |
|
| 195 | + public function getCssUrl() |
|
| 196 | + { |
|
| 197 | + return $this->getViewState('CssUrl','default'); |
|
| 198 | + } |
|
| 199 | + |
|
| 200 | + /** |
|
| 201 | + * @param string URL for the CSS file including all relevant CSS class definitions. |
|
| 202 | + */ |
|
| 203 | + public function setCssUrl($value) |
|
| 204 | + { |
|
| 205 | + $this->setViewState('CssUrl',TPropertyValue::ensureString($value),''); |
|
| 206 | + } |
|
| 207 | + |
|
| 208 | + /** |
|
| 209 | + * @return string CSS class for the whole tab control div. Defaults to 'tab-panel'. |
|
| 210 | + */ |
|
| 211 | + public function getCssClass() |
|
| 212 | + { |
|
| 213 | + $cssClass=parent::getCssClass(); |
|
| 214 | + return $cssClass===''?'tab-panel':$cssClass; |
|
| 215 | + } |
|
| 216 | + |
|
| 217 | + /** |
|
| 218 | + * @return string CSS class for the currently displayed view div. Defaults to 'tab-view'. |
|
| 219 | + */ |
|
| 220 | + public function getViewCssClass() |
|
| 221 | + { |
|
| 222 | + return $this->getViewStyle()->getCssClass(); |
|
| 223 | + } |
|
| 224 | + |
|
| 225 | + /** |
|
| 226 | + * @param string CSS class for the currently displayed view div. |
|
| 227 | + */ |
|
| 228 | + public function setViewCssClass($value) |
|
| 229 | + { |
|
| 230 | + $this->getViewStyle()->setCssClass($value); |
|
| 231 | + } |
|
| 232 | 232 | |
| 233 | 233 | /** |
| 234 | 234 | * @return TStyle the style for all the view div |
@@ -244,21 +244,21 @@ discard block |
||
| 244 | 244 | return $style; |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - /** |
|
| 248 | - * @return string CSS class for non-active tabs. Defaults to 'tab-normal'. |
|
| 249 | - */ |
|
| 250 | - public function getTabCssClass() |
|
| 251 | - { |
|
| 252 | - return $this->getTabStyle()->getCssClass(); |
|
| 253 | - } |
|
| 247 | + /** |
|
| 248 | + * @return string CSS class for non-active tabs. Defaults to 'tab-normal'. |
|
| 249 | + */ |
|
| 250 | + public function getTabCssClass() |
|
| 251 | + { |
|
| 252 | + return $this->getTabStyle()->getCssClass(); |
|
| 253 | + } |
|
| 254 | 254 | |
| 255 | - /** |
|
| 256 | - * @param string CSS class for non-active tabs. |
|
| 257 | - */ |
|
| 258 | - public function setTabCssClass($value) |
|
| 259 | - { |
|
| 260 | - $this->getTabStyle()->setCssClass($value); |
|
| 261 | - } |
|
| 255 | + /** |
|
| 256 | + * @param string CSS class for non-active tabs. |
|
| 257 | + */ |
|
| 258 | + public function setTabCssClass($value) |
|
| 259 | + { |
|
| 260 | + $this->getTabStyle()->setCssClass($value); |
|
| 261 | + } |
|
| 262 | 262 | |
| 263 | 263 | /** |
| 264 | 264 | * @return TStyle the style for all the inactive tab div |
@@ -274,21 +274,21 @@ discard block |
||
| 274 | 274 | return $style; |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | - /** |
|
| 278 | - * @return string CSS class for the active tab. Defaults to 'tab-active'. |
|
| 279 | - */ |
|
| 280 | - public function getActiveTabCssClass() |
|
| 281 | - { |
|
| 282 | - return $this->getActiveTabStyle()->getCssClass(); |
|
| 283 | - } |
|
| 284 | - |
|
| 285 | - /** |
|
| 286 | - * @param string CSS class for the active tab. |
|
| 287 | - */ |
|
| 288 | - public function setActiveTabCssClass($value) |
|
| 289 | - { |
|
| 290 | - $this->getActiveTabStyle()->setCssClass($value); |
|
| 291 | - } |
|
| 277 | + /** |
|
| 278 | + * @return string CSS class for the active tab. Defaults to 'tab-active'. |
|
| 279 | + */ |
|
| 280 | + public function getActiveTabCssClass() |
|
| 281 | + { |
|
| 282 | + return $this->getActiveTabStyle()->getCssClass(); |
|
| 283 | + } |
|
| 284 | + |
|
| 285 | + /** |
|
| 286 | + * @param string CSS class for the active tab. |
|
| 287 | + */ |
|
| 288 | + public function setActiveTabCssClass($value) |
|
| 289 | + { |
|
| 290 | + $this->getActiveTabStyle()->setCssClass($value); |
|
| 291 | + } |
|
| 292 | 292 | |
| 293 | 293 | /** |
| 294 | 294 | * @return TStyle the style for the active tab div |
@@ -136,15 +136,13 @@ discard block |
||
| 136 | 136 | $activeView=$views->itemAt($index); |
| 137 | 137 | else |
| 138 | 138 | throw new TInvalidDataValueException('tabpanel_activeviewid_invalid',$id); |
| 139 | - } |
|
| 140 | - else if(($index=$this->getActiveViewIndex())>=0) |
|
| 139 | + } else if(($index=$this->getActiveViewIndex())>=0) |
|
| 141 | 140 | { |
| 142 | 141 | if($index<$views->getCount()) |
| 143 | 142 | $activeView=$views->itemAt($index); |
| 144 | 143 | else |
| 145 | 144 | throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid',$index); |
| 146 | - } |
|
| 147 | - else |
|
| 145 | + } else |
|
| 148 | 146 | { |
| 149 | 147 | foreach($views as $index=>$view) |
| 150 | 148 | { |
@@ -320,8 +318,7 @@ discard block |
||
| 320 | 318 | $this->setActiveViewIndex($index); |
| 321 | 319 | $this->setActiveViewID($view->getID(false)); |
| 322 | 320 | $view->setActive(true); |
| 323 | - } |
|
| 324 | - else |
|
| 321 | + } else |
|
| 325 | 322 | $v->setActive(false); |
| 326 | 323 | } |
| 327 | 324 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function getActiveViewIndex() |
| 90 | 90 | { |
| 91 | - return $this->getViewState('ActiveViewIndex',0); |
|
| 91 | + return $this->getViewState('ActiveViewIndex', 0); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function setActiveViewIndex($value) |
| 99 | 99 | { |
| 100 | - $this->setViewState('ActiveViewIndex',TPropertyValue::ensureInteger($value),0); |
|
| 100 | + $this->setViewState('ActiveViewIndex', TPropertyValue::ensureInteger($value), 0); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function getActiveViewID() |
| 110 | 110 | { |
| 111 | - return $this->getViewState('ActiveViewID',''); |
|
| 111 | + return $this->getViewState('ActiveViewID', ''); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function setActiveViewID($value) |
| 118 | 118 | { |
| 119 | - $this->setViewState('ActiveViewID',$value,''); |
|
| 119 | + $this->setViewState('ActiveViewID', $value, ''); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -132,17 +132,17 @@ discard block |
||
| 132 | 132 | $views=$this->getViews(); |
| 133 | 133 | if(($id=$this->getActiveViewID())!=='') |
| 134 | 134 | { |
| 135 | - if(($index=$views->findIndexByID($id))>=0) |
|
| 135 | + if(($index=$views->findIndexByID($id)) >= 0) |
|
| 136 | 136 | $activeView=$views->itemAt($index); |
| 137 | 137 | else |
| 138 | - throw new TInvalidDataValueException('tabpanel_activeviewid_invalid',$id); |
|
| 138 | + throw new TInvalidDataValueException('tabpanel_activeviewid_invalid', $id); |
|
| 139 | 139 | } |
| 140 | - else if(($index=$this->getActiveViewIndex())>=0) |
|
| 140 | + else if(($index=$this->getActiveViewIndex()) >= 0) |
|
| 141 | 141 | { |
| 142 | - if($index<$views->getCount()) |
|
| 142 | + if($index < $views->getCount()) |
|
| 143 | 143 | $activeView=$views->itemAt($index); |
| 144 | 144 | else |
| 145 | - throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid',$index); |
|
| 145 | + throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid', $index); |
|
| 146 | 146 | } |
| 147 | 147 | else |
| 148 | 148 | { |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | public function setActiveView($view) |
| 168 | 168 | { |
| 169 | - if($this->getViews()->indexOf($view)>=0) |
|
| 169 | + if($this->getViews()->indexOf($view) >= 0) |
|
| 170 | 170 | $this->activateView($view); |
| 171 | 171 | else |
| 172 | 172 | throw new TInvalidOperationException('tabpanel_view_inexistent'); |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | public function setAutoSwitch($value) |
| 187 | 187 | { |
| 188 | - $this->setViewState('AutoSwitch',TPropertyValue::ensureBoolean($value)); |
|
| 188 | + $this->setViewState('AutoSwitch', TPropertyValue::ensureBoolean($value)); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | public function getCssUrl() |
| 196 | 196 | { |
| 197 | - return $this->getViewState('CssUrl','default'); |
|
| 197 | + return $this->getViewState('CssUrl', 'default'); |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | /** |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | public function setCssUrl($value) |
| 204 | 204 | { |
| 205 | - $this->setViewState('CssUrl',TPropertyValue::ensureString($value),''); |
|
| 205 | + $this->setViewState('CssUrl', TPropertyValue::ensureString($value), ''); |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | /** |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | public function getCssClass() |
| 212 | 212 | { |
| 213 | 213 | $cssClass=parent::getCssClass(); |
| 214 | - return $cssClass===''?'tab-panel':$cssClass; |
|
| 214 | + return $cssClass==='' ? 'tab-panel' : $cssClass; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | /** |
@@ -235,11 +235,11 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | public function getViewStyle() |
| 237 | 237 | { |
| 238 | - if(($style=$this->getViewState('ViewStyle',null))===null) |
|
| 238 | + if(($style=$this->getViewState('ViewStyle', null))===null) |
|
| 239 | 239 | { |
| 240 | 240 | $style=new TStyle; |
| 241 | 241 | $style->setCssClass('tab-view'); |
| 242 | - $this->setViewState('ViewStyle',$style,null); |
|
| 242 | + $this->setViewState('ViewStyle', $style, null); |
|
| 243 | 243 | } |
| 244 | 244 | return $style; |
| 245 | 245 | } |
@@ -265,11 +265,11 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | public function getTabStyle() |
| 267 | 267 | { |
| 268 | - if(($style=$this->getViewState('TabStyle',null))===null) |
|
| 268 | + if(($style=$this->getViewState('TabStyle', null))===null) |
|
| 269 | 269 | { |
| 270 | 270 | $style=new TStyle; |
| 271 | 271 | $style->setCssClass('tab-normal'); |
| 272 | - $this->setViewState('TabStyle',$style,null); |
|
| 272 | + $this->setViewState('TabStyle', $style, null); |
|
| 273 | 273 | } |
| 274 | 274 | return $style; |
| 275 | 275 | } |
@@ -295,11 +295,11 @@ discard block |
||
| 295 | 295 | */ |
| 296 | 296 | public function getActiveTabStyle() |
| 297 | 297 | { |
| 298 | - if(($style=$this->getViewState('ActiveTabStyle',null))===null) |
|
| 298 | + if(($style=$this->getViewState('ActiveTabStyle', null))===null) |
|
| 299 | 299 | { |
| 300 | 300 | $style=new TStyle; |
| 301 | 301 | $style->setCssClass('tab-active'); |
| 302 | - $this->setViewState('ActiveTabStyle',$style,null); |
|
| 302 | + $this->setViewState('ActiveTabStyle', $style, null); |
|
| 303 | 303 | } |
| 304 | 304 | return $style; |
| 305 | 305 | } |
@@ -333,11 +333,11 @@ discard block |
||
| 333 | 333 | * @param array the input data collection |
| 334 | 334 | * @return boolean whether the data of the control has been changed |
| 335 | 335 | */ |
| 336 | - public function loadPostData($key,$values) |
|
| 336 | + public function loadPostData($key, $values) |
|
| 337 | 337 | { |
| 338 | 338 | if(($index=$values[$this->getClientID().'_1'])!==null) |
| 339 | 339 | { |
| 340 | - $index=(int)$index; |
|
| 340 | + $index=(int) $index; |
|
| 341 | 341 | $currentIndex=$this->getActiveViewIndex(); |
| 342 | 342 | if($currentIndex!==$index) |
| 343 | 343 | { |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | */ |
| 378 | 378 | protected function addAttributesToRender($writer) |
| 379 | 379 | { |
| 380 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 380 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 381 | 381 | $this->setCssClass($this->getCssClass()); |
| 382 | 382 | parent::addAttributesToRender($writer); |
| 383 | 383 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | public function onPreRender($param) |
| 391 | 391 | { |
| 392 | 392 | parent::onPreRender($param); |
| 393 | - $this->getActiveView(); // determine the active view |
|
| 393 | + $this->getActiveView(); // determine the active view |
|
| 394 | 394 | $this->registerStyleSheet(); |
| 395 | 395 | |
| 396 | 396 | $page=$this->getPage(); |
@@ -405,17 +405,17 @@ discard block |
||
| 405 | 405 | */ |
| 406 | 406 | protected function registerStyleSheet() |
| 407 | 407 | { |
| 408 | - $url = $this->getCssUrl(); |
|
| 408 | + $url=$this->getCssUrl(); |
|
| 409 | 409 | |
| 410 | - if($url === '') { |
|
| 410 | + if($url==='') { |
|
| 411 | 411 | return; |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | - if($url === 'default') { |
|
| 415 | - $url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'tabpanel.css'); |
|
| 414 | + if($url==='default') { |
|
| 415 | + $url=$this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'tabpanel.css'); |
|
| 416 | 416 | } |
| 417 | 417 | |
| 418 | - if($url !== '') { |
|
| 418 | + if($url!=='') { |
|
| 419 | 419 | $this->getPage()->getClientScript()->registerStyleSheetFile($url, $url); |
| 420 | 420 | } |
| 421 | 421 | } |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | $code="new $className($options);"; |
| 434 | 434 | $cs->registerEndScript("prado:$id", $code); |
| 435 | 435 | // ensure an item is always active and visible |
| 436 | - $index = $this->getActiveViewIndex(); |
|
| 436 | + $index=$this->getActiveViewIndex(); |
|
| 437 | 437 | if(!$this->getViews()->itemAt($index)->Visible) |
| 438 | 438 | $index=0; |
| 439 | 439 | $cs->registerHiddenField($id.'_1', $index); |
@@ -454,19 +454,19 @@ discard block |
||
| 454 | 454 | */ |
| 455 | 455 | protected function getClientOptions() |
| 456 | 456 | { |
| 457 | - $options['ID'] = $this->getClientID(); |
|
| 458 | - $options['ActiveCssClass'] = $this->getActiveTabCssClass(); |
|
| 459 | - $options['NormalCssClass'] = $this->getTabCssClass(); |
|
| 460 | - $viewIDs = array(); |
|
| 461 | - $viewVis = array(); |
|
| 457 | + $options['ID']=$this->getClientID(); |
|
| 458 | + $options['ActiveCssClass']=$this->getActiveTabCssClass(); |
|
| 459 | + $options['NormalCssClass']=$this->getTabCssClass(); |
|
| 460 | + $viewIDs=array(); |
|
| 461 | + $viewVis=array(); |
|
| 462 | 462 | foreach($this->getViews() as $view) |
| 463 | 463 | { |
| 464 | - $viewIDs[] = $view->getClientID(); |
|
| 465 | - $viewVis[] = $view->getVisible(); |
|
| 464 | + $viewIDs[]=$view->getClientID(); |
|
| 465 | + $viewVis[]=$view->getVisible(); |
|
| 466 | 466 | } |
| 467 | - $options['Views'] = $viewIDs; |
|
| 468 | - $options['ViewsVis'] = $viewVis; |
|
| 469 | - $options['AutoSwitch'] = $this->getAutoSwitch(); |
|
| 467 | + $options['Views']=$viewIDs; |
|
| 468 | + $options['ViewsVis']=$viewVis; |
|
| 469 | + $options['AutoSwitch']=$this->getAutoSwitch(); |
|
| 470 | 470 | |
| 471 | 471 | return $options; |
| 472 | 472 | } |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | public function renderContents($writer) |
| 502 | 502 | { |
| 503 | 503 | $views=$this->getViews(); |
| 504 | - if($views->getCount()>0) |
|
| 504 | + if($views->getCount() > 0) |
|
| 505 | 505 | { |
| 506 | 506 | $writer->writeLine(); |
| 507 | 507 | // render tab bar |
@@ -560,13 +560,13 @@ discard block |
||
| 560 | 560 | protected function addAttributesToRender($writer) |
| 561 | 561 | { |
| 562 | 562 | if(!$this->getActive() && $this->getPage()->getClientSupportsJavaScript()) |
| 563 | - $this->getStyle()->setStyleField('display','none'); |
|
| 563 | + $this->getStyle()->setStyleField('display', 'none'); |
|
| 564 | 564 | |
| 565 | 565 | $this->getStyle()->mergeWith($this->getParent()->getViewStyle()); |
| 566 | 566 | |
| 567 | 567 | parent::addAttributesToRender($writer); |
| 568 | 568 | |
| 569 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 569 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | /** |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | */ |
| 575 | 575 | public function getCaption() |
| 576 | 576 | { |
| 577 | - return $this->getViewState('Caption',''); |
|
| 577 | + return $this->getViewState('Caption', ''); |
|
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | /** |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | */ |
| 583 | 583 | public function setCaption($value) |
| 584 | 584 | { |
| 585 | - $this->setViewState('Caption',TPropertyValue::ensureString($value),''); |
|
| 585 | + $this->setViewState('Caption', TPropertyValue::ensureString($value), ''); |
|
| 586 | 586 | } |
| 587 | 587 | |
| 588 | 588 | /** |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | */ |
| 591 | 591 | public function getNavigateUrl() |
| 592 | 592 | { |
| 593 | - return $this->getViewState('NavigateUrl',''); |
|
| 593 | + return $this->getViewState('NavigateUrl', ''); |
|
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | /** |
@@ -600,7 +600,7 @@ discard block |
||
| 600 | 600 | */ |
| 601 | 601 | public function setNavigateUrl($value) |
| 602 | 602 | { |
| 603 | - $this->setViewState('NavigateUrl',TPropertyValue::ensureString($value),''); |
|
| 603 | + $this->setViewState('NavigateUrl', TPropertyValue::ensureString($value), ''); |
|
| 604 | 604 | } |
| 605 | 605 | |
| 606 | 606 | /** |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | */ |
| 609 | 609 | public function getText() |
| 610 | 610 | { |
| 611 | - return $this->getViewState('Text',''); |
|
| 611 | + return $this->getViewState('Text', ''); |
|
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | /** |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | */ |
| 619 | 619 | public function setText($value) |
| 620 | 620 | { |
| 621 | - $this->setViewState('Text',TPropertyValue::ensureString($value),''); |
|
| 621 | + $this->setViewState('Text', TPropertyValue::ensureString($value), ''); |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | /** |
@@ -657,9 +657,9 @@ discard block |
||
| 657 | 657 | { |
| 658 | 658 | if($this->getVisible(false) && $this->getPage()->getClientSupportsJavaScript()) |
| 659 | 659 | { |
| 660 | - $writer->addAttribute('id',$this->getClientID().'_0'); |
|
| 660 | + $writer->addAttribute('id', $this->getClientID().'_0'); |
|
| 661 | 661 | |
| 662 | - $style=$this->getActive()?$this->getParent()->getActiveTabStyle():$this->getParent()->getTabStyle(); |
|
| 662 | + $style=$this->getActive() ? $this->getParent()->getActiveTabStyle() : $this->getParent()->getTabStyle(); |
|
| 663 | 663 | $style->addAttributesToRender($writer); |
| 664 | 664 | |
| 665 | 665 | $writer->renderBeginTag($this->getTagName()); |
@@ -703,10 +703,10 @@ discard block |
||
| 703 | 703 | * @param mixed new item |
| 704 | 704 | * @throws TInvalidDataTypeException if the item to be inserted is not a {@link TTabView} object. |
| 705 | 705 | */ |
| 706 | - public function insertAt($index,$item) |
|
| 706 | + public function insertAt($index, $item) |
|
| 707 | 707 | { |
| 708 | 708 | if($item instanceof TTabView) |
| 709 | - parent::insertAt($index,$item); |
|
| 709 | + parent::insertAt($index, $item); |
|
| 710 | 710 | else |
| 711 | 711 | throw new TInvalidDataTypeException('tabviewcollection_tabview_required'); |
| 712 | 712 | } |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
| 121 | - * @return ITemplate the item template |
|
| 121 | + * @return string the item template |
|
| 122 | 122 | */ |
| 123 | 123 | public function getItemTemplate() |
| 124 | 124 | { |
@@ -197,8 +197,7 @@ discard block |
||
| 197 | 197 | $classPath=$this->getItemRenderer(); |
| 198 | 198 | $template=$this->_itemTemplate; |
| 199 | 199 | } |
| 200 | - } |
|
| 201 | - else |
|
| 200 | + } else |
|
| 202 | 201 | { |
| 203 | 202 | $template=$this->_itemTemplate; |
| 204 | 203 | $classPath=$this->getItemRenderer(); |
@@ -214,13 +213,11 @@ discard block |
||
| 214 | 213 | } |
| 215 | 214 | if($control instanceof IDataRenderer) |
| 216 | 215 | $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
| 217 | - } |
|
| 218 | - else if($template!==null) |
|
| 216 | + } else if($template!==null) |
|
| 219 | 217 | $template->instantiateIn($cell); |
| 220 | 218 | else if($itemType!==TListItemType::EditItem) |
| 221 | 219 | $cell->setText(' '); |
| 222 | - } |
|
| 223 | - else if($itemType===TListItemType::Header) |
|
| 220 | + } else if($itemType===TListItemType::Header) |
|
| 224 | 221 | { |
| 225 | 222 | if(($classPath=$this->getHeaderRenderer())!=='') |
| 226 | 223 | $this->initializeHeaderCell($cell,$columnIndex); |
@@ -228,8 +225,7 @@ discard block |
||
| 228 | 225 | $this->_headerTemplate->instantiateIn($cell); |
| 229 | 226 | else |
| 230 | 227 | $this->initializeHeaderCell($cell,$columnIndex); |
| 231 | - } |
|
| 232 | - else if($itemType===TListItemType::Footer) |
|
| 228 | + } else if($itemType===TListItemType::Footer) |
|
| 233 | 229 | { |
| 234 | 230 | if(($classPath=$this->getFooterRenderer())!=='') |
| 235 | 231 | $this->initializeFooterCell($cell,$columnIndex); |
@@ -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()); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | /** |
| 238 | 238 | * Returns the value to be validated. |
| 239 | 239 | * This methid is required by IValidatable interface. |
| 240 | - * @return mixed the value of the property to be validated. |
|
| 240 | + * @return string the value of the property to be validated. |
|
| 241 | 241 | */ |
| 242 | 242 | public function getValidationPropertyValue() |
| 243 | 243 | { |
@@ -342,6 +342,7 @@ discard block |
||
| 342 | 342 | * An automatic postback to the server will occur whenever the user |
| 343 | 343 | * modifies the text in the TTextBox control and then tabs out of the component. |
| 344 | 344 | * @param boolean the value indicating if postback automatically |
| 345 | + * @param boolean $value |
|
| 345 | 346 | */ |
| 346 | 347 | public function setAutoPostBack($value) |
| 347 | 348 | { |
@@ -425,6 +426,7 @@ discard block |
||
| 425 | 426 | |
| 426 | 427 | /** |
| 427 | 428 | * @param boolean whether the textbox is read only |
| 429 | + * @param boolean $value |
|
| 428 | 430 | */ |
| 429 | 431 | public function setReadOnly($value) |
| 430 | 432 | { |
@@ -251,14 +251,14 @@ discard block |
||
| 251 | 251 | */ |
| 252 | 252 | public function getIsValid() |
| 253 | 253 | { |
| 254 | - return $this->_isValid; |
|
| 254 | + return $this->_isValid; |
|
| 255 | 255 | } |
| 256 | 256 | /** |
| 257 | 257 | * @param bool wether this control is valid. |
| 258 | 258 | */ |
| 259 | 259 | public function setIsValid($value) |
| 260 | 260 | { |
| 261 | - $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
| 261 | + $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | /** |
@@ -329,8 +329,8 @@ discard block |
||
| 329 | 329 | |
| 330 | 330 | /** |
| 331 | 331 | * @return boolean a value indicating whether an automatic postback to the server |
| 332 | - * will occur whenever the user modifies the text in the TTextBox control and |
|
| 333 | - * then tabs out of the component. Defaults to false. |
|
| 332 | + * will occur whenever the user modifies the text in the TTextBox control and |
|
| 333 | + * then tabs out of the component. Defaults to false. |
|
| 334 | 334 | */ |
| 335 | 335 | public function getAutoPostBack() |
| 336 | 336 | { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | protected function getTagName() |
| 74 | 74 | { |
| 75 | - return ($this->getTextMode()==='MultiLine')?'textarea':'input'; |
|
| 75 | + return ($this->getTextMode()==='MultiLine') ? 'textarea' : 'input'; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function getEnableClientScript() |
| 82 | 82 | { |
| 83 | - return $this->getViewState('EnableClientScript',true); |
|
| 83 | + return $this->getViewState('EnableClientScript', true); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function setEnableClientScript($value) |
| 90 | 90 | { |
| 91 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
| 91 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -101,66 +101,66 @@ discard block |
||
| 101 | 101 | $page=$this->getPage(); |
| 102 | 102 | $page->ensureRenderInForm($this); |
| 103 | 103 | if(($uid=$this->getUniqueID())!=='') |
| 104 | - $writer->addAttribute('name',$uid); |
|
| 104 | + $writer->addAttribute('name', $uid); |
|
| 105 | 105 | if(($textMode=$this->getTextMode())===TTextBoxMode::MultiLine) |
| 106 | 106 | { |
| 107 | - if(($rows=$this->getRows())<=0) |
|
| 107 | + if(($rows=$this->getRows()) <= 0) |
|
| 108 | 108 | $rows=self::DEFAULT_ROWS; |
| 109 | - if(($cols=$this->getColumns())<=0) |
|
| 109 | + if(($cols=$this->getColumns()) <= 0) |
|
| 110 | 110 | $cols=self::DEFAULT_COLUMNS; |
| 111 | - $writer->addAttribute('rows',"$rows"); |
|
| 112 | - $writer->addAttribute('cols',"$cols"); |
|
| 111 | + $writer->addAttribute('rows', "$rows"); |
|
| 112 | + $writer->addAttribute('cols', "$cols"); |
|
| 113 | 113 | if(!$this->getWrap()) |
| 114 | - $writer->addAttribute('wrap','off'); |
|
| 114 | + $writer->addAttribute('wrap', 'off'); |
|
| 115 | 115 | } |
| 116 | 116 | else |
| 117 | 117 | { |
| 118 | 118 | if($textMode===TTextBoxMode::SingleLine) |
| 119 | 119 | { |
| 120 | - $writer->addAttribute('type','text'); |
|
| 120 | + $writer->addAttribute('type', 'text'); |
|
| 121 | 121 | if(($text=$this->getText())!=='') |
| 122 | - $writer->addAttribute('value',$text); |
|
| 122 | + $writer->addAttribute('value', $text); |
|
| 123 | 123 | } |
| 124 | 124 | else |
| 125 | 125 | { |
| 126 | 126 | if($this->getPersistPassword() && ($text=$this->getText())!=='') |
| 127 | - $writer->addAttribute('value',$text); |
|
| 128 | - $writer->addAttribute('type','password'); |
|
| 127 | + $writer->addAttribute('value', $text); |
|
| 128 | + $writer->addAttribute('type', 'password'); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if(($act=$this->getAutoCompleteType())!=='None') |
| 132 | 132 | { |
| 133 | 133 | if($act==='Disabled') |
| 134 | - $writer->addAttribute('autocomplete','off'); |
|
| 134 | + $writer->addAttribute('autocomplete', 'off'); |
|
| 135 | 135 | else if($act==='Search') |
| 136 | - $writer->addAttribute('vcard_name','search'); |
|
| 136 | + $writer->addAttribute('vcard_name', 'search'); |
|
| 137 | 137 | else if($act==='HomeCountryRegion') |
| 138 | - $writer->addAttribute('vcard_name','HomeCountry'); |
|
| 138 | + $writer->addAttribute('vcard_name', 'HomeCountry'); |
|
| 139 | 139 | else if($act==='BusinessCountryRegion') |
| 140 | - $writer->addAttribute('vcard_name','BusinessCountry'); |
|
| 140 | + $writer->addAttribute('vcard_name', 'BusinessCountry'); |
|
| 141 | 141 | else |
| 142 | 142 | { |
| 143 | - if(strpos($act,'Business')===0) |
|
| 144 | - $act='Business'.'.'.substr($act,8); |
|
| 145 | - else if(strpos($act,'Home')===0) |
|
| 146 | - $act='Home'.'.'.substr($act,4); |
|
| 147 | - $writer->addAttribute('vcard_name','vCard.'.$act); |
|
| 143 | + if(strpos($act, 'Business')===0) |
|
| 144 | + $act='Business'.'.'.substr($act, 8); |
|
| 145 | + else if(strpos($act, 'Home')===0) |
|
| 146 | + $act='Home'.'.'.substr($act, 4); |
|
| 147 | + $writer->addAttribute('vcard_name', 'vCard.'.$act); |
|
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - if(($cols=$this->getColumns())>0) |
|
| 152 | - $writer->addAttribute('size',"$cols"); |
|
| 153 | - if(($maxLength=$this->getMaxLength())>0) |
|
| 154 | - $writer->addAttribute('maxlength',"$maxLength"); |
|
| 151 | + if(($cols=$this->getColumns()) > 0) |
|
| 152 | + $writer->addAttribute('size', "$cols"); |
|
| 153 | + if(($maxLength=$this->getMaxLength()) > 0) |
|
| 154 | + $writer->addAttribute('maxlength', "$maxLength"); |
|
| 155 | 155 | } |
| 156 | 156 | if($this->getReadOnly()) |
| 157 | - $writer->addAttribute('readonly','readonly'); |
|
| 157 | + $writer->addAttribute('readonly', 'readonly'); |
|
| 158 | 158 | $isEnabled=$this->getEnabled(true); |
| 159 | 159 | if(!$isEnabled && $this->getEnabled()) // in this case parent will not render 'disabled' |
| 160 | - $writer->addAttribute('disabled','disabled'); |
|
| 160 | + $writer->addAttribute('disabled', 'disabled'); |
|
| 161 | 161 | if($isEnabled |
| 162 | 162 | && $this->getEnableClientScript() |
| 163 | - && ( $this->getAutoPostBack() || $textMode===TTextBoxMode::SingleLine) |
|
| 163 | + && ($this->getAutoPostBack() || $textMode===TTextBoxMode::SingleLine) |
|
| 164 | 164 | && $page->getClientSupportsJavaScript()) |
| 165 | 165 | { |
| 166 | 166 | $this->renderClientControlScript($writer); |
@@ -173,9 +173,9 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | protected function renderClientControlScript($writer) |
| 175 | 175 | { |
| 176 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 177 | - $cs = $this->getPage()->getClientScript(); |
|
| 178 | - $cs->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions()); |
|
| 176 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 177 | + $cs=$this->getPage()->getClientScript(); |
|
| 178 | + $cs->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions()); |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** |
@@ -194,12 +194,12 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | protected function getPostBackOptions() |
| 196 | 196 | { |
| 197 | - $options['ID'] = $this->getClientID(); |
|
| 198 | - $options['EventTarget'] = $this->getUniqueID(); |
|
| 199 | - $options['AutoPostBack'] = $this->getAutoPostBack(); |
|
| 200 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
| 201 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
| 202 | - $options['TextMode'] = $this->getTextMode(); |
|
| 197 | + $options['ID']=$this->getClientID(); |
|
| 198 | + $options['EventTarget']=$this->getUniqueID(); |
|
| 199 | + $options['AutoPostBack']=$this->getAutoPostBack(); |
|
| 200 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
| 201 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
| 202 | + $options['TextMode']=$this->getTextMode(); |
|
| 203 | 203 | return $options; |
| 204 | 204 | } |
| 205 | 205 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | * @param array the input data collection |
| 211 | 211 | * @return boolean whether the data of the component has been changed |
| 212 | 212 | */ |
| 213 | - public function loadPostData($key,$values) |
|
| 213 | + public function loadPostData($key, $values) |
|
| 214 | 214 | { |
| 215 | 215 | $value=$values[$key]; |
| 216 | 216 | if($this->getAutoTrim()) |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | public function onTextChanged($param) |
| 273 | 273 | { |
| 274 | - $this->raiseEvent('OnTextChanged',$this,$param); |
|
| 274 | + $this->raiseEvent('OnTextChanged', $this, $param); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /** |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | */ |
| 316 | 316 | public function getAutoCompleteType() |
| 317 | 317 | { |
| 318 | - return $this->getViewState('AutoCompleteType',TTextBoxAutoCompleteType::None); |
|
| 318 | + return $this->getViewState('AutoCompleteType', TTextBoxAutoCompleteType::None); |
|
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | /** |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | */ |
| 325 | 325 | public function setAutoCompleteType($value) |
| 326 | 326 | { |
| 327 | - $this->setViewState('AutoCompleteType',TPropertyValue::ensureEnum($value,'TTextBoxAutoCompleteType'),TTextBoxAutoCompleteType::None); |
|
| 327 | + $this->setViewState('AutoCompleteType', TPropertyValue::ensureEnum($value, 'TTextBoxAutoCompleteType'), TTextBoxAutoCompleteType::None); |
|
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | /** |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | */ |
| 335 | 335 | public function getAutoPostBack() |
| 336 | 336 | { |
| 337 | - return $this->getViewState('AutoPostBack',false); |
|
| 337 | + return $this->getViewState('AutoPostBack', false); |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /** |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | */ |
| 346 | 346 | public function setAutoPostBack($value) |
| 347 | 347 | { |
| 348 | - $this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),false); |
|
| 348 | + $this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), false); |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | /** |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | */ |
| 354 | 354 | public function getAutoTrim() |
| 355 | 355 | { |
| 356 | - return $this->getViewState('AutoTrim',false); |
|
| 356 | + return $this->getViewState('AutoTrim', false); |
|
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | /** |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | */ |
| 363 | 363 | public function setAutoTrim($value) |
| 364 | 364 | { |
| 365 | - $this->setViewState('AutoTrim',TPropertyValue::ensureBoolean($value),false); |
|
| 365 | + $this->setViewState('AutoTrim', TPropertyValue::ensureBoolean($value), false); |
|
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | /** |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | */ |
| 371 | 371 | public function getCausesValidation() |
| 372 | 372 | { |
| 373 | - return $this->getViewState('CausesValidation',true); |
|
| 373 | + return $this->getViewState('CausesValidation', true); |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | /** |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | */ |
| 379 | 379 | public function setCausesValidation($value) |
| 380 | 380 | { |
| 381 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
| 381 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | /** |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | */ |
| 387 | 387 | public function getColumns() |
| 388 | 388 | { |
| 389 | - return $this->getViewState('Columns',0); |
|
| 389 | + return $this->getViewState('Columns', 0); |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | /** |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | */ |
| 396 | 396 | public function setColumns($value) |
| 397 | 397 | { |
| 398 | - $this->setViewState('Columns',TPropertyValue::ensureInteger($value),0); |
|
| 398 | + $this->setViewState('Columns', TPropertyValue::ensureInteger($value), 0); |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | /** |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | */ |
| 404 | 404 | public function getMaxLength() |
| 405 | 405 | { |
| 406 | - return $this->getViewState('MaxLength',0); |
|
| 406 | + return $this->getViewState('MaxLength', 0); |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | /** |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | */ |
| 413 | 413 | public function setMaxLength($value) |
| 414 | 414 | { |
| 415 | - $this->setViewState('MaxLength',TPropertyValue::ensureInteger($value),0); |
|
| 415 | + $this->setViewState('MaxLength', TPropertyValue::ensureInteger($value), 0); |
|
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | /** |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | */ |
| 421 | 421 | public function getReadOnly() |
| 422 | 422 | { |
| 423 | - return $this->getViewState('ReadOnly',false); |
|
| 423 | + return $this->getViewState('ReadOnly', false); |
|
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | /** |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | */ |
| 429 | 429 | public function setReadOnly($value) |
| 430 | 430 | { |
| 431 | - $this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false); |
|
| 431 | + $this->setViewState('ReadOnly', TPropertyValue::ensureBoolean($value), false); |
|
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | /** |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | */ |
| 437 | 437 | public function getRows() |
| 438 | 438 | { |
| 439 | - return $this->getViewState('Rows',self::DEFAULT_ROWS); |
|
| 439 | + return $this->getViewState('Rows', self::DEFAULT_ROWS); |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | /** |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | */ |
| 446 | 446 | public function setRows($value) |
| 447 | 447 | { |
| 448 | - $this->setViewState('Rows',TPropertyValue::ensureInteger($value),self::DEFAULT_ROWS); |
|
| 448 | + $this->setViewState('Rows', TPropertyValue::ensureInteger($value), self::DEFAULT_ROWS); |
|
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | /** |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | */ |
| 454 | 454 | public function getPersistPassword() |
| 455 | 455 | { |
| 456 | - return $this->getViewState('PersistPassword',false); |
|
| 456 | + return $this->getViewState('PersistPassword', false); |
|
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | /** |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | */ |
| 462 | 462 | public function setPersistPassword($value) |
| 463 | 463 | { |
| 464 | - $this->setViewState('PersistPassword',TPropertyValue::ensureBoolean($value),false); |
|
| 464 | + $this->setViewState('PersistPassword', TPropertyValue::ensureBoolean($value), false); |
|
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | /** |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | */ |
| 470 | 470 | public function getText() |
| 471 | 471 | { |
| 472 | - return $this->getViewState('Text',''); |
|
| 472 | + return $this->getViewState('Text', ''); |
|
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | /** |
@@ -478,8 +478,8 @@ discard block |
||
| 478 | 478 | */ |
| 479 | 479 | public function setText($value) |
| 480 | 480 | { |
| 481 | - $this->setViewState('Text',TPropertyValue::ensureString($value),''); |
|
| 482 | - $this->_safeText = null; |
|
| 481 | + $this->setViewState('Text', TPropertyValue::ensureString($value), ''); |
|
| 482 | + $this->_safeText=null; |
|
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | /** |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | */ |
| 534 | 534 | public function getTextMode() |
| 535 | 535 | { |
| 536 | - return $this->getViewState('TextMode',TTextBoxMode::SingleLine); |
|
| 536 | + return $this->getViewState('TextMode', TTextBoxMode::SingleLine); |
|
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | /** |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | */ |
| 544 | 544 | public function setTextMode($value) |
| 545 | 545 | { |
| 546 | - $this->setViewState('TextMode',TPropertyValue::ensureEnum($value,'TTextBoxMode'),TTextBoxMode::SingleLine); |
|
| 546 | + $this->setViewState('TextMode', TPropertyValue::ensureEnum($value, 'TTextBoxMode'), TTextBoxMode::SingleLine); |
|
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | /** |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | */ |
| 552 | 552 | public function getValidationGroup() |
| 553 | 553 | { |
| 554 | - return $this->getViewState('ValidationGroup',''); |
|
| 554 | + return $this->getViewState('ValidationGroup', ''); |
|
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | /** |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | */ |
| 560 | 560 | public function setValidationGroup($value) |
| 561 | 561 | { |
| 562 | - $this->setViewState('ValidationGroup',$value,''); |
|
| 562 | + $this->setViewState('ValidationGroup', $value, ''); |
|
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | /** |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | */ |
| 568 | 568 | public function getWrap() |
| 569 | 569 | { |
| 570 | - return $this->getViewState('Wrap',true); |
|
| 570 | + return $this->getViewState('Wrap', true); |
|
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | /** |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | */ |
| 577 | 577 | public function setWrap($value) |
| 578 | 578 | { |
| 579 | - $this->setViewState('Wrap',TPropertyValue::ensureBoolean($value),true); |
|
| 579 | + $this->setViewState('Wrap', TPropertyValue::ensureBoolean($value), true); |
|
| 580 | 580 | } |
| 581 | 581 | } |
| 582 | 582 | |
@@ -323,8 +323,7 @@ discard block |
||
| 323 | 323 | $writer->addAttributes($attributes); |
| 324 | 324 | if($value!==null) |
| 325 | 325 | $attributes->add('value',$value); |
| 326 | - } |
|
| 327 | - else |
|
| 326 | + } else |
|
| 328 | 327 | $onclick=''; |
| 329 | 328 | if($needspan=$this->getSpanNeeded()) |
| 330 | 329 | { |
@@ -338,14 +337,12 @@ discard block |
||
| 338 | 337 | { |
| 339 | 338 | $this->renderLabel($writer,$clientID,$text); |
| 340 | 339 | $this->renderInputTag($writer,$clientID,$onclick); |
| 341 | - } |
|
| 342 | - else |
|
| 340 | + } else |
|
| 343 | 341 | { |
| 344 | 342 | $this->renderInputTag($writer,$clientID,$onclick); |
| 345 | 343 | $this->renderLabel($writer,$clientID,$text); |
| 346 | 344 | } |
| 347 | - } |
|
| 348 | - else |
|
| 345 | + } else |
|
| 349 | 346 | $this->renderInputTag($writer,$clientID,$onclick); |
| 350 | 347 | if($needspan) |
| 351 | 348 | $writer->renderEndTag(); |
@@ -157,6 +157,7 @@ |
||
| 157 | 157 | * Processes a text string. |
| 158 | 158 | * This method is required by the parent class. |
| 159 | 159 | * @param string text string to be processed |
| 160 | + * @param string $text |
|
| 160 | 161 | * @return string the processed text result |
| 161 | 162 | */ |
| 162 | 163 | public function processText($text) |
@@ -164,8 +164,7 @@ |
||
| 164 | 164 | try |
| 165 | 165 | { |
| 166 | 166 | $highlighter=Text_Highlighter::factory($this->getLanguage()); |
| 167 | - } |
|
| 168 | - catch(Exception $e) |
|
| 167 | + } catch(Exception $e) |
|
| 169 | 168 | { |
| 170 | 169 | $highlighter=false; |
| 171 | 170 | } |
@@ -9,8 +9,8 @@ discard block |
||
| 9 | 9 | * @package System.Web.UI.WebControls |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter',false); |
|
| 13 | -Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter.Renderer.Html',false); |
|
| 12 | +Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter', false); |
|
| 13 | +Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter.Renderer.Html', false); |
|
| 14 | 14 | Prado::using('System.Web.UI.WebControls.TTextProcessor'); |
| 15 | 15 | |
| 16 | 16 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function setLineNumberStyle($value) |
| 113 | 113 | { |
| 114 | - $this->setViewState('LineNumberStyle', TPropertyValue::ensureEnum($value,'TTextHighlighterLineNumberStyle')); |
|
| 114 | + $this->setViewState('LineNumberStyle', TPropertyValue::ensureEnum($value, 'TTextHighlighterLineNumberStyle')); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | protected function registerStyleSheet() |
| 148 | 148 | { |
| 149 | 149 | $cs=$this->getPage()->getClientScript(); |
| 150 | - $cssFile=Prado::getPathOfNamespace('System.3rdParty.TextHighlighter.highlight','.css'); |
|
| 150 | + $cssFile=Prado::getPathOfNamespace('System.3rdParty.TextHighlighter.highlight', '.css'); |
|
| 151 | 151 | $cssKey='prado:TTextHighlighter:'.$cssFile; |
| 152 | 152 | if(!$cs->isStyleSheetFileRegistered($cssKey)) |
| 153 | 153 | $cs->registerStyleSheetFile($cssKey, $this->publishFilePath($cssFile)); |
@@ -173,9 +173,9 @@ discard block |
||
| 173 | 173 | return ('<pre>'.htmlentities(trim($text)).'</pre>'); |
| 174 | 174 | |
| 175 | 175 | $options["use_language"]=true; |
| 176 | - $options["tabsize"] = $this->getTabSize(); |
|
| 177 | - if ($this->getShowLineNumbers()) |
|
| 178 | - $options["numbers"] = self::$_lineNumberStyle[$this->getLineNumberStyle()]; |
|
| 176 | + $options["tabsize"]=$this->getTabSize(); |
|
| 177 | + if($this->getShowLineNumbers()) |
|
| 178 | + $options["numbers"]=self::$_lineNumberStyle[$this->getLineNumberStyle()]; |
|
| 179 | 179 | $highlighter->setRenderer(new Text_Highlighter_Renderer_Html($options)); |
| 180 | 180 | return $highlighter->highlight(trim($text)); |
| 181 | 181 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | protected function getHeaderTemplate() |
| 187 | 187 | { |
| 188 | - $id = $this->getClientID(); |
|
| 188 | + $id=$this->getClientID(); |
|
| 189 | 189 | return TJavaScript::renderScriptBlock("new Prado.WebUI.TTextHighlighter('{$id}');"); |
| 190 | 190 | } |
| 191 | 191 | |
@@ -55,6 +55,7 @@ discard block |
||
| 55 | 55 | * control does work with javascript and your class wants to flag that it requires an id |
| 56 | 56 | * to operate properly. Once set to true, it stays that way. |
| 57 | 57 | * @param boolean pass true to enable enforcement of the tag attribute id. |
| 58 | + * @param boolean $value |
|
| 58 | 59 | */ |
| 59 | 60 | public function setEnsureId($value) |
| 60 | 61 | { |
@@ -62,7 +63,7 @@ discard block |
||
| 62 | 63 | } |
| 63 | 64 | |
| 64 | 65 | /** |
| 65 | - * @return whether this web control must have an id |
|
| 66 | + * @return boolean this web control must have an id |
|
| 66 | 67 | */ |
| 67 | 68 | public function getEnsureId() |
| 68 | 69 | { |
@@ -215,6 +216,7 @@ discard block |
||
| 215 | 216 | |
| 216 | 217 | /** |
| 217 | 218 | * @param string the foreground color of the control |
| 219 | + * @param string $value |
|
| 218 | 220 | */ |
| 219 | 221 | public function setForeColor($value) |
| 220 | 222 | { |
@@ -241,7 +243,7 @@ discard block |
||
| 241 | 243 | } |
| 242 | 244 | |
| 243 | 245 | /** |
| 244 | - * @return TDisplayStyle display style of the control, default is TDisplayStyle::Fixed |
|
| 246 | + * @return string display style of the control, default is TDisplayStyle::Fixed |
|
| 245 | 247 | */ |
| 246 | 248 | public function getDisplay() |
| 247 | 249 | { |
@@ -269,6 +271,7 @@ discard block |
||
| 269 | 271 | |
| 270 | 272 | /** |
| 271 | 273 | * @param string the height of the control |
| 274 | + * @param string $value |
|
| 272 | 275 | */ |
| 273 | 276 | public function setHeight($value) |
| 274 | 277 | { |
@@ -390,6 +393,7 @@ discard block |
||
| 390 | 393 | |
| 391 | 394 | /** |
| 392 | 395 | * @param string the width of the control |
| 396 | + * @param string $value |
|
| 393 | 397 | */ |
| 394 | 398 | public function setWidth($value) |
| 395 | 399 | { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function setEnsureId($value) |
| 60 | 60 | { |
| 61 | - $this->_ensureid |= TPropertyValue::ensureBoolean($value); |
|
| 61 | + $this->_ensureid|=TPropertyValue::ensureBoolean($value); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | public function getDecorator($create=true) |
| 76 | 76 | { |
| 77 | 77 | if($create && !$this->_decorator) |
| 78 | - $this->_decorator = Prado::createComponent('TWebControlDecorator', $this); |
|
| 78 | + $this->_decorator=Prado::createComponent('TWebControlDecorator', $this); |
|
| 79 | 79 | return $this->_decorator; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | public function getAccessKey() |
| 103 | 103 | { |
| 104 | - return $this->getViewState('AccessKey',''); |
|
| 104 | + return $this->getViewState('AccessKey', ''); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -113,9 +113,9 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function setAccessKey($value) |
| 115 | 115 | { |
| 116 | - if(strlen($value)>1) |
|
| 117 | - throw new TInvalidDataValueException('webcontrol_accesskey_invalid',get_class($this),$value); |
|
| 118 | - $this->setViewState('AccessKey',$value,''); |
|
| 116 | + if(strlen($value) > 1) |
|
| 117 | + throw new TInvalidDataValueException('webcontrol_accesskey_invalid', get_class($this), $value); |
|
| 118 | + $this->setViewState('AccessKey', $value, ''); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /** |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function getBackColor() |
| 125 | 125 | { |
| 126 | - if($style=$this->getViewState('Style',null)) |
|
| 126 | + if($style=$this->getViewState('Style', null)) |
|
| 127 | 127 | return $style->getBackColor(); |
| 128 | 128 | else |
| 129 | 129 | return ''; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public function getBorderColor() |
| 144 | 144 | { |
| 145 | - if($style=$this->getViewState('Style',null)) |
|
| 145 | + if($style=$this->getViewState('Style', null)) |
|
| 146 | 146 | return $style->getBorderColor(); |
| 147 | 147 | else |
| 148 | 148 | return ''; |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | public function getBorderStyle() |
| 163 | 163 | { |
| 164 | - if($style=$this->getViewState('Style',null)) |
|
| 164 | + if($style=$this->getViewState('Style', null)) |
|
| 165 | 165 | return $style->getBorderStyle(); |
| 166 | 166 | else |
| 167 | 167 | return ''; |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public function getBorderWidth() |
| 182 | 182 | { |
| 183 | - if($style=$this->getViewState('Style',null)) |
|
| 183 | + if($style=$this->getViewState('Style', null)) |
|
| 184 | 184 | return $style->getBorderWidth(); |
| 185 | 185 | else |
| 186 | 186 | return ''; |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | public function getForeColor() |
| 209 | 209 | { |
| 210 | - if($style=$this->getViewState('Style',null)) |
|
| 210 | + if($style=$this->getViewState('Style', null)) |
|
| 211 | 211 | return $style->getForeColor(); |
| 212 | 212 | else |
| 213 | 213 | return ''; |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | */ |
| 227 | 227 | public function getHeight() |
| 228 | 228 | { |
| 229 | - if($style=$this->getViewState('Style',null)) |
|
| 229 | + if($style=$this->getViewState('Style', null)) |
|
| 230 | 230 | return $style->getHeight(); |
| 231 | 231 | else |
| 232 | 232 | return ''; |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | */ |
| 262 | 262 | public function getCssClass() |
| 263 | 263 | { |
| 264 | - if($style=$this->getViewState('Style',null)) |
|
| 264 | + if($style=$this->getViewState('Style', null)) |
|
| 265 | 265 | return $style->getCssClass(); |
| 266 | 266 | else |
| 267 | 267 | return ''; |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | */ |
| 281 | 281 | public function getHasStyle() |
| 282 | 282 | { |
| 283 | - return $this->getViewState('Style',null)!==null; |
|
| 283 | + return $this->getViewState('Style', null)!==null; |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /** |
@@ -298,12 +298,12 @@ discard block |
||
| 298 | 298 | */ |
| 299 | 299 | public function getStyle() |
| 300 | 300 | { |
| 301 | - if($style=$this->getViewState('Style',null)) |
|
| 301 | + if($style=$this->getViewState('Style', null)) |
|
| 302 | 302 | return $style; |
| 303 | 303 | else |
| 304 | 304 | { |
| 305 | 305 | $style=$this->createStyle(); |
| 306 | - $this->setViewState('Style',$style,null); |
|
| 306 | + $this->setViewState('Style', $style, null); |
|
| 307 | 307 | return $style; |
| 308 | 308 | } |
| 309 | 309 | } |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | if(is_string($value)) |
| 320 | 320 | $this->getStyle()->setCustomStyle($value); |
| 321 | 321 | else |
| 322 | - throw new TInvalidDataValueException('webcontrol_style_invalid',get_class($this)); |
|
| 322 | + throw new TInvalidDataValueException('webcontrol_style_invalid', get_class($this)); |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | /** |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | */ |
| 336 | 336 | public function getTabIndex() |
| 337 | 337 | { |
| 338 | - return $this->getViewState('TabIndex',0); |
|
| 338 | + return $this->getViewState('TabIndex', 0); |
|
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | /** |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | */ |
| 346 | 346 | public function setTabIndex($value) |
| 347 | 347 | { |
| 348 | - $this->setViewState('TabIndex',TPropertyValue::ensureInteger($value),0); |
|
| 348 | + $this->setViewState('TabIndex', TPropertyValue::ensureInteger($value), 0); |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | /** |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | */ |
| 365 | 365 | public function getToolTip() |
| 366 | 366 | { |
| 367 | - return $this->getViewState('ToolTip',''); |
|
| 367 | + return $this->getViewState('ToolTip', ''); |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | /** |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | public function setToolTip($value) |
| 376 | 376 | { |
| 377 | - $this->setViewState('ToolTip',$value,''); |
|
| 377 | + $this->setViewState('ToolTip', $value, ''); |
|
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | /** |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | */ |
| 383 | 383 | public function getWidth() |
| 384 | 384 | { |
| 385 | - if($style=$this->getViewState('Style',null)) |
|
| 385 | + if($style=$this->getViewState('Style', null)) |
|
| 386 | 386 | return $style->getWidth(); |
| 387 | 387 | else |
| 388 | 388 | return ''; |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | * @param TEventParameter event parameter to be passed to the event handlers |
| 405 | 405 | */ |
| 406 | 406 | public function onPreRender($param) { |
| 407 | - if($decorator = $this->getDecorator(false)) |
|
| 407 | + if($decorator=$this->getDecorator(false)) |
|
| 408 | 408 | $decorator->instantiate(); |
| 409 | 409 | |
| 410 | 410 | parent::onPreRender($param); |
@@ -420,21 +420,21 @@ discard block |
||
| 420 | 420 | protected function addAttributesToRender($writer) |
| 421 | 421 | { |
| 422 | 422 | if($this->getID()!=='' || $this->getEnsureId()) |
| 423 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 423 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 424 | 424 | if(($accessKey=$this->getAccessKey())!=='') |
| 425 | - $writer->addAttribute('accesskey',$accessKey); |
|
| 425 | + $writer->addAttribute('accesskey', $accessKey); |
|
| 426 | 426 | if(!$this->getEnabled()) |
| 427 | - $writer->addAttribute('disabled','disabled'); |
|
| 428 | - if(($tabIndex=$this->getTabIndex())>0) |
|
| 429 | - $writer->addAttribute('tabindex',"$tabIndex"); |
|
| 427 | + $writer->addAttribute('disabled', 'disabled'); |
|
| 428 | + if(($tabIndex=$this->getTabIndex()) > 0) |
|
| 429 | + $writer->addAttribute('tabindex', "$tabIndex"); |
|
| 430 | 430 | if(($toolTip=$this->getToolTip())!=='') |
| 431 | - $writer->addAttribute('title',$toolTip); |
|
| 432 | - if($style=$this->getViewState('Style',null)) |
|
| 431 | + $writer->addAttribute('title', $toolTip); |
|
| 432 | + if($style=$this->getViewState('Style', null)) |
|
| 433 | 433 | $style->addAttributesToRender($writer); |
| 434 | 434 | if($this->getHasAttributes()) |
| 435 | 435 | { |
| 436 | 436 | foreach($this->getAttributes() as $name=>$value) |
| 437 | - $writer->addAttribute($name,$value); |
|
| 437 | + $writer->addAttribute($name, $value); |
|
| 438 | 438 | } |
| 439 | 439 | } |
| 440 | 440 | |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | */ |
| 461 | 461 | public function renderBeginTag($writer) |
| 462 | 462 | { |
| 463 | - if($decorator = $this->getDecorator(false)) { |
|
| 463 | + if($decorator=$this->getDecorator(false)) { |
|
| 464 | 464 | $decorator->renderPreTagText($writer); |
| 465 | 465 | $this->addAttributesToRender($writer); |
| 466 | 466 | $writer->renderBeginTag($this->getTagName()); |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | */ |
| 489 | 489 | public function renderEndTag($writer) |
| 490 | 490 | { |
| 491 | - if($decorator = $this->getDecorator(false)) { |
|
| 491 | + if($decorator=$this->getDecorator(false)) { |
|
| 492 | 492 | $decorator->renderPostContentsText($writer); |
| 493 | 493 | $writer->renderEndTag(); |
| 494 | 494 | $decorator->renderPostTagText($writer); |