@@ -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 | } |
@@ -58,8 +58,7 @@ |
||
58 | 58 | if ($this->sourcepath === NULL) |
59 | 59 | { |
60 | 60 | $this->sourcepath = $sourcepath; |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->sourcepath->append($sourcepath); |
65 | 64 | } |
@@ -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 | } |
@@ -174,14 +174,12 @@ |
||
174 | 174 | { |
175 | 175 | $parameter = new TAutoCompleteEventParameter($this->getResponse(), $token[0]); |
176 | 176 | $this->onSuggest($parameter); |
177 | - } |
|
178 | - else if($token[1] === '__TAutoComplete_onSuggestionSelected__') |
|
177 | + } else if($token[1] === '__TAutoComplete_onSuggestionSelected__') |
|
179 | 178 | { |
180 | 179 | $parameter = new TAutoCompleteEventParameter($this->getResponse(), null, $token[0]); |
181 | 180 | $this->onSuggestionSelected($parameter); |
182 | 181 | } |
183 | - } |
|
184 | - else if($this->getAutoPostBack()) |
|
182 | + } else if($this->getAutoPostBack()) |
|
185 | 183 | parent::raiseCallbackEvent($param); |
186 | 184 | } |
187 | 185 |
@@ -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 | } |
@@ -58,8 +58,7 @@ |
||
58 | 58 | if ($this->sourcepath === NULL) |
59 | 59 | { |
60 | 60 | $this->sourcepath = $sourcepath; |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->sourcepath->append($sourcepath); |
65 | 64 | } |
@@ -58,8 +58,7 @@ |
||
58 | 58 | if ($this->sourcepath === NULL) |
59 | 59 | { |
60 | 60 | $this->sourcepath = $sourcepath; |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->sourcepath->append($sourcepath); |
65 | 64 | } |
@@ -58,8 +58,7 @@ |
||
58 | 58 | if ($this->sourcepath === NULL) |
59 | 59 | { |
60 | 60 | $this->sourcepath = $sourcepath; |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->sourcepath->append($sourcepath); |
65 | 64 | } |