@@ -84,6 +84,7 @@ discard block |
||
84 | 84 | * Executes a client-side statement. |
85 | 85 | * @param string javascript function name |
86 | 86 | * @param array list of arguments for the function |
87 | + * @param string $function |
|
87 | 88 | */ |
88 | 89 | public function callClientFunction($function, $params=array()) |
89 | 90 | { |
@@ -144,6 +145,7 @@ discard block |
||
144 | 145 | * @param string selection method |
145 | 146 | * @param string|int the value or index to select/check. |
146 | 147 | * @param string selection control type, either 'check' or 'select' |
148 | + * @param boolean $value |
|
147 | 149 | */ |
148 | 150 | public function select($control, $method='Value', $value=null, $type=null) |
149 | 151 | { |
@@ -210,6 +212,7 @@ discard block |
||
210 | 212 | * @param TControl control element or element id |
211 | 213 | * @param string attribute name |
212 | 214 | * @param string attribute value |
215 | + * @param TControl $control |
|
213 | 216 | */ |
214 | 217 | public function setAttribute($control, $name, $value) |
215 | 218 | { |
@@ -359,6 +362,7 @@ discard block |
||
359 | 362 | * key is the style property and the value is the style value. |
360 | 363 | * @param TControl control element or element id |
361 | 364 | * @param array list of key-value pairs as style property and style value. |
365 | + * @param TControl $element |
|
362 | 366 | */ |
363 | 367 | public function setStyle($element, $styles) |
364 | 368 | { |
@@ -413,6 +417,7 @@ discard block |
||
413 | 417 | * @param TControl control element or HTML element id. |
414 | 418 | * @param string HTML fragement or the control to be rendered. |
415 | 419 | * @param boolean whether to fully replace the element or just its inner content. |
420 | + * @param boolean $self |
|
416 | 421 | * @see insertAbout |
417 | 422 | * @see insertBelow |
418 | 423 | * @see insertBefore |
@@ -441,6 +446,7 @@ discard block |
||
441 | 446 | * @param TControl control element or HTML element id. |
442 | 447 | * @param string HTML fragement or the control to be rendered. |
443 | 448 | * @param boolean whether to fully replace the element or just its inner content, defaults to true. |
449 | + * @param TControl $element |
|
444 | 450 | */ |
445 | 451 | public function replaceContent($element, $content, $self=true) |
446 | 452 | { |
@@ -492,6 +498,7 @@ discard block |
||
492 | 498 | * component developers. The render() method is defered to be called in the |
493 | 499 | * TActivePageAdapter class. |
494 | 500 | * @param TControl control to be rendered on callback response. |
501 | + * @param TControl $control |
|
495 | 502 | * @return string the boundary for which the rendered content is wrapped. |
496 | 503 | */ |
497 | 504 | private function getRenderedContentBoundary($control) |
@@ -504,6 +511,7 @@ discard block |
||
504 | 511 | |
505 | 512 | /** |
506 | 513 | * @param THtmlWriter the writer responsible for rendering html content. |
514 | + * @param THtmlWriter $html |
|
507 | 515 | * @return string content boundary. |
508 | 516 | */ |
509 | 517 | private function getResponseContentBoundary($html) |
@@ -523,6 +531,7 @@ discard block |
||
523 | 531 | * @param string visual effect function name. |
524 | 532 | * @param TControl control element or element id |
525 | 533 | * @param array visual effect key-value pair options. |
534 | + * @param string $type |
|
526 | 535 | */ |
527 | 536 | public function visualEffect($type, $element, $options=array()) |
528 | 537 | { |
@@ -630,6 +639,7 @@ discard block |
||
630 | 639 | * @param string visual effect function name. |
631 | 640 | * @param TControl control element or element id |
632 | 641 | * @param array effect options. |
642 | + * @param string $effect |
|
633 | 643 | */ |
634 | 644 | public function juiEffect($element, $effect, $options=array()) |
635 | 645 | { |
@@ -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 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function __construct() |
70 | 70 | { |
71 | - $this->_actions = new TList; |
|
71 | + $this->_actions=new TList; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | public function callClientFunction($function, $params=array()) |
89 | 89 | { |
90 | 90 | if(!is_array($params)) |
91 | - $params = array($params); |
|
91 | + $params=array($params); |
|
92 | 92 | |
93 | 93 | if(count($params) > 0) |
94 | 94 | { |
95 | - if ($params[0] instanceof ISurroundable) |
|
96 | - $params[0] = $params[0]->getSurroundingTagID(); |
|
95 | + if($params[0] instanceof ISurroundable) |
|
96 | + $params[0]=$params[0]->getSurroundingTagID(); |
|
97 | 97 | elseif($params[0] instanceof TControl) |
98 | - $params[0] = $params[0]->getClientID(); |
|
98 | + $params[0]=$params[0]->getClientID(); |
|
99 | 99 | } |
100 | 100 | $this->_actions->add(array($function => $params)); |
101 | 101 | } |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function jQuery($element, $method, $params=array()) |
110 | 110 | { |
111 | - if ($element instanceof ISurroundable) |
|
112 | - $element = $element->getSurroundingTagID(); |
|
111 | + if($element instanceof ISurroundable) |
|
112 | + $element=$element->getSurroundingTagID(); |
|
113 | 113 | elseif($element instanceof TControl) |
114 | - $element = $element->getClientID(); |
|
114 | + $element=$element->getClientID(); |
|
115 | 115 | |
116 | 116 | if(!is_array($params)) |
117 | - $params = array($params); |
|
117 | + $params=array($params); |
|
118 | 118 | |
119 | 119 | $this->_actions->add(array('Prado.Element.j' => array($element, $method, $params))); |
120 | 120 | } |
@@ -147,14 +147,14 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function select($control, $method='Value', $value=null, $type=null) |
149 | 149 | { |
150 | - $method = TPropertyValue::ensureEnum($method, |
|
150 | + $method=TPropertyValue::ensureEnum($method, |
|
151 | 151 | 'Value', 'Index', 'Clear', 'Indices', 'Values', 'All', 'Invert'); |
152 | - $type = ($type===null) ? $this->getSelectionControlType($control) : $type; |
|
153 | - $total = $this->getSelectionControlIsListType($control) ? $control->getItemCount() : 1; |
|
152 | + $type=($type===null) ? $this->getSelectionControlType($control) : $type; |
|
153 | + $total=$this->getSelectionControlIsListType($control) ? $control->getItemCount() : 1; |
|
154 | 154 | |
155 | 155 | // pass the ID to avoid getting the surrounding elements (ISurroundable) |
156 | 156 | if($control instanceof TControl) |
157 | - $control = $control->getClientID(); |
|
157 | + $control=$control->getClientID(); |
|
158 | 158 | |
159 | 159 | $this->callClientFunction('Prado.Element.select', |
160 | 160 | array($control, $type.$method, $value, $total)); |
@@ -214,9 +214,9 @@ discard block |
||
214 | 214 | public function setAttribute($control, $name, $value) |
215 | 215 | { |
216 | 216 | // Attributes should be applied on Surrounding tag, except for 'disabled' attribute |
217 | - if ($control instanceof ISurroundable && strtolower($name)!=='disabled') |
|
217 | + if($control instanceof ISurroundable && strtolower($name)!=='disabled') |
|
218 | 218 | $control=$control->getSurroundingTagID(); |
219 | - $this->callClientFunction('Prado.Element.setAttribute',array($control, $name, $value)); |
|
219 | + $this->callClientFunction('Prado.Element.setAttribute', array($control, $name, $value)); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | /** |
@@ -226,25 +226,25 @@ discard block |
||
226 | 226 | */ |
227 | 227 | public function setListItems($control, $items) |
228 | 228 | { |
229 | - $options = array(); |
|
229 | + $options=array(); |
|
230 | 230 | if($control instanceof TListControl) |
231 | 231 | { |
232 | - $promptText = $control->getPromptText(); |
|
233 | - $promptValue = $control->getPromptValue(); |
|
232 | + $promptText=$control->getPromptText(); |
|
233 | + $promptValue=$control->getPromptValue(); |
|
234 | 234 | |
235 | 235 | if($promptValue==='') |
236 | - $promptValue = $promptText; |
|
236 | + $promptValue=$promptText; |
|
237 | 237 | |
238 | 238 | if($promptValue!=='') |
239 | - $options[] = array($promptText, $promptValue); |
|
239 | + $options[]=array($promptText, $promptValue); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | foreach($items as $item) |
243 | 243 | { |
244 | 244 | if($item->getHasAttributes()) |
245 | - $options[] = array($item->getText(),$item->getValue(), $item->getAttributes()->itemAt('Group')); |
|
245 | + $options[]=array($item->getText(), $item->getValue(), $item->getAttributes()->itemAt('Group')); |
|
246 | 246 | else |
247 | - $options[] = array($item->getText(),$item->getValue()); |
|
247 | + $options[]=array($item->getText(), $item->getValue()); |
|
248 | 248 | } |
249 | 249 | $this->callClientFunction('Prado.Element.setOptions', array($control, $options)); |
250 | 250 | } |
@@ -422,16 +422,16 @@ discard block |
||
422 | 422 | { |
423 | 423 | if($content instanceof TControl) |
424 | 424 | { |
425 | - $boundary = $this->getRenderedContentBoundary($content); |
|
426 | - $content = null; |
|
425 | + $boundary=$this->getRenderedContentBoundary($content); |
|
426 | + $content=null; |
|
427 | 427 | } |
428 | 428 | else if($content instanceof THtmlWriter) |
429 | 429 | { |
430 | - $boundary = $this->getResponseContentBoundary($content); |
|
431 | - $content = null; |
|
430 | + $boundary=$this->getResponseContentBoundary($content); |
|
431 | + $content=null; |
|
432 | 432 | } |
433 | 433 | else |
434 | - $boundary = null; |
|
434 | + $boundary=null; |
|
435 | 435 | |
436 | 436 | $this->callClientFunction('Prado.Element.replace', array($element, $content, $boundary, $self)); |
437 | 437 | } |
@@ -456,11 +456,11 @@ discard block |
||
456 | 456 | { |
457 | 457 | if($writer instanceof THtmlWriter) |
458 | 458 | { |
459 | - $boundary = $this->getResponseContentBoundary($writer); |
|
460 | - $content = null; |
|
459 | + $boundary=$this->getResponseContentBoundary($writer); |
|
460 | + $content=null; |
|
461 | 461 | } else { |
462 | - $boundary = null; |
|
463 | - $content = $writer; |
|
462 | + $boundary=null; |
|
463 | + $content=$writer; |
|
464 | 464 | } |
465 | 465 | |
466 | 466 | $this->callClientFunction('Prado.Element.evaluateScript', array($content, $boundary)); |
@@ -476,11 +476,11 @@ discard block |
||
476 | 476 | { |
477 | 477 | if($content instanceof TControl) |
478 | 478 | { |
479 | - $boundary = $this->getRenderedContentBoundary($content); |
|
479 | + $boundary=$this->getRenderedContentBoundary($content); |
|
480 | 480 | } |
481 | 481 | elseif($content instanceof THtmlWriter) |
482 | 482 | { |
483 | - $boundary = $this->getResponseContentBoundary($content); |
|
483 | + $boundary=$this->getResponseContentBoundary($content); |
|
484 | 484 | } |
485 | 485 | |
486 | 486 | $this->callClientFunction('Prado.Element.appendScriptBlock', array($boundary)); |
@@ -496,8 +496,8 @@ discard block |
||
496 | 496 | */ |
497 | 497 | private function getRenderedContentBoundary($control) |
498 | 498 | { |
499 | - $writer = $this->getResponse()->createHtmlWriter(); |
|
500 | - $adapter = $control->getPage()->getAdapter(); |
|
499 | + $writer=$this->getResponse()->createHtmlWriter(); |
|
500 | + $adapter=$control->getPage()->getAdapter(); |
|
501 | 501 | $adapter->registerControlToRender($control, $writer); |
502 | 502 | return $writer->getWriter()->getBoundary(); |
503 | 503 | } |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | */ |
562 | 562 | public function fadeTo($element, $value, $duration=500) |
563 | 563 | { |
564 | - $value = TPropertyValue::ensureFloat($value); |
|
564 | + $value=TPropertyValue::ensureFloat($value); |
|
565 | 565 | $this->visualEffect('fadeTo', $element, array($duration, $value)); |
566 | 566 | } |
567 | 567 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * o 'True' or 'Revert' : The draggable will revert to it's original position |
54 | 54 | * o 'False' or 'None' : The draggable won't revert to it's original position |
55 | 55 | * o 'Failure' : The draggable will only revert if it's dropped on a non droppable area |
56 | - * @return TDraggableRevertOption true to revert |
|
56 | + * @return string true to revert |
|
57 | 57 | */ |
58 | 58 | public function getRevert() |
59 | 59 | { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | /** |
120 | 120 | * Determine if the element should be constrainted in one direction or not |
121 | - * @return CDraggableConstraint |
|
121 | + * @return string |
|
122 | 122 | */ |
123 | 123 | public function getConstraint() |
124 | 124 | { |
@@ -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; |
@@ -127,7 +127,6 @@ |
||
127 | 127 | * Raises the onDrop event. |
128 | 128 | * The drop parameters are encapsulated into a {@link TDropContainerEventParameter} |
129 | 129 | * |
130 | - * @param object $dropControlId |
|
131 | 130 | */ |
132 | 131 | public function onDrop ($dropParams) |
133 | 132 | { |
@@ -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 | } |
@@ -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; |
@@ -92,6 +92,8 @@ discard block |
||
92 | 92 | * Calls the client-side static method for this control class. |
93 | 93 | * @param string static method name |
94 | 94 | * @param mixed method parmaeter |
95 | + * @param string $func |
|
96 | + * @param boolean $value |
|
95 | 97 | */ |
96 | 98 | protected function callClientFunction($func,$value) |
97 | 99 | { |
@@ -239,6 +241,7 @@ discard block |
||
239 | 241 | * Raised when editing the content is requsted to be loaded from the |
240 | 242 | * server side. |
241 | 243 | * @param TCallbackEventParameter event parameter to be passed to the event handlers |
244 | + * @param TCallbackEventParameter $param |
|
242 | 245 | */ |
243 | 246 | public function onLoadingText($param) |
244 | 247 | { |
@@ -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 | } |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function setDisplayTextBox($value) |
76 | 76 | { |
77 | - $value = TPropertyValue::ensureBoolean($value); |
|
78 | - $this->setViewState('DisplayTextBox', $value,false); |
|
77 | + $value=TPropertyValue::ensureBoolean($value); |
|
78 | + $this->setViewState('DisplayTextBox', $value, false); |
|
79 | 79 | if($this->getActiveControl()->canUpdateClientSide()) |
80 | - $this->callClientFunction('setDisplayTextBox',$value); |
|
80 | + $this->callClientFunction('setDisplayTextBox', $value); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | * @param string static method name |
94 | 94 | * @param mixed method parmaeter |
95 | 95 | */ |
96 | - protected function callClientFunction($func,$value) |
|
96 | + protected function callClientFunction($func, $value) |
|
97 | 97 | { |
98 | - $client = $this->getPage()->getCallbackClient(); |
|
99 | - $code = $this->getClientClassName().'.'.$func; |
|
100 | - $client->callClientFunction($code,array($this,$value)); |
|
98 | + $client=$this->getPage()->getCallbackClient(); |
|
99 | + $code=$this->getClientClassName().'.'.$func; |
|
100 | + $client->callClientFunction($code, array($this, $value)); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -121,9 +121,9 @@ discard block |
||
121 | 121 | */ |
122 | 122 | protected function getExternalControlID() |
123 | 123 | { |
124 | - $extID = $this->getEditTriggerControlID(); |
|
124 | + $extID=$this->getEditTriggerControlID(); |
|
125 | 125 | if($extID===null) return ''; |
126 | - if(($control = $this->findControl($extID))!==null) |
|
126 | + if(($control=$this->findControl($extID))!==null) |
|
127 | 127 | return $control->getClientID(); |
128 | 128 | return $extID; |
129 | 129 | } |
@@ -135,13 +135,13 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function setText($value) |
137 | 137 | { |
138 | - if(TTextBox::getText() === $value) |
|
138 | + if(TTextBox::getText()===$value) |
|
139 | 139 | return; |
140 | 140 | |
141 | 141 | TTextBox::setText($value); |
142 | 142 | if($this->getActiveControl()->canUpdateClientSide()) |
143 | 143 | { |
144 | - $client = $this->getPage()->getCallbackClient(); |
|
144 | + $client=$this->getPage()->getCallbackClient(); |
|
145 | 145 | $client->update($this->getLabelClientID(), $value); |
146 | 146 | $client->setValue($this, $value); |
147 | 147 | } |
@@ -152,14 +152,14 @@ discard block |
||
152 | 152 | * @param boolean value |
153 | 153 | * @since 3.1.2 |
154 | 154 | */ |
155 | - public function setReadOnly ($value) |
|
155 | + public function setReadOnly($value) |
|
156 | 156 | { |
157 | 157 | $value=TPropertyValue::ensureBoolean($value); |
158 | - if(TTextBox::getReadOnly() === $value) |
|
158 | + if(TTextBox::getReadOnly()===$value) |
|
159 | 159 | return; |
160 | 160 | |
161 | 161 | TTextBox::setReadOnly($value); |
162 | - if ($this->getActiveControl()->canUpdateClientSide()) |
|
162 | + if($this->getActiveControl()->canUpdateClientSide()) |
|
163 | 163 | { |
164 | 164 | $this->callClientFunction('setReadOnly', $value); |
165 | 165 | } |
@@ -202,10 +202,10 @@ discard block |
||
202 | 202 | */ |
203 | 203 | public function onCallback($param) |
204 | 204 | { |
205 | - $action = $param->getCallbackParameter(); |
|
206 | - if(is_array($action) && $action[0] === '__InlineEditor_loadExternalText__') |
|
205 | + $action=$param->getCallbackParameter(); |
|
206 | + if(is_array($action) && $action[0]==='__InlineEditor_loadExternalText__') |
|
207 | 207 | { |
208 | - $parameter = new TCallbackEventParameter($this->getResponse(), $action[1]); |
|
208 | + $parameter=new TCallbackEventParameter($this->getResponse(), $action[1]); |
|
209 | 209 | $this->onLoadingText($parameter); |
210 | 210 | } |
211 | 211 | $this->raiseEvent('OnCallback', $this, $param); |
@@ -216,26 +216,26 @@ discard block |
||
216 | 216 | */ |
217 | 217 | protected function getPostBackOptions() |
218 | 218 | { |
219 | - $options = parent::getPostBackOptions(); |
|
220 | - $options['ID'] = $this->getLabelClientID(); |
|
221 | - $options['TextBoxID'] = $this->getClientID(); |
|
222 | - $options['ExternalControl'] = $this->getExternalControlID(); |
|
223 | - $options['AutoHide'] = $this->getAutoHideTextBox() == false ? '' : true; |
|
224 | - $options['AutoPostBack'] = $this->getAutoPostBack() == false ? '' : true; |
|
225 | - $options['Columns'] = $this->getColumns(); |
|
219 | + $options=parent::getPostBackOptions(); |
|
220 | + $options['ID']=$this->getLabelClientID(); |
|
221 | + $options['TextBoxID']=$this->getClientID(); |
|
222 | + $options['ExternalControl']=$this->getExternalControlID(); |
|
223 | + $options['AutoHide']=$this->getAutoHideTextBox()==false ? '' : true; |
|
224 | + $options['AutoPostBack']=$this->getAutoPostBack()==false ? '' : true; |
|
225 | + $options['Columns']=$this->getColumns(); |
|
226 | 226 | if($this->getTextMode()==='MultiLine') |
227 | 227 | { |
228 | - $options['Rows'] = $this->getRows(); |
|
229 | - $options['Wrap'] = $this->getWrap()== false ? '' : true; |
|
228 | + $options['Rows']=$this->getRows(); |
|
229 | + $options['Wrap']=$this->getWrap()==false ? '' : true; |
|
230 | 230 | } |
231 | 231 | else |
232 | 232 | { |
233 | - $length = $this->getMaxLength(); |
|
234 | - $options['MaxLength'] = $length > 0 ? $length : ''; |
|
233 | + $length=$this->getMaxLength(); |
|
234 | + $options['MaxLength']=$length > 0 ? $length : ''; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | if($this->hasEventHandler('OnLoadingText')) |
238 | - $options['LoadTextOnEdit'] = true; |
|
238 | + $options['LoadTextOnEdit']=true; |
|
239 | 239 | |
240 | 240 | $options['ReadOnly']=$this->getReadOnly(); |
241 | 241 | return $options; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | */ |
249 | 249 | public function onLoadingText($param) |
250 | 250 | { |
251 | - $this->raiseEvent('OnLoadingText',$this,$param); |
|
251 | + $this->raiseEvent('OnLoadingText', $this, $param); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | /** |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | { |
268 | 268 | //calls the TWebControl to avoid rendering other attribute normally render for a textbox. |
269 | 269 | TWebControl::addAttributesToRender($writer); |
270 | - $writer->addAttribute('id',$this->getLabelClientID()); |
|
270 | + $writer->addAttribute('id', $this->getLabelClientID()); |
|
271 | 271 | $this->getActiveControl()->registerCallbackClientScript( |
272 | 272 | $this->getClientClassName(), $this->getPostBackOptions()); |
273 | 273 | } |
@@ -56,7 +56,7 @@ |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
59 | - * @return array list of trigger callback options. |
|
59 | + * @return string list of trigger callback options. |
|
60 | 60 | */ |
61 | 61 | protected function getTriggerOptions() |
62 | 62 | { |
@@ -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 | } |
@@ -252,6 +252,7 @@ discard block |
||
252 | 252 | * method, be sure to call the parent implementation so that the event |
253 | 253 | * handler can be invoked. |
254 | 254 | * @param TCallbackEventParameter event parameter to be passed to the event handlers |
255 | + * @param TJuiAutoCompleteEventParameter $param |
|
255 | 256 | */ |
256 | 257 | public function onSuggest($param) |
257 | 258 | { |
@@ -264,6 +265,7 @@ discard block |
||
264 | 265 | * method, be sure to call the parent implementation so that the event |
265 | 266 | * handler can be invoked. |
266 | 267 | * @param TCallbackEventParameter event parameter to be passed to the event handlers |
268 | + * @param TJuiAutoCompleteEventParameter $param |
|
267 | 269 | */ |
268 | 270 | public function onSuggestionSelected($param) |
269 | 271 | { |
@@ -441,6 +443,7 @@ discard block |
||
441 | 443 | |
442 | 444 | /** |
443 | 445 | * Creates a new TCallbackEventParameter. |
446 | + * @param THttpResponse $response |
|
444 | 447 | */ |
445 | 448 | public function __construct($response, $parameter, $index=-1) |
446 | 449 | { |
@@ -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 |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function getOptions() |
125 | 125 | { |
126 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
126 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
127 | 127 | { |
128 | 128 | $options=new TJuiControlOptions($this); |
129 | 129 | $this->setViewState('JuiOptions', $options); |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public function getMinChars() |
206 | 206 | { |
207 | - return $this->getViewState('minChars',''); |
|
207 | + return $this->getViewState('minChars', ''); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
@@ -228,17 +228,17 @@ discard block |
||
228 | 228 | */ |
229 | 229 | public function raiseCallbackEvent($param) |
230 | 230 | { |
231 | - $token = $param->getCallbackParameter(); |
|
232 | - if(is_array($token) && count($token) == 2) |
|
231 | + $token=$param->getCallbackParameter(); |
|
232 | + if(is_array($token) && count($token)==2) |
|
233 | 233 | { |
234 | - if($token[1] === '__TJuiAutoComplete_onSuggest__') |
|
234 | + if($token[1]==='__TJuiAutoComplete_onSuggest__') |
|
235 | 235 | { |
236 | - $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), $token[0]); |
|
236 | + $parameter=new TJuiAutoCompleteEventParameter($this->getResponse(), $token[0]); |
|
237 | 237 | $this->onSuggest($parameter); |
238 | 238 | } |
239 | - else if($token[1] === '__TJuiAutoComplete_onSuggestionSelected__') |
|
239 | + else if($token[1]==='__TJuiAutoComplete_onSuggestionSelected__') |
|
240 | 240 | { |
241 | - $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), null, $token[0]); |
|
241 | + $parameter=new TJuiAutoCompleteEventParameter($this->getResponse(), null, $token[0]); |
|
242 | 242 | $this->onSuggestionSelected($parameter); |
243 | 243 | } |
244 | 244 | } |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | public function getResultPanel() |
296 | 296 | { |
297 | 297 | if($this->_resultPanel===null) |
298 | - $this->_resultPanel = $this->createResultPanel(); |
|
298 | + $this->_resultPanel=$this->createResultPanel(); |
|
299 | 299 | return $this->_resultPanel; |
300 | 300 | } |
301 | 301 | |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | */ |
305 | 305 | protected function createResultPanel() |
306 | 306 | { |
307 | - $panel = Prado::createComponent('System.Web.UI.WebControls.TPanel'); |
|
307 | + $panel=Prado::createComponent('System.Web.UI.WebControls.TPanel'); |
|
308 | 308 | $this->getControls()->add($panel); |
309 | 309 | $panel->setID('result'); |
310 | 310 | return $panel; |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | public function getSuggestions() |
317 | 317 | { |
318 | 318 | if($this->_repeater===null) |
319 | - $this->_repeater = $this->createRepeater(); |
|
319 | + $this->_repeater=$this->createRepeater(); |
|
320 | 320 | return $this->_repeater; |
321 | 321 | } |
322 | 322 | |
@@ -325,8 +325,8 @@ discard block |
||
325 | 325 | */ |
326 | 326 | protected function createRepeater() |
327 | 327 | { |
328 | - $repeater = Prado::createComponent('System.Web.UI.WebControls.TRepeater'); |
|
329 | - $repeater->setItemTemplate(new TTemplate('<%# $this->Data %>',null)); |
|
328 | + $repeater=Prado::createComponent('System.Web.UI.WebControls.TRepeater'); |
|
329 | + $repeater->setItemTemplate(new TTemplate('<%# $this->Data %>', null)); |
|
330 | 330 | $this->getControls()->add($repeater); |
331 | 331 | return $repeater; |
332 | 332 | } |
@@ -368,12 +368,12 @@ discard block |
||
368 | 368 | { |
369 | 369 | $data=array(); |
370 | 370 | $items=$this->getSuggestions()->getItems(); |
371 | - $writer = new TTextWriter; |
|
372 | - for($i=0; $i<$items->Count; $i++) |
|
371 | + $writer=new TTextWriter; |
|
372 | + for($i=0; $i < $items->Count; $i++) |
|
373 | 373 | { |
374 | 374 | $items->itemAt($i)->render($writer); |
375 | 375 | $item=$writer->flush(); |
376 | - $data[]=array( 'id' => $i, 'label' => $item); |
|
376 | + $data[]=array('id' => $i, 'label' => $item); |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | $this->getResponse()->getAdapter()->setResponseData($data); |
@@ -385,25 +385,25 @@ discard block |
||
385 | 385 | */ |
386 | 386 | protected function getPostBackOptions() |
387 | 387 | { |
388 | - $options = $this->getOptions()->toArray(); |
|
388 | + $options=$this->getOptions()->toArray(); |
|
389 | 389 | |
390 | - if(strlen($separator = $this->getSeparator())) |
|
391 | - $options['Separators'] = $separator; |
|
390 | + if(strlen($separator=$this->getSeparator())) |
|
391 | + $options['Separators']=$separator; |
|
392 | 392 | |
393 | 393 | if($this->getAutoPostBack()) |
394 | 394 | { |
395 | - $options = array_merge($options,parent::getPostBackOptions()); |
|
396 | - $options['AutoPostBack'] = true; |
|
395 | + $options=array_merge($options, parent::getPostBackOptions()); |
|
396 | + $options['AutoPostBack']=true; |
|
397 | 397 | } |
398 | - if(strlen($textCssClass = $this->getTextCssClass())) |
|
399 | - $options['textCssClass'] = $textCssClass; |
|
400 | - $options['minLength'] = $this->getMinChars(); |
|
401 | - $options['delay'] = $this->getFrequency()*1000.0; |
|
402 | - $options['appendTo'] = '#'.$this->getResultPanel()->getClientID(); |
|
403 | - $options['ID'] = $this->getClientID(); |
|
404 | - $options['EventTarget'] = $this->getUniqueID(); |
|
405 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
406 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
398 | + if(strlen($textCssClass=$this->getTextCssClass())) |
|
399 | + $options['textCssClass']=$textCssClass; |
|
400 | + $options['minLength']=$this->getMinChars(); |
|
401 | + $options['delay']=$this->getFrequency() * 1000.0; |
|
402 | + $options['appendTo']='#'.$this->getResultPanel()->getClientID(); |
|
403 | + $options['ID']=$this->getClientID(); |
|
404 | + $options['EventTarget']=$this->getUniqueID(); |
|
405 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
406 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
407 | 407 | return $options; |
408 | 408 | } |
409 | 409 | |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | |
482 | 482 | public function __construct($template) |
483 | 483 | { |
484 | - $this->_template = $template; |
|
484 | + $this->_template=$template; |
|
485 | 485 | } |
486 | 486 | /** |
487 | 487 | * Instantiates the template. |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | /** |
80 | 80 | * Publish the jQuery-ui style Css asset file. |
81 | - * @param file name |
|
81 | + * @param file string |
|
82 | 82 | * @return string Css file url. |
83 | 83 | */ |
84 | 84 | public function publishJuiStyle($file) |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * Gets a control instance named after a returned control id. |
154 | 154 | * Example: if a $param->draggable control id is returned from clientside, |
155 | 155 | * calling $param->DraggableControl will return the control instance |
156 | - * @return mixed control or null if not set. |
|
156 | + * @return null|TControl control or null if not set. |
|
157 | 157 | */ |
158 | 158 | public function __get($name) |
159 | 159 | { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function loadState() { |
98 | 98 | parent::loadState(); |
99 | - $this->getControl()->getOptions()->setControl($this->getControl()); |
|
99 | + $this->getControl()->getOptions()->setControl($this->getControl()); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | } |
@@ -130,10 +130,10 @@ discard block |
||
130 | 130 | class TJuiEventParameter extends TCallbackEventParameter |
131 | 131 | { |
132 | 132 | /** |
133 | - * getControl |
|
134 | - * |
|
135 | - * Compatibility method to get a control from its clientside id |
|
136 | - * @return TControl control, or null if not found |
|
133 | + * getControl |
|
134 | + * |
|
135 | + * Compatibility method to get a control from its clientside id |
|
136 | + * @return TControl control, or null if not found |
|
137 | 137 | */ |
138 | 138 | public function getControl($id) |
139 | 139 | { |
@@ -184,9 +184,9 @@ discard block |
||
184 | 184 | */ |
185 | 185 | protected function addStatesToTrack() |
186 | 186 | { |
187 | - parent::addStatesToTrack(); |
|
188 | - $states = $this->getStatesToTrack(); |
|
189 | - $states['JuiOptions'] = array('TMapCollectionDiff', array($this, 'updateJuiOptions')); |
|
187 | + parent::addStatesToTrack(); |
|
188 | + $states = $this->getStatesToTrack(); |
|
189 | + $states['JuiOptions'] = array('TMapCollectionDiff', array($this, 'updateJuiOptions')); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | */ |
196 | 196 | protected function updateJuiOptions($options) |
197 | 197 | { |
198 | - foreach ($options as $key => $value) $options[$key] = $key . ': ' . (is_string($value) ? "'{$value}'" : TPropertyValue::ensureString($value)); |
|
199 | - $code = "jQuery('#{$this->_control->getWidgetID()}').{$this->_control->getWidget()}('option', { " . implode(', ', $options) . " });"; |
|
200 | - $this->_control->getPage()->getClientScript()->registerEndScript(sprintf('%08X', crc32($code)), $code); |
|
198 | + foreach ($options as $key => $value) $options[$key] = $key . ': ' . (is_string($value) ? "'{$value}'" : TPropertyValue::ensureString($value)); |
|
199 | + $code = "jQuery('#{$this->_control->getWidgetID()}').{$this->_control->getWidget()}('option', { " . implode(', ', $options) . " });"; |
|
200 | + $this->_control->getPage()->getClientScript()->registerEndScript(sprintf('%08X', crc32($code)), $code); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | } |
204 | 204 | \ No newline at end of file |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | */ |
26 | 26 | class TJuiControlAdapter extends TActiveControlAdapter |
27 | 27 | { |
28 | - const SCRIPT_PATH = 'jquery'; |
|
29 | - const CSS_PATH = 'css'; |
|
30 | - const BASE_CSS_FILENAME ='jquery-ui.css'; |
|
28 | + const SCRIPT_PATH='jquery'; |
|
29 | + const CSS_PATH='css'; |
|
30 | + const BASE_CSS_FILENAME='jquery-ui.css'; |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Replace default StateTracker with {@link TJuiCallbackPageStateTracker} for |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | protected function getAssetUrl($file='') |
74 | 74 | { |
75 | - $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
75 | + $base=$this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
76 | 76 | return $base.'/'.self::SCRIPT_PATH.'/'.$file; |
77 | 77 | } |
78 | 78 | |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function publishJuiStyle($file) |
85 | 85 | { |
86 | - $url = $this->getAssetUrl(self::CSS_PATH.'/'.$this->getJuiBaseStyle().'/'.$file); |
|
87 | - $cs = $this->getPage()->getClientScript(); |
|
86 | + $url=$this->getAssetUrl(self::CSS_PATH.'/'.$this->getJuiBaseStyle().'/'.$file); |
|
87 | + $cs=$this->getPage()->getClientScript(); |
|
88 | 88 | if(!$cs->isStyleSheetFileRegistered($url)) |
89 | 89 | $cs->registerStyleSheetFile($url, $url); |
90 | 90 | return $url; |
@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | { |
140 | 140 | $control=null; |
141 | 141 | $service=prado::getApplication()->getService(); |
142 | - if ($service instanceof TPageService) |
|
142 | + if($service instanceof TPageService) |
|
143 | 143 | { |
144 | 144 | // Find the control |
145 | 145 | // Warning, this will not work if you have a '_' in your control Id ! |
146 | - $controlId=str_replace(TControl::CLIENT_ID_SEPARATOR,TControl::ID_SEPARATOR,$id); |
|
146 | + $controlId=str_replace(TControl::CLIENT_ID_SEPARATOR, TControl::ID_SEPARATOR, $id); |
|
147 | 147 | $control=$service->getRequestedPage()->findControl($controlId); |
148 | 148 | } |
149 | 149 | return $control; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function __get($name) |
159 | 159 | { |
160 | - $pos=strpos($name, 'Control',1); |
|
160 | + $pos=strpos($name, 'Control', 1); |
|
161 | 161 | $name=strtolower(substr($name, 0, $pos)); |
162 | 162 | |
163 | 163 | $cp=$this->getCallbackParameter(); |
@@ -185,8 +185,8 @@ discard block |
||
185 | 185 | protected function addStatesToTrack() |
186 | 186 | { |
187 | 187 | parent::addStatesToTrack(); |
188 | - $states = $this->getStatesToTrack(); |
|
189 | - $states['JuiOptions'] = array('TMapCollectionDiff', array($this, 'updateJuiOptions')); |
|
188 | + $states=$this->getStatesToTrack(); |
|
189 | + $states['JuiOptions']=array('TMapCollectionDiff', array($this, 'updateJuiOptions')); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | */ |
196 | 196 | protected function updateJuiOptions($options) |
197 | 197 | { |
198 | - foreach ($options as $key => $value) $options[$key] = $key . ': ' . (is_string($value) ? "'{$value}'" : TPropertyValue::ensureString($value)); |
|
199 | - $code = "jQuery('#{$this->_control->getWidgetID()}').{$this->_control->getWidget()}('option', { " . implode(', ', $options) . " });"; |
|
198 | + foreach($options as $key => $value) $options[$key]=$key.': '.(is_string($value) ? "'{$value}'" : TPropertyValue::ensureString($value)); |
|
199 | + $code="jQuery('#{$this->_control->getWidgetID()}').{$this->_control->getWidget()}('option', { ".implode(', ', $options)." });"; |
|
200 | 200 | $this->_control->getPage()->getClientScript()->registerEndScript(sprintf('%08X', crc32($code)), $code); |
201 | 201 | } |
202 | 202 |
@@ -21,9 +21,24 @@ discard block |
||
21 | 21 | */ |
22 | 22 | interface IJuiOptions |
23 | 23 | { |
24 | + /** |
|
25 | + * @return string |
|
26 | + */ |
|
24 | 27 | public function getWidget(); |
28 | + |
|
29 | + /** |
|
30 | + * @return string |
|
31 | + */ |
|
25 | 32 | public function getWidgetID(); |
33 | + |
|
34 | + /** |
|
35 | + * @return TJuiControlOptions |
|
36 | + */ |
|
26 | 37 | public function getOptions(); |
38 | + |
|
39 | + /** |
|
40 | + * @return string[] |
|
41 | + */ |
|
27 | 42 | public function getValidOptions(); |
28 | 43 | public function getValidEvents(); |
29 | 44 | } |
@@ -139,7 +154,7 @@ discard block |
||
139 | 154 | |
140 | 155 | /** |
141 | 156 | * Only serialize the options itself, not the corresponding parent control. |
142 | - * @return mixed array with the names of all variables of that object that should be serialized. |
|
157 | + * @return string[] array with the names of all variables of that object that should be serialized. |
|
143 | 158 | */ |
144 | 159 | public function __sleep() { |
145 | 160 | return array('_options'); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function __construct($control) |
63 | 63 | { |
64 | - $this->setControl($control); |
|
64 | + $this->setControl($control); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | public function setControl($control) |
73 | 73 | { |
74 | 74 | if(!$control instanceof IJuiOptions) |
75 | - throw new THttpException(500,'juioptions_control_invalid',$control->ID); |
|
75 | + throw new THttpException(500,'juioptions_control_invalid',$control->ID); |
|
76 | 76 | $this->_control=$control; |
77 | 77 | } |
78 | 78 |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | public function setControl($control) |
73 | 73 | { |
74 | 74 | if(!$control instanceof IJuiOptions) |
75 | - throw new THttpException(500,'juioptions_control_invalid',$control->ID); |
|
75 | + throw new THttpException(500, 'juioptions_control_invalid', $control->ID); |
|
76 | 76 | $this->_control=$control; |
77 | 77 | } |
78 | 78 | |
@@ -83,36 +83,36 @@ discard block |
||
83 | 83 | * @param mixed option value. |
84 | 84 | * @throws THttpException |
85 | 85 | */ |
86 | - public function __set($name,$value) |
|
86 | + public function __set($name, $value) |
|
87 | 87 | { |
88 | 88 | if($this->_options===null) |
89 | 89 | $this->_options=array(); |
90 | 90 | |
91 | 91 | foreach($this->_control->getValidOptions() as $option) |
92 | 92 | { |
93 | - if(0 == strcasecmp($name, $option)) |
|
93 | + if(0==strcasecmp($name, $option)) |
|
94 | 94 | { |
95 | - $low = strtolower($value); |
|
96 | - if($low === 'null') |
|
95 | + $low=strtolower($value); |
|
96 | + if($low==='null') |
|
97 | 97 | { |
98 | - $this->_options[$option] = null; |
|
99 | - } elseif($low === 'true') { |
|
100 | - $this->_options[$option] = true; |
|
101 | - } elseif($low === 'false') { |
|
102 | - $this->_options[$option] = false; |
|
98 | + $this->_options[$option]=null; |
|
99 | + } elseif($low==='true') { |
|
100 | + $this->_options[$option]=true; |
|
101 | + } elseif($low==='false') { |
|
102 | + $this->_options[$option]=false; |
|
103 | 103 | } elseif(is_numeric($value)) { |
104 | 104 | // trick to get float or integer automatically when needed |
105 | - $this->_options[$option] = $value + 0; |
|
106 | - } elseif(substr($low,0,8)=='function') { |
|
107 | - $this->_options[$option] = new TJavaScriptLiteral($value); |
|
105 | + $this->_options[$option]=$value + 0; |
|
106 | + } elseif(substr($low, 0, 8)=='function') { |
|
107 | + $this->_options[$option]=new TJavaScriptLiteral($value); |
|
108 | 108 | } else { |
109 | - $this->_options[$option] = $value; |
|
109 | + $this->_options[$option]=$value; |
|
110 | 110 | } |
111 | 111 | return; |
112 | 112 | } |
113 | 113 | } |
114 | 114 | |
115 | - throw new TConfigurationException('juioptions_option_invalid',$this->_control->ID, $name); |
|
115 | + throw new TConfigurationException('juioptions_option_invalid', $this->_control->ID, $name); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | foreach($this->_control->getValidOptions() as $option) |
130 | 130 | { |
131 | - if(0 == strcasecmp($name, $option) && isset($this->_options[$option])) |
|
131 | + if(0==strcasecmp($name, $option) && isset($this->_options[$option])) |
|
132 | 132 | { |
133 | 133 | return $this->_options[$option]; |
134 | 134 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function toArray() |
152 | 152 | { |
153 | - $ret= ($this->_options===null) ? array() : $this->_options; |
|
153 | + $ret=($this->_options===null) ? array() : $this->_options; |
|
154 | 154 | |
155 | 155 | foreach($this->_control->getValidEvents() as $event) |
156 | 156 | if($this->_control->hasEventHandler('on'.$event)) |
@@ -168,10 +168,10 @@ discard block |
||
168 | 168 | $callbackParam=$param->CallbackParameter; |
169 | 169 | if(isset($callbackParam->event)) |
170 | 170 | { |
171 | - $eventName = 'On'.ucfirst($callbackParam->event); |
|
171 | + $eventName='On'.ucfirst($callbackParam->event); |
|
172 | 172 | if($this->_control->hasEventHandler($eventName)) |
173 | 173 | { |
174 | - $this->_control->$eventName( new TJuiEventParameter( |
|
174 | + $this->_control->$eventName(new TJuiEventParameter( |
|
175 | 175 | $this->_control->getResponse(), |
176 | 176 | isset($callbackParam->ui) ? $callbackParam->ui : null) |
177 | 177 | ); |
@@ -158,6 +158,9 @@ |
||
158 | 158 | $this->triggerClientMethod('close'); |
159 | 159 | } |
160 | 160 | |
161 | + /** |
|
162 | + * @param string $method |
|
163 | + */ |
|
161 | 164 | private function triggerClientMethod($method) |
162 | 165 | { |
163 | 166 | $cs = $this->getPage()->getClientScript(); |
@@ -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 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function getOptions() |
70 | 70 | { |
71 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
71 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
72 | 72 | { |
73 | 73 | $options=new TJuiControlOptions($this); |
74 | 74 | $this->setViewState('JuiOptions', $options); |
@@ -99,14 +99,14 @@ discard block |
||
99 | 99 | */ |
100 | 100 | protected function getPostBackOptions() |
101 | 101 | { |
102 | - $options = $this->getOptions()->toArray(); |
|
102 | + $options=$this->getOptions()->toArray(); |
|
103 | 103 | // always make the dialog a child of the form, or its inner inputs won't be collected |
104 | 104 | if(!isset($options['appendTo'])) |
105 | - $options['appendTo'] = 'form:first'; |
|
105 | + $options['appendTo']='form:first'; |
|
106 | 106 | |
107 | 107 | foreach($this->getControls() as $control) |
108 | 108 | if($control instanceof TJuiDialogButton) |
109 | - $options['buttons'][] = $control->getPostBackOptions(); |
|
109 | + $options['buttons'][]=$control->getPostBackOptions(); |
|
110 | 110 | |
111 | 111 | return $options; |
112 | 112 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | { |
120 | 120 | parent::addAttributesToRender($writer); |
121 | 121 | |
122 | - $writer->addAttribute('id',$this->getClientID()); |
|
122 | + $writer->addAttribute('id', $this->getClientID()); |
|
123 | 123 | $options=TJavascript::encode($this->getPostBackOptions()); |
124 | 124 | $cs=$this->getPage()->getClientScript(); |
125 | 125 | $code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");"; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * Raises the OnCreate event |
141 | 141 | * @param object $params event parameters |
142 | 142 | */ |
143 | - public function onOpen ($params) |
|
143 | + public function onOpen($params) |
|
144 | 144 | { |
145 | 145 | $this->raiseEvent('OnOpen', $this, $params); |
146 | 146 | } |
@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | |
164 | 164 | private function triggerClientMethod($method) |
165 | 165 | { |
166 | - $cs = $this->getPage()->getClientScript(); |
|
167 | - $code = "jQuery(document).ready(function() { jQuery('#".$this->getClientId()."').dialog('".$method."'); })"; |
|
166 | + $cs=$this->getPage()->getClientScript(); |
|
167 | + $code="jQuery(document).ready(function() { jQuery('#".$this->getClientId()."').dialog('".$method."'); })"; |
|
168 | 168 | $cs->registerEndScript(sprintf('%08X', crc32($code)), $code); |
169 | 169 | } |
170 | 170 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | return array( |
245 | 245 | 'text' => $this->getText(), |
246 | 246 | 'click' => new TJavaScriptLiteral("function(){new Prado.Callback('".$this->getUniqueID()."', 'onClick');}" |
247 | - )) ; |
|
247 | + )); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | */ |
253 | 253 | public function getText() |
254 | 254 | { |
255 | - return $this->getViewState('Text',''); |
|
255 | + return $this->getViewState('Text', ''); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | /** |
@@ -260,14 +260,14 @@ discard block |
||
260 | 260 | */ |
261 | 261 | public function setText($value) |
262 | 262 | { |
263 | - $this->setViewState('Text',$value,''); |
|
263 | + $this->setViewState('Text', $value, ''); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | /** |
267 | 267 | * Raises the OnClick event |
268 | 268 | * @param object $params event parameters |
269 | 269 | */ |
270 | - public function onClick ($params) |
|
270 | + public function onClick($params) |
|
271 | 271 | { |
272 | 272 | $this->raiseEvent('OnClick', $this, $params); |
273 | 273 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | */ |
280 | 280 | public function raiseCallbackEvent($param) |
281 | 281 | { |
282 | - if($param->CallbackParameter === 'onClick') |
|
282 | + if($param->CallbackParameter==='onClick') |
|
283 | 283 | $this->onClick($param); |
284 | 284 | } |
285 | 285 |