@@ -69,11 +69,9 @@ |
||
69 | 69 | $this->_forControl=$control->getClientID(); |
70 | 70 | parent::render($writer); |
71 | 71 | } |
72 | - } |
|
73 | - else |
|
72 | + } else |
|
74 | 73 | throw new TInvalidDataValueException('label_associatedcontrol_invalid',$aid); |
75 | - } |
|
76 | - else |
|
74 | + } else |
|
77 | 75 | parent::render($writer); |
78 | 76 | } |
79 | 77 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | protected function getTagName() |
39 | 39 | { |
40 | - return ($this->getForControl()==='')?'span':'label'; |
|
40 | + return ($this->getForControl()==='') ? 'span' : 'label'; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | protected function addAttributesToRender($writer) |
49 | 49 | { |
50 | 50 | if($this->_forControl!=='') |
51 | - $writer->addAttribute('for',$this->_forControl); |
|
51 | + $writer->addAttribute('for', $this->_forControl); |
|
52 | 52 | parent::addAttributesToRender($writer); |
53 | 53 | } |
54 | 54 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | } |
73 | 73 | else |
74 | - throw new TInvalidDataValueException('label_associatedcontrol_invalid',$aid); |
|
74 | + throw new TInvalidDataValueException('label_associatedcontrol_invalid', $aid); |
|
75 | 75 | } |
76 | 76 | else |
77 | 77 | parent::render($writer); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function getText() |
96 | 96 | { |
97 | - return $this->getViewState('Text',''); |
|
97 | + return $this->getViewState('Text', ''); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function setText($value) |
104 | 104 | { |
105 | - $this->setViewState('Text',TPropertyValue::ensureString($value),''); |
|
105 | + $this->setViewState('Text', TPropertyValue::ensureString($value), ''); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function getForControl() |
138 | 138 | { |
139 | - return $this->getViewState('ForControl',''); |
|
139 | + return $this->getViewState('ForControl', ''); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function setForControl($value) |
148 | 148 | { |
149 | - $this->setViewState('ForControl',$value,''); |
|
149 | + $this->setViewState('ForControl', $value, ''); |
|
150 | 150 | } |
151 | 151 | } |
152 | 152 |
@@ -270,8 +270,7 @@ discard block |
||
270 | 270 | $cell->getControls()->add($listControl); |
271 | 271 | $cell->registerObject('DropDownList',$listControl); |
272 | 272 | $control=$listControl; |
273 | - } |
|
274 | - else |
|
273 | + } else |
|
275 | 274 | $control=$cell; |
276 | 275 | $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
277 | 276 | break; |
@@ -307,8 +306,7 @@ discard block |
||
307 | 306 | $value=$text; |
308 | 307 | $formatString=$this->getDataTextFormatString(); |
309 | 308 | $text=$this->formatDataValue($formatString,$text); |
310 | - } |
|
311 | - else |
|
309 | + } else |
|
312 | 310 | $text=$value; |
313 | 311 | if($sender instanceof TTableCell) |
314 | 312 | $sender->setText($text); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | parent::loadState($state); |
78 | 78 | $this->_stateLoaded=true; |
79 | 79 | if(!$this->_dataBound) |
80 | - $this->_listControl->getItems()->loadState($this->getViewState('Items',null)); |
|
80 | + $this->_listControl->getItems()->loadState($this->getViewState('Items', null)); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function saveState() |
88 | 88 | { |
89 | - $this->setViewState('Items',$this->_listControl->getItems()->saveState(),null); |
|
89 | + $this->setViewState('Items', $this->_listControl->getItems()->saveState(), null); |
|
90 | 90 | return parent::saveState(); |
91 | 91 | } |
92 | 92 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function getDataTextField() |
113 | 113 | { |
114 | - return $this->getViewState('DataTextField',''); |
|
114 | + return $this->getViewState('DataTextField', ''); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function setDataTextField($value) |
124 | 124 | { |
125 | - $this->setViewState('DataTextField',$value,''); |
|
125 | + $this->setViewState('DataTextField', $value, ''); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function getDataTextFormatString() |
132 | 132 | { |
133 | - return $this->getViewState('DataTextFormatString',''); |
|
133 | + return $this->getViewState('DataTextFormatString', ''); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function setDataTextFormatString($value) |
140 | 140 | { |
141 | - $this->setViewState('DataTextFormatString',$value,''); |
|
141 | + $this->setViewState('DataTextFormatString', $value, ''); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function getDataValueField() |
148 | 148 | { |
149 | - return $this->getViewState('DataValueField',''); |
|
149 | + return $this->getViewState('DataValueField', ''); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function setDataValueField($value) |
159 | 159 | { |
160 | - $this->setViewState('DataValueField',$value,''); |
|
160 | + $this->setViewState('DataValueField', $value, ''); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public function getReadOnly() |
167 | 167 | { |
168 | - return $this->getViewState('ReadOnly',false); |
|
168 | + return $this->getViewState('ReadOnly', false); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | */ |
174 | 174 | public function setReadOnly($value) |
175 | 175 | { |
176 | - $this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false); |
|
176 | + $this->setViewState('ReadOnly', TPropertyValue::ensureBoolean($value), false); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | */ |
198 | 198 | public function getListValueField() |
199 | 199 | { |
200 | - return $this->getViewState('ListValueField',''); |
|
200 | + return $this->getViewState('ListValueField', ''); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | /** |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | public function setListValueField($value) |
207 | 207 | { |
208 | - $this->setViewState('ListValueField',$value,''); |
|
208 | + $this->setViewState('ListValueField', $value, ''); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function getListTextField() |
215 | 215 | { |
216 | - return $this->getViewState('ListTextField',''); |
|
216 | + return $this->getViewState('ListTextField', ''); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function setListTextField($value) |
223 | 223 | { |
224 | - $this->setViewState('ListTextField',$value,''); |
|
224 | + $this->setViewState('ListTextField', $value, ''); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | */ |
230 | 230 | public function getListTextFormatString() |
231 | 231 | { |
232 | - return $this->getViewState('ListTextFormatString',''); |
|
232 | + return $this->getViewState('ListTextFormatString', ''); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | /** |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function setListTextFormatString($value) |
239 | 239 | { |
240 | - $this->setViewState('ListTextFormatString',$value,''); |
|
240 | + $this->setViewState('ListTextFormatString', $value, ''); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | * @param integer the index to the Columns property that the cell resides in. |
252 | 252 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
253 | 253 | */ |
254 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
254 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
255 | 255 | { |
256 | 256 | if(!$this->_dataBound && $this->_listControl->getDataSource()!==null) |
257 | 257 | { |
@@ -268,21 +268,21 @@ discard block |
||
268 | 268 | { |
269 | 269 | $listControl=clone $this->_listControl; |
270 | 270 | $cell->getControls()->add($listControl); |
271 | - $cell->registerObject('DropDownList',$listControl); |
|
271 | + $cell->registerObject('DropDownList', $listControl); |
|
272 | 272 | $control=$listControl; |
273 | 273 | } |
274 | 274 | else |
275 | 275 | $control=$cell; |
276 | - $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
276 | + $control->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
277 | 277 | break; |
278 | 278 | case TListItemType::Item: |
279 | 279 | case TListItemType::AlternatingItem: |
280 | 280 | case TListItemType::SelectedItem: |
281 | 281 | if($this->getDataTextField()!=='' || $this->getDataValueField()!=='') |
282 | - $cell->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
282 | + $cell->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
283 | 283 | break; |
284 | 284 | default: |
285 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
285 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
286 | 286 | break; |
287 | 287 | } |
288 | 288 | } |
@@ -292,21 +292,21 @@ discard block |
||
292 | 292 | * This method is invoked when datagrid performs databinding. |
293 | 293 | * It populates the content of the cell with the relevant data from data source. |
294 | 294 | */ |
295 | - public function dataBindColumn($sender,$param) |
|
295 | + public function dataBindColumn($sender, $param) |
|
296 | 296 | { |
297 | 297 | $item=$sender->getNamingContainer(); |
298 | 298 | $data=$item->getData(); |
299 | 299 | if(($valueField=$this->getDataValueField())!=='') |
300 | - $value=$this->getDataFieldValue($data,$valueField); |
|
300 | + $value=$this->getDataFieldValue($data, $valueField); |
|
301 | 301 | else |
302 | 302 | $value=''; |
303 | 303 | if(($textField=$this->getDataTextField())!=='') |
304 | 304 | { |
305 | - $text=$this->getDataFieldValue($data,$textField); |
|
305 | + $text=$this->getDataFieldValue($data, $textField); |
|
306 | 306 | if($valueField==='') |
307 | 307 | $value=$text; |
308 | 308 | $formatString=$this->getDataTextFormatString(); |
309 | - $text=$this->formatDataValue($formatString,$text); |
|
309 | + $text=$this->formatDataValue($formatString, $text); |
|
310 | 310 | } |
311 | 311 | else |
312 | 312 | $text=$value; |
@@ -98,8 +98,7 @@ |
||
98 | 98 | { |
99 | 99 | $this->renderLinkButtonHref($writer); |
100 | 100 | $this->renderClientControlScript($writer); |
101 | - } |
|
102 | - else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
101 | + } else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
103 | 102 | $writer->addAttribute('disabled','disabled'); |
104 | 103 | } |
105 | 104 |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function getEnableClientScript() |
72 | 72 | { |
73 | - return $this->getViewState('EnableClientScript',true); |
|
73 | + return $this->getViewState('EnableClientScript', true); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function setEnableClientScript($value) |
80 | 80 | { |
81 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
81 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $page=$this->getPage(); |
92 | 92 | $page->ensureRenderInForm($this); |
93 | 93 | |
94 | - $writer->addAttribute('id',$this->getClientID()); |
|
94 | + $writer->addAttribute('id', $this->getClientID()); |
|
95 | 95 | |
96 | 96 | // We call parent implementation here because some attributes |
97 | 97 | // may be overwritten in the following |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $this->renderClientControlScript($writer); |
104 | 104 | } |
105 | 105 | else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
106 | - $writer->addAttribute('disabled','disabled'); |
|
106 | + $writer->addAttribute('disabled', 'disabled'); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | */ |
113 | 113 | protected function renderClientControlScript($writer) |
114 | 114 | { |
115 | - $cs = $this->getPage()->getClientScript(); |
|
116 | - $cs->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions()); |
|
115 | + $cs=$this->getPage()->getClientScript(); |
|
116 | + $cs->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions()); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function setIsDefaultButton($value) |
123 | 123 | { |
124 | - $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value),false); |
|
124 | + $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value), false); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | protected function renderLinkButtonHref($writer) |
140 | 140 | { |
141 | 141 | //create unique no-op url references |
142 | - $nop = "javascript:;//".$this->getClientID(); |
|
142 | + $nop="javascript:;//".$this->getClientID(); |
|
143 | 143 | $writer->addAttribute('href', $nop); |
144 | 144 | } |
145 | 145 | |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | */ |
161 | 161 | protected function getPostBackOptions() |
162 | 162 | { |
163 | - $options['ID'] = $this->getClientID(); |
|
164 | - $options['EventTarget'] = $this->getUniqueID(); |
|
165 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
166 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
167 | - $options['StopEvent'] = true; |
|
163 | + $options['ID']=$this->getClientID(); |
|
164 | + $options['EventTarget']=$this->getUniqueID(); |
|
165 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
166 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
167 | + $options['StopEvent']=true; |
|
168 | 168 | |
169 | 169 | return $options; |
170 | 170 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public function getText() |
190 | 190 | { |
191 | - return $this->getViewState('Text',''); |
|
191 | + return $this->getViewState('Text', ''); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | /** |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public function setText($value) |
198 | 198 | { |
199 | - $this->setViewState('Text',$value,''); |
|
199 | + $this->setViewState('Text', $value, ''); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | /** |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | */ |
231 | 231 | public function getCommandName() |
232 | 232 | { |
233 | - return $this->getViewState('CommandName',''); |
|
233 | + return $this->getViewState('CommandName', ''); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | /** |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | */ |
239 | 239 | public function setCommandName($value) |
240 | 240 | { |
241 | - $this->setViewState('CommandName',$value,''); |
|
241 | + $this->setViewState('CommandName', $value, ''); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | public function getCommandParameter() |
248 | 248 | { |
249 | - return $this->getViewState('CommandParameter',''); |
|
249 | + return $this->getViewState('CommandParameter', ''); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | */ |
255 | 255 | public function setCommandParameter($value) |
256 | 256 | { |
257 | - $this->setViewState('CommandParameter',$value,''); |
|
257 | + $this->setViewState('CommandParameter', $value, ''); |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | public function getCausesValidation() |
264 | 264 | { |
265 | - return $this->getViewState('CausesValidation',true); |
|
265 | + return $this->getViewState('CausesValidation', true); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | */ |
272 | 272 | public function setCausesValidation($value) |
273 | 273 | { |
274 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
274 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | /** |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | */ |
280 | 280 | public function getValidationGroup() |
281 | 281 | { |
282 | - return $this->getViewState('ValidationGroup',''); |
|
282 | + return $this->getViewState('ValidationGroup', ''); |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | /** |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | */ |
288 | 288 | public function setValidationGroup($value) |
289 | 289 | { |
290 | - $this->setViewState('ValidationGroup',$value,''); |
|
290 | + $this->setViewState('ValidationGroup', $value, ''); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | /** |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | if($this->getCausesValidation()) |
305 | 305 | $this->getPage()->validate($this->getValidationGroup()); |
306 | 306 | $this->onClick(null); |
307 | - $this->onCommand(new \Prado\Web\UI\TCommandEventParameter($this->getCommandName(),$this->getCommandParameter())); |
|
307 | + $this->onCommand(new \Prado\Web\UI\TCommandEventParameter($this->getCommandName(), $this->getCommandParameter())); |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | /** |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | */ |
317 | 317 | public function onClick($param) |
318 | 318 | { |
319 | - $this->raiseEvent('OnClick',$this,$param); |
|
319 | + $this->raiseEvent('OnClick', $this, $param); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | /** |
@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | */ |
329 | 329 | public function onCommand($param) |
330 | 330 | { |
331 | - $this->raiseEvent('OnCommand',$this,$param); |
|
332 | - $this->raiseBubbleEvent($this,$param); |
|
331 | + $this->raiseEvent('OnCommand', $this, $param); |
|
332 | + $this->raiseBubbleEvent($this, $param); |
|
333 | 333 | } |
334 | 334 | } |
335 | 335 |
@@ -325,6 +325,7 @@ |
||
325 | 325 | * If you override this method, be sure to call the parent implementation |
326 | 326 | * so that the event handlers can be invoked. |
327 | 327 | * @param \Prado\Web\UI\TCommandEventParameter event parameter to be passed to the event handlers |
328 | + * @param \Prado\Web\UI\TCommandEventParameter $param |
|
328 | 329 | */ |
329 | 330 | public function onCommand($param) |
330 | 331 | { |
@@ -84,8 +84,7 @@ discard block |
||
84 | 84 | { |
85 | 85 | $this->raiseBubbleEvent($this,new TDataListCommandEventParameter($this,$sender,$param)); |
86 | 86 | return true; |
87 | - } |
|
88 | - else |
|
87 | + } else |
|
89 | 88 | return false; |
90 | 89 | } |
91 | 90 | |
@@ -130,8 +129,7 @@ discard block |
||
130 | 129 | $this->renderBeginTag($writer); |
131 | 130 | $this->renderContents($writer); |
132 | 131 | $this->renderEndTag($writer); |
133 | - } |
|
134 | - else |
|
132 | + } else |
|
135 | 133 | $this->renderContents($writer); |
136 | 134 | } |
137 | 135 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function getHasStyle() |
46 | 46 | { |
47 | - return $this->getViewState('Style',null)!==null; |
|
47 | + return $this->getViewState('Style', null)!==null; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function getStyle() |
54 | 54 | { |
55 | - if($style=$this->getViewState('Style',null)) |
|
55 | + if($style=$this->getViewState('Style', null)) |
|
56 | 56 | return $style; |
57 | 57 | else |
58 | 58 | { |
59 | 59 | $style=$this->createStyle(); |
60 | - $this->setViewState('Style',$style,null); |
|
60 | + $this->setViewState('Style', $style, null); |
|
61 | 61 | return $style; |
62 | 62 | } |
63 | 63 | } |
@@ -77,11 +77,11 @@ discard block |
||
77 | 77 | * @param TEventParameter event parameter |
78 | 78 | * @return boolean whether the event bubbling should stop here. |
79 | 79 | */ |
80 | - public function bubbleEvent($sender,$param) |
|
80 | + public function bubbleEvent($sender, $param) |
|
81 | 81 | { |
82 | 82 | if($param instanceof \Prado\Web\UI\TCommandEventParameter) |
83 | 83 | { |
84 | - $this->raiseBubbleEvent($this,new TDataListCommandEventParameter($this,$sender,$param)); |
|
84 | + $this->raiseBubbleEvent($this, new TDataListCommandEventParameter($this, $sender, $param)); |
|
85 | 85 | return true; |
86 | 86 | } |
87 | 87 | else |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | protected function addAttributesToRender($writer) |
110 | 110 | { |
111 | - if($style=$this->getViewState('Style',null)) |
|
111 | + if($style=$this->getViewState('Style', null)) |
|
112 | 112 | $style->addAttributesToRender($writer); |
113 | 113 | } |
114 | 114 |
@@ -97,8 +97,7 @@ discard block |
||
97 | 97 | $this->_cachedActiveViewIndex=-1; |
98 | 98 | if($index>=0) |
99 | 99 | $this->activateView($views->itemAt($index),true); |
100 | - } |
|
101 | - else |
|
100 | + } else |
|
102 | 101 | throw new TInvalidDataValueException('multiview_activeviewindex_invalid',$index); |
103 | 102 | } |
104 | 103 | |
@@ -153,8 +152,7 @@ discard block |
||
153 | 152 | $view->onActivate(null); |
154 | 153 | $this->onActiveViewChanged(null); |
155 | 154 | } |
156 | - } |
|
157 | - else if($v->getActive()) |
|
155 | + } else if($v->getActive()) |
|
158 | 156 | { |
159 | 157 | $v->setActive(false); |
160 | 158 | if($triggerEvent) |
@@ -232,8 +230,7 @@ discard block |
||
232 | 230 | { |
233 | 231 | $this->setActiveView($view); |
234 | 232 | return true; |
235 | - } |
|
236 | - else |
|
233 | + } else |
|
237 | 234 | throw new TInvalidDataValueException('multiview_viewid_invalid', $viewID); |
238 | 235 | case self::CMD_SWITCHVIEWINDEX: |
239 | 236 | $index=TPropertyValue::ensureInteger($param->getCommandParameter()); |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function getActiveViewIndex() |
82 | 82 | { |
83 | - if($this->_cachedActiveViewIndex>-1) |
|
83 | + if($this->_cachedActiveViewIndex > -1) |
|
84 | 84 | return $this->_cachedActiveViewIndex; |
85 | 85 | else |
86 | - return $this->getControlState('ActiveViewIndex',-1); |
|
86 | + return $this->getControlState('ActiveViewIndex', -1); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -92,21 +92,21 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function setActiveViewIndex($value) |
94 | 94 | { |
95 | - if(($index=TPropertyValue::ensureInteger($value))<0) |
|
95 | + if(($index=TPropertyValue::ensureInteger($value)) < 0) |
|
96 | 96 | $index=-1; |
97 | 97 | $views=$this->getViews(); |
98 | 98 | $count=$views->getCount(); |
99 | - if($count===0 && $this->getControlStage()<TControl::CS_CHILD_INITIALIZED) |
|
99 | + if($count===0 && $this->getControlStage() < TControl::CS_CHILD_INITIALIZED) |
|
100 | 100 | $this->_cachedActiveViewIndex=$index; |
101 | - else if($index<$count) |
|
101 | + else if($index < $count) |
|
102 | 102 | { |
103 | - $this->setControlState('ActiveViewIndex',$index,-1); |
|
103 | + $this->setControlState('ActiveViewIndex', $index, -1); |
|
104 | 104 | $this->_cachedActiveViewIndex=-1; |
105 | - if($index>=0) |
|
106 | - $this->activateView($views->itemAt($index),true); |
|
105 | + if($index >= 0) |
|
106 | + $this->activateView($views->itemAt($index), true); |
|
107 | 107 | } |
108 | 108 | else |
109 | - throw new TInvalidDataValueException('multiview_activeviewindex_invalid',$index); |
|
109 | + throw new TInvalidDataValueException('multiview_activeviewindex_invalid', $index); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -117,13 +117,13 @@ discard block |
||
117 | 117 | { |
118 | 118 | $index=$this->getActiveViewIndex(); |
119 | 119 | $views=$this->getViews(); |
120 | - if($index>=$views->getCount()) |
|
121 | - throw new TInvalidDataValueException('multiview_activeviewindex_invalid',$index); |
|
122 | - if($index<0) |
|
120 | + if($index >= $views->getCount()) |
|
121 | + throw new TInvalidDataValueException('multiview_activeviewindex_invalid', $index); |
|
122 | + if($index < 0) |
|
123 | 123 | return null; |
124 | 124 | $view=$views->itemAt($index); |
125 | 125 | if(!$view->getActive()) |
126 | - $this->activateView($view,false); |
|
126 | + $this->activateView($view, false); |
|
127 | 127 | return $view; |
128 | 128 | } |
129 | 129 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function setActiveView($view) |
135 | 135 | { |
136 | - if(($index=$this->getViews()->indexOf($view))>=0) |
|
136 | + if(($index=$this->getViews()->indexOf($view)) >= 0) |
|
137 | 137 | $this->setActiveViewIndex($index); |
138 | 138 | else |
139 | 139 | throw new TInvalidOperationException('multiview_view_inexistent'); |
@@ -145,11 +145,11 @@ discard block |
||
145 | 145 | * @param TView the view to be activated |
146 | 146 | * @param boolean whether to trigger OnActiveViewChanged event. |
147 | 147 | */ |
148 | - protected function activateView($view,$triggerViewChangedEvent=true) |
|
148 | + protected function activateView($view, $triggerViewChangedEvent=true) |
|
149 | 149 | { |
150 | 150 | if($view->getActive()) |
151 | 151 | return; |
152 | - $triggerEvent=$triggerViewChangedEvent && ($this->getControlStage()>=\Prado\Web\UI\TControl::CS_STATE_LOADED || ($this->getPage() && !$this->getPage()->getIsPostBack())); |
|
152 | + $triggerEvent=$triggerViewChangedEvent && ($this->getControlStage() >= \Prado\Web\UI\TControl::CS_STATE_LOADED || ($this->getPage() && !$this->getPage()->getIsPostBack())); |
|
153 | 153 | foreach($this->getViews() as $v) |
154 | 154 | { |
155 | 155 | if($v===$view) |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | public function onInit($param) |
197 | 197 | { |
198 | 198 | parent::onInit($param); |
199 | - if($this->_cachedActiveViewIndex>=0) |
|
199 | + if($this->_cachedActiveViewIndex >= 0) |
|
200 | 200 | $this->setActiveViewIndex($this->_cachedActiveViewIndex); |
201 | 201 | } |
202 | 202 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | */ |
208 | 208 | public function onActiveViewChanged($param) |
209 | 209 | { |
210 | - $this->raiseEvent('OnActiveViewChanged',$this,$param); |
|
210 | + $this->raiseEvent('OnActiveViewChanged', $this, $param); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -217,21 +217,21 @@ discard block |
||
217 | 217 | * @param mixed event parameter |
218 | 218 | * @return boolean whether this event is handled |
219 | 219 | */ |
220 | - public function bubbleEvent($sender,$param) |
|
220 | + public function bubbleEvent($sender, $param) |
|
221 | 221 | { |
222 | 222 | if(!$this->_ignoreBubbleEvents && ($param instanceof \Prado\Web\UI\TCommandEventParameter)) |
223 | 223 | { |
224 | 224 | switch($param->getCommandName()) |
225 | 225 | { |
226 | 226 | case self::CMD_NEXTVIEW: |
227 | - if(($index=$this->getActiveViewIndex())<$this->getViews()->getCount()-1) |
|
228 | - $this->setActiveViewIndex($index+1); |
|
227 | + if(($index=$this->getActiveViewIndex()) < $this->getViews()->getCount() - 1) |
|
228 | + $this->setActiveViewIndex($index + 1); |
|
229 | 229 | else |
230 | 230 | $this->setActiveViewIndex(-1); |
231 | 231 | return true; |
232 | 232 | case self::CMD_PREVIOUSVIEW: |
233 | - if(($index=$this->getActiveViewIndex())>=0) |
|
234 | - $this->setActiveViewIndex($index-1); |
|
233 | + if(($index=$this->getActiveViewIndex()) >= 0) |
|
234 | + $this->setActiveViewIndex($index - 1); |
|
235 | 235 | return true; |
236 | 236 | case self::CMD_SWITCHVIEWID: |
237 | 237 | $view=$this->findControl($viewID=$param->getCommandParameter()); |
@@ -211,8 +211,7 @@ discard block |
||
211 | 211 | $button=$this->createButton('Edit',$this->getEditText(),false,''); |
212 | 212 | $cell->getControls()->add($button); |
213 | 213 | $cell->registerObject('EditButton',$button); |
214 | - } |
|
215 | - else if($itemType===TListItemType::EditItem) |
|
214 | + } else if($itemType===TListItemType::EditItem) |
|
216 | 215 | { |
217 | 216 | $controls=$cell->getControls(); |
218 | 217 | $button=$this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup()); |
@@ -222,8 +221,7 @@ discard block |
||
222 | 221 | $button=$this->createButton('Cancel',$this->getCancelText(),false,''); |
223 | 222 | $controls->add($button); |
224 | 223 | $cell->registerObject('CancelButton',$button); |
225 | - } |
|
226 | - else |
|
224 | + } else |
|
227 | 225 | parent::initializeCell($cell,$columnIndex,$itemType); |
228 | 226 | } |
229 | 227 |
@@ -233,6 +233,10 @@ |
||
233 | 233 | * @param string button caption |
234 | 234 | * @param boolean whether the button should cause validation |
235 | 235 | * @param string the validation group that the button belongs to |
236 | + * @param string $commandName |
|
237 | + * @param string $text |
|
238 | + * @param boolean $causesValidation |
|
239 | + * @param string $validationGroup |
|
236 | 240 | * @return mixed the newly created button. |
237 | 241 | */ |
238 | 242 | protected function createButton($commandName,$text,$causesValidation,$validationGroup) |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function getButtonType() |
57 | 57 | { |
58 | - return $this->getViewState('ButtonType',TButtonColumnType::LinkButton); |
|
58 | + return $this->getViewState('ButtonType', TButtonColumnType::LinkButton); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function setButtonType($value) |
65 | 65 | { |
66 | - $this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'Prado\\Web\\UI\\WebControls\\TButtonColumnType'),TButtonColumnType::LinkButton); |
|
66 | + $this->setViewState('ButtonType', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TButtonColumnType'), TButtonColumnType::LinkButton); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function getEditText() |
73 | 73 | { |
74 | - return $this->getViewState('EditText','Edit'); |
|
74 | + return $this->getViewState('EditText', 'Edit'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function setEditText($value) |
81 | 81 | { |
82 | - $this->setViewState('EditText',$value,'Edit'); |
|
82 | + $this->setViewState('EditText', $value, 'Edit'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function getEditImageUrl() |
89 | 89 | { |
90 | - return $this->getViewState('EditImageUrl',''); |
|
90 | + return $this->getViewState('EditImageUrl', ''); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function setEditImageUrl($value) |
97 | 97 | { |
98 | - $this->setViewState('EditImageUrl',$value,''); |
|
98 | + $this->setViewState('EditImageUrl', $value, ''); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function getUpdateText() |
105 | 105 | { |
106 | - return $this->getViewState('UpdateText','Update'); |
|
106 | + return $this->getViewState('UpdateText', 'Update'); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function setUpdateText($value) |
113 | 113 | { |
114 | - $this->setViewState('UpdateText',$value,'Update'); |
|
114 | + $this->setViewState('UpdateText', $value, 'Update'); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function getUpdateImageUrl() |
121 | 121 | { |
122 | - return $this->getViewState('UpdateImageUrl',''); |
|
122 | + return $this->getViewState('UpdateImageUrl', ''); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function setUpdateImageUrl($value) |
129 | 129 | { |
130 | - $this->setViewState('UpdateImageUrl',$value,''); |
|
130 | + $this->setViewState('UpdateImageUrl', $value, ''); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function getCancelText() |
137 | 137 | { |
138 | - return $this->getViewState('CancelText','Cancel'); |
|
138 | + return $this->getViewState('CancelText', 'Cancel'); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function setCancelText($value) |
145 | 145 | { |
146 | - $this->setViewState('CancelText',$value,'Cancel'); |
|
146 | + $this->setViewState('CancelText', $value, 'Cancel'); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function getCancelImageUrl() |
153 | 153 | { |
154 | - return $this->getViewState('CancelImageUrl',''); |
|
154 | + return $this->getViewState('CancelImageUrl', ''); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function setCancelImageUrl($value) |
161 | 161 | { |
162 | - $this->setViewState('CancelImageUrl',$value,''); |
|
162 | + $this->setViewState('CancelImageUrl', $value, ''); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | public function getCausesValidation() |
169 | 169 | { |
170 | - return $this->getViewState('CausesValidation',true); |
|
170 | + return $this->getViewState('CausesValidation', true); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function setCausesValidation($value) |
177 | 177 | { |
178 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
178 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | */ |
184 | 184 | public function getValidationGroup() |
185 | 185 | { |
186 | - return $this->getViewState('ValidationGroup',''); |
|
186 | + return $this->getViewState('ValidationGroup', ''); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | /** |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function setValidationGroup($value) |
193 | 193 | { |
194 | - $this->setViewState('ValidationGroup',$value,''); |
|
194 | + $this->setViewState('ValidationGroup', $value, ''); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
@@ -203,27 +203,27 @@ discard block |
||
203 | 203 | * @param integer the index to the Columns property that the cell resides in. |
204 | 204 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
205 | 205 | */ |
206 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
206 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
207 | 207 | { |
208 | 208 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem) |
209 | 209 | { |
210 | - $button=$this->createButton('Edit',$this->getEditText(),false,''); |
|
210 | + $button=$this->createButton('Edit', $this->getEditText(), false, ''); |
|
211 | 211 | $cell->getControls()->add($button); |
212 | - $cell->registerObject('EditButton',$button); |
|
212 | + $cell->registerObject('EditButton', $button); |
|
213 | 213 | } |
214 | 214 | else if($itemType===TListItemType::EditItem) |
215 | 215 | { |
216 | 216 | $controls=$cell->getControls(); |
217 | - $button=$this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup()); |
|
217 | + $button=$this->createButton('Update', $this->getUpdateText(), $this->getCausesValidation(), $this->getValidationGroup()); |
|
218 | 218 | $controls->add($button); |
219 | - $cell->registerObject('UpdateButton',$button); |
|
219 | + $cell->registerObject('UpdateButton', $button); |
|
220 | 220 | $controls->add(' '); |
221 | - $button=$this->createButton('Cancel',$this->getCancelText(),false,''); |
|
221 | + $button=$this->createButton('Cancel', $this->getCancelText(), false, ''); |
|
222 | 222 | $controls->add($button); |
223 | - $cell->registerObject('CancelButton',$button); |
|
223 | + $cell->registerObject('CancelButton', $button); |
|
224 | 224 | } |
225 | 225 | else |
226 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
226 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
@@ -235,18 +235,18 @@ discard block |
||
235 | 235 | * @param string the validation group that the button belongs to |
236 | 236 | * @return mixed the newly created button. |
237 | 237 | */ |
238 | - protected function createButton($commandName,$text,$causesValidation,$validationGroup) |
|
238 | + protected function createButton($commandName, $text, $causesValidation, $validationGroup) |
|
239 | 239 | { |
240 | 240 | if($this->getButtonType()===TButtonColumnType::LinkButton) |
241 | - $button= new TLinkButton; |
|
241 | + $button=new TLinkButton; |
|
242 | 242 | else if($this->getButtonType()===TButtonColumnType::PushButton) |
243 | - $button= new TButton; |
|
243 | + $button=new TButton; |
|
244 | 244 | else // image buttons |
245 | 245 | { |
246 | - $button= new TImageButton; |
|
247 | - if(strcasecmp($commandName,'Update')===0) |
|
246 | + $button=new TImageButton; |
|
247 | + if(strcasecmp($commandName, 'Update')===0) |
|
248 | 248 | $url=$this->getUpdateImageUrl(); |
249 | - else if(strcasecmp($commandName,'Cancel')===0) |
|
249 | + else if(strcasecmp($commandName, 'Cancel')===0) |
|
250 | 250 | $url=$this->getCancelImageUrl(); |
251 | 251 | else |
252 | 252 | $url=$this->getEditImageUrl(); |
@@ -106,8 +106,7 @@ discard block |
||
106 | 106 | { |
107 | 107 | if($this->getEnableClientScript() && $this->needPostBackScript()) |
108 | 108 | $this->renderClientControlScript($writer); |
109 | - } |
|
110 | - else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
109 | + } else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
111 | 110 | $writer->addAttribute('disabled','disabled'); |
112 | 111 | parent::addAttributesToRender($writer); |
113 | 112 | } |
@@ -141,8 +140,7 @@ discard block |
||
141 | 140 | { |
142 | 141 | $group=$this->getValidationGroup(); |
143 | 142 | return $this->getPage()->getValidators($group)->getCount()>0; |
144 | - } |
|
145 | - else |
|
143 | + } else |
|
146 | 144 | return false; |
147 | 145 | } |
148 | 146 |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function getEnableClientScript() |
80 | 80 | { |
81 | - return $this->getViewState('EnableClientScript',true); |
|
81 | + return $this->getViewState('EnableClientScript', true); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function setEnableClientScript($value) |
88 | 88 | { |
89 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
89 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -98,16 +98,16 @@ discard block |
||
98 | 98 | { |
99 | 99 | $page=$this->getPage(); |
100 | 100 | $page->ensureRenderInForm($this); |
101 | - $writer->addAttribute('type','image'); |
|
101 | + $writer->addAttribute('type', 'image'); |
|
102 | 102 | if(($uniqueID=$this->getUniqueID())!=='') |
103 | - $writer->addAttribute('name',$uniqueID); |
|
103 | + $writer->addAttribute('name', $uniqueID); |
|
104 | 104 | if($this->getEnabled(true)) |
105 | 105 | { |
106 | 106 | if($this->getEnableClientScript() && $this->needPostBackScript()) |
107 | 107 | $this->renderClientControlScript($writer); |
108 | 108 | } |
109 | 109 | else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
110 | - $writer->addAttribute('disabled','disabled'); |
|
110 | + $writer->addAttribute('disabled', 'disabled'); |
|
111 | 111 | parent::addAttributesToRender($writer); |
112 | 112 | } |
113 | 113 | |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | */ |
117 | 117 | protected function renderClientControlScript($writer) |
118 | 118 | { |
119 | - $writer->addAttribute('id',$this->getClientID()); |
|
120 | - $cs = $this->getPage()->getClientScript(); |
|
121 | - $cs->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions()); |
|
119 | + $writer->addAttribute('id', $this->getClientID()); |
|
120 | + $cs=$this->getPage()->getClientScript(); |
|
121 | + $cs->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions()); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | if($this->getCausesValidation()) |
140 | 140 | { |
141 | 141 | $group=$this->getValidationGroup(); |
142 | - return $this->getPage()->getValidators($group)->getCount()>0; |
|
142 | + return $this->getPage()->getValidators($group)->getCount() > 0; |
|
143 | 143 | } |
144 | 144 | else |
145 | 145 | return false; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function setIsDefaultButton($value) |
152 | 152 | { |
153 | - $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value),false); |
|
153 | + $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value), false); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
@@ -176,10 +176,10 @@ discard block |
||
176 | 176 | */ |
177 | 177 | protected function getPostBackOptions() |
178 | 178 | { |
179 | - $options['ID'] = $this->getClientID(); |
|
180 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
181 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
182 | - $options['EventTarget'] = $this->getUniqueID(); |
|
179 | + $options['ID']=$this->getClientID(); |
|
180 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
181 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
182 | + $options['EventTarget']=$this->getUniqueID(); |
|
183 | 183 | |
184 | 184 | return $options; |
185 | 185 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | * @param array the input data collection |
192 | 192 | * @return boolean whether the data of the component has been changed |
193 | 193 | */ |
194 | - public function loadPostData($key,$values) |
|
194 | + public function loadPostData($key, $values) |
|
195 | 195 | { |
196 | 196 | $uid=$this->getUniqueID(); |
197 | 197 | if(isset($values["{$uid}_x"]) && isset($values["{$uid}_y"])) |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | public function onClick($param) |
224 | 224 | { |
225 | - $this->raiseEvent('OnClick',$this,$param); |
|
225 | + $this->raiseEvent('OnClick', $this, $param); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
@@ -234,8 +234,8 @@ discard block |
||
234 | 234 | */ |
235 | 235 | public function onCommand($param) |
236 | 236 | { |
237 | - $this->raiseEvent('OnCommand',$this,$param); |
|
238 | - $this->raiseBubbleEvent($this,$param); |
|
237 | + $this->raiseEvent('OnCommand', $this, $param); |
|
238 | + $this->raiseBubbleEvent($this, $param); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
@@ -251,8 +251,8 @@ discard block |
||
251 | 251 | { |
252 | 252 | if($this->getCausesValidation()) |
253 | 253 | $this->getPage()->validate($this->getValidationGroup()); |
254 | - $this->onClick(new TImageClickEventParameter($this->_x,$this->_y)); |
|
255 | - $this->onCommand(new \Prado\Web\UI\TCommandEventParameter($this->getCommandName(),$this->getCommandParameter())); |
|
254 | + $this->onClick(new TImageClickEventParameter($this->_x, $this->_y)); |
|
255 | + $this->onCommand(new \Prado\Web\UI\TCommandEventParameter($this->getCommandName(), $this->getCommandParameter())); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | /** |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | */ |
271 | 271 | public function getCausesValidation() |
272 | 272 | { |
273 | - return $this->getViewState('CausesValidation',true); |
|
273 | + return $this->getViewState('CausesValidation', true); |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | /** |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | */ |
279 | 279 | public function setCausesValidation($value) |
280 | 280 | { |
281 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
281 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | /** |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | */ |
287 | 287 | public function getCommandName() |
288 | 288 | { |
289 | - return $this->getViewState('CommandName',''); |
|
289 | + return $this->getViewState('CommandName', ''); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | /** |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | */ |
295 | 295 | public function setCommandName($value) |
296 | 296 | { |
297 | - $this->setViewState('CommandName',$value,''); |
|
297 | + $this->setViewState('CommandName', $value, ''); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | /** |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | */ |
303 | 303 | public function getCommandParameter() |
304 | 304 | { |
305 | - return $this->getViewState('CommandParameter',''); |
|
305 | + return $this->getViewState('CommandParameter', ''); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | /** |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | */ |
311 | 311 | public function setCommandParameter($value) |
312 | 312 | { |
313 | - $this->setViewState('CommandParameter',$value,''); |
|
313 | + $this->setViewState('CommandParameter', $value, ''); |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | */ |
319 | 319 | public function getValidationGroup() |
320 | 320 | { |
321 | - return $this->getViewState('ValidationGroup',''); |
|
321 | + return $this->getViewState('ValidationGroup', ''); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | /** |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | */ |
327 | 327 | public function setValidationGroup($value) |
328 | 328 | { |
329 | - $this->setViewState('ValidationGroup',$value,''); |
|
329 | + $this->setViewState('ValidationGroup', $value, ''); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | /** |
@@ -219,6 +219,7 @@ discard block |
||
219 | 219 | * If you override this method, be sure to call the parent implementation |
220 | 220 | * so that the event handler can be invoked. |
221 | 221 | * @param TImageClickEventParameter event parameter to be passed to the event handlers |
222 | + * @param TImageClickEventParameter $param |
|
222 | 223 | */ |
223 | 224 | public function onClick($param) |
224 | 225 | { |
@@ -231,6 +232,7 @@ discard block |
||
231 | 232 | * If you override this method, be sure to call the parent implementation |
232 | 233 | * so that the event handlers can be invoked. |
233 | 234 | * @param \Prado\Web\UI\TCommandEventParameter event parameter to be passed to the event handlers |
235 | + * @param \Prado\Web\UI\TCommandEventParameter $param |
|
234 | 236 | */ |
235 | 237 | public function onCommand($param) |
236 | 238 | { |
@@ -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 |
@@ -260,6 +260,7 @@ discard block |
||
260 | 260 | * method, be sure to call the parent implementation so that the event |
261 | 261 | * handler can be invoked. |
262 | 262 | * @param TCallbackEventParameter event parameter to be passed to the event handlers |
263 | + * @param TJuiAutoCompleteEventParameter $param |
|
263 | 264 | */ |
264 | 265 | public function onSuggest($param) |
265 | 266 | { |
@@ -272,6 +273,7 @@ discard block |
||
272 | 273 | * method, be sure to call the parent implementation so that the event |
273 | 274 | * handler can be invoked. |
274 | 275 | * @param TCallbackEventParameter event parameter to be passed to the event handlers |
276 | + * @param TJuiAutoCompleteEventParameter $param |
|
275 | 277 | */ |
276 | 278 | public function onSuggestionSelected($param) |
277 | 279 | { |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function getOptions() |
133 | 133 | { |
134 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
134 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
135 | 135 | { |
136 | 136 | $options=new TJuiControlOptions($this); |
137 | 137 | $this->setViewState('JuiOptions', $options); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function getMinChars() |
214 | 214 | { |
215 | - return $this->getViewState('minChars',''); |
|
215 | + return $this->getViewState('minChars', ''); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
@@ -236,17 +236,17 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function raiseCallbackEvent($param) |
238 | 238 | { |
239 | - $token = $param->getCallbackParameter(); |
|
240 | - if(is_array($token) && count($token) == 2) |
|
239 | + $token=$param->getCallbackParameter(); |
|
240 | + if(is_array($token) && count($token)==2) |
|
241 | 241 | { |
242 | - if($token[1] === '__TJuiAutoComplete_onSuggest__') |
|
242 | + if($token[1]==='__TJuiAutoComplete_onSuggest__') |
|
243 | 243 | { |
244 | - $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), $token[0]); |
|
244 | + $parameter=new TJuiAutoCompleteEventParameter($this->getResponse(), $token[0]); |
|
245 | 245 | $this->onSuggest($parameter); |
246 | 246 | } |
247 | - else if($token[1] === '__TJuiAutoComplete_onSuggestionSelected__') |
|
247 | + else if($token[1]==='__TJuiAutoComplete_onSuggestionSelected__') |
|
248 | 248 | { |
249 | - $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), null, $token[0]); |
|
249 | + $parameter=new TJuiAutoCompleteEventParameter($this->getResponse(), null, $token[0]); |
|
250 | 250 | $this->onSuggestionSelected($parameter); |
251 | 251 | } |
252 | 252 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | public function getResultPanel() |
304 | 304 | { |
305 | 305 | if($this->_resultPanel===null) |
306 | - $this->_resultPanel = $this->createResultPanel(); |
|
306 | + $this->_resultPanel=$this->createResultPanel(); |
|
307 | 307 | return $this->_resultPanel; |
308 | 308 | } |
309 | 309 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | */ |
313 | 313 | protected function createResultPanel() |
314 | 314 | { |
315 | - $panel = new TPanel; |
|
315 | + $panel=new TPanel; |
|
316 | 316 | $this->getControls()->add($panel); |
317 | 317 | $panel->setID('result'); |
318 | 318 | return $panel; |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | public function getSuggestions() |
325 | 325 | { |
326 | 326 | if($this->_repeater===null) |
327 | - $this->_repeater = $this->createRepeater(); |
|
327 | + $this->_repeater=$this->createRepeater(); |
|
328 | 328 | return $this->_repeater; |
329 | 329 | } |
330 | 330 | |
@@ -333,8 +333,8 @@ discard block |
||
333 | 333 | */ |
334 | 334 | protected function createRepeater() |
335 | 335 | { |
336 | - $repeater = new TRepeater; |
|
337 | - $repeater->setItemTemplate(new TTemplate('<%# $this->Data %>',null)); |
|
336 | + $repeater=new TRepeater; |
|
337 | + $repeater->setItemTemplate(new TTemplate('<%# $this->Data %>', null)); |
|
338 | 338 | $this->getControls()->add($repeater); |
339 | 339 | return $repeater; |
340 | 340 | } |
@@ -376,12 +376,12 @@ discard block |
||
376 | 376 | { |
377 | 377 | $data=array(); |
378 | 378 | $items=$this->getSuggestions()->getItems(); |
379 | - $writer = new TTextWriter; |
|
380 | - for($i=0; $i<$items->Count; $i++) |
|
379 | + $writer=new TTextWriter; |
|
380 | + for($i=0; $i < $items->Count; $i++) |
|
381 | 381 | { |
382 | 382 | $items->itemAt($i)->render($writer); |
383 | 383 | $item=$writer->flush(); |
384 | - $data[]=array( 'id' => $i, 'label' => $item); |
|
384 | + $data[]=array('id' => $i, 'label' => $item); |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | $this->getResponse()->getAdapter()->setResponseData($data); |
@@ -393,25 +393,25 @@ discard block |
||
393 | 393 | */ |
394 | 394 | protected function getPostBackOptions() |
395 | 395 | { |
396 | - $options = $this->getOptions()->toArray(); |
|
396 | + $options=$this->getOptions()->toArray(); |
|
397 | 397 | |
398 | - if(strlen($separator = $this->getSeparator())) |
|
399 | - $options['Separators'] = $separator; |
|
398 | + if(strlen($separator=$this->getSeparator())) |
|
399 | + $options['Separators']=$separator; |
|
400 | 400 | |
401 | 401 | if($this->getAutoPostBack()) |
402 | 402 | { |
403 | - $options = array_merge($options,parent::getPostBackOptions()); |
|
404 | - $options['AutoPostBack'] = true; |
|
403 | + $options=array_merge($options, parent::getPostBackOptions()); |
|
404 | + $options['AutoPostBack']=true; |
|
405 | 405 | } |
406 | - if(strlen($textCssClass = $this->getTextCssClass())) |
|
407 | - $options['textCssClass'] = $textCssClass; |
|
408 | - $options['minLength'] = $this->getMinChars(); |
|
409 | - $options['delay'] = $this->getFrequency()*1000.0; |
|
410 | - $options['appendTo'] = '#'.$this->getResultPanel()->getClientID(); |
|
411 | - $options['ID'] = $this->getClientID(); |
|
412 | - $options['EventTarget'] = $this->getUniqueID(); |
|
413 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
414 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
406 | + if(strlen($textCssClass=$this->getTextCssClass())) |
|
407 | + $options['textCssClass']=$textCssClass; |
|
408 | + $options['minLength']=$this->getMinChars(); |
|
409 | + $options['delay']=$this->getFrequency() * 1000.0; |
|
410 | + $options['appendTo']='#'.$this->getResultPanel()->getClientID(); |
|
411 | + $options['ID']=$this->getClientID(); |
|
412 | + $options['EventTarget']=$this->getUniqueID(); |
|
413 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
414 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
415 | 415 | return $options; |
416 | 416 | } |
417 | 417 |
@@ -79,8 +79,7 @@ |
||
79 | 79 | if($this->getHasPreRendered()) { |
80 | 80 | $this->renderDataList($writer); |
81 | 81 | if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer); |
82 | - } |
|
83 | - else { |
|
82 | + } else { |
|
84 | 83 | $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
85 | 84 | } |
86 | 85 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | parent::setDataSource($value); |
56 | 56 | if($this->getActiveControl()->canUpdateClientSide()) { |
57 | 57 | $this->renderPager(); |
58 | - $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); |
|
58 | + $this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter()); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | { |
79 | 79 | if($this->getHasPreRendered()) { |
80 | 80 | $this->renderDataList($writer); |
81 | - if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer); |
|
81 | + if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(), $writer); |
|
82 | 82 | } |
83 | 83 | else { |
84 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
84 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | { |
98 | 98 | if($item->ControlToPaginate==$this->ID) { |
99 | 99 | $writer=$this->getResponse()->createHtmlWriter(); |
100 | - $this->getPage()->getAdapter()->registerControlToRender($item,$writer); |
|
100 | + $this->getPage()->getAdapter()->registerControlToRender($item, $writer); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | } |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function __construct() |
36 | 36 | { |
37 | - parent::__construct(); |
|
38 | - $this->setAdapter(new TActiveControlAdapter($this)); |
|
37 | + parent::__construct(); |
|
38 | + $this->setAdapter(new TActiveControlAdapter($this)); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function getActiveControl() |
45 | 45 | { |
46 | - return $this->getAdapter()->getBaseActiveControl(); |
|
46 | + return $this->getAdapter()->getBaseActiveControl(); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function setDataSource($value) |
57 | 57 | { |
58 | - parent::setDataSource($value); |
|
59 | - if($this->getActiveControl()->canUpdateClientSide()) { |
|
60 | - $this->renderPager(); |
|
61 | - $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); |
|
62 | - } |
|
58 | + parent::setDataSource($value); |
|
59 | + if($this->getActiveControl()->canUpdateClientSide()) { |
|
60 | + $this->renderPager(); |
|
61 | + $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); |
|
62 | + } |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | protected function getContainerID() |
70 | 70 | { |
71 | - return $this->ClientID.'_Container'; |
|
71 | + return $this->ClientID.'_Container'; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -79,13 +79,13 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function render($writer) |
81 | 81 | { |
82 | - if($this->getHasPreRendered()) { |
|
83 | - $this->renderDataList($writer); |
|
84 | - if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer); |
|
85 | - } |
|
86 | - else { |
|
87 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
88 | - } |
|
82 | + if($this->getHasPreRendered()) { |
|
83 | + $this->renderDataList($writer); |
|
84 | + if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer); |
|
85 | + } |
|
86 | + else { |
|
87 | + $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
88 | + } |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | */ |
96 | 96 | private function renderPager() |
97 | 97 | { |
98 | - $pager=$this->getPage()->findControlsByType('Prado\Web\UI\ActiveControls\TActivePager', false); |
|
99 | - foreach($pager as $item) |
|
100 | - { |
|
101 | - if($item->ControlToPaginate==$this->ID) { |
|
102 | - $writer=$this->getResponse()->createHtmlWriter(); |
|
103 | - $this->getPage()->getAdapter()->registerControlToRender($item,$writer); |
|
104 | - } |
|
105 | - } |
|
98 | + $pager=$this->getPage()->findControlsByType('Prado\Web\UI\ActiveControls\TActivePager', false); |
|
99 | + foreach($pager as $item) |
|
100 | + { |
|
101 | + if($item->ControlToPaginate==$this->ID) { |
|
102 | + $writer=$this->getResponse()->createHtmlWriter(); |
|
103 | + $this->getPage()->getAdapter()->registerControlToRender($item,$writer); |
|
104 | + } |
|
105 | + } |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | */ |
113 | 113 | private function renderDataList($writer) |
114 | 114 | { |
115 | - $writer->write('<span id="'.$this->getContainerID().'">'); |
|
116 | - parent::render($writer); |
|
117 | - $writer->write('</span>'); |
|
115 | + $writer->write('<span id="'.$this->getContainerID().'">'); |
|
116 | + parent::render($writer); |
|
117 | + $writer->write('</span>'); |
|
118 | 118 | } |
119 | 119 | } |