@@ -394,9 +394,9 @@ |
||
394 | 394 | if(count($option) == 2) |
395 | 395 | { |
396 | 396 | $value = trim(trim($option[1]), "'\""); |
397 | - if (($s = strtolower($value)) === 'false') |
|
397 | + if(($s = strtolower($value)) === 'false') |
|
398 | 398 | $value = false; |
399 | - elseif ($s === 'true') |
|
399 | + elseif($s === 'true') |
|
400 | 400 | $value = true; |
401 | 401 | $options[trim($option[0])] = $value; |
402 | 402 | } |
@@ -440,9 +440,9 @@ |
||
440 | 440 | if(count($option) == 2) |
441 | 441 | { |
442 | 442 | $value = trim(trim($option[1]), "'\""); |
443 | - if (($s = strtolower($value)) === 'false') |
|
443 | + if(($s = strtolower($value)) === 'false') |
|
444 | 444 | $value = false; |
445 | - elseif ($s === 'true') |
|
445 | + elseif($s === 'true') |
|
446 | 446 | $value = true; |
447 | 447 | $options[trim($option[0])] = $value; |
448 | 448 | } |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | */ |
442 | 442 | public function getItemCount() |
443 | 443 | { |
444 | - return $this->_items?$this->_items->getCount():0; |
|
444 | + return $this->_items ? $this->_items->getCount() : 0; |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | /** |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | if($this->_items) |
471 | 471 | { |
472 | 472 | $n = $this->_items->getCount(); |
473 | - for($i = 0;$i < $n;++$i) |
|
473 | + for($i = 0; $i < $n; ++$i) |
|
474 | 474 | if($this->_items->itemAt($i)->getSelected()) |
475 | 475 | return $i; |
476 | 476 | } |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | if($this->_items) |
505 | 505 | { |
506 | 506 | $n = $this->_items->getCount(); |
507 | - for($i = 0;$i < $n;++$i) |
|
507 | + for($i = 0; $i < $n; ++$i) |
|
508 | 508 | if($this->_items->itemAt($i)->getSelected()) |
509 | 509 | $selections[] = $i; |
510 | 510 | } |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | public function getSelectedValue() |
581 | 581 | { |
582 | 582 | $index = $this->getSelectedIndex(); |
583 | - return $index >= 0?$this->getItems()->itemAt($index)->getValue():''; |
|
583 | + return $index >= 0 ? $this->getItems()->itemAt($index)->getValue() : ''; |
|
584 | 584 | } |
585 | 585 | |
586 | 586 | /** |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | */ |
737 | 737 | public function setPromptValue($value) |
738 | 738 | { |
739 | - $this->setViewState('PromptValue', (string)$value, ''); |
|
739 | + $this->setViewState('PromptValue', (string) $value, ''); |
|
740 | 740 | } |
741 | 741 | |
742 | 742 | /** |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | throw new Exception(''); |
871 | 871 | return $result; |
872 | 872 | } |
873 | - catch(Exception $e) |
|
873 | + catch (Exception $e) |
|
874 | 874 | { |
875 | 875 | throw new TInvalidDataValueException('listcontrol_expression_invalid', get_class($this), $expression, $e->getMessage()); |
876 | 876 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | $button->setCausesValidation($this->getCausesValidation()); |
50 | 50 | $button->setValidationGroup($this->getValidationGroup()); |
51 | 51 | if($this->getDataTextField() !== '' || ($buttonType === TButtonColumnType::ImageButton && $this->getDataImageUrlField() !== '')) |
52 | - $button->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
|
52 | + $button->attachEventHandler('OnDataBinding', [$this, 'dataBindColumn']); |
|
53 | 53 | $cell->getControls()->add($button); |
54 | 54 | $cell->registerObject('Button', $button); |
55 | 55 | } |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | { |
445 | 445 | if($this->getShowCalendar()) |
446 | 446 | { |
447 | - switch ($this->getMode()) |
|
447 | + switch($this->getMode()) |
|
448 | 448 | { |
449 | 449 | case TDatePickerMode::Button: |
450 | 450 | $this->renderButtonDatePicker($writer); |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $date = @getdate(); |
490 | 490 | |
491 | 491 | $pattern = $this->getDateFormat(); |
492 | - $pattern = str_replace(['MMMM', 'MMM'], ['MM','MM'], $pattern); |
|
492 | + $pattern = str_replace(['MMMM', 'MMM'], ['MM', 'MM'], $pattern); |
|
493 | 493 | $formatter = new TSimpleDateFormatter($pattern); |
494 | 494 | |
495 | 495 | $order = $formatter->getDayMonthYearOrdering(); |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | //$date = @mktime(0, 0, 0, $month, $day, $year); |
520 | 520 | |
521 | 521 | $pattern = $this->getDateFormat(); |
522 | - $pattern = str_replace(['MMMM', 'MMM'], ['MM','MM'], $pattern); |
|
522 | + $pattern = str_replace(['MMMM', 'MMM'], ['MM', 'MM'], $pattern); |
|
523 | 523 | |
524 | 524 | $formatter = new TSimpleDateFormatter($pattern); |
525 | 525 | return $formatter->format($date); |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | protected function getTimeStampFromText() |
662 | 662 | { |
663 | 663 | $pattern = $this->getDateFormat(); |
664 | - $pattern = str_replace(['MMMM', 'MMM'], ['MM','MM'], $pattern); |
|
664 | + $pattern = str_replace(['MMMM', 'MMM'], ['MM', 'MM'], $pattern); |
|
665 | 665 | $formatter = new TSimpleDateFormatter($pattern); |
666 | 666 | return $formatter->parse($this->getText()); |
667 | 667 | } |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | $formatter = new TSimpleDateFormatter($this->getDateFormat()); |
712 | 712 | $days = []; |
713 | 713 | $requiresPadding = $formatter->getDayPattern() === 'dd'; |
714 | - for($i = 1;$i <= 31;$i++) |
|
714 | + for($i = 1; $i <= 31; $i++) |
|
715 | 715 | { |
716 | 716 | $days[$i] = $requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i; |
717 | 717 | } |
@@ -752,11 +752,11 @@ discard block |
||
752 | 752 | case 'MMM': return $info->getAbbreviatedMonthNames(); |
753 | 753 | case 'MM': |
754 | 754 | $array = []; |
755 | - for($i = 1;$i <= 12;$i++) |
|
755 | + for($i = 1; $i <= 12; $i++) |
|
756 | 756 | $array[$i - 1] = $i < 10 ? '0' . $i : $i; |
757 | 757 | return $array; |
758 | 758 | case 'M': |
759 | - $array = []; for($i = 1;$i <= 12;$i++) $array[$i - 1] = $i; |
|
759 | + $array = []; for($i = 1; $i <= 12; $i++) $array[$i - 1] = $i; |
|
760 | 760 | return $array; |
761 | 761 | default : return $info->getMonthNames(); |
762 | 762 | } |
@@ -58,17 +58,17 @@ discard block |
||
58 | 58 | protected function _getZappableSleepProps(&$exprops) |
59 | 59 | { |
60 | 60 | parent::_getZappableSleepProps($exprops); |
61 | - if ($this->_backImageUrl === null) |
|
61 | + if($this->_backImageUrl === null) |
|
62 | 62 | $exprops[] = "\0Prado\Web\UI\WebControls\TTableStyle\0_backImageUrl"; |
63 | - if ($this->_horizontalAlign === null) |
|
63 | + if($this->_horizontalAlign === null) |
|
64 | 64 | $exprops[] = "\0Prado\Web\UI\WebControls\TTableStyle\0_horizontalAlign"; |
65 | - if ($this->_cellPadding === null) |
|
65 | + if($this->_cellPadding === null) |
|
66 | 66 | $exprops[] = "\0Prado\Web\UI\WebControls\TTableStyle\0_cellPadding"; |
67 | - if ($this->_cellSpacing === null) |
|
67 | + if($this->_cellSpacing === null) |
|
68 | 68 | $exprops[] = "\0Prado\Web\UI\WebControls\TTableStyle\0_cellSpacing"; |
69 | - if ($this->_gridLines === null) |
|
69 | + if($this->_gridLines === null) |
|
70 | 70 | $exprops[] = "\0Prado\Web\UI\WebControls\TTableStyle\0_gridLines"; |
71 | - if ($this->_borderCollapse === null) |
|
71 | + if($this->_borderCollapse === null) |
|
72 | 72 | $exprops[] = "\0Prado\Web\UI\WebControls\TTableStyle\0_borderCollapse"; |
73 | 73 | } |
74 | 74 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function getBackImageUrl() |
179 | 179 | { |
180 | - return $this->_backImageUrl === null?'':$this->_backImageUrl; |
|
180 | + return $this->_backImageUrl === null ? '' : $this->_backImageUrl; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | */ |
195 | 195 | public function getHorizontalAlign() |
196 | 196 | { |
197 | - return $this->_horizontalAlign === null?THorizontalAlign::NotSet:$this->_horizontalAlign; |
|
197 | + return $this->_horizontalAlign === null ?THorizontalAlign::NotSet : $this->_horizontalAlign; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | /** |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | */ |
212 | 212 | public function getCellPadding() |
213 | 213 | { |
214 | - return $this->_cellPadding === null?-1:$this->_cellPadding; |
|
214 | + return $this->_cellPadding === null ?-1 : $this->_cellPadding; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | */ |
230 | 230 | public function getCellSpacing() |
231 | 231 | { |
232 | - return $this->_cellSpacing === null?-1:$this->_cellSpacing; |
|
232 | + return $this->_cellSpacing === null ?-1 : $this->_cellSpacing; |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | /** |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function getGridLines() |
249 | 249 | { |
250 | - return $this->_gridLines === null?TTableGridLines::None:$this->_gridLines; |
|
250 | + return $this->_gridLines === null ?TTableGridLines::None : $this->_gridLines; |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | */ |
266 | 266 | public function getBorderCollapse() |
267 | 267 | { |
268 | - return $this->_borderCollapse === null?false:$this->_borderCollapse; |
|
268 | + return $this->_borderCollapse === null ?false:$this->_borderCollapse; |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | $captchas = $this->Page->findControlsByType('Prado\Web\UI\WebControls\TReCaptcha2'); |
112 | 112 | $cont = 0; |
113 | 113 | $responseFieldName = self::ChallengeFieldName; |
114 | - foreach ($captchas as $captcha) |
|
114 | + foreach($captchas as $captcha) |
|
115 | 115 | { |
116 | - if ($this->getClientID() == $captcha->ClientID) |
|
116 | + if($this->getClientID() == $captcha->ClientID) |
|
117 | 117 | { |
118 | 118 | $responseFieldName .= ($cont > 0) ? '-' . $cont : ''; |
119 | 119 | } |
@@ -271,10 +271,10 @@ discard block |
||
271 | 271 | $options['onCallback'] = $this->hasEventHandler('OnCallback'); |
272 | 272 | $options['onCallbackExpired'] = $this->hasEventHandler('OnCallbackExpired'); |
273 | 273 | $options['options']['sitekey'] = $this->getSiteKey(); |
274 | - if ($theme = $this->getTheme()) $options['options']['theme'] = $theme; |
|
275 | - if ($type = $this->getType()) $options['options']['type'] = $type; |
|
276 | - if ($size = $this->getSize()) $options['options']['size'] = $size; |
|
277 | - if ($tabIndex = $this->getTabIndex()) $options['options']['tabindex'] = $tabIndex; |
|
274 | + if($theme = $this->getTheme()) $options['options']['theme'] = $theme; |
|
275 | + if($type = $this->getType()) $options['options']['type'] = $type; |
|
276 | + if($size = $this->getSize()) $options['options']['size'] = $size; |
|
277 | + if($tabIndex = $this->getTabIndex()) $options['options']['tabindex'] = $tabIndex; |
|
278 | 278 | |
279 | 279 | return $options; |
280 | 280 | } |
@@ -322,29 +322,29 @@ discard block |
||
322 | 322 | public function raiseCallbackEvent($param) |
323 | 323 | { |
324 | 324 | $params = $param->getCallbackParameter(); |
325 | - if ($params instanceof stdClass) |
|
325 | + if($params instanceof stdClass) |
|
326 | 326 | { |
327 | 327 | $callback = property_exists($params, 'onCallback'); |
328 | 328 | $callbackExpired = property_exists($params, 'onCallbackExpired'); |
329 | 329 | |
330 | - if ($callback) |
|
330 | + if($callback) |
|
331 | 331 | { |
332 | 332 | $this->WidgetId = $params->widgetId; |
333 | 333 | $this->Response = $params->response; |
334 | 334 | $this->Page->CallbackClient->jQuery($params->responseField, 'text', [$params->response]); |
335 | 335 | |
336 | - if ($params->onCallback) |
|
336 | + if($params->onCallback) |
|
337 | 337 | { |
338 | 338 | $this->onCallback($param); |
339 | 339 | } |
340 | 340 | } |
341 | 341 | |
342 | - if ($callbackExpired) |
|
342 | + if($callbackExpired) |
|
343 | 343 | { |
344 | 344 | $this->Response = ''; |
345 | 345 | $this->reset(); |
346 | 346 | |
347 | - if ($params->onCallbackExpired) |
|
347 | + if($params->onCallbackExpired) |
|
348 | 348 | { |
349 | 349 | $this->onCallbackExpired($param); |
350 | 350 | } |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | protected function getCaptchaControl() |
45 | 45 | { |
46 | 46 | $control = $this->getValidationTarget(); |
47 | - if (!$control) |
|
47 | + if(!$control) |
|
48 | 48 | throw new Exception('No target control specified for TReCaptcha2Validator'); |
49 | - if (!($control instanceof TReCaptcha2)) |
|
49 | + if(!($control instanceof TReCaptcha2)) |
|
50 | 50 | throw new Exception('TReCaptcha2Validator only works with TReCaptcha2 controls'); |
51 | 51 | return $control; |
52 | 52 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | protected function evaluateIsValid() |
67 | 67 | { |
68 | 68 | // check validity only once (if trying to evaulate multiple times, all redundant checks would fail) |
69 | - if (null === $this->_isvalid) |
|
69 | + if(null === $this->_isvalid) |
|
70 | 70 | { |
71 | 71 | $control = $this->getCaptchaControl(); |
72 | 72 | $this->_isvalid = $control->validate(); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $cs->registerHiddenField($this->getClientID() . '_1', $value); |
86 | 86 | |
87 | 87 | // update validator display |
88 | - if ($control = $this->getValidationTarget()) |
|
88 | + if($control = $this->getValidationTarget()) |
|
89 | 89 | { |
90 | 90 | $fn = 'captchaUpdateValidatorStatus_' . $this->getClientID(); |
91 | 91 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if(($randomSeed = $options['randomSeed']) > 0) |
43 | 43 | srand($randomSeed); |
44 | 44 | else |
45 | - srand((int)(microtime() * 1000000)); |
|
45 | + srand((int) (microtime() * 1000000)); |
|
46 | 46 | $token = generateToken($publicKey, $privateKey, $alphabet, $tokenLength, $caseSensitive); |
47 | 47 | } |
48 | 48 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | function generateToken($publicKey, $privateKey, $alphabet, $tokenLength, $caseSensitive) |
54 | 54 | { |
55 | 55 | $token = substr(hash2string(md5($publicKey . $privateKey), $alphabet) . hash2string(md5($privateKey . $publicKey), $alphabet), 0, $tokenLength); |
56 | - return $caseSensitive?$token:strtoupper($token); |
|
56 | + return $caseSensitive ? $token : strtoupper($token); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | function hash2string($hex, $alphabet) |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $hexLength = strlen($hex); |
64 | 64 | $base = strlen($alphabet); |
65 | 65 | $result = ''; |
66 | - for($i = 0;$i < $hexLength;$i += 6) |
|
66 | + for($i = 0; $i < $hexLength; $i += 6) |
|
67 | 67 | { |
68 | 68 | $number = hexdec(substr($hex, $i, 6)); |
69 | 69 | while($number) |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | function displayToken($token, $fontSize, $theme) |
79 | 79 | { |
80 | - if(($fontSize = (int)$fontSize) < 22) |
|
80 | + if(($fontSize = (int) $fontSize) < 22) |
|
81 | 81 | $fontSize = 22; |
82 | 82 | if($fontSize > 100) |
83 | 83 | $fontSize = 100; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR); |
105 | 105 | |
106 | 106 | $hasShadow = ($theme & THEME_SHADOWED_TEXT); |
107 | - for($i = 0;$i < $length;$i++) |
|
107 | + for($i = 0; $i < $length; $i++) |
|
108 | 108 | { |
109 | 109 | $color = imagecolorallocate($image, rand(150, 220), rand(150, 220), rand(150, 220)); |
110 | 110 | $size = rand($fontWidth - 10, $fontWidth); |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | |
152 | 152 | function addNoise($image, $width, $height) |
153 | 153 | { |
154 | - for($x = 0;$x < $width;++$x) |
|
154 | + for($x = 0; $x < $width; ++$x) |
|
155 | 155 | { |
156 | - for($y = 0;$y < $height;++$y) |
|
156 | + for($y = 0; $y < $height; ++$y) |
|
157 | 157 | { |
158 | 158 | if(rand(0, 100) < 25) |
159 | 159 | { |
@@ -167,14 +167,14 @@ discard block |
||
167 | 167 | |
168 | 168 | function addGrid($image, $width, $height) |
169 | 169 | { |
170 | - for($i = 0;$i < $width;$i += rand(15, 25)) |
|
170 | + for($i = 0; $i < $width; $i += rand(15, 25)) |
|
171 | 171 | { |
172 | 172 | imagesetthickness($image, rand(2, 6)); |
173 | 173 | $color = imagecolorallocate($image, rand(100, 180), rand(100, 180), rand(100, 180)); |
174 | 174 | imageline($image, $i + rand(-10, 20), 0, $i + rand(-10, 20), $height, $color); |
175 | 175 | imagecolordeallocate($image, $color); |
176 | 176 | } |
177 | - for($i = 0;$i < $height;$i += rand(15, 25)) |
|
177 | + for($i = 0; $i < $height; $i += rand(15, 25)) |
|
178 | 178 | { |
179 | 179 | imagesetthickness($image, rand(2, 6)); |
180 | 180 | $color = imagecolorallocate($image, rand(100, 180), rand(100, 180), rand(100, 180)); |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | |
186 | 186 | function addScribble($image, $width, $height) |
187 | 187 | { |
188 | - for($i = 0;$i < 8;$i++) |
|
188 | + for($i = 0; $i < 8; $i++) |
|
189 | 189 | { |
190 | 190 | $color = imagecolorallocate($image, rand(100, 180), rand(100, 180), rand(100, 180)); |
191 | 191 | $points = []; |
192 | - for($j = 1;$j < rand(5, 10);$j++) |
|
192 | + for($j = 1; $j < rand(5, 10); $j++) |
|
193 | 193 | { |
194 | 194 | $points[] = rand(2 * (20 * ($i + 1)), 2 * (50 * ($i + 1))); |
195 | 195 | $points[] = rand(30, $height + 30); |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | $tempImage = imagecreatetruecolor($width, $height); |
206 | 206 | $chunk = rand(1, 5); |
207 | - for($x = $y = 0;$x < $width;$x += $chunk) |
|
207 | + for($x = $y = 0; $x < $width; $x += $chunk) |
|
208 | 208 | { |
209 | 209 | $chunk = rand(1, 5); |
210 | 210 | $y += rand(-1, 1); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | if($y < 0) $y = 5; |
213 | 213 | imagecopy($tempImage, $image, $x, 0, $x, $y, $chunk, $height); |
214 | 214 | } |
215 | - for($x = $y = 0;$y < $height;$y += $chunk) |
|
215 | + for($x = $y = 0; $y < $height; $y += $chunk) |
|
216 | 216 | { |
217 | 217 | $chunk = rand(1, 5); |
218 | 218 | $x += rand(-1, 1); |