@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function __construct($control) |
44 | 44 | { |
45 | - $this->_control = $control; |
|
46 | - $this->_options = new TMap; |
|
45 | + $this->_control=$control; |
|
46 | + $this->_options=new TMap; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | * @param mixed default value. |
55 | 55 | * @return mixed options value. |
56 | 56 | */ |
57 | - protected function setOption($name,$value,$default=null) |
|
57 | + protected function setOption($name, $value, $default=null) |
|
58 | 58 | { |
59 | - $value = ($value===null) ? $default : $value; |
|
59 | + $value=($value===null) ? $default : $value; |
|
60 | 60 | if($value!==null) |
61 | - $this->_options->add($name,$value); |
|
61 | + $this->_options->add($name, $value); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | * @param mixed default value. |
69 | 69 | * @return mixed options value. |
70 | 70 | */ |
71 | - protected function getOption($name,$default=null) |
|
71 | + protected function getOption($name, $default=null) |
|
72 | 72 | { |
73 | - $item = $this->_options->itemAt($name); |
|
73 | + $item=$this->_options->itemAt($name); |
|
74 | 74 | return ($item===null) ? $default : $item; |
75 | 75 | } |
76 | 76 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | public function canUpdateClientSide($bDontRequireVisibility=false) |
126 | 126 | { |
127 | 127 | return $this->getControl()->getHasChildInitialized() |
128 | - && $this->getPage()->getIsLoadingPostData() == false |
|
128 | + && $this->getPage()->getIsLoadingPostData()==false |
|
129 | 129 | && $this->getPage()->getIsCallback() |
130 | 130 | && $this->getEnableUpdate() |
131 | 131 | && ($bDontRequireVisibility || $this->getControl()->getVisible()); |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public function getClientSide() |
168 | 168 | { |
169 | - if(($client = $this->getOption('ClientSide'))===null) |
|
169 | + if(($client=$this->getOption('ClientSide'))===null) |
|
170 | 170 | { |
171 | - $client = $this->createClientSide(); |
|
171 | + $client=$this->createClientSide(); |
|
172 | 172 | $this->setOption('ClientSide', $client); |
173 | 173 | } |
174 | 174 | return $client; |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function setClientSide($client) |
182 | 182 | { |
183 | - if( $this->getOption('ClientSide')===null) |
|
183 | + if($this->getOption('ClientSide')===null) |
|
184 | 184 | $this->setOption('ClientSide', $client); |
185 | 185 | else |
186 | 186 | throw new TConfigurationException( |
@@ -227,11 +227,11 @@ discard block |
||
227 | 227 | { |
228 | 228 | if(($id=$this->getCallbackOptions())!=='') |
229 | 229 | { |
230 | - if(($pos=strrpos($id,'.'))!==false) |
|
230 | + if(($pos=strrpos($id, '.'))!==false) |
|
231 | 231 | { |
232 | - $control=$this->getControl()->getSubProperty(substr($id,0,$pos)); |
|
233 | - $newid=substr($id,$pos+1); |
|
234 | - if ($control!==null) |
|
232 | + $control=$this->getControl()->getSubProperty(substr($id, 0, $pos)); |
|
233 | + $newid=substr($id, $pos + 1); |
|
234 | + if($control!==null) |
|
235 | 235 | $control=$control->$newid; |
236 | 236 | } |
237 | 237 | else |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | */ |
257 | 257 | public function getCausesValidation() |
258 | 258 | { |
259 | - return $this->getOption('CausesValidation',true); |
|
259 | + return $this->getOption('CausesValidation', true); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | /** |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | */ |
266 | 266 | public function setCausesValidation($value) |
267 | 267 | { |
268 | - $this->setOption('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
268 | + $this->setOption('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | */ |
275 | 275 | public function getValidationGroup() |
276 | 276 | { |
277 | - return $this->getOption('ValidationGroup',''); |
|
277 | + return $this->getOption('ValidationGroup', ''); |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | /** |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | */ |
284 | 284 | public function setValidationGroup($value) |
285 | 285 | { |
286 | - $this->setOption('ValidationGroup',$value,''); |
|
286 | + $this->setOption('ValidationGroup', $value, ''); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | /** |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | if($this->getCausesValidation()) |
296 | 296 | { |
297 | 297 | $group=$this->getValidationGroup(); |
298 | - return $this->getPage()->getValidators($group)->getCount()>0; |
|
298 | + return $this->getPage()->getValidators($group)->getCount() > 0; |
|
299 | 299 | } |
300 | 300 | else |
301 | 301 | return false; |
@@ -323,15 +323,15 @@ discard block |
||
323 | 323 | */ |
324 | 324 | protected function getClientSideOptions() |
325 | 325 | { |
326 | - $default = $this->getDefaultClientSideOptions(); |
|
327 | - $options = array_merge($default,$this->getClientSide()->getOptions()->toArray()); |
|
328 | - $validate = $this->getCausesValidation(); |
|
329 | - $options['CausesValidation']= $validate ? '' : false; |
|
326 | + $default=$this->getDefaultClientSideOptions(); |
|
327 | + $options=array_merge($default, $this->getClientSide()->getOptions()->toArray()); |
|
328 | + $validate=$this->getCausesValidation(); |
|
329 | + $options['CausesValidation']=$validate ? '' : false; |
|
330 | 330 | $options['ValidationGroup']=$this->getValidationGroup(); |
331 | - $options['CallbackParameter'] = $this->getCallbackParameter(); |
|
331 | + $options['CallbackParameter']=$this->getCallbackParameter(); |
|
332 | 332 | // needed for TCallback |
333 | 333 | if(!isset($options['EventTarget'])) |
334 | - $options['EventTarget'] = $this->getControl()->getUniqueID(); |
|
334 | + $options['EventTarget']=$this->getControl()->getUniqueID(); |
|
335 | 335 | return $options; |
336 | 336 | } |
337 | 337 | |
@@ -344,13 +344,13 @@ discard block |
||
344 | 344 | * @param string client side javascript class name. |
345 | 345 | * @param array additional callback options. |
346 | 346 | */ |
347 | - public function registerCallbackClientScript($class,$options=null) |
|
347 | + public function registerCallbackClientScript($class, $options=null) |
|
348 | 348 | { |
349 | - $cs = $this->getPage()->getClientScript(); |
|
349 | + $cs=$this->getPage()->getClientScript(); |
|
350 | 350 | if(is_array($options)) |
351 | - $options = array_merge($this->getClientSideOptions(),$options); |
|
351 | + $options=array_merge($this->getClientSideOptions(), $options); |
|
352 | 352 | else |
353 | - $options = $this->getClientSideOptions(); |
|
353 | + $options=$this->getClientSideOptions(); |
|
354 | 354 | |
355 | 355 | //remove true as default to save bytes |
356 | 356 | if($options['CausesValidation']===true) |
@@ -379,8 +379,8 @@ discard block |
||
379 | 379 | */ |
380 | 380 | public function getJavascript() |
381 | 381 | { |
382 | - $client = $this->getPage()->getClientScript(); |
|
383 | - return $client->getCallbackReference($this->getControl(),$this->getClientSideOptions()); |
|
382 | + $client=$this->getPage()->getClientScript(); |
|
383 | + return $client->getCallbackReference($this->getControl(), $this->getClientSideOptions()); |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | /** |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | * |
130 | 130 | * @param object $dropControlId |
131 | 131 | */ |
132 | - public function onDrop ($dropParams) |
|
132 | + public function onDrop($dropParams) |
|
133 | 133 | { |
134 | - $this->raiseEvent('OnDrop', $this, new TDropContainerEventParameter ($dropParams)); |
|
134 | + $this->raiseEvent('OnDrop', $this, new TDropContainerEventParameter($dropParams)); |
|
135 | 135 | |
136 | 136 | } |
137 | 137 | |
@@ -153,11 +153,11 @@ discard block |
||
153 | 153 | */ |
154 | 154 | protected function getPostBackOptions() |
155 | 155 | { |
156 | - $options['ID'] = $this->getClientID(); |
|
157 | - $options['EventTarget'] = $this->getUniqueID(); |
|
156 | + $options['ID']=$this->getClientID(); |
|
157 | + $options['EventTarget']=$this->getUniqueID(); |
|
158 | 158 | |
159 | - $options['accept'] = $this->getAcceptCssClass(); |
|
160 | - $options['hoverclass'] = $this->getHoverCssClass(); |
|
159 | + $options['accept']=$this->getAcceptCssClass(); |
|
160 | + $options['hoverclass']=$this->getHoverCssClass(); |
|
161 | 161 | return $options; |
162 | 162 | } |
163 | 163 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | protected function addAttributesToRender($writer) |
190 | 190 | { |
191 | 191 | parent::addAttributesToRender($writer); |
192 | - $writer->addAttribute('id',$this->getClientID()); |
|
192 | + $writer->addAttribute('id', $this->getClientID()); |
|
193 | 193 | |
194 | 194 | $this->getPage()->getClientScript()->registerPradoScript('dragdrop'); |
195 | 195 | $this->getActiveControl()->registerCallbackClientScript( |
@@ -202,9 +202,9 @@ discard block |
||
202 | 202 | * child controls. This container will be a TActivePanel, in order to allow user |
203 | 203 | * to update its content on callback. |
204 | 204 | */ |
205 | - public function createChildControls () |
|
205 | + public function createChildControls() |
|
206 | 206 | { |
207 | - if ($this->_container===null) |
|
207 | + if($this->_container===null) |
|
208 | 208 | { |
209 | 209 | $this->_container=Prado::CreateComponent('System.Web.UI.ActiveControls.TActivePanel'); |
210 | 210 | $this->_container->setId($this->getId(false).'_content'); |
@@ -230,17 +230,17 @@ discard block |
||
230 | 230 | * is defered until OnPreRender event is raised. |
231 | 231 | * @param THtmlWriter html writer |
232 | 232 | */ |
233 | - public function render ($writer) |
|
233 | + public function render($writer) |
|
234 | 234 | { |
235 | 235 | if($this->getHasPreRendered()) |
236 | 236 | { |
237 | 237 | parent::render($writer); |
238 | 238 | if($this->getActiveControl()->canUpdateClientSide()) |
239 | - $this->getPage()->getCallbackClient()->replaceContent($this->_container,$writer); |
|
239 | + $this->getPage()->getCallbackClient()->replaceContent($this->_container, $writer); |
|
240 | 240 | } |
241 | 241 | else |
242 | 242 | { |
243 | - $this->getPage()->getAdapter()->registerControlToRender($this->_container,$writer); |
|
243 | + $this->getPage()->getAdapter()->registerControlToRender($this->_container, $writer); |
|
244 | 244 | } |
245 | 245 | } |
246 | 246 | |
@@ -272,28 +272,28 @@ discard block |
||
272 | 272 | |
273 | 273 | public function __construct($dropParams) |
274 | 274 | { |
275 | - $this->_dragElementId = $dropParams->DragElementID; |
|
276 | - $this->_screenX = $dropParams->ScreenX; |
|
277 | - $this->_screenY = $dropParams->ScreenY; |
|
278 | - $this->_offsetX = isset($dropParams->OffsetX) ? $dropParams->OffsetX : false; |
|
279 | - $this->_offsetY = isset($dropParams->OffsetY) ? $dropParams->OffsetY : false; |
|
280 | - $this->_clientX = $dropParams->ClientX; |
|
281 | - $this->_clientY = $dropParams->ClientY; |
|
282 | - $this->_shiftKey = TPropertyValue::ensureBoolean($dropParams->ShiftKey); |
|
283 | - $this->_ctrlKey = TPropertyValue::ensureBoolean($dropParams->CtrlKey); |
|
284 | - $this->_altKey = TPropertyValue::ensureBoolean($dropParams->AltKey); |
|
275 | + $this->_dragElementId=$dropParams->DragElementID; |
|
276 | + $this->_screenX=$dropParams->ScreenX; |
|
277 | + $this->_screenY=$dropParams->ScreenY; |
|
278 | + $this->_offsetX=isset($dropParams->OffsetX) ? $dropParams->OffsetX : false; |
|
279 | + $this->_offsetY=isset($dropParams->OffsetY) ? $dropParams->OffsetY : false; |
|
280 | + $this->_clientX=$dropParams->ClientX; |
|
281 | + $this->_clientY=$dropParams->ClientY; |
|
282 | + $this->_shiftKey=TPropertyValue::ensureBoolean($dropParams->ShiftKey); |
|
283 | + $this->_ctrlKey=TPropertyValue::ensureBoolean($dropParams->CtrlKey); |
|
284 | + $this->_altKey=TPropertyValue::ensureBoolean($dropParams->AltKey); |
|
285 | 285 | } |
286 | 286 | |
287 | - public function getDragElementId() { return $this->_dragElementId; } |
|
288 | - public function getScreenX() { return $this->_screenX; } |
|
289 | - public function getScreenY() { return $this->_screenY; } |
|
290 | - public function getOffsetX() { return $this->_offsetX; } |
|
291 | - public function geOffsetY() { return $this->_offsetY; } |
|
292 | - public function getClientX() { return $this->_clientX; } |
|
293 | - public function getClientY() { return $this->_clientY; } |
|
294 | - public function getShiftKey() { return $this->_shiftKey; } |
|
295 | - public function getCtrlKey() { return $this->_ctrlKey; } |
|
296 | - public function getAltKey() { return $this->_altKey; } |
|
287 | + public function getDragElementId() { return $this->_dragElementId; } |
|
288 | + public function getScreenX() { return $this->_screenX; } |
|
289 | + public function getScreenY() { return $this->_screenY; } |
|
290 | + public function getOffsetX() { return $this->_offsetX; } |
|
291 | + public function geOffsetY() { return $this->_offsetY; } |
|
292 | + public function getClientX() { return $this->_clientX; } |
|
293 | + public function getClientY() { return $this->_clientY; } |
|
294 | + public function getShiftKey() { return $this->_shiftKey; } |
|
295 | + public function getCtrlKey() { return $this->_ctrlKey; } |
|
296 | + public function getAltKey() { return $this->_altKey; } |
|
297 | 297 | |
298 | 298 | /** |
299 | 299 | * GetDroppedControl |
@@ -301,15 +301,15 @@ discard block |
||
301 | 301 | * Compatibility method to get the dropped control |
302 | 302 | * @return TControl dropped control, or null if not found |
303 | 303 | */ |
304 | - public function getDroppedControl () |
|
304 | + public function getDroppedControl() |
|
305 | 305 | { |
306 | 306 | $control=null; |
307 | 307 | $service=prado::getApplication()->getService(); |
308 | - if ($service instanceof TPageService) |
|
308 | + if($service instanceof TPageService) |
|
309 | 309 | { |
310 | 310 | // Find the control |
311 | 311 | // Warning, this will not work if you have a '_' in your control Id ! |
312 | - $dropControlId=str_replace(TControl::CLIENT_ID_SEPARATOR,TControl::ID_SEPARATOR,$this->_dragElementId); |
|
312 | + $dropControlId=str_replace(TControl::CLIENT_ID_SEPARATOR, TControl::ID_SEPARATOR, $this->_dragElementId); |
|
313 | 313 | $control=$service->getRequestedPage()->findControl($dropControlId); |
314 | 314 | } |
315 | 315 | return $control; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * Set the handle id or css class |
33 | 33 | * @param string |
34 | 34 | */ |
35 | - public function setHandle ($value) |
|
35 | + public function setHandle($value) |
|
36 | 36 | { |
37 | 37 | $this->setViewState('DragHandle', TPropertyValue::ensureString($value), null); |
38 | 38 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * Get the handle id or css class |
42 | 42 | * @return string |
43 | 43 | */ |
44 | - public function getHandle () |
|
44 | + public function getHandle() |
|
45 | 45 | { |
46 | 46 | return $this->getViewState('DragHandle', null); |
47 | 47 | } |
@@ -71,9 +71,9 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function setRevert($value) |
73 | 73 | { |
74 | - if (strcasecmp($value,'true')==0 || $value===true) |
|
74 | + if(strcasecmp($value, 'true')==0 || $value===true) |
|
75 | 75 | $value=TDraggableRevertOptions::Revert; |
76 | - elseif (strcasecmp($value,'false')==0 || $value===false) |
|
76 | + elseif(strcasecmp($value, 'false')==0 || $value===false) |
|
77 | 77 | $value=TDraggableRevertOptions::None; |
78 | 78 | $this->setViewState('Revert', TPropertyValue::ensureEnum($value, 'TDraggableRevertOptions'), true); |
79 | 79 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * |
91 | 91 | * @return TDraggableGhostingOption to clone the element |
92 | 92 | */ |
93 | - public function getGhosting () |
|
93 | + public function getGhosting() |
|
94 | 94 | { |
95 | 95 | return $this->getViewState('Ghosting', TDraggableGhostingOptions::None); |
96 | 96 | } |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | * o "False" or "None" means no Ghosting options |
108 | 108 | * |
109 | 109 | */ |
110 | - public function setGhosting ($value) |
|
110 | + public function setGhosting($value) |
|
111 | 111 | { |
112 | - if (strcasecmp($value,'true')==0 || $value===true) |
|
112 | + if(strcasecmp($value, 'true')==0 || $value===true) |
|
113 | 113 | $value=TDraggableGhostingOptions::Ghosting; |
114 | - elseif (strcasecmp($value,'false')==0 || $value===false) |
|
114 | + elseif(strcasecmp($value, 'false')==0 || $value===false) |
|
115 | 115 | $value=TDraggableGhostingOptions::None; |
116 | 116 | $this->setViewState('Ghosting', TPropertyValue::ensureEnum($value, 'TDraggableGhostingOptions'), TDraggableGhostingOptions::None); |
117 | 117 | } |
@@ -154,11 +154,11 @@ discard block |
||
154 | 154 | parent::addAttributesToRender($writer); |
155 | 155 | |
156 | 156 | $cs=$this->getPage()->getClientScript(); |
157 | - if ($this->getGhosting()==TDraggableGhostingOptions::SuperGhosting) |
|
157 | + if($this->getGhosting()==TDraggableGhostingOptions::SuperGhosting) |
|
158 | 158 | $cs->registerPradoScript('dragdropextra'); |
159 | 159 | else |
160 | 160 | $cs->registerPradoScript('dragdrop'); |
161 | - $writer->addAttribute('id',$this->getClientID()); |
|
161 | + $writer->addAttribute('id', $this->getClientID()); |
|
162 | 162 | $options=TJavascript::encode($this->getPostBackOptions()); |
163 | 163 | $class=$this->getClientClassName(); |
164 | 164 | $code="new {$class}('{$this->getClientId()}', {$options}) "; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * This method overrides the parent implementation. |
171 | 171 | * @return string the javascript class name |
172 | 172 | */ |
173 | - protected function getClientClassName () |
|
173 | + protected function getClientClassName() |
|
174 | 174 | { |
175 | 175 | return 'Draggable'; |
176 | 176 | } |
@@ -181,17 +181,17 @@ discard block |
||
181 | 181 | */ |
182 | 182 | protected function getPostBackOptions() |
183 | 183 | { |
184 | - $options['ID'] = $this->getClientID(); |
|
184 | + $options['ID']=$this->getClientID(); |
|
185 | 185 | |
186 | - if (($handle=$this->getHandle())!== null) $options['handle']=$handle; |
|
187 | - if (($revert=$this->getRevert())===TDraggableRevertOptions::None) |
|
186 | + if(($handle=$this->getHandle())!==null) $options['handle']=$handle; |
|
187 | + if(($revert=$this->getRevert())===TDraggableRevertOptions::None) |
|
188 | 188 | $options['revert']=false; |
189 | - elseif ($revert==TDraggableRevertOptions::Revert) |
|
189 | + elseif($revert==TDraggableRevertOptions::Revert) |
|
190 | 190 | $options['revert']=true; |
191 | 191 | else |
192 | 192 | $options['revert']=strtolower($revert); |
193 | - if (($constraint=$this->getConstraint())!==TDraggableConstraint::None) $options['constraint']=strtolower($constraint); |
|
194 | - switch ($this->getGhosting()) |
|
193 | + if(($constraint=$this->getConstraint())!==TDraggableConstraint::None) $options['constraint']=strtolower($constraint); |
|
194 | + switch($this->getGhosting()) |
|
195 | 195 | { |
196 | 196 | case TDraggableGhostingOptions::SuperGhosting: |
197 | 197 | $options['superghosting']=true; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | public function getClientSide() |
37 | 37 | { |
38 | 38 | if($this->_clientSide===null) |
39 | - $this->_clientSide = $this->createClientSide(); |
|
39 | + $this->_clientSide=$this->createClientSide(); |
|
40 | 40 | return $this->_clientSide; |
41 | 41 | } |
42 | 42 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | protected function getTargetControl() |
46 | 46 | { |
47 | - $id = $this->getControlID(); |
|
47 | + $id=$this->getControlID(); |
|
48 | 48 | if(($control=$this->findControl($id)) instanceof TControl) |
49 | 49 | return $control->getClientID(); |
50 | 50 | if($id==='') |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | */ |
61 | 61 | protected function getTriggerOptions() |
62 | 62 | { |
63 | - $options['ID'] = $this->getClientID(); |
|
64 | - $options['EventTarget'] = $this->getUniqueID(); |
|
65 | - $options['ControlID'] = $this->getTargetControl(); |
|
63 | + $options['ID']=$this->getClientID(); |
|
64 | + $options['EventTarget']=$this->getUniqueID(); |
|
65 | + $options['ControlID']=$this->getTargetControl(); |
|
66 | 66 | return $options; |
67 | 67 | } |
68 | 68 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @param THtmlWriter the writer used for the rendering purpose |
61 | 61 | */ |
62 | 62 | protected function addAttributesToRender($writer) { |
63 | - $writer->addAttribute('id',$this->getClientID()); |
|
63 | + $writer->addAttribute('id', $this->getClientID()); |
|
64 | 64 | parent::addAttributesToRender($writer); |
65 | 65 | } |
66 | 66 | |
@@ -77,17 +77,17 @@ discard block |
||
77 | 77 | { |
78 | 78 | parent::render($writer); |
79 | 79 | if($this->getActiveControl()->canUpdateClientSide()) |
80 | - $this->getPage()->getCallbackClient()->replaceContent($this,$writer); |
|
80 | + $this->getPage()->getCallbackClient()->replaceContent($this, $writer); |
|
81 | 81 | } |
82 | 82 | else |
83 | 83 | { |
84 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
85 | - if ($this->getHasControls()) |
|
84 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
85 | + if($this->getHasControls()) |
|
86 | 86 | { |
87 | 87 | // If we update a TActivePanel on callback, |
88 | 88 | // We shouldn't update all childs, because the whole content will be replaced by |
89 | 89 | // the parent |
90 | - foreach ($this->findControlsByType('IActiveControl', false) as $control) |
|
90 | + foreach($this->findControlsByType('IActiveControl', false) as $control) |
|
91 | 91 | { |
92 | 92 | $control->getActiveControl()->setEnableUpdate(false); |
93 | 93 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | protected function createListItemCollection() |
84 | 84 | { |
85 | - $collection = new TActiveListItemCollection; |
|
85 | + $collection=new TActiveListItemCollection; |
|
86 | 86 | $collection->setControl($this); |
87 | 87 | return $collection; |
88 | 88 | } |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | protected function addAttributesToRender($writer) |
103 | 103 | { |
104 | 104 | parent::addAttributesToRender($writer); |
105 | - $writer->addAttribute('id',$this->getClientID()); |
|
106 | - if ($this->getAutoPostBack()) |
|
105 | + $writer->addAttribute('id', $this->getClientID()); |
|
106 | + if($this->getAutoPostBack()) |
|
107 | 107 | $this->getActiveControl()->registerCallbackClientScript( |
108 | 108 | $this->getClientClassName(), $this->getPostBackOptions()); |
109 | 109 | } |
@@ -32,40 +32,40 @@ discard block |
||
32 | 32 | /** |
33 | 33 | * Callback response data header name. |
34 | 34 | */ |
35 | - const CALLBACK_DATA_HEADER = 'X-PRADO-DATA'; |
|
35 | + const CALLBACK_DATA_HEADER='X-PRADO-DATA'; |
|
36 | 36 | /** |
37 | 37 | * Callback response client-side action header name. |
38 | 38 | */ |
39 | - const CALLBACK_ACTION_HEADER = 'X-PRADO-ACTIONS'; |
|
39 | + const CALLBACK_ACTION_HEADER='X-PRADO-ACTIONS'; |
|
40 | 40 | /** |
41 | 41 | * Callback error header name. |
42 | 42 | */ |
43 | - const CALLBACK_ERROR_HEADER = 'X-PRADO-ERROR'; |
|
43 | + const CALLBACK_ERROR_HEADER='X-PRADO-ERROR'; |
|
44 | 44 | /** |
45 | 45 | * Callback page state header name. |
46 | 46 | */ |
47 | - const CALLBACK_PAGESTATE_HEADER = 'X-PRADO-PAGESTATE'; |
|
47 | + const CALLBACK_PAGESTATE_HEADER='X-PRADO-PAGESTATE'; |
|
48 | 48 | /** |
49 | 49 | * Script list header name. |
50 | 50 | */ |
51 | - const CALLBACK_SCRIPTLIST_HEADER = 'X-PRADO-SCRIPTLIST'; |
|
51 | + const CALLBACK_SCRIPTLIST_HEADER='X-PRADO-SCRIPTLIST'; |
|
52 | 52 | /** |
53 | 53 | * Stylesheet list header name. |
54 | 54 | */ |
55 | - const CALLBACK_STYLESHEETLIST_HEADER = 'X-PRADO-STYLESHEETLIST'; |
|
55 | + const CALLBACK_STYLESHEETLIST_HEADER='X-PRADO-STYLESHEETLIST'; |
|
56 | 56 | /** |
57 | 57 | * Stylesheet header name. |
58 | 58 | */ |
59 | - const CALLBACK_STYLESHEET_HEADER = 'X-PRADO-STYLESHEET'; |
|
59 | + const CALLBACK_STYLESHEET_HEADER='X-PRADO-STYLESHEET'; |
|
60 | 60 | /** |
61 | 61 | * Hidden field list header name. |
62 | 62 | */ |
63 | - const CALLBACK_HIDDENFIELDLIST_HEADER = 'X-PRADO-HIDDENFIELDLIST'; |
|
63 | + const CALLBACK_HIDDENFIELDLIST_HEADER='X-PRADO-HIDDENFIELDLIST'; |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Callback redirect url header name. |
67 | 67 | */ |
68 | - const CALLBACK_REDIRECT = 'X-PRADO-REDIRECT'; |
|
68 | + const CALLBACK_REDIRECT='X-PRADO-REDIRECT'; |
|
69 | 69 | |
70 | 70 | /** |
71 | 71 | * @var ICallbackEventHandler callback event handler. |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | parent::__construct($control); |
92 | 92 | |
93 | 93 | //TODO: can this be done later? |
94 | - $response = $this->getApplication()->getResponse(); |
|
94 | + $response=$this->getApplication()->getResponse(); |
|
95 | 95 | $response->setAdapter(new TCallbackResponseAdapter($response)); |
96 | 96 | |
97 | 97 | $this->trapCallbackErrorsExceptions(); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function processCallbackEvent($writer) |
105 | 105 | { |
106 | - Prado::trace("ActivePage raiseCallbackEvent()",'System.Web.UI.ActiveControls.TActivePageAdapter'); |
|
106 | + Prado::trace("ActivePage raiseCallbackEvent()", 'System.Web.UI.ActiveControls.TActivePageAdapter'); |
|
107 | 107 | $this->raiseCallbackEvent(); |
108 | 108 | } |
109 | 109 | |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | * @param TControl control for defered rendering |
113 | 113 | * @param THtmlWriter the renderer |
114 | 114 | */ |
115 | - public function registerControlToRender($control,$writer) |
|
115 | + public function registerControlToRender($control, $writer) |
|
116 | 116 | { |
117 | - $id = $control->getUniqueID(); |
|
117 | + $id=$control->getUniqueID(); |
|
118 | 118 | if(!isset($this->_controlsToRender[$id])) |
119 | - $this->_controlsToRender[$id] = array($control,$writer); |
|
119 | + $this->_controlsToRender[$id]=array($control, $writer); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function renderCallbackResponse($writer) |
135 | 135 | { |
136 | - Prado::trace("ActivePage renderCallbackResponse()",'System.Web.UI.ActiveControls.TActivePageAdapter'); |
|
137 | - if(($url = $this->getResponse()->getAdapter()->getRedirectedUrl())===null) |
|
136 | + Prado::trace("ActivePage renderCallbackResponse()", 'System.Web.UI.ActiveControls.TActivePageAdapter'); |
|
137 | + if(($url=$this->getResponse()->getAdapter()->getRedirectedUrl())===null) |
|
138 | 138 | $this->renderResponse($writer); |
139 | 139 | else |
140 | 140 | $this->redirect($url); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | protected function redirect($url) |
148 | 148 | { |
149 | - Prado::trace("ActivePage redirect()",'System.Web.UI.ActiveControls.TActivePageAdapter'); |
|
149 | + Prado::trace("ActivePage redirect()", 'System.Web.UI.ActiveControls.TActivePageAdapter'); |
|
150 | 150 | $this->appendContentPart($this->getResponse(), self::CALLBACK_REDIRECT, $url); |
151 | 151 | } |
152 | 152 | |
@@ -157,31 +157,31 @@ discard block |
||
157 | 157 | */ |
158 | 158 | protected function renderResponse($writer) |
159 | 159 | { |
160 | - Prado::trace("ActivePage renderResponse()",'System.Web.UI.ActiveControls.TActivePageAdapter'); |
|
160 | + Prado::trace("ActivePage renderResponse()", 'System.Web.UI.ActiveControls.TActivePageAdapter'); |
|
161 | 161 | //renders all the defered render() calls. |
162 | 162 | foreach($this->_controlsToRender as $rid => $forRender) |
163 | 163 | $forRender[0]->render($forRender[1]); |
164 | 164 | |
165 | - $response = $this->getResponse(); |
|
165 | + $response=$this->getResponse(); |
|
166 | 166 | |
167 | 167 | //send response data in header |
168 | 168 | if($response->getHasAdapter()) |
169 | 169 | { |
170 | - $responseData = $response->getAdapter()->getResponseData(); |
|
170 | + $responseData=$response->getAdapter()->getResponseData(); |
|
171 | 171 | if($responseData!==null) |
172 | 172 | { |
173 | - $data = TJavaScript::jsonEncode($responseData); |
|
173 | + $data=TJavaScript::jsonEncode($responseData); |
|
174 | 174 | |
175 | 175 | $this->appendContentPart($response, self::CALLBACK_DATA_HEADER, $data); |
176 | 176 | } |
177 | 177 | } |
178 | 178 | |
179 | 179 | //sends page state in header |
180 | - if(($handler = $this->getCallbackEventTarget()) !== null) |
|
180 | + if(($handler=$this->getCallbackEventTarget())!==null) |
|
181 | 181 | { |
182 | 182 | if($handler->getActiveControl()->getClientSide()->getEnablePageStateUpdate()) |
183 | 183 | { |
184 | - $pagestate = $this->getPage()->getClientState(); |
|
184 | + $pagestate=$this->getPage()->getClientState(); |
|
185 | 185 | $this->appendContentPart($response, self::CALLBACK_PAGESTATE_HEADER, $pagestate); |
186 | 186 | } |
187 | 187 | } |
@@ -192,37 +192,37 @@ discard block |
||
192 | 192 | //output the end javascript |
193 | 193 | if($this->getPage()->getClientScript()->hasEndScripts()) |
194 | 194 | { |
195 | - $writer = $response->createHtmlWriter(); |
|
195 | + $writer=$response->createHtmlWriter(); |
|
196 | 196 | $this->getPage()->getClientScript()->renderEndScriptsCallback($writer); |
197 | 197 | $this->getPage()->getCallbackClient()->evaluateScript($writer); |
198 | 198 | } |
199 | 199 | |
200 | 200 | //output the actions |
201 | - $executeJavascript = $this->getCallbackClientHandler()->getClientFunctionsToExecute(); |
|
202 | - $actions = TJavaScript::jsonEncode($executeJavascript); |
|
201 | + $executeJavascript=$this->getCallbackClientHandler()->getClientFunctionsToExecute(); |
|
202 | + $actions=TJavaScript::jsonEncode($executeJavascript); |
|
203 | 203 | $this->appendContentPart($response, self::CALLBACK_ACTION_HEADER, $actions); |
204 | 204 | |
205 | 205 | |
206 | - $cs = $this->Page->getClientScript(); |
|
206 | + $cs=$this->Page->getClientScript(); |
|
207 | 207 | |
208 | 208 | // collect all stylesheet file references |
209 | - $stylesheets = $cs->getStyleSheetUrls(); |
|
210 | - if (count($stylesheets)>0) |
|
209 | + $stylesheets=$cs->getStyleSheetUrls(); |
|
210 | + if(count($stylesheets) > 0) |
|
211 | 211 | $this->appendContentPart($response, self::CALLBACK_STYLESHEETLIST_HEADER, TJavaScript::jsonEncode($stylesheets)); |
212 | 212 | |
213 | 213 | // collect all stylesheet snippets references |
214 | - $stylesheets = $cs->getStyleSheetCodes(); |
|
215 | - if (count($stylesheets)>0) |
|
214 | + $stylesheets=$cs->getStyleSheetCodes(); |
|
215 | + if(count($stylesheets) > 0) |
|
216 | 216 | $this->appendContentPart($response, self::CALLBACK_STYLESHEET_HEADER, TJavaScript::jsonEncode($stylesheets)); |
217 | 217 | |
218 | 218 | // collect all script file references |
219 | - $scripts = $cs->getScriptUrls(); |
|
220 | - if (count($scripts)>0) |
|
219 | + $scripts=$cs->getScriptUrls(); |
|
220 | + if(count($scripts) > 0) |
|
221 | 221 | $this->appendContentPart($response, self::CALLBACK_SCRIPTLIST_HEADER, TJavaScript::jsonEncode($scripts)); |
222 | 222 | |
223 | 223 | // collect all hidden field references |
224 | - $fields = $cs->getHiddenFields(); |
|
225 | - if (count($fields)>0) |
|
224 | + $fields=$cs->getHiddenFields(); |
|
225 | + if(count($fields) > 0) |
|
226 | 226 | $this->appendContentPart($response, self::CALLBACK_HIDDENFIELDLIST_HEADER, TJavaScript::jsonEncode($fields)); |
227 | 227 | } |
228 | 228 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | private function appendContentPart($response, $delimiter, $data) |
233 | 233 | { |
234 | - $content = $response->createHtmlWriter(); |
|
234 | + $content=$response->createHtmlWriter(); |
|
235 | 235 | $content->getWriter()->setBoundary($delimiter); |
236 | 236 | $content->write($data); |
237 | 237 | } |
@@ -248,8 +248,8 @@ discard block |
||
248 | 248 | { |
249 | 249 | if($callbackHandler instanceof ICallbackEventHandler) |
250 | 250 | { |
251 | - $param = $this->getCallbackEventParameter(); |
|
252 | - $result = new TCallbackEventParameter($this->getResponse(), $param); |
|
251 | + $param=$this->getCallbackEventParameter(); |
|
252 | + $result=new TCallbackEventParameter($this->getResponse(), $param); |
|
253 | 253 | $callbackHandler->raiseCallbackEvent($result); |
254 | 254 | } |
255 | 255 | else |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | } |
261 | 261 | else |
262 | 262 | { |
263 | - $target = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_TARGET); |
|
263 | + $target=$this->getRequest()->itemAt(TPage::FIELD_CALLBACK_TARGET); |
|
264 | 264 | throw new TInvalidCallbackException('callback_invalid_target', $target); |
265 | 265 | } |
266 | 266 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | { |
298 | 298 | if($this->_callbackEventParameter===null) |
299 | 299 | { |
300 | - $param = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER); |
|
300 | + $param=$this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER); |
|
301 | 301 | $this->_callbackEventParameter=$param; |
302 | 302 | } |
303 | 303 | return $this->_callbackEventParameter; |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | public function getCallbackClientHandler() |
320 | 320 | { |
321 | 321 | if($this->_callbackClient===null) |
322 | - $this->_callbackClient = new TCallbackClientScript; |
|
322 | + $this->_callbackClient=new TCallbackClientScript; |
|
323 | 323 | return $this->_callbackClient; |
324 | 324 | } |
325 | 325 | } |
@@ -347,22 +347,22 @@ discard block |
||
347 | 347 | { |
348 | 348 | if($this->getApplication()->getMode()===TApplication::STATE_DEBUG) |
349 | 349 | { |
350 | - $response = $this->getApplication()->getResponse(); |
|
351 | - $trace = $this->getExceptionStackTrace($exception); |
|
350 | + $response=$this->getApplication()->getResponse(); |
|
351 | + $trace=$this->getExceptionStackTrace($exception); |
|
352 | 352 | // avoid error on non-utf8 strings |
353 | 353 | try { |
354 | - $trace = TJavaScript::jsonEncode($trace); |
|
355 | - } catch (Exception $e) { |
|
354 | + $trace=TJavaScript::jsonEncode($trace); |
|
355 | + } catch(Exception $e) { |
|
356 | 356 | // strip everythin not 7bit ascii |
357 | - $trace = preg_replace('/[^(\x20-\x7F)]*/','', serialize($trace)); |
|
357 | + $trace=preg_replace('/[^(\x20-\x7F)]*/', '', serialize($trace)); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | // avoid exception loop if headers have already been sent |
361 | 361 | try { |
362 | 362 | $response->setStatusCode(500, 'Internal Server Error'); |
363 | - } catch (Exception $e) { } |
|
363 | + } catch(Exception $e) { } |
|
364 | 364 | |
365 | - $content = $response->createHtmlWriter(); |
|
365 | + $content=$response->createHtmlWriter(); |
|
366 | 366 | $content->getWriter()->setBoundary(TActivePageAdapter::CALLBACK_ERROR_HEADER); |
367 | 367 | $content->write($trace); |
368 | 368 | } |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | $data['type']=get_class($exception); |
398 | 398 | $data['message']=$exception->getMessage(); |
399 | 399 | $data['version']=$_SERVER['SERVER_SOFTWARE'].' '.Prado::getVersion(); |
400 | - $data['time']=@strftime('%Y-%m-%d %H:%M',time()); |
|
400 | + $data['time']=@strftime('%Y-%m-%d %H:%M', time()); |
|
401 | 401 | return $data; |
402 | 402 | } |
403 | 403 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | protected function createRepeatedControl() |
79 | 79 | { |
80 | - $control = new TActiveRadioButtonItem; |
|
80 | + $control=new TActiveRadioButtonItem; |
|
81 | 81 | $control->getAdapter()->setBaseActiveControl($this->getActiveControl()); |
82 | 82 | return $control; |
83 | 83 | } |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | * @param string checkbox id |
139 | 139 | * @param string onclick js |
140 | 140 | */ |
141 | - protected function renderInputTag($writer,$clientID,$onclick) |
|
141 | + protected function renderInputTag($writer, $clientID, $onclick) |
|
142 | 142 | { |
143 | - TRadioButton::renderInputTag($writer,$clientID,$onclick); |
|
143 | + TRadioButton::renderInputTag($writer, $clientID, $onclick); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | \ No newline at end of file |