@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function getOptions() |
79 | 79 | { |
80 | - if (($options = $this->getViewState('JuiOptions')) === null) |
|
80 | + if(($options = $this->getViewState('JuiOptions')) === null) |
|
81 | 81 | { |
82 | 82 | $options = new TJuiControlOptions($this); |
83 | 83 | $this->setViewState('JuiOptions', $options); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * Raises the OnCreate event |
141 | 141 | * @param object $params event parameters |
142 | 142 | */ |
143 | - public function onCreate ($params) |
|
143 | + public function onCreate($params) |
|
144 | 144 | { |
145 | 145 | $this->raiseEvent('OnCreate', $this, $params); |
146 | 146 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * Raises the OnDrag event |
150 | 150 | * @param object $params event parameters |
151 | 151 | */ |
152 | - public function onDrag ($params) |
|
152 | + public function onDrag($params) |
|
153 | 153 | { |
154 | 154 | $this->raiseEvent('OnDrag', $this, $params); |
155 | 155 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * Raises the OnStart event |
159 | 159 | * @param object $params event parameters |
160 | 160 | */ |
161 | - public function onStart ($params) |
|
161 | + public function onStart($params) |
|
162 | 162 | { |
163 | 163 | $this->raiseEvent('OnStart', $this, $params); |
164 | 164 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * Raises the OnStop event |
168 | 168 | * @param object $params event parameters |
169 | 169 | */ |
170 | - public function onStop ($params) |
|
170 | + public function onStop($params) |
|
171 | 171 | { |
172 | 172 | $this->raiseEvent('OnStop', $this, $params); |
173 | 173 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | */ |
74 | 74 | public function getOptions() |
75 | 75 | { |
76 | - if (($options = $this->getViewState('JuiOptions')) === null) |
|
76 | + if(($options = $this->getViewState('JuiOptions')) === null) |
|
77 | 77 | { |
78 | 78 | $options = new TJuiControlOptions($this); |
79 | 79 | $this->setViewState('JuiOptions', $options); |
@@ -182,7 +182,7 @@ |
||
182 | 182 | */ |
183 | 183 | public function save($data) |
184 | 184 | { |
185 | - $timestamp = (string)microtime(true); |
|
185 | + $timestamp = (string) microtime(true); |
|
186 | 186 | $key = $this->calculateKey($timestamp); |
187 | 187 | $this->getCache()->add($key, $data, $this->_timeout); |
188 | 188 | $this->_page->setClientState(TPageStateFormatter::serialize($this->_page, $timestamp)); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | self::$_scriptsPackages = $packages; |
180 | 180 | } |
181 | 181 | |
182 | - if (isset(self::$_scripts[$name])) |
|
182 | + if(isset(self::$_scripts[$name])) |
|
183 | 183 | $this->_registeredScripts[$name] = true; |
184 | 184 | else |
185 | 185 | throw new TInvalidOperationException('csmanager_pradoscript_invalid', $name); |
@@ -188,13 +188,13 @@ discard block |
||
188 | 188 | { |
189 | 189 | $packagesUrl = []; |
190 | 190 | $isDebug = $this->getApplication()->getMode() === TApplicationMode::Debug; |
191 | - foreach ($packages as $p) |
|
191 | + foreach($packages as $p) |
|
192 | 192 | { |
193 | - foreach (self::$_scripts[$p] as $dep) |
|
193 | + foreach(self::$_scripts[$p] as $dep) |
|
194 | 194 | { |
195 | - foreach (self::$_scriptsPackages[$dep] as $script) |
|
195 | + foreach(self::$_scriptsPackages[$dep] as $script) |
|
196 | 196 | { |
197 | - if (!isset($this->_expandedScripts[$script])) |
|
197 | + if(!isset($this->_expandedScripts[$script])) |
|
198 | 198 | { |
199 | 199 | list($base, $subPath) = $this->getScriptPackageFolder($script); |
200 | 200 | list($path, $baseUrl) = $this->getPackagePathUrl($base); |
@@ -202,11 +202,11 @@ discard block |
||
202 | 202 | $this->_expandedScripts[$script] = true; |
203 | 203 | if($isDebug) |
204 | 204 | { |
205 | - if (!in_array($url = $baseUrl . '/' . $subPath, $packagesUrl)) |
|
205 | + if(!in_array($url = $baseUrl . '/' . $subPath, $packagesUrl)) |
|
206 | 206 | $packagesUrl[] = $url; |
207 | 207 | } else { |
208 | 208 | $minPath = preg_replace('/^(.*)(?<!\.min)\.js$/', "\\1.min.js", $subPath); |
209 | - if (!in_array($url = $baseUrl . '/' . $minPath, $packagesUrl)) |
|
209 | + if(!in_array($url = $baseUrl . '/' . $minPath, $packagesUrl)) |
|
210 | 210 | { |
211 | 211 | if(!is_file($filePath = $path . DIRECTORY_SEPARATOR . $minPath)) |
212 | 212 | { |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | */ |
386 | 386 | public function registerDefaultButton($panel, $button) |
387 | 387 | { |
388 | - $panelID = is_string($panel)?$panel:$panel->getUniqueID(); |
|
388 | + $panelID = is_string($panel) ? $panel : $panel->getUniqueID(); |
|
389 | 389 | |
390 | 390 | if(is_string($button)) |
391 | 391 | $buttonID = $button; |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | $this->_endScripts['prado:' . $panelID] = $code; |
401 | 401 | $this->registerPradoScriptInternal('prado'); |
402 | 402 | |
403 | - $params = [$panelID,$buttonID]; |
|
403 | + $params = [$panelID, $buttonID]; |
|
404 | 404 | $this->_page->registerCachingAction('Page.ClientScript', 'registerDefaultButton', $params); |
405 | 405 | } |
406 | 406 | |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | self::$_stylesPackages = $packages; |
464 | 464 | } |
465 | 465 | |
466 | - if (isset(self::$_styles[$name])) |
|
466 | + if(isset(self::$_styles[$name])) |
|
467 | 467 | $this->_registeredStyles[$name] = true; |
468 | 468 | else |
469 | 469 | throw new TInvalidOperationException('csmanager_pradostyle_invalid', $name); |
@@ -472,20 +472,20 @@ discard block |
||
472 | 472 | { |
473 | 473 | $packagesUrl = []; |
474 | 474 | $isDebug = $this->getApplication()->getMode() === TApplicationMode::Debug; |
475 | - foreach ($packages as $p) |
|
475 | + foreach($packages as $p) |
|
476 | 476 | { |
477 | - foreach (self::$_styles[$p] as $dep) |
|
477 | + foreach(self::$_styles[$p] as $dep) |
|
478 | 478 | { |
479 | - foreach (self::$_stylesPackages[$dep] as $style) |
|
479 | + foreach(self::$_stylesPackages[$dep] as $style) |
|
480 | 480 | { |
481 | - if (!isset($this->_expandedStyles[$style])) |
|
481 | + if(!isset($this->_expandedStyles[$style])) |
|
482 | 482 | { |
483 | 483 | list($base, $subPath) = $this->getStylePackageFolder($style); |
484 | 484 | list($path, $baseUrl) = $this->getPackagePathUrl($base); |
485 | 485 | |
486 | 486 | $this->_expandedStyles[$style] = true; |
487 | 487 | // TODO minify css? |
488 | - if (!in_array($url = $baseUrl . '/' . $subPath, $packagesUrl)) |
|
488 | + if(!in_array($url = $baseUrl . '/' . $subPath, $packagesUrl)) |
|
489 | 489 | $packagesUrl[] = $url; |
490 | 490 | } |
491 | 491 | } |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | if($media === '') |
525 | 525 | $this->_styleSheetFiles[$key] = $url; |
526 | 526 | else |
527 | - $this->_styleSheetFiles[$key] = [$url,$media]; |
|
527 | + $this->_styleSheetFiles[$key] = [$url, $media]; |
|
528 | 528 | |
529 | 529 | $params = func_get_args(); |
530 | 530 | $this->_page->registerCachingAction('Page.ClientScript', 'registerStyleSheetFile', $params); |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | ); |
557 | 557 | |
558 | 558 | foreach(Prado::getApplication()->getAssetManager()->getPublished() as $path => $url) |
559 | - if (substr($url, strlen($url) - 4) == '.css') |
|
559 | + if(substr($url, strlen($url) - 4) == '.css') |
|
560 | 560 | $stylesheets[] = $url; |
561 | 561 | |
562 | 562 | $stylesheets = array_unique($stylesheets); |
@@ -893,11 +893,11 @@ discard block |
||
893 | 893 | |
894 | 894 | protected function renderHiddenFieldsInt($writer, $initial) |
895 | 895 | { |
896 | - if ($initial) $this->_renderedHiddenFields = []; |
|
896 | + if($initial) $this->_renderedHiddenFields = []; |
|
897 | 897 | $str = ''; |
898 | 898 | foreach($this->_hiddenFields as $name => $value) |
899 | 899 | { |
900 | - if (in_array($name, $this->_renderedHiddenFields)) continue; |
|
900 | + if(in_array($name, $this->_renderedHiddenFields)) continue; |
|
901 | 901 | $id = strtr($name, ':', '_'); |
902 | 902 | if(is_array($value)) |
903 | 903 | { |
@@ -924,7 +924,7 @@ discard block |
||
924 | 924 | */ |
925 | 925 | protected function checkIfNotInRender() |
926 | 926 | { |
927 | - if ($form = $this->_page->InFormRender) |
|
927 | + if($form = $this->_page->InFormRender) |
|
928 | 928 | throw new \Exception('Operation invalid when page is already rendering'); |
929 | 929 | } |
930 | 930 | } |
@@ -107,7 +107,7 @@ |
||
107 | 107 | public function getRating() |
108 | 108 | { |
109 | 109 | $rating = $this->getViewState('Rating', null); |
110 | - if ($rating === null) |
|
110 | + if($rating === null) |
|
111 | 111 | return $this->getSelectedIndex() + 1; |
112 | 112 | else |
113 | 113 | return $rating; |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | protected function getCaptchaControl() |
53 | 53 | { |
54 | 54 | $control = $this->getValidationTarget(); |
55 | - if (!$control) |
|
55 | + if(!$control) |
|
56 | 56 | throw new Exception('No target control specified for TReCaptchaValidator'); |
57 | - if (!($control instanceof TReCaptcha)) |
|
57 | + if(!($control instanceof TReCaptcha)) |
|
58 | 58 | throw new Exception('TReCaptchaValidator only works with TReCaptcha controls'); |
59 | 59 | return $control; |
60 | 60 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | protected function evaluateIsValid() |
77 | 77 | { |
78 | 78 | // check validity only once (if trying to evaulate multiple times, all redundant checks would fail) |
79 | - if (null === $this->_isvalid) |
|
79 | + if(null === $this->_isvalid) |
|
80 | 80 | { |
81 | 81 | $control = $this->getCaptchaControl(); |
82 | 82 | $this->_isvalid = $control->validate(); |
@@ -96,15 +96,15 @@ discard block |
||
96 | 96 | $cs->registerHiddenField($this->getClientID() . '_1', $value); |
97 | 97 | |
98 | 98 | // update validator display |
99 | - if ($control = $this->getValidationTarget()) |
|
99 | + if($control = $this->getValidationTarget()) |
|
100 | 100 | { |
101 | 101 | $fn = 'captchaUpdateValidatorStatus_' . $this->getClientID(); |
102 | 102 | |
103 | 103 | // check if we need to request a new captcha too |
104 | - if ($this->Page->IsCallback) |
|
104 | + if($this->Page->IsCallback) |
|
105 | 105 | { |
106 | - if ($control->getVisible(true)) |
|
107 | - if (null !== $this->_isvalid) |
|
106 | + if($control->getVisible(true)) |
|
107 | + if(null !== $this->_isvalid) |
|
108 | 108 | { |
109 | 109 | // if the response has been tested and we reach the pre-render phase |
110 | 110 | // then we need to regenerate the token, because it won't test positive |
@@ -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; |