@@ -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); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | if(is_array($data)) |
128 | 128 | { |
129 | 129 | $param = new TOutputCacheCheckDependencyEventParameter; |
130 | - $param->setCacheTime(isset($data[3])?$data[3]:0); |
|
130 | + $param->setCacheTime(isset($data[3]) ? $data[3] : 0); |
|
131 | 131 | $this->onCheckDependency($param); |
132 | 132 | $this->_dataCached = $param->getIsValid(); |
133 | 133 | } |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | foreach($this->_actions as $action) |
193 | 193 | { |
194 | 194 | if($action[0] === 'Page.ClientScript') |
195 | - call_user_func_array([$cs,$action[1]], $action[2]); |
|
195 | + call_user_func_array([$cs, $action[1]], $action[2]); |
|
196 | 196 | elseif($action[0] === 'Page') |
197 | - call_user_func_array([$page,$action[1]], $action[2]); |
|
197 | + call_user_func_array([$page, $action[1]], $action[2]); |
|
198 | 198 | else |
199 | - call_user_func_array([$this->getSubProperty($action[0]),$action[1]], $action[2]); |
|
199 | + call_user_func_array([$this->getSubProperty($action[0]), $action[1]], $action[2]); |
|
200 | 200 | } |
201 | 201 | } |
202 | 202 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | */ |
267 | 267 | public function registerAction($context, $funcName, $funcParams) |
268 | 268 | { |
269 | - $this->_actions[] = [$context,$funcName,$funcParams]; |
|
269 | + $this->_actions[] = [$context, $funcName, $funcParams]; |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | public function getCacheKey() |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | elseif($this->_cacheAvailable) |
487 | 487 | { |
488 | 488 | $textwriter = new TTextWriter(); |
489 | - $multiwriter = new TOutputCacheTextWriterMulti([$writer->getWriter(),$textwriter]); |
|
489 | + $multiwriter = new TOutputCacheTextWriterMulti([$writer->getWriter(), $textwriter]); |
|
490 | 490 | $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $multiwriter); |
491 | 491 | |
492 | 492 | $stack = $this->getPage()->getCachingStack(); |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | $stack->pop(); |
496 | 496 | |
497 | 497 | $content = $textwriter->flush(); |
498 | - $data = [$content,$this->_state,$this->_actions,time()]; |
|
498 | + $data = [$content, $this->_state, $this->_actions, time()]; |
|
499 | 499 | $this->_cache->set($this->getCacheKey(), $data, $this->getDuration(), $this->getCacheDependency()); |
500 | 500 | } |
501 | 501 | else |
@@ -167,19 +167,18 @@ discard block |
||
167 | 167 | public function getClientSideOptions() |
168 | 168 | { |
169 | 169 | $options = []; |
170 | - if ($theme = $this->getThemeName()) |
|
170 | + if($theme = $this->getThemeName()) |
|
171 | 171 | $options['theme'] = $theme; |
172 | - if ($lang = $this->getLanguage()) |
|
172 | + if($lang = $this->getLanguage()) |
|
173 | 173 | $options['lang'] = $lang; |
174 | - if ($trans = $this->getCustomTranslations()) |
|
174 | + if($trans = $this->getCustomTranslations()) |
|
175 | 175 | $options['custom_translations'] = $trans; |
176 | 176 | return $options; |
177 | 177 | } |
178 | 178 | |
179 | 179 | public function validate() |
180 | 180 | { |
181 | - if (! |
|
182 | - ( |
|
181 | + if(!( |
|
183 | 182 | ($challenge = @$_POST[$this->getChallengeFieldName()]) |
184 | 183 | and |
185 | 184 | ($response = @$_POST[$this->getResponseFieldName()]) |
@@ -224,7 +223,7 @@ discard block |
||
224 | 223 | { |
225 | 224 | // if we're in a callback, then schedule re-rendering of the control |
226 | 225 | // if not, don't do anything, because a new challenge will be rendered anyway |
227 | - if ($this->Page->IsCallback) |
|
226 | + if($this->Page->IsCallback) |
|
228 | 227 | $this->Page->CallbackClient->jQuery($this->getClientID() . ' #recaptcha_reload', 'click'); |
229 | 228 | } |
230 | 229 | |
@@ -236,7 +235,7 @@ discard block |
||
236 | 235 | $divid = $id . '_1_recaptchadiv'; |
237 | 236 | $writer->write('<div id="' . htmlspecialchars($divid) . '">'); |
238 | 237 | |
239 | - if (!$this->Page->IsCallback) |
|
238 | + if(!$this->Page->IsCallback) |
|
240 | 239 | { |
241 | 240 | $writer->write(TJavaScript::renderScriptBlock( |
242 | 241 | 'var RecaptchaOptions = ' . TJavaScript::jsonEncode($this->getClientSideOptions()) . ';' |
@@ -290,7 +289,7 @@ discard block |
||
290 | 289 | { |
291 | 290 | $server = $use_ssl ? self::RECAPTCHA_API_SECURE_SERVER : $server = self::RECAPTCHA_API_SERVER; |
292 | 291 | $errorpart = ''; |
293 | - if ($error) |
|
292 | + if($error) |
|
294 | 293 | $errorpart = "&error=" . $error; |
295 | 294 | |
296 | 295 | return '<script type="text/javascript" src="' . $server . '/challenge?k=' . $pubkey . $errorpart . '"></script> |
@@ -306,9 +305,9 @@ discard block |
||
306 | 305 | * @param $data - array of string elements to be encoded |
307 | 306 | * @return string - encoded request |
308 | 307 | */ |
309 | - private function recaptcha_qsencode ($data) { |
|
308 | + private function recaptcha_qsencode($data) { |
|
310 | 309 | $req = ""; |
311 | - foreach ($data as $key => $value) |
|
310 | + foreach($data as $key => $value) |
|
312 | 311 | $req .= $key . '=' . urlencode(stripslashes($value)) . '&'; |
313 | 312 | |
314 | 313 | // Cut the last '&' |
@@ -342,7 +341,7 @@ discard block |
||
342 | 341 | |
343 | 342 | fwrite($fs, $http_request); |
344 | 343 | |
345 | - while (!feof($fs)) |
|
344 | + while(!feof($fs)) |
|
346 | 345 | $response .= fgets($fs, 1160); // One TCP-IP packet |
347 | 346 | fclose($fs); |
348 | 347 | $response = explode("\r\n\r\n", $response, 2); |
@@ -362,7 +361,7 @@ discard block |
||
362 | 361 | private function recaptcha_check_answer($privkey, $remoteip, $challenge, $response, $extra_params = []) |
363 | 362 | { |
364 | 363 | //discard spam submissions |
365 | - if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) |
|
364 | + if($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) |
|
366 | 365 | return false; |
367 | 366 | |
368 | 367 | $response = $this->recaptcha_http_post(self::RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify", |
@@ -376,7 +375,7 @@ discard block |
||
376 | 375 | |
377 | 376 | $answers = explode("\n", $response [1]); |
378 | 377 | |
379 | - if (trim($answers [0]) == 'true') |
|
378 | + if(trim($answers [0]) == 'true') |
|
380 | 379 | return true; |
381 | 380 | else |
382 | 381 | return false; |
@@ -88,13 +88,13 @@ discard block |
||
88 | 88 | if(!$this->getEnabled(true)) |
89 | 89 | return false; |
90 | 90 | $this->ensureDataBound(); |
91 | - $selections = isset($values[$key])?$values[$key]:null; |
|
91 | + $selections = isset($values[$key]) ? $values[$key] : null; |
|
92 | 92 | if($selections !== null) |
93 | 93 | { |
94 | 94 | $items = $this->getItems(); |
95 | 95 | if($this->getSelectionMode() === TListSelectionMode::Single) |
96 | 96 | { |
97 | - $selection = is_array($selections)?$selections[0]:$selections; |
|
97 | + $selection = is_array($selections) ? $selections[0] : $selections; |
|
98 | 98 | $index = $items->findIndexByValue($selection, false); |
99 | 99 | if($this->getSelectedIndex() !== $index) |
100 | 100 | { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | if($n === count($list2)) |
116 | 116 | { |
117 | 117 | sort($list, SORT_NUMERIC); |
118 | - for($i = 0;$i < $n;++$i) |
|
118 | + for($i = 0; $i < $n; ++$i) |
|
119 | 119 | { |
120 | 120 | if($list[$i] !== $list2[$i]) |
121 | 121 | { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | public function renderClientControlScript($writer) |
238 | 238 | { |
239 | 239 | $scripts = $this->getPage()->getClientScript(); |
240 | - if ($this->getEnableClientScript()) |
|
240 | + if($this->getEnableClientScript()) |
|
241 | 241 | $scripts->registerPradoScript('validator'); |
242 | 242 | $formID = $this->getPage()->getForm()->getClientID(); |
243 | 243 | $scriptKey = "TBaseValidator:$formID"; |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | * Override parent implementation to update the control CSS Class before |
256 | 256 | * the validated control is rendered |
257 | 257 | */ |
258 | - public function onPreRender ($param) |
|
258 | + public function onPreRender($param) |
|
259 | 259 | { |
260 | 260 | parent::onPreRender($param); |
261 | 261 | $this->updateControlCssClass(); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | { |
279 | 279 | $class .= ' ' . $cssClass; |
280 | 280 | $control->setCssClass($class); |
281 | - } elseif ($control->getIsValid()) |
|
281 | + } elseif($control->getIsValid()) |
|
282 | 282 | $control->setCssClass($class); |
283 | 283 | } |
284 | 284 | } |