@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | if($cache===null || !($cache instanceof ICache)) |
111 | 111 | { |
112 | 112 | if($this->_cacheModuleID!=='') |
113 | - throw new TConfigurationException('cachepagestatepersister_cachemoduleid_invalid',$this->_cacheModuleID); |
|
113 | + throw new TConfigurationException('cachepagestatepersister_cachemoduleid_invalid', $this->_cacheModuleID); |
|
114 | 114 | else |
115 | 115 | throw new TConfigurationException('cachepagestatepersister_cache_required'); |
116 | 116 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function setCacheTimeout($value) |
135 | 135 | { |
136 | - if(($value=TPropertyValue::ensureInteger($value))>=0) |
|
136 | + if(($value=TPropertyValue::ensureInteger($value)) >= 0) |
|
137 | 137 | $this->_timeout=$value; |
138 | 138 | else |
139 | 139 | throw new TInvalidDataValueException('cachepagestatepersister_timeout_invalid'); |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | */ |
174 | 174 | public function save($data) |
175 | 175 | { |
176 | - $timestamp=(string)microtime(true); |
|
176 | + $timestamp=(string) microtime(true); |
|
177 | 177 | $key=$this->calculateKey($timestamp); |
178 | - $this->getCache()->add($key,$data,$this->_timeout); |
|
179 | - $this->_page->setClientState(TPageStateFormatter::serialize($this->_page,$timestamp)); |
|
178 | + $this->getCache()->add($key, $data, $this->_timeout); |
|
179 | + $this->_page->setClientState(TPageStateFormatter::serialize($this->_page, $timestamp)); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -186,13 +186,13 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function load() |
188 | 188 | { |
189 | - if(($timestamp=TPageStateFormatter::unserialize($this->_page,$this->_page->getRequestClientState()))!==null) |
|
189 | + if(($timestamp=TPageStateFormatter::unserialize($this->_page, $this->_page->getRequestClientState()))!==null) |
|
190 | 190 | { |
191 | 191 | $key=$this->calculateKey($timestamp); |
192 | 192 | if(($data=$this->getCache()->get($key))!==false) |
193 | 193 | return $data; |
194 | 194 | } |
195 | - throw new THttpException(400,'cachepagestatepersister_pagestate_corrupted'); |
|
195 | + throw new THttpException(400, 'cachepagestatepersister_pagestate_corrupted'); |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 |
@@ -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 |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function setDecayRate($value) |
81 | 81 | { |
82 | - $decay = TPropertyValue::ensureFloat($value); |
|
82 | + $decay=TPropertyValue::ensureFloat($value); |
|
83 | 83 | if($decay < 0) |
84 | 84 | throw new TConfigurationException('callback_decay_be_not_negative', $this->getID()); |
85 | 85 | $this->setViewState('Decay', $decay); |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | */ |
91 | 91 | protected function getTriggerOptions() |
92 | 92 | { |
93 | - $options = parent::getTriggerOptions(); |
|
94 | - $options['PropertyName'] = $this->getPropertyName(); |
|
95 | - $options['Interval'] = $this->getInterval(); |
|
96 | - $options['Decay'] = $this->getDecayRate(); |
|
93 | + $options=parent::getTriggerOptions(); |
|
94 | + $options['PropertyName']=$this->getPropertyName(); |
|
95 | + $options['Interval']=$this->getInterval(); |
|
96 | + $options['Decay']=$this->getDecayRate(); |
|
97 | 97 | return $options; |
98 | 98 | } |
99 | 99 |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected function renderCustomScriptFile($writer) |
43 | 43 | { |
44 | - if(($scriptUrl = $this->getScriptUrl())!=='') |
|
44 | + if(($scriptUrl=$this->getScriptUrl())!=='') |
|
45 | 45 | { |
46 | 46 | if($this->getPage()->getIsCallback()) |
47 | 47 | { |
48 | - $cs = $this->getPage()->getClientScript(); |
|
48 | + $cs=$this->getPage()->getClientScript(); |
|
49 | 49 | $uniqueid=$this->ClientID.'_custom'; |
50 | 50 | if(!$cs->isScriptFileRegistered($uniqueid)) |
51 | 51 | $cs->registerScriptFile($uniqueid, $scriptUrl); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | if($this->getPage()->getIsCallback()) |
67 | 67 | { |
68 | - $extWriter= $this->getPage()->getResponse()->createHtmlWriter(); |
|
68 | + $extWriter=$this->getPage()->getResponse()->createHtmlWriter(); |
|
69 | 69 | $extWriter->write("/*<![CDATA[*/\n"); |
70 | 70 | $this->renderChildren($extWriter); |
71 | 71 | $extWriter->write("\n/*]]>*/"); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | parent::setDataSource($value); |
58 | 58 | if($this->getActiveControl()->canUpdateClientSide()) { |
59 | 59 | $this->renderPager(); |
60 | - $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); |
|
60 | + $this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter()); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | public function render($writer) { |
95 | 95 | if($this->getHasPreRendered()) { |
96 | 96 | $this->renderRepeater($writer); |
97 | - if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(),$writer); |
|
97 | + if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(), $writer); |
|
98 | 98 | } |
99 | 99 | else { |
100 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
100 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | foreach($pager as $item) { |
112 | 112 | if($item->ControlToPaginate==$this->ID) { |
113 | 113 | $writer=$this->getResponse()->createHtmlWriter(); |
114 | - $this->getPage()->getAdapter()->registerControlToRender($item,$writer); |
|
114 | + $this->getPage()->getAdapter()->registerControlToRender($item, $writer); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * @param THtmlWriter writer for the rendering purpose |
124 | 124 | */ |
125 | 125 | private function renderRepeater($writer) { |
126 | - $writer->addAttribute('id',$this->getSurroundingTagID()); |
|
126 | + $writer->addAttribute('id', $this->getSurroundingTagID()); |
|
127 | 127 | $writer->renderBeginTag($this->getSurroundingTag()); |
128 | 128 | parent::render($writer); |
129 | 129 | $writer->renderEndTag(); |
@@ -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 | } |
@@ -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 | } |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | */ |
265 | 265 | public function setEnablePageStateUpdate($value) |
266 | 266 | { |
267 | - $enabled = TPropertyValue::ensureBoolean($value); |
|
267 | + $enabled=TPropertyValue::ensureBoolean($value); |
|
268 | 268 | $this->setOption('EnablePageStateUpdate', $enabled); |
269 | 269 | } |
270 | 270 | |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | */ |
275 | 275 | public function getEnablePageStateUpdate() |
276 | 276 | { |
277 | - $option = $this->getOption('EnablePageStateUpdate'); |
|
277 | + $option=$this->getOption('EnablePageStateUpdate'); |
|
278 | 278 | return ($option===null) ? true : $option; |
279 | 279 | } |
280 | 280 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | public function setPostBackTarget($value) |
293 | 293 | { |
294 | 294 | if($value instanceof TControl) |
295 | - $value = $value->getUniqueID(); |
|
295 | + $value=$value->getUniqueID(); |
|
296 | 296 | $this->setOption('EventTarget', $value); |
297 | 297 | } |
298 | 298 |