@@ -211,8 +211,7 @@ discard block |
||
| 211 | 211 | $button=$this->createButton('Edit',$this->getEditText(),false,''); |
| 212 | 212 | $cell->getControls()->add($button); |
| 213 | 213 | $cell->registerObject('EditButton',$button); |
| 214 | - } |
|
| 215 | - else if($itemType===TListItemType::EditItem) |
|
| 214 | + } else if($itemType===TListItemType::EditItem) |
|
| 216 | 215 | { |
| 217 | 216 | $controls=$cell->getControls(); |
| 218 | 217 | $button=$this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup()); |
@@ -222,8 +221,7 @@ discard block |
||
| 222 | 221 | $button=$this->createButton('Cancel',$this->getCancelText(),false,''); |
| 223 | 222 | $controls->add($button); |
| 224 | 223 | $cell->registerObject('CancelButton',$button); |
| 225 | - } |
|
| 226 | - else |
|
| 224 | + } else |
|
| 227 | 225 | parent::initializeCell($cell,$columnIndex,$itemType); |
| 228 | 226 | } |
| 229 | 227 | |
@@ -70,8 +70,7 @@ |
||
| 70 | 70 | { |
| 71 | 71 | $domain=substr($value,$pos+1); |
| 72 | 72 | return $domain===''?false:checkdnsrr($domain,'MX'); |
| 73 | - } |
|
| 74 | - else |
|
| 73 | + } else |
|
| 75 | 74 | return false; |
| 76 | 75 | } |
| 77 | 76 | } |
@@ -106,8 +106,7 @@ discard block |
||
| 106 | 106 | { |
| 107 | 107 | if($this->getEnableClientScript() && $this->needPostBackScript()) |
| 108 | 108 | $this->renderClientControlScript($writer); |
| 109 | - } |
|
| 110 | - else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
| 109 | + } else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
| 111 | 110 | $writer->addAttribute('disabled','disabled'); |
| 112 | 111 | parent::addAttributesToRender($writer); |
| 113 | 112 | } |
@@ -141,8 +140,7 @@ discard block |
||
| 141 | 140 | { |
| 142 | 141 | $group=$this->getValidationGroup(); |
| 143 | 142 | return $this->getPage()->getValidators($group)->getCount()>0; |
| 144 | - } |
|
| 145 | - else |
|
| 143 | + } else |
|
| 146 | 144 | return false; |
| 147 | 145 | } |
| 148 | 146 | |
@@ -235,14 +235,12 @@ |
||
| 235 | 235 | { |
| 236 | 236 | $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), $token[0]); |
| 237 | 237 | $this->onSuggest($parameter); |
| 238 | - } |
|
| 239 | - else if($token[1] === '__TJuiAutoComplete_onSuggestionSelected__') |
|
| 238 | + } else if($token[1] === '__TJuiAutoComplete_onSuggestionSelected__') |
|
| 240 | 239 | { |
| 241 | 240 | $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), null, $token[0]); |
| 242 | 241 | $this->onSuggestionSelected($parameter); |
| 243 | 242 | } |
| 244 | - } |
|
| 245 | - else if($this->getAutoPostBack()) |
|
| 243 | + } else if($this->getAutoPostBack()) |
|
| 246 | 244 | parent::raiseCallbackEvent($param); |
| 247 | 245 | } |
| 248 | 246 | |
@@ -79,8 +79,7 @@ |
||
| 79 | 79 | if($this->getHasPreRendered()) { |
| 80 | 80 | $this->renderDataList($writer); |
| 81 | 81 | if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer); |
| 82 | - } |
|
| 83 | - else { |
|
| 82 | + } else { |
|
| 84 | 83 | $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
| 85 | 84 | } |
| 86 | 85 | } |
@@ -223,14 +223,12 @@ discard block |
||
| 223 | 223 | // this is the most secure method, file info can't be forged from client side, no matter what |
| 224 | 224 | $token = md5('TActiveFileUpload::Params::'.$this->ClientID.'::'+rand(1000*1000,9999*1000)); |
| 225 | 225 | $cache->set($token, serialize($params), 5*60); // expire in 5 minutes - the callback should arrive back in seconds, actually |
| 226 | - } |
|
| 227 | - else |
|
| 226 | + } else |
|
| 228 | 227 | if ($mgr = Prado::getApplication()->getSecurityManager()) |
| 229 | 228 | { |
| 230 | 229 | // this is a less secure method, file info can be still forged from client side, but only if attacker knows the secret application key |
| 231 | 230 | $token = urlencode(base64_encode($mgr->encrypt(serialize($params)))); |
| 232 | - } |
|
| 233 | - else |
|
| 231 | + } else |
|
| 234 | 232 | throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely'); |
| 235 | 233 | |
| 236 | 234 | return $token; |
@@ -244,14 +242,12 @@ discard block |
||
| 244 | 242 | assert($v!=''); |
| 245 | 243 | $cache->delete($token); // remove it from cache so it can't be used again and won't take up space either |
| 246 | 244 | $params = unserialize($v); |
| 247 | - } |
|
| 248 | - else |
|
| 245 | + } else |
|
| 249 | 246 | if ($mgr = Prado::getApplication()->getSecurityManager()) |
| 250 | 247 | { |
| 251 | 248 | $v = $mgr->decrypt(base64_decode(urldecode($token))); |
| 252 | 249 | $params = unserialize($v); |
| 253 | - } |
|
| 254 | - else |
|
| 250 | + } else |
|
| 255 | 251 | throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely'); |
| 256 | 252 | |
| 257 | 253 | assert($params instanceof TActiveFileUploadCallbackParams); |
@@ -127,8 +127,7 @@ discard block |
||
| 127 | 127 | $button->setCssClass($this->getButtonCssClass()); |
| 128 | 128 | return $button; |
| 129 | 129 | } |
| 130 | - } |
|
| 131 | - else if($buttonType===TPagerButtonType::ImageButton) |
|
| 130 | + } else if($buttonType===TPagerButtonType::ImageButton) |
|
| 132 | 131 | { |
| 133 | 132 | $button = new TActiveImageButton; |
| 134 | 133 | $button->setImageUrl($this->getPageImageUrl($text,$commandName)); |
@@ -136,8 +135,7 @@ discard block |
||
| 136 | 135 | $button->Visible = true; |
| 137 | 136 | else |
| 138 | 137 | $button->Visible = false; |
| 139 | - } |
|
| 140 | - else |
|
| 138 | + } else |
|
| 141 | 139 | { |
| 142 | 140 | $button=new TActiveButton; |
| 143 | 141 | if(!$enabled) |
@@ -197,8 +195,7 @@ discard block |
||
| 197 | 195 | TWebControl::render($writer); |
| 198 | 196 | if($this->getActiveControl()->canUpdateClientSide()) |
| 199 | 197 | $this->getPage()->getCallbackClient()->replaceContent($this,$writer); |
| 200 | - } |
|
| 201 | - else |
|
| 198 | + } else |
|
| 202 | 199 | { |
| 203 | 200 | $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
| 204 | 201 | } |
@@ -95,8 +95,7 @@ |
||
| 95 | 95 | if($this->getHasPreRendered()) { |
| 96 | 96 | $this->renderRepeater($writer); |
| 97 | 97 | if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(),$writer); |
| 98 | - } |
|
| 99 | - else { |
|
| 98 | + } else { |
|
| 100 | 99 | $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
| 101 | 100 | } |
| 102 | 101 | } |
@@ -424,13 +424,11 @@ discard block |
||
| 424 | 424 | { |
| 425 | 425 | $boundary = $this->getRenderedContentBoundary($content); |
| 426 | 426 | $content = null; |
| 427 | - } |
|
| 428 | - else if($content instanceof THtmlWriter) |
|
| 427 | + } else if($content instanceof THtmlWriter) |
|
| 429 | 428 | { |
| 430 | 429 | $boundary = $this->getResponseContentBoundary($content); |
| 431 | 430 | $content = null; |
| 432 | - } |
|
| 433 | - else |
|
| 431 | + } else |
|
| 434 | 432 | $boundary = null; |
| 435 | 433 | |
| 436 | 434 | $this->callClientFunction('Prado.Element.replace', array($element, $content, $boundary, $self)); |
@@ -477,8 +475,7 @@ discard block |
||
| 477 | 475 | if($content instanceof TControl) |
| 478 | 476 | { |
| 479 | 477 | $boundary = $this->getRenderedContentBoundary($content); |
| 480 | - } |
|
| 481 | - elseif($content instanceof THtmlWriter) |
|
| 478 | + } elseif($content instanceof THtmlWriter) |
|
| 482 | 479 | { |
| 483 | 480 | $boundary = $this->getResponseContentBoundary($content); |
| 484 | 481 | } |