@@ -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 | } |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | */ |
| 82 | 82 | protected function getTagName() |
| 83 | 83 | { |
| 84 | - return ($this->getTextMode() === 'MultiLine')?'textarea':'input'; |
|
| 84 | + return ($this->getTextMode() === 'MultiLine') ? 'textarea' : 'input'; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -66,11 +66,11 @@ discard block |
||
| 66 | 66 | protected function _getZappableSleepProps(&$exprops) |
| 67 | 67 | { |
| 68 | 68 | parent::_getZappableSleepProps($exprops); |
| 69 | - if ($this->_flags === 0) |
|
| 69 | + if($this->_flags === 0) |
|
| 70 | 70 | $exprops[] = "\0Prado\Web\UI\WebControls\TFont\0_flags"; |
| 71 | - if ($this->_name === '') |
|
| 71 | + if($this->_name === '') |
|
| 72 | 72 | $exprops[] = "\0Prado\Web\UI\WebControls\TFont\0_name"; |
| 73 | - if ($this->_size === '') |
|
| 73 | + if($this->_size === '') |
|
| 74 | 74 | $exprops[] = "\0Prado\Web\UI\WebControls\TFont\0_size"; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -287,9 +287,9 @@ discard block |
||
| 287 | 287 | return ''; |
| 288 | 288 | $str = ''; |
| 289 | 289 | if($this->_flags & self::IS_SET_BOLD) |
| 290 | - $str .= 'font-weight:' . (($this->_flags & self::IS_BOLD)?'bold;':'normal;'); |
|
| 290 | + $str .= 'font-weight:' . (($this->_flags & self::IS_BOLD) ? 'bold;' : 'normal;'); |
|
| 291 | 291 | if($this->_flags & self::IS_SET_ITALIC) |
| 292 | - $str .= 'font-style:' . (($this->_flags & self::IS_ITALIC)?'italic;':'normal;'); |
|
| 292 | + $str .= 'font-style:' . (($this->_flags & self::IS_ITALIC) ? 'italic;' : 'normal;'); |
|
| 293 | 293 | $textDec = ''; |
| 294 | 294 | if($this->_flags & self::IS_UNDERLINE) |
| 295 | 295 | $textDec .= 'underline'; |
@@ -316,9 +316,9 @@ discard block |
||
| 316 | 316 | if($this->_flags === 0) |
| 317 | 317 | return; |
| 318 | 318 | if($this->_flags & self::IS_SET_BOLD) |
| 319 | - $writer->addStyleAttribute('font-weight', (($this->_flags & self::IS_BOLD)?'bold':'normal')); |
|
| 319 | + $writer->addStyleAttribute('font-weight', (($this->_flags & self::IS_BOLD) ? 'bold' : 'normal')); |
|
| 320 | 320 | if($this->_flags & self::IS_SET_ITALIC) |
| 321 | - $writer->addStyleAttribute('font-style', (($this->_flags & self::IS_ITALIC)?'italic':'normal')); |
|
| 321 | + $writer->addStyleAttribute('font-style', (($this->_flags & self::IS_ITALIC) ? 'italic' : 'normal')); |
|
| 322 | 322 | $textDec = ''; |
| 323 | 323 | if($this->_flags & self::IS_UNDERLINE) |
| 324 | 324 | $textDec .= 'underline'; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | { |
| 146 | 146 | $writer->addAttribute('id', $this->getClientID() . '_0'); |
| 147 | 147 | |
| 148 | - $style = $this->getActive()?$this->getParent()->getActiveHeaderStyle():$this->getParent()->getHeaderStyle(); |
|
| 148 | + $style = $this->getActive() ? $this->getParent()->getActiveHeaderStyle() : $this->getParent()->getHeaderStyle(); |
|
| 149 | 149 | |
| 150 | 150 | $style->addAttributesToRender($writer); |
| 151 | 151 | |
@@ -168,10 +168,10 @@ discard block |
||
| 168 | 168 | if(($caption = $this->getCaption()) === '') |
| 169 | 169 | $caption = ' '; |
| 170 | 170 | |
| 171 | - if ($url != '') |
|
| 171 | + if($url != '') |
|
| 172 | 172 | $writer->write("<a href=\"{$url}\">"); |
| 173 | 173 | $writer->write("{$caption}"); |
| 174 | - if ($url != '') |
|
| 174 | + if($url != '') |
|
| 175 | 175 | $writer->write("</a>"); |
| 176 | 176 | } |
| 177 | 177 | } |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | $cell->getControls()->add($checkBox); |
| 55 | 55 | $cell->registerObject('CheckBox', $checkBox); |
| 56 | 56 | if($this->getDataField() !== '') |
| 57 | - $checkBox->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
|
| 57 | + $checkBox->attachEventHandler('OnDataBinding', [$this, 'dataBindColumn']); |
|
| 58 | 58 | } |
| 59 | 59 | else |
| 60 | 60 | parent::initializeCell($cell, $columnIndex, $itemType); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | protected function getViewState($key, $defaultValue = null) |
| 293 | 293 | { |
| 294 | - return isset($this->_viewState[$key])?$this->_viewState[$key]:$defaultValue; |
|
| 294 | + return isset($this->_viewState[$key]) ? $this->_viewState[$key] : $defaultValue; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /** |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | throw new Exception(''); |
| 537 | 537 | return $result; |
| 538 | 538 | } |
| 539 | - catch(Exception $e) |
|
| 539 | + catch (Exception $e) |
|
| 540 | 540 | { |
| 541 | 541 | throw new TInvalidDataValueException('datagridcolumn_expression_invalid', get_class($this), $expression, $e->getMessage()); |
| 542 | 542 | } |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | $session = $this->_page->getSession(); |
| 100 | 100 | $session->open(); |
| 101 | 101 | $data = serialize($state); |
| 102 | - $timestamp = (string)microtime(true); |
|
| 102 | + $timestamp = (string) microtime(true); |
|
| 103 | 103 | $key = self::STATE_SESSION_KEY . $timestamp; |
| 104 | 104 | $session->add($key, $data); |
| 105 | 105 | if(($queue = $session->itemAt(self::QUEUE_SESSION_KEY)) === null) |