@@ -105,18 +105,18 @@ discard block |
||
| 105 | 105 | $page = $this->getPage(); |
| 106 | 106 | $page->ensureRenderInForm($this); |
| 107 | 107 | $writer->addAttribute('type', strtolower($this->getButtonType())); |
| 108 | - if(($uniqueID = $this->getUniqueID()) !== '') |
|
| 108 | + if (($uniqueID = $this->getUniqueID()) !== '') |
|
| 109 | 109 | $writer->addAttribute('name', $uniqueID); |
| 110 | - if($this->getButtonTag() === TButtonTag::Button) |
|
| 110 | + if ($this->getButtonTag() === TButtonTag::Button) |
|
| 111 | 111 | $this->addParsedObject($this->getText()); |
| 112 | 112 | else |
| 113 | 113 | $writer->addAttribute('value', $this->getText()); |
| 114 | - if($this->getEnabled(true)) |
|
| 114 | + if ($this->getEnabled(true)) |
|
| 115 | 115 | { |
| 116 | - if($this->getEnableClientScript() && $this->needPostBackScript()) |
|
| 116 | + if ($this->getEnableClientScript() && $this->needPostBackScript()) |
|
| 117 | 117 | $this->renderClientControlScript($writer); |
| 118 | 118 | } |
| 119 | - elseif($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
| 119 | + elseif ($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
| 120 | 120 | $writer->addAttribute('disabled', 'disabled'); |
| 121 | 121 | |
| 122 | 122 | parent::addAttributesToRender($writer); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | protected function canCauseValidation() |
| 148 | 148 | { |
| 149 | - if($this->getCausesValidation()) |
|
| 149 | + if ($this->getCausesValidation()) |
|
| 150 | 150 | { |
| 151 | 151 | $group = $this->getValidationGroup(); |
| 152 | 152 | return $this->getPage()->getValidators($group)->getCount() > 0; |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | */ |
| 205 | 205 | public function renderContents($writer) |
| 206 | 206 | { |
| 207 | - if($this->getButtonTag() === TButtonTag::Button) |
|
| 207 | + if ($this->getButtonTag() === TButtonTag::Button) |
|
| 208 | 208 | parent::renderContents($writer); |
| 209 | 209 | } |
| 210 | 210 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | public function raisePostBackEvent($param) |
| 246 | 246 | { |
| 247 | - if($this->getCausesValidation()) |
|
| 247 | + if ($this->getCausesValidation()) |
|
| 248 | 248 | $this->getPage()->validate($this->getValidationGroup()); |
| 249 | 249 | $this->onClick(null); |
| 250 | 250 | $this->onCommand(new \Prado\Web\UI\TCommandEventParameter($this->getCommandName(), $this->getCommandParameter())); |
@@ -105,19 +105,23 @@ discard block |
||
| 105 | 105 | $page = $this->getPage(); |
| 106 | 106 | $page->ensureRenderInForm($this); |
| 107 | 107 | $writer->addAttribute('type', strtolower($this->getButtonType())); |
| 108 | - if(($uniqueID = $this->getUniqueID()) !== '') |
|
| 109 | - $writer->addAttribute('name', $uniqueID); |
|
| 110 | - if($this->getButtonTag() === TButtonTag::Button) |
|
| 111 | - $this->addParsedObject($this->getText()); |
|
| 112 | - else |
|
| 113 | - $writer->addAttribute('value', $this->getText()); |
|
| 108 | + if(($uniqueID = $this->getUniqueID()) !== '') { |
|
| 109 | + $writer->addAttribute('name', $uniqueID); |
|
| 110 | + } |
|
| 111 | + if($this->getButtonTag() === TButtonTag::Button) { |
|
| 112 | + $this->addParsedObject($this->getText()); |
|
| 113 | + } else { |
|
| 114 | + $writer->addAttribute('value', $this->getText()); |
|
| 115 | + } |
|
| 114 | 116 | if($this->getEnabled(true)) |
| 115 | 117 | { |
| 116 | - if($this->getEnableClientScript() && $this->needPostBackScript()) |
|
| 117 | - $this->renderClientControlScript($writer); |
|
| 118 | - } |
|
| 119 | - elseif($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
| 118 | + if($this->getEnableClientScript() && $this->needPostBackScript()) { |
|
| 119 | + $this->renderClientControlScript($writer); |
|
| 120 | + } |
|
| 121 | + } elseif($this->getEnabled()) { |
|
| 122 | + // in this case, parent will not render 'disabled' |
|
| 120 | 123 | $writer->addAttribute('disabled', 'disabled'); |
| 124 | + } |
|
| 121 | 125 | |
| 122 | 126 | parent::addAttributesToRender($writer); |
| 123 | 127 | } |
@@ -150,9 +154,9 @@ discard block |
||
| 150 | 154 | { |
| 151 | 155 | $group = $this->getValidationGroup(); |
| 152 | 156 | return $this->getPage()->getValidators($group)->getCount() > 0; |
| 157 | + } else { |
|
| 158 | + return false; |
|
| 153 | 159 | } |
| 154 | - else |
|
| 155 | - return false; |
|
| 156 | 160 | } |
| 157 | 161 | |
| 158 | 162 | /** |
@@ -204,8 +208,9 @@ discard block |
||
| 204 | 208 | */ |
| 205 | 209 | public function renderContents($writer) |
| 206 | 210 | { |
| 207 | - if($this->getButtonTag() === TButtonTag::Button) |
|
| 208 | - parent::renderContents($writer); |
|
| 211 | + if($this->getButtonTag() === TButtonTag::Button) { |
|
| 212 | + parent::renderContents($writer); |
|
| 213 | + } |
|
| 209 | 214 | } |
| 210 | 215 | |
| 211 | 216 | /** |
@@ -244,8 +249,9 @@ discard block |
||
| 244 | 249 | */ |
| 245 | 250 | public function raisePostBackEvent($param) |
| 246 | 251 | { |
| 247 | - if($this->getCausesValidation()) |
|
| 248 | - $this->getPage()->validate($this->getValidationGroup()); |
|
| 252 | + if($this->getCausesValidation()) { |
|
| 253 | + $this->getPage()->validate($this->getValidationGroup()); |
|
| 254 | + } |
|
| 249 | 255 | $this->onClick(null); |
| 250 | 256 | $this->onCommand(new \Prado\Web\UI\TCommandEventParameter($this->getCommandName(), $this->getCommandParameter())); |
| 251 | 257 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function insertAt($index, $item) |
| 35 | 35 | { |
| 36 | - if($item instanceof THotSpot) |
|
| 36 | + if ($item instanceof THotSpot) |
|
| 37 | 37 | parent::insertAt($index, $item); |
| 38 | 38 | else |
| 39 | 39 | throw new TInvalidDataTypeException('hotspotcollection_hotspot_required'); |
@@ -33,9 +33,10 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function insertAt($index, $item) |
| 35 | 35 | { |
| 36 | - if($item instanceof THotSpot) |
|
| 37 | - parent::insertAt($index, $item); |
|
| 38 | - else |
|
| 39 | - throw new TInvalidDataTypeException('hotspotcollection_hotspot_required'); |
|
| 36 | + if($item instanceof THotSpot) { |
|
| 37 | + parent::insertAt($index, $item); |
|
| 38 | + } else { |
|
| 39 | + throw new TInvalidDataTypeException('hotspotcollection_hotspot_required'); |
|
| 40 | + } |
|
| 40 | 41 | } |
| 41 | 42 | } |
| 42 | 43 | \ No newline at end of file |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function insertAt($index, $item) |
| 35 | 35 | { |
| 36 | - if($item instanceof TView) |
|
| 36 | + if ($item instanceof TView) |
|
| 37 | 37 | parent::insertAt($index, $item); |
| 38 | 38 | else |
| 39 | 39 | throw new TInvalidDataTypeException('viewcollection_view_required'); |
@@ -33,9 +33,10 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function insertAt($index, $item) |
| 35 | 35 | { |
| 36 | - if($item instanceof TView) |
|
| 37 | - parent::insertAt($index, $item); |
|
| 38 | - else |
|
| 39 | - throw new TInvalidDataTypeException('viewcollection_view_required'); |
|
| 36 | + if($item instanceof TView) { |
|
| 37 | + parent::insertAt($index, $item); |
|
| 38 | + } else { |
|
| 39 | + throw new TInvalidDataTypeException('viewcollection_view_required'); |
|
| 40 | + } |
|
| 40 | 41 | } |
| 41 | 42 | } |
| 42 | 43 | \ No newline at end of file |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function insertAt($index, $item) |
| 37 | 37 | { |
| 38 | - if($item instanceof TMetaTag) |
|
| 38 | + if ($item instanceof TMetaTag) |
|
| 39 | 39 | parent::insertAt($index, $item); |
| 40 | 40 | else |
| 41 | 41 | throw new TInvalidDataTypeException('metatagcollection_metatag_invalid'); |
@@ -49,9 +49,9 @@ discard block |
||
| 49 | 49 | public function findIndexByID($id) |
| 50 | 50 | { |
| 51 | 51 | $index = 0; |
| 52 | - foreach($this as $item) |
|
| 52 | + foreach ($this as $item) |
|
| 53 | 53 | { |
| 54 | - if($item->getID() === $id) |
|
| 54 | + if ($item->getID() === $id) |
|
| 55 | 55 | return $index; |
| 56 | 56 | $index++; |
| 57 | 57 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function findMetaTagByID($id) |
| 67 | 67 | { |
| 68 | - if(($index = $this->findIndexByID($id)) >= 0) |
|
| 68 | + if (($index = $this->findIndexByID($id)) >= 0) |
|
| 69 | 69 | return $this->itemAt($index); |
| 70 | 70 | else |
| 71 | 71 | return null; |
@@ -35,10 +35,11 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function insertAt($index, $item) |
| 37 | 37 | { |
| 38 | - if($item instanceof TMetaTag) |
|
| 39 | - parent::insertAt($index, $item); |
|
| 40 | - else |
|
| 41 | - throw new TInvalidDataTypeException('metatagcollection_metatag_invalid'); |
|
| 38 | + if($item instanceof TMetaTag) { |
|
| 39 | + parent::insertAt($index, $item); |
|
| 40 | + } else { |
|
| 41 | + throw new TInvalidDataTypeException('metatagcollection_metatag_invalid'); |
|
| 42 | + } |
|
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | /** |
@@ -51,8 +52,9 @@ discard block |
||
| 51 | 52 | $index = 0; |
| 52 | 53 | foreach($this as $item) |
| 53 | 54 | { |
| 54 | - if($item->getID() === $id) |
|
| 55 | - return $index; |
|
| 55 | + if($item->getID() === $id) { |
|
| 56 | + return $index; |
|
| 57 | + } |
|
| 56 | 58 | $index++; |
| 57 | 59 | } |
| 58 | 60 | return -1; |
@@ -65,9 +67,10 @@ discard block |
||
| 65 | 67 | */ |
| 66 | 68 | public function findMetaTagByID($id) |
| 67 | 69 | { |
| 68 | - if(($index = $this->findIndexByID($id)) >= 0) |
|
| 69 | - return $this->itemAt($index); |
|
| 70 | - else |
|
| 71 | - return null; |
|
| 70 | + if(($index = $this->findIndexByID($id)) >= 0) { |
|
| 71 | + return $this->itemAt($index); |
|
| 72 | + } else { |
|
| 73 | + return null; |
|
| 74 | + } |
|
| 72 | 75 | } |
| 73 | 76 | } |
| 74 | 77 | \ No newline at end of file |
@@ -164,15 +164,15 @@ discard block |
||
| 164 | 164 | public function initializeCell($cell, $columnIndex, $itemType) |
| 165 | 165 | { |
| 166 | 166 | $item = $cell->getParent(); |
| 167 | - switch($itemType) |
|
| 167 | + switch ($itemType) |
|
| 168 | 168 | { |
| 169 | 169 | case TListItemType::Item: |
| 170 | 170 | case TListItemType::AlternatingItem: |
| 171 | 171 | case TListItemType::SelectedItem: |
| 172 | - if(($classPath = $this->getItemRenderer()) !== '') |
|
| 172 | + if (($classPath = $this->getItemRenderer()) !== '') |
|
| 173 | 173 | { |
| 174 | 174 | $control = Prado::createComponent($classPath); |
| 175 | - if($control instanceof IItemDataRenderer) |
|
| 175 | + if ($control instanceof IItemDataRenderer) |
|
| 176 | 176 | { |
| 177 | 177 | $control->setItemIndex($item->getItemIndex()); |
| 178 | 178 | $control->setItemType($item->getItemType()); |
@@ -181,15 +181,15 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | else |
| 183 | 183 | $control = $cell; |
| 184 | - $control->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
|
| 184 | + $control->attachEventHandler('OnDataBinding', [$this, 'dataBindColumn']); |
|
| 185 | 185 | break; |
| 186 | 186 | case TListItemType::EditItem: |
| 187 | - if(!$this->getReadOnly()) |
|
| 187 | + if (!$this->getReadOnly()) |
|
| 188 | 188 | { |
| 189 | - if(($classPath = $this->getEditItemRenderer()) !== '') |
|
| 189 | + if (($classPath = $this->getEditItemRenderer()) !== '') |
|
| 190 | 190 | { |
| 191 | 191 | $control = Prado::createComponent($classPath); |
| 192 | - if($control instanceof IItemDataRenderer) |
|
| 192 | + if ($control instanceof IItemDataRenderer) |
|
| 193 | 193 | { |
| 194 | 194 | $control->setItemIndex($item->getItemIndex()); |
| 195 | 195 | $control->setItemType($item->getItemType()); |
@@ -206,10 +206,10 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | else |
| 208 | 208 | { |
| 209 | - if(($classPath = $this->getItemRenderer()) !== '') |
|
| 209 | + if (($classPath = $this->getItemRenderer()) !== '') |
|
| 210 | 210 | { |
| 211 | 211 | $control = Prado::createComponent($classPath); |
| 212 | - if($control instanceof IItemDataRenderer) |
|
| 212 | + if ($control instanceof IItemDataRenderer) |
|
| 213 | 213 | { |
| 214 | 214 | $control->setItemIndex($item->getItemIndex()); |
| 215 | 215 | $control->setItemType($item->getItemType()); |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | else |
| 220 | 220 | $control = $cell; |
| 221 | 221 | } |
| 222 | - $control->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
|
| 222 | + $control->attachEventHandler('OnDataBinding', [$this, 'dataBindColumn']); |
|
| 223 | 223 | break; |
| 224 | 224 | default: |
| 225 | 225 | parent::initializeCell($cell, $columnIndex, $itemType); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | $item = $sender->getNamingContainer(); |
| 238 | 238 | $data = $item->getData(); |
| 239 | 239 | $formatString = $this->getDataFormatString(); |
| 240 | - if(($field = $this->getDataField()) !== '') |
|
| 240 | + if (($field = $this->getDataField()) !== '') |
|
| 241 | 241 | $value = $this->formatDataValue($formatString, $this->getDataFieldValue($data, $field)); |
| 242 | 242 | else |
| 243 | 243 | $value = $this->formatDataValue($formatString, $data); |
@@ -178,9 +178,9 @@ discard block |
||
| 178 | 178 | $control->setItemType($item->getItemType()); |
| 179 | 179 | } |
| 180 | 180 | $cell->getControls()->add($control); |
| 181 | + } else { |
|
| 182 | + $control = $cell; |
|
| 181 | 183 | } |
| 182 | - else |
|
| 183 | - $control = $cell; |
|
| 184 | 184 | $control->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
| 185 | 185 | break; |
| 186 | 186 | case TListItemType::EditItem: |
@@ -196,15 +196,13 @@ discard block |
||
| 196 | 196 | } |
| 197 | 197 | $cell->getControls()->add($control); |
| 198 | 198 | $cell->registerObject('EditControl', $control); |
| 199 | - } |
|
| 200 | - else |
|
| 199 | + } else |
|
| 201 | 200 | { |
| 202 | 201 | $control = new TTextBox; |
| 203 | 202 | $cell->getControls()->add($control); |
| 204 | 203 | $cell->registerObject('TextBox', $control); |
| 205 | 204 | } |
| 206 | - } |
|
| 207 | - else |
|
| 205 | + } else |
|
| 208 | 206 | { |
| 209 | 207 | if(($classPath = $this->getItemRenderer()) !== '') |
| 210 | 208 | { |
@@ -215,9 +213,9 @@ discard block |
||
| 215 | 213 | $control->setItemType($item->getItemType()); |
| 216 | 214 | } |
| 217 | 215 | $cell->getControls()->add($control); |
| 216 | + } else { |
|
| 217 | + $control = $cell; |
|
| 218 | 218 | } |
| 219 | - else |
|
| 220 | - $control = $cell; |
|
| 221 | 219 | } |
| 222 | 220 | $control->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
| 223 | 221 | break; |
@@ -237,10 +235,11 @@ discard block |
||
| 237 | 235 | $item = $sender->getNamingContainer(); |
| 238 | 236 | $data = $item->getData(); |
| 239 | 237 | $formatString = $this->getDataFormatString(); |
| 240 | - if(($field = $this->getDataField()) !== '') |
|
| 241 | - $value = $this->formatDataValue($formatString, $this->getDataFieldValue($data, $field)); |
|
| 242 | - else |
|
| 243 | - $value = $this->formatDataValue($formatString, $data); |
|
| 238 | + if(($field = $this->getDataField()) !== '') { |
|
| 239 | + $value = $this->formatDataValue($formatString, $this->getDataFieldValue($data, $field)); |
|
| 240 | + } else { |
|
| 241 | + $value = $this->formatDataValue($formatString, $data); |
|
| 242 | + } |
|
| 244 | 243 | $sender->setData($value); |
| 245 | 244 | } |
| 246 | 245 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | public function render($writer) |
| 57 | 57 | { |
| 58 | - if($this->_e !== '') |
|
| 58 | + if ($this->_e !== '') |
|
| 59 | 59 | $writer->write($this->evaluateExpression($this->_e)); |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -55,8 +55,9 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | public function render($writer) |
| 57 | 57 | { |
| 58 | - if($this->_e !== '') |
|
| 59 | - $writer->write($this->evaluateExpression($this->_e)); |
|
| 58 | + if($this->_e !== '') { |
|
| 59 | + $writer->write($this->evaluateExpression($this->_e)); |
|
| 60 | + } |
|
| 60 | 61 | } |
| 61 | 62 | } |
| 62 | 63 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | { |
| 116 | 116 | if ($this->getClientID() == $captcha->ClientID) |
| 117 | 117 | { |
| 118 | - $responseFieldName .= ($cont > 0) ? '-' . $cont : ''; |
|
| 118 | + $responseFieldName .= ($cont > 0) ? '-'.$cont : ''; |
|
| 119 | 119 | } |
| 120 | 120 | $cont++; |
| 121 | 121 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | public function validate() |
| 293 | 293 | { |
| 294 | 294 | $value = $this->getValidationPropertyValue(); |
| 295 | - if($value === null || empty($value)) |
|
| 295 | + if ($value === null || empty($value)) |
|
| 296 | 296 | return false; |
| 297 | 297 | |
| 298 | 298 | return true; |
@@ -305,14 +305,14 @@ discard block |
||
| 305 | 305 | { |
| 306 | 306 | parent::onPreRender($param); |
| 307 | 307 | |
| 308 | - if("" == $this->getSiteKey()) |
|
| 308 | + if ("" == $this->getSiteKey()) |
|
| 309 | 309 | throw new TConfigurationException('recaptcha_publickey_unknown'); |
| 310 | - if("" == $this->getSecretKey()) |
|
| 310 | + if ("" == $this->getSecretKey()) |
|
| 311 | 311 | throw new TConfigurationException('recaptcha_privatekey_unknown'); |
| 312 | 312 | |
| 313 | 313 | // need to register captcha fields so they will be sent postback |
| 314 | 314 | $this->Page->registerRequiresPostData($this->getResponseFieldName()); |
| 315 | - $this->Page->ClientScript->registerHeadScriptFile('grecaptcha2', 'https://www.google.com/recaptcha/api.js?onload=TReCaptcha2_onloadCallback&render=explicit&hl=' . $this->getLanguage()); |
|
| 315 | + $this->Page->ClientScript->registerHeadScriptFile('grecaptcha2', 'https://www.google.com/recaptcha/api.js?onload=TReCaptcha2_onloadCallback&render=explicit&hl='.$this->getLanguage()); |
|
| 316 | 316 | } |
| 317 | 317 | protected function addAttributesToRender($writer) |
| 318 | 318 | { |
@@ -271,10 +271,18 @@ 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()) { |
|
| 275 | + $options['options']['theme'] = $theme; |
|
| 276 | + } |
|
| 277 | + if ($type = $this->getType()) { |
|
| 278 | + $options['options']['type'] = $type; |
|
| 279 | + } |
|
| 280 | + if ($size = $this->getSize()) { |
|
| 281 | + $options['options']['size'] = $size; |
|
| 282 | + } |
|
| 283 | + if ($tabIndex = $this->getTabIndex()) { |
|
| 284 | + $options['options']['tabindex'] = $tabIndex; |
|
| 285 | + } |
|
| 278 | 286 | |
| 279 | 287 | return $options; |
| 280 | 288 | } |
@@ -292,8 +300,9 @@ discard block |
||
| 292 | 300 | public function validate() |
| 293 | 301 | { |
| 294 | 302 | $value = $this->getValidationPropertyValue(); |
| 295 | - if($value === null || empty($value)) |
|
| 296 | - return false; |
|
| 303 | + if($value === null || empty($value)) { |
|
| 304 | + return false; |
|
| 305 | + } |
|
| 297 | 306 | |
| 298 | 307 | return true; |
| 299 | 308 | } |
@@ -305,10 +314,12 @@ discard block |
||
| 305 | 314 | { |
| 306 | 315 | parent::onPreRender($param); |
| 307 | 316 | |
| 308 | - if("" == $this->getSiteKey()) |
|
| 309 | - throw new TConfigurationException('recaptcha_publickey_unknown'); |
|
| 310 | - if("" == $this->getSecretKey()) |
|
| 311 | - throw new TConfigurationException('recaptcha_privatekey_unknown'); |
|
| 317 | + if("" == $this->getSiteKey()) { |
|
| 318 | + throw new TConfigurationException('recaptcha_publickey_unknown'); |
|
| 319 | + } |
|
| 320 | + if("" == $this->getSecretKey()) { |
|
| 321 | + throw new TConfigurationException('recaptcha_privatekey_unknown'); |
|
| 322 | + } |
|
| 312 | 323 | |
| 313 | 324 | // need to register captcha fields so they will be sent postback |
| 314 | 325 | $this->Page->registerRequiresPostData($this->getResponseFieldName()); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function addParsedObject($object) |
| 75 | 75 | { |
| 76 | - if($object instanceof TMetaTag) |
|
| 76 | + if ($object instanceof TMetaTag) |
|
| 77 | 77 | $this->getMetaTags()->add($object); |
| 78 | 78 | else |
| 79 | 79 | parent::addParsedObject($object); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | public function getMetaTags() |
| 137 | 137 | { |
| 138 | - if(($metaTags = $this->getViewState('MetaTags', null)) === null) |
|
| 138 | + if (($metaTags = $this->getViewState('MetaTags', null)) === null) |
|
| 139 | 139 | { |
| 140 | 140 | $metaTags = new TMetaTagCollection; |
| 141 | 141 | $this->setViewState('MetaTags', $metaTags, null); |
@@ -151,15 +151,15 @@ discard block |
||
| 151 | 151 | { |
| 152 | 152 | $page = $this->getPage(); |
| 153 | 153 | $title = $this->getTitle(); |
| 154 | - $writer->write("<head>\n<title>" . THttpUtility::htmlEncode($title) . "</title>\n"); |
|
| 155 | - if(($baseUrl = $this->getBaseUrl()) !== '') |
|
| 156 | - $writer->write('<base href="' . $baseUrl . "\" />\n"); |
|
| 157 | - if(($icon = $this->getShortcutIcon()) !== '') |
|
| 158 | - $writer->write('<link rel="shortcut icon" href="' . $icon . "\" />\n"); |
|
| 154 | + $writer->write("<head>\n<title>".THttpUtility::htmlEncode($title)."</title>\n"); |
|
| 155 | + if (($baseUrl = $this->getBaseUrl()) !== '') |
|
| 156 | + $writer->write('<base href="'.$baseUrl."\" />\n"); |
|
| 157 | + if (($icon = $this->getShortcutIcon()) !== '') |
|
| 158 | + $writer->write('<link rel="shortcut icon" href="'.$icon."\" />\n"); |
|
| 159 | 159 | |
| 160 | - if(($metaTags = $this->getMetaTags()) !== null) |
|
| 160 | + if (($metaTags = $this->getMetaTags()) !== null) |
|
| 161 | 161 | { |
| 162 | - foreach($metaTags as $metaTag) |
|
| 162 | + foreach ($metaTags as $metaTag) |
|
| 163 | 163 | { |
| 164 | 164 | $metaTag->render($writer); |
| 165 | 165 | $writer->writeLine(); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $cs = $page->getClientScript(); |
| 169 | 169 | $cs->renderStyleSheetFiles($writer); |
| 170 | 170 | $cs->renderStyleSheets($writer); |
| 171 | - if($page->getClientSupportsJavaScript()) |
|
| 171 | + if ($page->getClientSupportsJavaScript()) |
|
| 172 | 172 | { |
| 173 | 173 | $cs->renderHeadScriptFiles($writer); |
| 174 | 174 | $cs->renderHeadScripts($writer); |
@@ -73,10 +73,11 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function addParsedObject($object) |
| 75 | 75 | { |
| 76 | - if($object instanceof TMetaTag) |
|
| 77 | - $this->getMetaTags()->add($object); |
|
| 78 | - else |
|
| 79 | - parent::addParsedObject($object); |
|
| 76 | + if($object instanceof TMetaTag) { |
|
| 77 | + $this->getMetaTags()->add($object); |
|
| 78 | + } else { |
|
| 79 | + parent::addParsedObject($object); |
|
| 80 | + } |
|
| 80 | 81 | } |
| 81 | 82 | |
| 82 | 83 | /** |
@@ -152,10 +153,12 @@ discard block |
||
| 152 | 153 | $page = $this->getPage(); |
| 153 | 154 | $title = $this->getTitle(); |
| 154 | 155 | $writer->write("<head>\n<title>" . THttpUtility::htmlEncode($title) . "</title>\n"); |
| 155 | - if(($baseUrl = $this->getBaseUrl()) !== '') |
|
| 156 | - $writer->write('<base href="' . $baseUrl . "\" />\n"); |
|
| 157 | - if(($icon = $this->getShortcutIcon()) !== '') |
|
| 158 | - $writer->write('<link rel="shortcut icon" href="' . $icon . "\" />\n"); |
|
| 156 | + if(($baseUrl = $this->getBaseUrl()) !== '') { |
|
| 157 | + $writer->write('<base href="' . $baseUrl . "\" />\n"); |
|
| 158 | + } |
|
| 159 | + if(($icon = $this->getShortcutIcon()) !== '') { |
|
| 160 | + $writer->write('<link rel="shortcut icon" href="' . $icon . "\" />\n"); |
|
| 161 | + } |
|
| 159 | 162 | |
| 160 | 163 | if(($metaTags = $this->getMetaTags()) !== null) |
| 161 | 164 | { |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | public function createdOnTemplate($parent) |
| 45 | 45 | { |
| 46 | - if(($id = $this->getID()) === '') |
|
| 46 | + if (($id = $this->getID()) === '') |
|
| 47 | 47 | throw new TConfigurationException('content_id_required'); |
| 48 | 48 | $this->getTemplateControl()->registerContent($id, $this); |
| 49 | 49 | } |
@@ -43,8 +43,9 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | public function createdOnTemplate($parent) |
| 45 | 45 | { |
| 46 | - if(($id = $this->getID()) === '') |
|
| 47 | - throw new TConfigurationException('content_id_required'); |
|
| 46 | + if(($id = $this->getID()) === '') { |
|
| 47 | + throw new TConfigurationException('content_id_required'); |
|
| 48 | + } |
|
| 48 | 49 | $this->getTemplateControl()->registerContent($id, $this); |
| 49 | 50 | } |
| 50 | 51 | } |