@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | /** |
152 | 152 | * @return boolean wether to display a progress indicator or not. Defaults to true. |
153 | 153 | */ |
154 | - public function getProgressIndicator () |
|
154 | + public function getProgressIndicator() |
|
155 | 155 | { |
156 | 156 | return $this->getViewState('ProgressIndicator', true); |
157 | 157 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | /** |
160 | 160 | * @param boolean wether to display a progress indicator or not. Defaults to true. |
161 | 161 | */ |
162 | - public function setProgressIndicator ($value) |
|
162 | + public function setProgressIndicator($value) |
|
163 | 163 | { |
164 | 164 | $this->setViewState('ProgressIndicator', TPropertyValue::ensureBoolean($value), true); |
165 | 165 | } |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | */ |
297 | 297 | public function loadPostData($key, $values) |
298 | 298 | { |
299 | - $value = (float)$values[$this->getClientID() . '_1']; |
|
299 | + $value = (float) $values[$this->getClientID() . '_1']; |
|
300 | 300 | if($this->getValue() !== $value) |
301 | 301 | { |
302 | 302 | $this->setValue($value); |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | /** |
336 | 336 | * @return string the HTML tag name for slider. Defaults to div. |
337 | 337 | */ |
338 | - public function getTagName () |
|
338 | + public function getTagName() |
|
339 | 339 | { |
340 | 340 | return "div"; |
341 | 341 | } |
@@ -348,9 +348,9 @@ discard block |
||
348 | 348 | { |
349 | 349 | parent::addAttributesToRender($writer); |
350 | 350 | $writer->addAttribute('id', $this->getClientID()); |
351 | - if ($this->getCssClass() === '') |
|
351 | + if($this->getCssClass() === '') |
|
352 | 352 | { |
353 | - $class = ($this->getDirection() == TSliderDirection::Horizontal)?'HorizontalSlider':'VerticalSlider'; |
|
353 | + $class = ($this->getDirection() == TSliderDirection::Horizontal) ? 'HorizontalSlider' : 'VerticalSlider'; |
|
354 | 354 | $writer->addAttribute('class', 'Slider ' . $class); |
355 | 355 | } |
356 | 356 | |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | $writer->addAttribute('id', $this->getClientID() . '_track'); |
367 | 367 | $writer->renderBeginTag('div'); |
368 | 368 | // Render the 'Progress Indicator' |
369 | - if ($this->getProgressIndicator()) |
|
369 | + if($this->getProgressIndicator()) |
|
370 | 370 | { |
371 | 371 | $writer->addAttribute('class', 'Progress'); |
372 | 372 | $writer->addAttribute('id', $this->getClientID() . '_progress'); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | * This method is invoked right before the control rendering, if the control is visible. |
404 | 404 | * @param mixed event parameter |
405 | 405 | */ |
406 | - public function onPreRender ($param) |
|
406 | + public function onPreRender($param) |
|
407 | 407 | { |
408 | 408 | parent::onPreRender($param); |
409 | 409 | $this->registerStyleSheet(); |
@@ -463,16 +463,16 @@ discard block |
||
463 | 463 | $options['sliderValue'] = $this->getValue(); |
464 | 464 | $options['disabled'] = !$this->getEnabled(); |
465 | 465 | $values = $this->getValues(); |
466 | - if (!empty($values)) |
|
466 | + if(!empty($values)) |
|
467 | 467 | { |
468 | 468 | // Values are provided. Check if min/max are present in them |
469 | - if (!in_array($minValue, $values)) $values[] = $minValue; |
|
470 | - if (!in_array($maxValue, $values)) $values[] = $maxValue; |
|
469 | + if(!in_array($minValue, $values)) $values[] = $minValue; |
|
470 | + if(!in_array($maxValue, $values)) $values[] = $maxValue; |
|
471 | 471 | // Remove all values outsize the range [min..max] |
472 | - foreach ($values as $idx => $value) |
|
472 | + foreach($values as $idx => $value) |
|
473 | 473 | { |
474 | - if ($value < $minValue) unset($values[$idx]); |
|
475 | - if ($value > $maxValue) unset($values[$idx]); |
|
474 | + if($value < $minValue) unset($values[$idx]); |
|
475 | + if($value > $maxValue) unset($values[$idx]); |
|
476 | 476 | } |
477 | 477 | } |
478 | 478 | else |
@@ -480,15 +480,15 @@ discard block |
||
480 | 480 | // Values are not provided, generate automatically using stepsize |
481 | 481 | $step = $this->getStepSize(); |
482 | 482 | // We want at most self::MAX_STEPS values, so, change the step if necessary |
483 | - if (($maxValue - $minValue) / $step > self::MAX_STEPS) |
|
483 | + if(($maxValue - $minValue) / $step > self::MAX_STEPS) |
|
484 | 484 | { |
485 | 485 | $step = ($maxValue - $minValue) / self::MAX_STEPS; |
486 | 486 | } |
487 | 487 | $values = []; |
488 | - for ($i = $minValue;$i <= $maxValue;$i += $step) |
|
488 | + for($i = $minValue; $i <= $maxValue; $i += $step) |
|
489 | 489 | $values[] = $i; |
490 | 490 | // Add max if it's not in the array because of step |
491 | - if (!in_array($maxValue, $values)) $values[] = $maxValue; |
|
491 | + if(!in_array($maxValue, $values)) $values[] = $maxValue; |
|
492 | 492 | } |
493 | 493 | $options['values'] = $values; |
494 | 494 | if($this->_clientScript !== null) |
@@ -153,7 +153,7 @@ |
||
153 | 153 | { |
154 | 154 | $writer->addAttribute('id', $this->getClientID() . '_0'); |
155 | 155 | |
156 | - $style = $this->getActive()?$this->getParent()->getActiveTabStyle():$this->getParent()->getTabStyle(); |
|
156 | + $style = $this->getActive() ? $this->getParent()->getActiveTabStyle() : $this->getParent()->getTabStyle(); |
|
157 | 157 | $style->addAttributesToRender($writer); |
158 | 158 | |
159 | 159 | $writer->renderBeginTag($this->getTagName()); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | public function getCssClass() |
209 | 209 | { |
210 | 210 | $cssClass = parent::getCssClass(); |
211 | - return $cssClass === ''?'accordion':$cssClass; |
|
211 | + return $cssClass === '' ? 'accordion' : $cssClass; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | { |
367 | 367 | if(($index = $values[$this->getClientID() . '_1']) !== null) |
368 | 368 | { |
369 | - $index = (int)$index; |
|
369 | + $index = (int) $index; |
|
370 | 370 | $currentIndex = $this->getActiveViewIndex(); |
371 | 371 | if($currentIndex !== $index) |
372 | 372 | { |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | public function onPreRender($param) |
420 | 420 | { |
421 | 421 | parent::onPreRender($param); |
422 | - $this->getActiveView(); // determine the active view |
|
422 | + $this->getActiveView(); // determine the active view |
|
423 | 423 | $this->registerStyleSheet(); |
424 | 424 | } |
425 | 425 | |
@@ -487,11 +487,11 @@ discard block |
||
487 | 487 | $options['HeaderCssClass'] = $this->getHeaderCssClass(); |
488 | 488 | $options['Duration'] = $this->getAnimationDuration(); |
489 | 489 | |
490 | - if (($viewheight = $this->getViewHeight()) > 0) |
|
490 | + if(($viewheight = $this->getViewHeight()) > 0) |
|
491 | 491 | $options['maxHeight'] = $viewheight; |
492 | 492 | $views = []; |
493 | 493 | foreach($this->getViews() as $view) |
494 | - $views[$view->getClientID()] = $view->getVisible() ? '1': '0'; |
|
494 | + $views[$view->getClientID()] = $view->getVisible() ? '1' : '0'; |
|
495 | 495 | $options['Views'] = $views; |
496 | 496 | |
497 | 497 | return $options; |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | protected function _getZappableSleepProps(&$exprops) |
54 | 54 | { |
55 | 55 | parent::_getZappableSleepProps($exprops); |
56 | - if ($this->_backImageUrl === null) |
|
56 | + if($this->_backImageUrl === null) |
|
57 | 57 | $exprops[] = "\0Prado\Web\UI\WebControls\TPanelStyle\0_backImageUrl"; |
58 | - if ($this->_direction === null) |
|
58 | + if($this->_direction === null) |
|
59 | 59 | $exprops[] = "\0Prado\Web\UI\WebControls\TPanelStyle\0_direction"; |
60 | - if ($this->_horizontalAlign === null) |
|
60 | + if($this->_horizontalAlign === null) |
|
61 | 61 | $exprops[] = "\0Prado\Web\UI\WebControls\TPanelStyle\0_horizontalAlign"; |
62 | - if ($this->_scrollBars === null) |
|
62 | + if($this->_scrollBars === null) |
|
63 | 63 | $exprops[] = "\0Prado\Web\UI\WebControls\TPanelStyle\0_scrollBars"; |
64 | - if ($this->_wrap === null) |
|
64 | + if($this->_wrap === null) |
|
65 | 65 | $exprops[] = "\0Prado\Web\UI\WebControls\TPanelStyle\0_wrap"; |
66 | 66 | } |
67 | 67 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function getBackImageUrl() |
107 | 107 | { |
108 | - return $this->_backImageUrl === null?'':$this->_backImageUrl; |
|
108 | + return $this->_backImageUrl === null ? '' : $this->_backImageUrl; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function getDirection() |
124 | 124 | { |
125 | - return $this->_direction === null?TContentDirection::NotSet:$this->_direction; |
|
125 | + return $this->_direction === null ?TContentDirection::NotSet : $this->_direction; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function getWrap() |
140 | 140 | { |
141 | - return $this->_wrap === null?true:$this->_wrap; |
|
141 | + return $this->_wrap === null ?true:$this->_wrap; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function getHorizontalAlign() |
157 | 157 | { |
158 | - return $this->_horizontalAlign === null?THorizontalAlign::NotSet:$this->_horizontalAlign; |
|
158 | + return $this->_horizontalAlign === null ?THorizontalAlign::NotSet : $this->_horizontalAlign; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public function getScrollBars() |
174 | 174 | { |
175 | - return $this->_scrollBars === null?TScrollBars::None:$this->_scrollBars; |
|
175 | + return $this->_scrollBars === null ?TScrollBars::None : $this->_scrollBars; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
@@ -80,7 +80,7 @@ |
||
80 | 80 | { |
81 | 81 | $result = $this->getTemplateControl()->evaluateExpression($this->_condition); |
82 | 82 | } |
83 | - catch(\Exception $e) |
|
83 | + catch (\Exception $e) |
|
84 | 84 | { |
85 | 85 | throw new TInvalidDataValueException('conditional_condition_invalid', $this->_condition, $e->getMessage()); |
86 | 86 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | { |
63 | 63 | if($this->getCausesValidation()) |
64 | 64 | $this->getPage()->validate($this->getValidationGroup()); |
65 | - $this->onClick(new TBulletedListEventParameter((int)$param)); |
|
65 | + $this->onClick(new TBulletedListEventParameter((int) $param)); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -112,7 +112,7 @@ |
||
112 | 112 | public function loadPostData($key, $values) |
113 | 113 | { |
114 | 114 | $uniqueGroupName = $this->getUniqueGroupName(); |
115 | - $value = isset($values[$uniqueGroupName])?$values[$uniqueGroupName]:null; |
|
115 | + $value = isset($values[$uniqueGroupName]) ? $values[$uniqueGroupName] : null; |
|
116 | 116 | if($value !== null && $value === $this->getValueAttribute()) |
117 | 117 | { |
118 | 118 | if(!$this->getChecked()) |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | $this->regenerateToken(); |
341 | 341 | return false; |
342 | 342 | } |
343 | - return ($this->getToken() === ($this->getCaseSensitive()?$input:strtoupper($input))); |
|
343 | + return ($this->getToken() === ($this->getCaseSensitive() ? $input : strtoupper($input))); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | /** |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | */ |
384 | 384 | protected function getTokenImageOptions() |
385 | 385 | { |
386 | - $privateKey = $this->getPrivateKey(); // call this method to ensure private key is generated |
|
386 | + $privateKey = $this->getPrivateKey(); // call this method to ensure private key is generated |
|
387 | 387 | $token = $this->getToken(); |
388 | 388 | $options = []; |
389 | 389 | $options['publicKey'] = $this->getPublicKey(); |
@@ -394,10 +394,10 @@ discard block |
||
394 | 394 | $options['theme'] = $this->getTokenImageTheme(); |
395 | 395 | if(($randomSeed = $this->getViewState('RandomSeed', 0)) === 0) |
396 | 396 | { |
397 | - $randomSeed = (int)(microtime(true) * 1000000); |
|
397 | + $randomSeed = (int) (microtime(true) * 1000000); |
|
398 | 398 | $this->setViewState('RandomSeed', $randomSeed); |
399 | 399 | } |
400 | - $options['randomSeed'] = $this->getChangingTokenBackground()?0:$randomSeed; |
|
400 | + $options['randomSeed'] = $this->getChangingTokenBackground() ? 0 : $randomSeed; |
|
401 | 401 | $str = serialize($options); |
402 | 402 | return base64_encode(md5($privateKey . $str) . $str); |
403 | 403 | } |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | protected function generateToken($publicKey, $privateKey, $alphabet, $tokenLength, $caseSensitive) |
456 | 456 | { |
457 | 457 | $token = substr($this->hash2string(md5($publicKey . $privateKey), $alphabet) . $this->hash2string(md5($privateKey . $publicKey), $alphabet), 0, $tokenLength); |
458 | - return $caseSensitive?$token:strtoupper($token); |
|
458 | + return $caseSensitive ? $token : strtoupper($token); |
|
459 | 459 | } |
460 | 460 | |
461 | 461 | /** |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | $hexLength = strlen($hex); |
472 | 472 | $base = strlen($alphabet); |
473 | 473 | $result = ''; |
474 | - for($i = 0;$i < $hexLength;$i += 6) |
|
474 | + for($i = 0; $i < $hexLength; $i += 6) |
|
475 | 475 | { |
476 | 476 | $number = hexdec(substr($hex, $i, 6)); |
477 | 477 | while($number) |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function findControl($id, $real = false) |
78 | 78 | { |
79 | - if ($real === true) |
|
79 | + if($real === true) |
|
80 | 80 | return parent::findControl($id); |
81 | 81 | return $this; |
82 | 82 | } |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | { |
321 | 321 | if($this->getEnabled(true)) |
322 | 322 | { |
323 | - $index = (int)substr($key, strlen($this->getUniqueID()) + 2); |
|
323 | + $index = (int) substr($key, strlen($this->getUniqueID()) + 2); |
|
324 | 324 | $this->ensureDataBound(); |
325 | 325 | if($index >= 0 && $index < $this->getItemCount()) |
326 | 326 | { |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | $this->_repeatedControl->setValidationGroup($this->getValidationGroup()); |
371 | 371 | $page = $this->getPage(); |
372 | 372 | $n = $this->getItemCount(); |
373 | - for($i = 0;$i < $n;++$i) |
|
373 | + for($i = 0; $i < $n; ++$i) |
|
374 | 374 | { |
375 | 375 | $this->_repeatedControl->setID("c$i"); |
376 | 376 | $page->registerRequiresPostData($this->_repeatedControl); |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | * |
383 | 383 | *@return boolean true if we need a span |
384 | 384 | */ |
385 | - protected function getSpanNeeded () |
|
385 | + protected function getSpanNeeded() |
|
386 | 386 | { |
387 | 387 | return $this->getRepeatLayout() === TRepeatLayout::Raw; |
388 | 388 | } |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | */ |
395 | 395 | public function render($writer) |
396 | 396 | { |
397 | - if ($needSpan = $this->getSpanNeeded()) |
|
397 | + if($needSpan = $this->getSpanNeeded()) |
|
398 | 398 | { |
399 | 399 | $writer->addAttribute('id', $this->getClientId()); |
400 | 400 | $writer->renderBeginTag('span'); |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | $this->setAccessKey($accessKey); |
416 | 416 | $this->setTabIndex($tabIndex); |
417 | 417 | } |
418 | - if ($needSpan) |
|
418 | + if($needSpan) |
|
419 | 419 | $writer->renderEndTag(); |
420 | 420 | |
421 | 421 | //checkbox skipped the client control script in addAttributesToRender |