@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | protected function getRepeatInfo() |
123 | 123 | { |
124 | - if(($repeatInfo = $this->getViewState('RepeatInfo', null)) === null) |
|
124 | + if (($repeatInfo = $this->getViewState('RepeatInfo', null)) === null) |
|
125 | 125 | { |
126 | 126 | $repeatInfo = new TRepeatInfo; |
127 | 127 | $this->setViewState('RepeatInfo', $repeatInfo, null); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function getCellSpacing() |
184 | 184 | { |
185 | - if($this->getHasStyle()) |
|
185 | + if ($this->getHasStyle()) |
|
186 | 186 | return $this->getStyle()->getCellSpacing(); |
187 | 187 | else |
188 | 188 | return -1; |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | */ |
203 | 203 | public function getCellPadding() |
204 | 204 | { |
205 | - if($this->getHasStyle()) |
|
205 | + if ($this->getHasStyle()) |
|
206 | 206 | return $this->getStyle()->getCellPadding(); |
207 | 207 | else |
208 | 208 | return -1; |
@@ -258,16 +258,16 @@ discard block |
||
258 | 258 | // and it's a callback, |
259 | 259 | // and we can update clientside, |
260 | 260 | // then update the 'disabled' attribute of the items. |
261 | - if(($this instanceof IActiveControl) && |
|
261 | + if (($this instanceof IActiveControl) && |
|
262 | 262 | $this->getPage()->getIsCallBack() && |
263 | 263 | $this->getActiveControl()->canUpdateClientSide()) |
264 | 264 | { |
265 | 265 | $items = $this->getItems(); |
266 | 266 | $cs = $this->getPage()->getCallbackClient(); |
267 | - $baseClientID = $this->getClientID() . '_c'; |
|
268 | - foreach($items as $index => $item) |
|
267 | + $baseClientID = $this->getClientID().'_c'; |
|
268 | + foreach ($items as $index => $item) |
|
269 | 269 | { |
270 | - $cs->setAttribute($baseClientID . $index, 'disabled', $value); |
|
270 | + $cs->setAttribute($baseClientID.$index, 'disabled', $value); |
|
271 | 271 | } |
272 | 272 | } |
273 | 273 | } |
@@ -296,9 +296,9 @@ discard block |
||
296 | 296 | { |
297 | 297 | $repeatedControl = $this->_repeatedControl; |
298 | 298 | $item = $this->getItems()->itemAt($index); |
299 | - if($item->getHasAttributes()) |
|
299 | + if ($item->getHasAttributes()) |
|
300 | 300 | $repeatedControl->getAttributes()->copyFrom($item->getAttributes()); |
301 | - elseif($repeatedControl->getHasAttributes()) |
|
301 | + elseif ($repeatedControl->getHasAttributes()) |
|
302 | 302 | $repeatedControl->getAttributes()->clear(); |
303 | 303 | $repeatedControl->setID("c$index"); |
304 | 304 | $repeatedControl->setText($item->getText()); |
@@ -318,20 +318,20 @@ discard block |
||
318 | 318 | */ |
319 | 319 | public function loadPostData($key, $values) |
320 | 320 | { |
321 | - if($this->getEnabled(true)) |
|
321 | + if ($this->getEnabled(true)) |
|
322 | 322 | { |
323 | - $index = (int)substr($key, strlen($this->getUniqueID()) + 2); |
|
323 | + $index = (int) substr($key, strlen($this->getUniqueID()) + 2); |
|
324 | 324 | $this->ensureDataBound(); |
325 | - if($index >= 0 && $index < $this->getItemCount()) |
|
325 | + if ($index >= 0 && $index < $this->getItemCount()) |
|
326 | 326 | { |
327 | 327 | $item = $this->getItems()->itemAt($index); |
328 | - if($item->getEnabled()) |
|
328 | + if ($item->getEnabled()) |
|
329 | 329 | { |
330 | 330 | $checked = isset($values[$key]); |
331 | - if($item->getSelected() !== $checked) |
|
331 | + if ($item->getSelected() !== $checked) |
|
332 | 332 | { |
333 | 333 | $item->setSelected($checked); |
334 | - if(!$this->_changedEventRaised) |
|
334 | + if (!$this->_changedEventRaised) |
|
335 | 335 | { |
336 | 336 | $this->_changedEventRaised = true; |
337 | 337 | return $this->_dataChanged = true; |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | */ |
353 | 353 | public function raisePostDataChangedEvent() |
354 | 354 | { |
355 | - if($this->getAutoPostBack() && $this->getCausesValidation()) |
|
355 | + if ($this->getAutoPostBack() && $this->getCausesValidation()) |
|
356 | 356 | $this->getPage()->validate($this->getValidationGroup()); |
357 | 357 | $this->onSelectedIndexChanged(null); |
358 | 358 | } |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | $this->_repeatedControl->setValidationGroup($this->getValidationGroup()); |
371 | 371 | $page = $this->getPage(); |
372 | 372 | $n = $this->getItemCount(); |
373 | - for($i = 0;$i < $n;++$i) |
|
373 | + for ($i = 0; $i < $n; ++$i) |
|
374 | 374 | { |
375 | 375 | $this->_repeatedControl->setID("c$i"); |
376 | 376 | $page->registerRequiresPostData($this->_repeatedControl); |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | * |
383 | 383 | *@return boolean true if we need a span |
384 | 384 | */ |
385 | - protected function getSpanNeeded () |
|
385 | + protected function getSpanNeeded() |
|
386 | 386 | { |
387 | 387 | return $this->getRepeatLayout() === TRepeatLayout::Raw; |
388 | 388 | } |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | $writer->addAttribute('id', $this->getClientId()); |
400 | 400 | $writer->renderBeginTag('span'); |
401 | 401 | } |
402 | - if($this->getItemCount() > 0) |
|
402 | + if ($this->getItemCount() > 0) |
|
403 | 403 | { |
404 | 404 | $this->_isEnabled = $this->getEnabled(true); |
405 | 405 | $repeatInfo = $this->getRepeatInfo(); |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | $writer->renderEndTag(); |
420 | 420 | |
421 | 421 | //checkbox skipped the client control script in addAttributesToRender |
422 | - if($this->getEnabled(true) |
|
422 | + if ($this->getEnabled(true) |
|
423 | 423 | && $this->getEnableClientScript() |
424 | 424 | && $this->getAutoPostBack() |
425 | 425 | && $this->getPage()->getClientSupportsJavaScript()) |
@@ -76,8 +76,9 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function findControl($id, $real = false) |
78 | 78 | { |
79 | - if ($real === true) |
|
80 | - return parent::findControl($id); |
|
79 | + if ($real === true) { |
|
80 | + return parent::findControl($id); |
|
81 | + } |
|
81 | 82 | return $this; |
82 | 83 | } |
83 | 84 | |
@@ -182,10 +183,11 @@ discard block |
||
182 | 183 | */ |
183 | 184 | public function getCellSpacing() |
184 | 185 | { |
185 | - if($this->getHasStyle()) |
|
186 | - return $this->getStyle()->getCellSpacing(); |
|
187 | - else |
|
188 | - return -1; |
|
186 | + if($this->getHasStyle()) { |
|
187 | + return $this->getStyle()->getCellSpacing(); |
|
188 | + } else { |
|
189 | + return -1; |
|
190 | + } |
|
189 | 191 | } |
190 | 192 | |
191 | 193 | /** |
@@ -202,10 +204,11 @@ discard block |
||
202 | 204 | */ |
203 | 205 | public function getCellPadding() |
204 | 206 | { |
205 | - if($this->getHasStyle()) |
|
206 | - return $this->getStyle()->getCellPadding(); |
|
207 | - else |
|
208 | - return -1; |
|
207 | + if($this->getHasStyle()) { |
|
208 | + return $this->getStyle()->getCellPadding(); |
|
209 | + } else { |
|
210 | + return -1; |
|
211 | + } |
|
209 | 212 | } |
210 | 213 | |
211 | 214 | /** |
@@ -296,10 +299,11 @@ discard block |
||
296 | 299 | { |
297 | 300 | $repeatedControl = $this->_repeatedControl; |
298 | 301 | $item = $this->getItems()->itemAt($index); |
299 | - if($item->getHasAttributes()) |
|
300 | - $repeatedControl->getAttributes()->copyFrom($item->getAttributes()); |
|
301 | - elseif($repeatedControl->getHasAttributes()) |
|
302 | - $repeatedControl->getAttributes()->clear(); |
|
302 | + if($item->getHasAttributes()) { |
|
303 | + $repeatedControl->getAttributes()->copyFrom($item->getAttributes()); |
|
304 | + } elseif($repeatedControl->getHasAttributes()) { |
|
305 | + $repeatedControl->getAttributes()->clear(); |
|
306 | + } |
|
303 | 307 | $repeatedControl->setID("c$index"); |
304 | 308 | $repeatedControl->setText($item->getText()); |
305 | 309 | $repeatedControl->setChecked($item->getSelected()); |
@@ -352,8 +356,9 @@ discard block |
||
352 | 356 | */ |
353 | 357 | public function raisePostDataChangedEvent() |
354 | 358 | { |
355 | - if($this->getAutoPostBack() && $this->getCausesValidation()) |
|
356 | - $this->getPage()->validate($this->getValidationGroup()); |
|
359 | + if($this->getAutoPostBack() && $this->getCausesValidation()) { |
|
360 | + $this->getPage()->validate($this->getValidationGroup()); |
|
361 | + } |
|
357 | 362 | $this->onSelectedIndexChanged(null); |
358 | 363 | } |
359 | 364 | |
@@ -415,8 +420,9 @@ discard block |
||
415 | 420 | $this->setAccessKey($accessKey); |
416 | 421 | $this->setTabIndex($tabIndex); |
417 | 422 | } |
418 | - if ($needSpan) |
|
419 | - $writer->renderEndTag(); |
|
423 | + if ($needSpan) { |
|
424 | + $writer->renderEndTag(); |
|
425 | + } |
|
420 | 426 | |
421 | 427 | //checkbox skipped the client control script in addAttributesToRender |
422 | 428 | if($this->getEnabled(true) |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | protected function addAttributesToRender($writer) |
71 | 71 | { |
72 | 72 | parent::addAttributesToRender($writer); |
73 | - if(($butt = $this->getDefaultButton()) !== '') |
|
73 | + if (($butt = $this->getDefaultButton()) !== '') |
|
74 | 74 | $writer->addAttribute('id', $this->getClientID()); |
75 | 75 | } |
76 | 76 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | public function renderBeginTag($writer) |
204 | 204 | { |
205 | 205 | parent::renderBeginTag($writer); |
206 | - if(($text = $this->getGroupingText()) !== '') |
|
206 | + if (($text = $this->getGroupingText()) !== '') |
|
207 | 207 | { |
208 | 208 | $writer->renderBeginTag('fieldset'); |
209 | 209 | $writer->renderBeginTag('legend'); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | */ |
219 | 219 | public function renderEndTag($writer) |
220 | 220 | { |
221 | - if($this->getGroupingText() !== '') |
|
221 | + if ($this->getGroupingText() !== '') |
|
222 | 222 | $writer->renderEndTag(); |
223 | 223 | parent::renderEndTag($writer); |
224 | 224 | } |
@@ -227,9 +227,9 @@ discard block |
||
227 | 227 | { |
228 | 228 | parent::render($writer); |
229 | 229 | |
230 | - if(($butt = $this->getDefaultButton()) !== '') |
|
230 | + if (($butt = $this->getDefaultButton()) !== '') |
|
231 | 231 | { |
232 | - if(($button = $this->findControl($butt)) === null) |
|
232 | + if (($button = $this->findControl($butt)) === null) |
|
233 | 233 | throw new TInvalidDataValueException('panel_defaultbutton_invalid', $butt); |
234 | 234 | else |
235 | 235 | $this->getPage()->getClientScript()->registerDefaultButton($this, $button); |
@@ -70,8 +70,9 @@ discard block |
||
70 | 70 | protected function addAttributesToRender($writer) |
71 | 71 | { |
72 | 72 | parent::addAttributesToRender($writer); |
73 | - if(($butt = $this->getDefaultButton()) !== '') |
|
74 | - $writer->addAttribute('id', $this->getClientID()); |
|
73 | + if(($butt = $this->getDefaultButton()) !== '') { |
|
74 | + $writer->addAttribute('id', $this->getClientID()); |
|
75 | + } |
|
75 | 76 | } |
76 | 77 | |
77 | 78 | /** |
@@ -218,8 +219,9 @@ discard block |
||
218 | 219 | */ |
219 | 220 | public function renderEndTag($writer) |
220 | 221 | { |
221 | - if($this->getGroupingText() !== '') |
|
222 | - $writer->renderEndTag(); |
|
222 | + if($this->getGroupingText() !== '') { |
|
223 | + $writer->renderEndTag(); |
|
224 | + } |
|
223 | 225 | parent::renderEndTag($writer); |
224 | 226 | } |
225 | 227 | |
@@ -229,10 +231,11 @@ discard block |
||
229 | 231 | |
230 | 232 | if(($butt = $this->getDefaultButton()) !== '') |
231 | 233 | { |
232 | - if(($button = $this->findControl($butt)) === null) |
|
233 | - throw new TInvalidDataValueException('panel_defaultbutton_invalid', $butt); |
|
234 | - else |
|
235 | - $this->getPage()->getClientScript()->registerDefaultButton($this, $button); |
|
234 | + if(($button = $this->findControl($butt)) === null) { |
|
235 | + throw new TInvalidDataValueException('panel_defaultbutton_invalid', $butt); |
|
236 | + } else { |
|
237 | + $this->getPage()->getClientScript()->registerDefaultButton($this, $button); |
|
238 | + } |
|
236 | 239 | } |
237 | 240 | } |
238 | 241 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * @param string sets the text before the open tag in the TWebControl |
164 | 164 | */ |
165 | 165 | public function setPreTagText($value) { |
166 | - if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
|
166 | + if (!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
|
167 | 167 | $this->_pretagtext = TPropertyValue::ensureString($value); |
168 | 168 | } |
169 | 169 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * @param string sets the text after the open tag in the TWebControl |
180 | 180 | */ |
181 | 181 | public function setPreContentsText($value) { |
182 | - if(!$this->_control->getIsSkinApplied()) |
|
182 | + if (!$this->_control->getIsSkinApplied()) |
|
183 | 183 | $this->_precontentstext = TPropertyValue::ensureString($value); |
184 | 184 | } |
185 | 185 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * @param string sets the text before the close tag in the TWebControl |
196 | 196 | */ |
197 | 197 | public function setPostContentsText($value) { |
198 | - if(!$this->_control->getIsSkinApplied()) |
|
198 | + if (!$this->_control->getIsSkinApplied()) |
|
199 | 199 | $this->_postcontentstext = TPropertyValue::ensureString($value); |
200 | 200 | } |
201 | 201 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * @param string sets the text after the close tag in the TWebControl |
212 | 212 | */ |
213 | 213 | public function setPostTagText($value) { |
214 | - if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
|
214 | + if (!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
|
215 | 215 | $this->_posttagtext = TPropertyValue::ensureString($value); |
216 | 216 | } |
217 | 217 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * @param TTemplate sets the template before the open tag in the TWebControl |
228 | 228 | */ |
229 | 229 | public function setPreTagTemplate($value) { |
230 | - if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
|
230 | + if (!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
|
231 | 231 | $this->_pretagtemplate = $value; |
232 | 232 | } |
233 | 233 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * @param TTemplate sets the template after the open tag in the TWebControl |
244 | 244 | */ |
245 | 245 | public function setPreContentsTemplate($value) { |
246 | - if(!$this->_control->getIsSkinApplied()) |
|
246 | + if (!$this->_control->getIsSkinApplied()) |
|
247 | 247 | $this->_precontentstemplate = $value; |
248 | 248 | } |
249 | 249 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | * @param TTemplate sets the template before the close tag in the TWebControl |
260 | 260 | */ |
261 | 261 | public function setPostContentsTemplate($value) { |
262 | - if(!$this->_control->getIsSkinApplied()) |
|
262 | + if (!$this->_control->getIsSkinApplied()) |
|
263 | 263 | $this->_postcontentstemplate = $value; |
264 | 264 | } |
265 | 265 | |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | * @param TTemplate sets the template before the close tag in the TWebControl |
276 | 276 | */ |
277 | 277 | public function setPostTagTemplate($value) { |
278 | - if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
|
278 | + if (!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
|
279 | 279 | $this->_posttagtemplate = $value; |
280 | 280 | } |
281 | 281 | |
@@ -286,11 +286,11 @@ discard block |
||
286 | 286 | * these controls don't have page states. This is as close to not influencing the page as possible. |
287 | 287 | */ |
288 | 288 | public function instantiate($outercontrol = null) { |
289 | - if($this->getPreTagTemplate() || $this->getPreContentsTemplate() || |
|
289 | + if ($this->getPreTagTemplate() || $this->getPreContentsTemplate() || |
|
290 | 290 | $this->getPostContentsTemplate() || $this->getPostTagTemplate()) { |
291 | 291 | |
292 | 292 | $this->_outercontrol = $outercontrol; |
293 | - if($this->getUseState()) |
|
293 | + if ($this->getUseState()) |
|
294 | 294 | $this->ensureTemplateDecoration(); |
295 | 295 | else |
296 | 296 | $this->_control->getPage()->onSaveStateComplete[] = [$this, 'ensureTemplateDecoration']; |
@@ -310,40 +310,40 @@ discard block |
||
310 | 310 | |
311 | 311 | $control = $this->_control; |
312 | 312 | $outercontrol = $this->_outercontrol; |
313 | - if($outercontrol === null) |
|
313 | + if ($outercontrol === null) |
|
314 | 314 | $outercontrol = $control; |
315 | 315 | |
316 | - if($this->_addedTemplateDecoration) |
|
316 | + if ($this->_addedTemplateDecoration) |
|
317 | 317 | return $this->_addedTemplateDecoration; |
318 | 318 | |
319 | 319 | $this->_addedTemplateDecoration = true; |
320 | 320 | |
321 | - if($this->getPreContentsTemplate()) |
|
321 | + if ($this->getPreContentsTemplate()) |
|
322 | 322 | { |
323 | 323 | $precontents = new TCompositeControl; |
324 | 324 | $this->getPreContentsTemplate()->instantiateIn($precontents); |
325 | 325 | $control->getControls()->insertAt(0, $precontents); |
326 | 326 | } |
327 | 327 | |
328 | - if($this->getPostContentsTemplate()) |
|
328 | + if ($this->getPostContentsTemplate()) |
|
329 | 329 | { |
330 | 330 | $postcontents = new TCompositeControl; |
331 | 331 | $this->getPostContentsTemplate()->instantiateIn($postcontents); |
332 | 332 | $control->getControls()->add($postcontents); |
333 | 333 | } |
334 | 334 | |
335 | - if(!$outercontrol->getParent()) |
|
335 | + if (!$outercontrol->getParent()) |
|
336 | 336 | return $this->_addedTemplateDecoration; |
337 | 337 | |
338 | 338 | |
339 | - if($this->getPreTagTemplate()) |
|
339 | + if ($this->getPreTagTemplate()) |
|
340 | 340 | { |
341 | 341 | $pretag = new TCompositeControl; |
342 | 342 | $this->getPreTagTemplate()->instantiateIn($pretag); |
343 | 343 | $outercontrol->getParent()->getControls()->insertBefore($outercontrol, $pretag); |
344 | 344 | } |
345 | 345 | |
346 | - if($this->getPostTagTemplate()) |
|
346 | + if ($this->getPostTagTemplate()) |
|
347 | 347 | { |
348 | 348 | $posttag = new TCompositeControl; |
349 | 349 | $this->getPostTagTemplate()->instantiateIn($posttag); |
@@ -163,8 +163,9 @@ discard block |
||
163 | 163 | * @param string sets the text before the open tag in the TWebControl |
164 | 164 | */ |
165 | 165 | public function setPreTagText($value) { |
166 | - if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
|
167 | - $this->_pretagtext = TPropertyValue::ensureString($value); |
|
166 | + if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) { |
|
167 | + $this->_pretagtext = TPropertyValue::ensureString($value); |
|
168 | + } |
|
168 | 169 | } |
169 | 170 | |
170 | 171 | |
@@ -179,8 +180,9 @@ discard block |
||
179 | 180 | * @param string sets the text after the open tag in the TWebControl |
180 | 181 | */ |
181 | 182 | public function setPreContentsText($value) { |
182 | - if(!$this->_control->getIsSkinApplied()) |
|
183 | - $this->_precontentstext = TPropertyValue::ensureString($value); |
|
183 | + if(!$this->_control->getIsSkinApplied()) { |
|
184 | + $this->_precontentstext = TPropertyValue::ensureString($value); |
|
185 | + } |
|
184 | 186 | } |
185 | 187 | |
186 | 188 | |
@@ -195,8 +197,9 @@ discard block |
||
195 | 197 | * @param string sets the text before the close tag in the TWebControl |
196 | 198 | */ |
197 | 199 | public function setPostContentsText($value) { |
198 | - if(!$this->_control->getIsSkinApplied()) |
|
199 | - $this->_postcontentstext = TPropertyValue::ensureString($value); |
|
200 | + if(!$this->_control->getIsSkinApplied()) { |
|
201 | + $this->_postcontentstext = TPropertyValue::ensureString($value); |
|
202 | + } |
|
200 | 203 | } |
201 | 204 | |
202 | 205 | |
@@ -211,8 +214,9 @@ discard block |
||
211 | 214 | * @param string sets the text after the close tag in the TWebControl |
212 | 215 | */ |
213 | 216 | public function setPostTagText($value) { |
214 | - if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
|
215 | - $this->_posttagtext = TPropertyValue::ensureString($value); |
|
217 | + if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) { |
|
218 | + $this->_posttagtext = TPropertyValue::ensureString($value); |
|
219 | + } |
|
216 | 220 | } |
217 | 221 | |
218 | 222 | |
@@ -227,8 +231,9 @@ discard block |
||
227 | 231 | * @param TTemplate sets the template before the open tag in the TWebControl |
228 | 232 | */ |
229 | 233 | public function setPreTagTemplate($value) { |
230 | - if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
|
231 | - $this->_pretagtemplate = $value; |
|
234 | + if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) { |
|
235 | + $this->_pretagtemplate = $value; |
|
236 | + } |
|
232 | 237 | } |
233 | 238 | |
234 | 239 | |
@@ -243,8 +248,9 @@ discard block |
||
243 | 248 | * @param TTemplate sets the template after the open tag in the TWebControl |
244 | 249 | */ |
245 | 250 | public function setPreContentsTemplate($value) { |
246 | - if(!$this->_control->getIsSkinApplied()) |
|
247 | - $this->_precontentstemplate = $value; |
|
251 | + if(!$this->_control->getIsSkinApplied()) { |
|
252 | + $this->_precontentstemplate = $value; |
|
253 | + } |
|
248 | 254 | } |
249 | 255 | |
250 | 256 | |
@@ -259,8 +265,9 @@ discard block |
||
259 | 265 | * @param TTemplate sets the template before the close tag in the TWebControl |
260 | 266 | */ |
261 | 267 | public function setPostContentsTemplate($value) { |
262 | - if(!$this->_control->getIsSkinApplied()) |
|
263 | - $this->_postcontentstemplate = $value; |
|
268 | + if(!$this->_control->getIsSkinApplied()) { |
|
269 | + $this->_postcontentstemplate = $value; |
|
270 | + } |
|
264 | 271 | } |
265 | 272 | |
266 | 273 | |
@@ -275,8 +282,9 @@ discard block |
||
275 | 282 | * @param TTemplate sets the template before the close tag in the TWebControl |
276 | 283 | */ |
277 | 284 | public function setPostTagTemplate($value) { |
278 | - if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
|
279 | - $this->_posttagtemplate = $value; |
|
285 | + if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) { |
|
286 | + $this->_posttagtemplate = $value; |
|
287 | + } |
|
280 | 288 | } |
281 | 289 | |
282 | 290 | /** |
@@ -290,10 +298,11 @@ discard block |
||
290 | 298 | $this->getPostContentsTemplate() || $this->getPostTagTemplate()) { |
291 | 299 | |
292 | 300 | $this->_outercontrol = $outercontrol; |
293 | - if($this->getUseState()) |
|
294 | - $this->ensureTemplateDecoration(); |
|
295 | - else |
|
296 | - $this->_control->getPage()->onSaveStateComplete[] = [$this, 'ensureTemplateDecoration']; |
|
301 | + if($this->getUseState()) { |
|
302 | + $this->ensureTemplateDecoration(); |
|
303 | + } else { |
|
304 | + $this->_control->getPage()->onSaveStateComplete[] = [$this, 'ensureTemplateDecoration']; |
|
305 | + } |
|
297 | 306 | } |
298 | 307 | } |
299 | 308 | |
@@ -310,11 +319,13 @@ discard block |
||
310 | 319 | |
311 | 320 | $control = $this->_control; |
312 | 321 | $outercontrol = $this->_outercontrol; |
313 | - if($outercontrol === null) |
|
314 | - $outercontrol = $control; |
|
322 | + if($outercontrol === null) { |
|
323 | + $outercontrol = $control; |
|
324 | + } |
|
315 | 325 | |
316 | - if($this->_addedTemplateDecoration) |
|
317 | - return $this->_addedTemplateDecoration; |
|
326 | + if($this->_addedTemplateDecoration) { |
|
327 | + return $this->_addedTemplateDecoration; |
|
328 | + } |
|
318 | 329 | |
319 | 330 | $this->_addedTemplateDecoration = true; |
320 | 331 | |
@@ -332,8 +343,9 @@ discard block |
||
332 | 343 | $control->getControls()->add($postcontents); |
333 | 344 | } |
334 | 345 | |
335 | - if(!$outercontrol->getParent()) |
|
336 | - return $this->_addedTemplateDecoration; |
|
346 | + if(!$outercontrol->getParent()) { |
|
347 | + return $this->_addedTemplateDecoration; |
|
348 | + } |
|
337 | 349 | |
338 | 350 | |
339 | 351 | if($this->getPreTagTemplate()) |
@@ -56,7 +56,7 @@ |
||
56 | 56 | */ |
57 | 57 | public function render($writer) |
58 | 58 | { |
59 | - if($this->_s !== '') |
|
59 | + if ($this->_s !== '') |
|
60 | 60 | $writer->write($this->evaluateStatements($this->_s)); |
61 | 61 | } |
62 | 62 | } |
@@ -56,8 +56,9 @@ |
||
56 | 56 | */ |
57 | 57 | public function render($writer) |
58 | 58 | { |
59 | - if($this->_s !== '') |
|
60 | - $writer->write($this->evaluateStatements($this->_s)); |
|
59 | + if($this->_s !== '') { |
|
60 | + $writer->write($this->evaluateStatements($this->_s)); |
|
61 | + } |
|
61 | 62 | } |
62 | 63 | } |
63 | 64 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | public function getRegularExpression() |
50 | 50 | { |
51 | 51 | $regex = parent::getRegularExpression(); |
52 | - return $regex === ''?self::EMAIL_REGEXP:$regex; |
|
52 | + return $regex === '' ?self::EMAIL_REGEXP : $regex; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -61,14 +61,14 @@ discard block |
||
61 | 61 | $value = $this->getValidationValue($this->getValidationTarget()); |
62 | 62 | $valid = $valid = is_string($value) && strlen($value) <= 254 && parent::evaluateIsValid(); |
63 | 63 | |
64 | - if($valid && $this->getCheckMXRecord() && function_exists('checkdnsrr')) |
|
64 | + if ($valid && $this->getCheckMXRecord() && function_exists('checkdnsrr')) |
|
65 | 65 | { |
66 | - if($value !== '') |
|
66 | + if ($value !== '') |
|
67 | 67 | { |
68 | - if(($pos = strpos($value, '@')) !== false) |
|
68 | + if (($pos = strpos($value, '@')) !== false) |
|
69 | 69 | { |
70 | 70 | $domain = substr($value, $pos + 1); |
71 | - return $domain === ''?false:checkdnsrr($domain, 'MX'); |
|
71 | + return $domain === '' ?false:checkdnsrr($domain, 'MX'); |
|
72 | 72 | } |
73 | 73 | else |
74 | 74 | return false; |
@@ -69,9 +69,9 @@ |
||
69 | 69 | { |
70 | 70 | $domain = substr($value, $pos + 1); |
71 | 71 | return $domain === ''?false:checkdnsrr($domain, 'MX'); |
72 | + } else { |
|
73 | + return false; |
|
72 | 74 | } |
73 | - else |
|
74 | - return false; |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | return $valid; |
@@ -215,22 +215,22 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public function initializeCell($cell, $columnIndex, $itemType) |
217 | 217 | { |
218 | - if($itemType === TListItemType::Item || $itemType === TListItemType::AlternatingItem || $itemType === TListItemType::SelectedItem || $itemType === TListItemType::EditItem) |
|
218 | + if ($itemType === TListItemType::Item || $itemType === TListItemType::AlternatingItem || $itemType === TListItemType::SelectedItem || $itemType === TListItemType::EditItem) |
|
219 | 219 | { |
220 | 220 | $link = new THyperLink; |
221 | - if(($url = $this->getImageUrl()) !== '') |
|
221 | + if (($url = $this->getImageUrl()) !== '') |
|
222 | 222 | { |
223 | 223 | $link->setImageUrl($url); |
224 | - if(($width = $this->getImageWidth()) !== '') |
|
224 | + if (($width = $this->getImageWidth()) !== '') |
|
225 | 225 | $link->setImageWidth($width); |
226 | - if(($height = $this->getImageHeight()) !== '') |
|
226 | + if (($height = $this->getImageHeight()) !== '') |
|
227 | 227 | $link->setImageHeight($height); |
228 | 228 | } |
229 | 229 | $link->setText($this->getText()); |
230 | 230 | $link->setNavigateUrl($this->getNavigateUrl()); |
231 | 231 | $link->setTarget($this->getTarget()); |
232 | - if($this->getDataTextField() !== '' || $this->getDataNavigateUrlField() !== '') |
|
233 | - $link->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
|
232 | + if ($this->getDataTextField() !== '' || $this->getDataNavigateUrlField() !== '') |
|
233 | + $link->attachEventHandler('OnDataBinding', [$this, 'dataBindColumn']); |
|
234 | 234 | $cell->getControls()->add($link); |
235 | 235 | $cell->registerObject('HyperLink', $link); |
236 | 236 | } |
@@ -247,13 +247,13 @@ discard block |
||
247 | 247 | { |
248 | 248 | $item = $sender->getNamingContainer(); |
249 | 249 | $data = $item->getData(); |
250 | - if(($field = $this->getDataTextField()) !== '') |
|
250 | + if (($field = $this->getDataTextField()) !== '') |
|
251 | 251 | { |
252 | 252 | $value = $this->getDataFieldValue($data, $field); |
253 | 253 | $text = $this->formatDataValue($this->getDataTextFormatString(), $value); |
254 | 254 | $sender->setText($text); |
255 | 255 | } |
256 | - if(($field = $this->getDataNavigateUrlField()) !== '') |
|
256 | + if (($field = $this->getDataNavigateUrlField()) !== '') |
|
257 | 257 | { |
258 | 258 | $value = $this->getDataFieldValue($data, $field); |
259 | 259 | $url = $this->formatDataValue($this->getDataNavigateUrlFormatString(), $value); |
@@ -221,21 +221,24 @@ |
||
221 | 221 | if(($url = $this->getImageUrl()) !== '') |
222 | 222 | { |
223 | 223 | $link->setImageUrl($url); |
224 | - if(($width = $this->getImageWidth()) !== '') |
|
225 | - $link->setImageWidth($width); |
|
226 | - if(($height = $this->getImageHeight()) !== '') |
|
227 | - $link->setImageHeight($height); |
|
224 | + if(($width = $this->getImageWidth()) !== '') { |
|
225 | + $link->setImageWidth($width); |
|
226 | + } |
|
227 | + if(($height = $this->getImageHeight()) !== '') { |
|
228 | + $link->setImageHeight($height); |
|
229 | + } |
|
228 | 230 | } |
229 | 231 | $link->setText($this->getText()); |
230 | 232 | $link->setNavigateUrl($this->getNavigateUrl()); |
231 | 233 | $link->setTarget($this->getTarget()); |
232 | - if($this->getDataTextField() !== '' || $this->getDataNavigateUrlField() !== '') |
|
233 | - $link->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
|
234 | + if($this->getDataTextField() !== '' || $this->getDataNavigateUrlField() !== '') { |
|
235 | + $link->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
|
236 | + } |
|
234 | 237 | $cell->getControls()->add($link); |
235 | 238 | $cell->registerObject('HyperLink', $link); |
239 | + } else { |
|
240 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
236 | 241 | } |
237 | - else |
|
238 | - parent::initializeCell($cell, $columnIndex, $itemType); |
|
239 | 242 | } |
240 | 243 | |
241 | 244 | /** |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function setWidth($value) |
164 | 164 | { |
165 | - if(($value = TPropertyValue::ensureInteger($value)) < 0) |
|
165 | + if (($value = TPropertyValue::ensureInteger($value)) < 0) |
|
166 | 166 | $value = -1; |
167 | 167 | $this->setViewState('Width', $value, -1); |
168 | 168 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function setHeight($value) |
182 | 182 | { |
183 | - if(($value = TPropertyValue::ensureInteger($value)) < 0) |
|
183 | + if (($value = TPropertyValue::ensureInteger($value)) < 0) |
|
184 | 184 | $value = -1; |
185 | 185 | $this->setViewState('Height', $value, -1); |
186 | 186 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function setMarginWidth($value) |
202 | 202 | { |
203 | - if(($value = TPropertyValue::ensureInteger($value)) < 0) |
|
203 | + if (($value = TPropertyValue::ensureInteger($value)) < 0) |
|
204 | 204 | $value = -1; |
205 | 205 | $this->setViewState('MarginWidth', $value, -1); |
206 | 206 | } |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | */ |
221 | 221 | public function setMarginHeight($value) |
222 | 222 | { |
223 | - if(($value = TPropertyValue::ensureInteger($value)) < 0) |
|
223 | + if (($value = TPropertyValue::ensureInteger($value)) < 0) |
|
224 | 224 | $value = -1; |
225 | 225 | $this->setViewState('MarginHeight', $value, -1); |
226 | 226 | } |
@@ -232,25 +232,25 @@ discard block |
||
232 | 232 | */ |
233 | 233 | protected function addAttributesToRender($writer) |
234 | 234 | { |
235 | - if($this->getID() !== '') |
|
235 | + if ($this->getID() !== '') |
|
236 | 236 | $writer->addAttribute('name', $this->getUniqueID()); |
237 | 237 | |
238 | - if(($src = $this->getFrameUrl()) !== '') |
|
238 | + if (($src = $this->getFrameUrl()) !== '') |
|
239 | 239 | $writer->addAttribute('src', $src); |
240 | 240 | |
241 | - if(($align = strtolower($this->getAlign())) !== 'notset') |
|
241 | + if (($align = strtolower($this->getAlign())) !== 'notset') |
|
242 | 242 | $writer->addAttribute('align', $align); |
243 | 243 | |
244 | 244 | $scrollBars = $this->getScrollBars(); |
245 | - if($scrollBars === TInlineFrameScrollBars::None) |
|
245 | + if ($scrollBars === TInlineFrameScrollBars::None) |
|
246 | 246 | $writer->addAttribute('scrolling', 'no'); |
247 | - elseif($scrollBars === TInlineFrameScrollBars::Both) |
|
247 | + elseif ($scrollBars === TInlineFrameScrollBars::Both) |
|
248 | 248 | $writer->addAttribute('scrolling', 'yes'); |
249 | 249 | |
250 | 250 | if (!$this->getShowBorder()) |
251 | 251 | $writer->addAttribute('frameborder', '0'); |
252 | 252 | |
253 | - if(($longdesc = $this->getDescriptionUrl()) !== '') |
|
253 | + if (($longdesc = $this->getDescriptionUrl()) !== '') |
|
254 | 254 | $writer->addAttribute('longdesc', $longdesc); |
255 | 255 | |
256 | 256 | if (($width = $this->getWidth()) !== -1) |
@@ -259,10 +259,10 @@ discard block |
||
259 | 259 | if (($height = $this->getHeight()) !== -1) |
260 | 260 | $writer->addAttribute('height', $height); |
261 | 261 | |
262 | - if(($marginheight = $this->getMarginHeight()) !== -1) |
|
262 | + if (($marginheight = $this->getMarginHeight()) !== -1) |
|
263 | 263 | $writer->addAttribute('marginheight', $marginheight); |
264 | 264 | |
265 | - if(($marginwidth = $this->getMarginWidth()) !== -1) |
|
265 | + if (($marginwidth = $this->getMarginWidth()) !== -1) |
|
266 | 266 | $writer->addAttribute('marginwidth', $marginwidth); |
267 | 267 | |
268 | 268 | parent::addAttributesToRender($writer); |
@@ -162,8 +162,9 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function setWidth($value) |
164 | 164 | { |
165 | - if(($value = TPropertyValue::ensureInteger($value)) < 0) |
|
166 | - $value = -1; |
|
165 | + if(($value = TPropertyValue::ensureInteger($value)) < 0) { |
|
166 | + $value = -1; |
|
167 | + } |
|
167 | 168 | $this->setViewState('Width', $value, -1); |
168 | 169 | } |
169 | 170 | |
@@ -180,8 +181,9 @@ discard block |
||
180 | 181 | */ |
181 | 182 | public function setHeight($value) |
182 | 183 | { |
183 | - if(($value = TPropertyValue::ensureInteger($value)) < 0) |
|
184 | - $value = -1; |
|
184 | + if(($value = TPropertyValue::ensureInteger($value)) < 0) { |
|
185 | + $value = -1; |
|
186 | + } |
|
185 | 187 | $this->setViewState('Height', $value, -1); |
186 | 188 | } |
187 | 189 | |
@@ -200,8 +202,9 @@ discard block |
||
200 | 202 | */ |
201 | 203 | public function setMarginWidth($value) |
202 | 204 | { |
203 | - if(($value = TPropertyValue::ensureInteger($value)) < 0) |
|
204 | - $value = -1; |
|
205 | + if(($value = TPropertyValue::ensureInteger($value)) < 0) { |
|
206 | + $value = -1; |
|
207 | + } |
|
205 | 208 | $this->setViewState('MarginWidth', $value, -1); |
206 | 209 | } |
207 | 210 | |
@@ -220,8 +223,9 @@ discard block |
||
220 | 223 | */ |
221 | 224 | public function setMarginHeight($value) |
222 | 225 | { |
223 | - if(($value = TPropertyValue::ensureInteger($value)) < 0) |
|
224 | - $value = -1; |
|
226 | + if(($value = TPropertyValue::ensureInteger($value)) < 0) { |
|
227 | + $value = -1; |
|
228 | + } |
|
225 | 229 | $this->setViewState('MarginHeight', $value, -1); |
226 | 230 | } |
227 | 231 | |
@@ -232,38 +236,48 @@ discard block |
||
232 | 236 | */ |
233 | 237 | protected function addAttributesToRender($writer) |
234 | 238 | { |
235 | - if($this->getID() !== '') |
|
236 | - $writer->addAttribute('name', $this->getUniqueID()); |
|
239 | + if($this->getID() !== '') { |
|
240 | + $writer->addAttribute('name', $this->getUniqueID()); |
|
241 | + } |
|
237 | 242 | |
238 | - if(($src = $this->getFrameUrl()) !== '') |
|
239 | - $writer->addAttribute('src', $src); |
|
243 | + if(($src = $this->getFrameUrl()) !== '') { |
|
244 | + $writer->addAttribute('src', $src); |
|
245 | + } |
|
240 | 246 | |
241 | - if(($align = strtolower($this->getAlign())) !== 'notset') |
|
242 | - $writer->addAttribute('align', $align); |
|
247 | + if(($align = strtolower($this->getAlign())) !== 'notset') { |
|
248 | + $writer->addAttribute('align', $align); |
|
249 | + } |
|
243 | 250 | |
244 | 251 | $scrollBars = $this->getScrollBars(); |
245 | - if($scrollBars === TInlineFrameScrollBars::None) |
|
246 | - $writer->addAttribute('scrolling', 'no'); |
|
247 | - elseif($scrollBars === TInlineFrameScrollBars::Both) |
|
248 | - $writer->addAttribute('scrolling', 'yes'); |
|
252 | + if($scrollBars === TInlineFrameScrollBars::None) { |
|
253 | + $writer->addAttribute('scrolling', 'no'); |
|
254 | + } elseif($scrollBars === TInlineFrameScrollBars::Both) { |
|
255 | + $writer->addAttribute('scrolling', 'yes'); |
|
256 | + } |
|
249 | 257 | |
250 | - if (!$this->getShowBorder()) |
|
251 | - $writer->addAttribute('frameborder', '0'); |
|
258 | + if (!$this->getShowBorder()) { |
|
259 | + $writer->addAttribute('frameborder', '0'); |
|
260 | + } |
|
252 | 261 | |
253 | - if(($longdesc = $this->getDescriptionUrl()) !== '') |
|
254 | - $writer->addAttribute('longdesc', $longdesc); |
|
262 | + if(($longdesc = $this->getDescriptionUrl()) !== '') { |
|
263 | + $writer->addAttribute('longdesc', $longdesc); |
|
264 | + } |
|
255 | 265 | |
256 | - if (($width = $this->getWidth()) !== -1) |
|
257 | - $writer->addAttribute('width', $width); |
|
266 | + if (($width = $this->getWidth()) !== -1) { |
|
267 | + $writer->addAttribute('width', $width); |
|
268 | + } |
|
258 | 269 | |
259 | - if (($height = $this->getHeight()) !== -1) |
|
260 | - $writer->addAttribute('height', $height); |
|
270 | + if (($height = $this->getHeight()) !== -1) { |
|
271 | + $writer->addAttribute('height', $height); |
|
272 | + } |
|
261 | 273 | |
262 | - if(($marginheight = $this->getMarginHeight()) !== -1) |
|
263 | - $writer->addAttribute('marginheight', $marginheight); |
|
274 | + if(($marginheight = $this->getMarginHeight()) !== -1) { |
|
275 | + $writer->addAttribute('marginheight', $marginheight); |
|
276 | + } |
|
264 | 277 | |
265 | - if(($marginwidth = $this->getMarginWidth()) !== -1) |
|
266 | - $writer->addAttribute('marginwidth', $marginwidth); |
|
278 | + if(($marginwidth = $this->getMarginWidth()) !== -1) { |
|
279 | + $writer->addAttribute('marginwidth', $marginwidth); |
|
280 | + } |
|
267 | 281 | |
268 | 282 | parent::addAttributesToRender($writer); |
269 | 283 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | public function onPreRender($param) |
122 | 122 | { |
123 | 123 | parent::onPreRender($param); |
124 | - if($this->getPage()->getClientSupportsJavaScript()) |
|
124 | + if ($this->getPage()->getClientSupportsJavaScript()) |
|
125 | 125 | { |
126 | 126 | $this->registerStyleSheet(); |
127 | 127 | $this->registerClientScript(); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | protected function addAttributesToRender($writer) |
137 | 137 | { |
138 | 138 | parent::addAttributesToRender($writer); |
139 | - if($this->getPage()->getClientSupportsJavaScript()) |
|
139 | + if ($this->getPage()->getClientSupportsJavaScript()) |
|
140 | 140 | $writer->addAttribute('id', $this->getClientID()); |
141 | 141 | } |
142 | 142 | |
@@ -147,8 +147,8 @@ discard block |
||
147 | 147 | */ |
148 | 148 | protected function registerStyleSheet() |
149 | 149 | { |
150 | - if(($url = $this->getCssUrl()) === '') |
|
151 | - $url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'keyboard.css'); |
|
150 | + if (($url = $this->getCssUrl()) === '') |
|
151 | + $url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'keyboard.css'); |
|
152 | 152 | $this->getPage()->getClientScript()->registerStyleSheetFile($url, $url); |
153 | 153 | } |
154 | 154 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $className = $this->getClientClassName(); |
162 | 162 | $cs = $this->getPage()->getClientScript(); |
163 | 163 | $cs->registerPradoScript('keyboard'); |
164 | - $cs->registerEndScript('prado:' . $this->getClientID(), "new $className($options);"); |
|
164 | + $cs->registerEndScript('prado:'.$this->getClientID(), "new $className($options);"); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
@@ -177,9 +177,9 @@ discard block |
||
177 | 177 | */ |
178 | 178 | protected function getClientOptions() |
179 | 179 | { |
180 | - if(($forControl = $this->getForControl()) === '') |
|
180 | + if (($forControl = $this->getForControl()) === '') |
|
181 | 181 | throw new TConfigurationException('keyboard_forcontrol_required'); |
182 | - if(($target = $this->findControl($forControl)) === null) |
|
182 | + if (($target = $this->findControl($forControl)) === null) |
|
183 | 183 | throw new TConfigurationException('keyboard_forcontrol_invalid', $forControl); |
184 | 184 | |
185 | 185 | $options['ID'] = $this->getClientID(); |
@@ -136,8 +136,9 @@ discard block |
||
136 | 136 | protected function addAttributesToRender($writer) |
137 | 137 | { |
138 | 138 | parent::addAttributesToRender($writer); |
139 | - if($this->getPage()->getClientSupportsJavaScript()) |
|
140 | - $writer->addAttribute('id', $this->getClientID()); |
|
139 | + if($this->getPage()->getClientSupportsJavaScript()) { |
|
140 | + $writer->addAttribute('id', $this->getClientID()); |
|
141 | + } |
|
141 | 142 | } |
142 | 143 | |
143 | 144 | /** |
@@ -147,8 +148,9 @@ discard block |
||
147 | 148 | */ |
148 | 149 | protected function registerStyleSheet() |
149 | 150 | { |
150 | - if(($url = $this->getCssUrl()) === '') |
|
151 | - $url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'keyboard.css'); |
|
151 | + if(($url = $this->getCssUrl()) === '') { |
|
152 | + $url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'keyboard.css'); |
|
153 | + } |
|
152 | 154 | $this->getPage()->getClientScript()->registerStyleSheetFile($url, $url); |
153 | 155 | } |
154 | 156 | |
@@ -177,10 +179,12 @@ discard block |
||
177 | 179 | */ |
178 | 180 | protected function getClientOptions() |
179 | 181 | { |
180 | - if(($forControl = $this->getForControl()) === '') |
|
181 | - throw new TConfigurationException('keyboard_forcontrol_required'); |
|
182 | - if(($target = $this->findControl($forControl)) === null) |
|
183 | - throw new TConfigurationException('keyboard_forcontrol_invalid', $forControl); |
|
182 | + if(($forControl = $this->getForControl()) === '') { |
|
183 | + throw new TConfigurationException('keyboard_forcontrol_required'); |
|
184 | + } |
|
185 | + if(($target = $this->findControl($forControl)) === null) { |
|
186 | + throw new TConfigurationException('keyboard_forcontrol_invalid', $forControl); |
|
187 | + } |
|
184 | 188 | |
185 | 189 | $options['ID'] = $this->getClientID(); |
186 | 190 | $options['ForControl'] = $target->getClientID(); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function setEditItemTemplate($value) |
114 | 114 | { |
115 | - if($value instanceof ITemplate || $value === null) |
|
115 | + if ($value instanceof ITemplate || $value === null) |
|
116 | 116 | $this->_editItemTemplate = $value; |
117 | 117 | else |
118 | 118 | throw new TInvalidDataTypeException('templatecolumn_template_required', 'EditItemTemplate'); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function setItemTemplate($value) |
134 | 134 | { |
135 | - if($value instanceof ITemplate || $value === null) |
|
135 | + if ($value instanceof ITemplate || $value === null) |
|
136 | 136 | $this->_itemTemplate = $value; |
137 | 137 | else |
138 | 138 | throw new TInvalidDataTypeException('templatecolumn_template_required', 'ItemTemplate'); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function setHeaderTemplate($value) |
154 | 154 | { |
155 | - if($value instanceof ITemplate || $value === null) |
|
155 | + if ($value instanceof ITemplate || $value === null) |
|
156 | 156 | $this->_headerTemplate = $value; |
157 | 157 | else |
158 | 158 | throw new TInvalidDataTypeException('templatecolumn_template_required', 'HeaderTemplate'); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public function setFooterTemplate($value) |
174 | 174 | { |
175 | - if($value instanceof ITemplate || $value === null) |
|
175 | + if ($value instanceof ITemplate || $value === null) |
|
176 | 176 | $this->_footerTemplate = $value; |
177 | 177 | else |
178 | 178 | throw new TInvalidDataTypeException('templatecolumn_template_required', 'FooterTemplate'); |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | */ |
190 | 190 | public function initializeCell($cell, $columnIndex, $itemType) |
191 | 191 | { |
192 | - if($itemType === TListItemType::Item || $itemType === TListItemType::AlternatingItem || $itemType === TListItemType::SelectedItem || $itemType === TListItemType::EditItem) |
|
192 | + if ($itemType === TListItemType::Item || $itemType === TListItemType::AlternatingItem || $itemType === TListItemType::SelectedItem || $itemType === TListItemType::EditItem) |
|
193 | 193 | { |
194 | - if($itemType === TListItemType::EditItem) |
|
194 | + if ($itemType === TListItemType::EditItem) |
|
195 | 195 | { |
196 | - if(($classPath = $this->getEditItemRenderer()) === '' && ($template = $this->_editItemTemplate) === null) |
|
196 | + if (($classPath = $this->getEditItemRenderer()) === '' && ($template = $this->_editItemTemplate) === null) |
|
197 | 197 | { |
198 | 198 | $classPath = $this->getItemRenderer(); |
199 | 199 | $template = $this->_itemTemplate; |
@@ -204,37 +204,37 @@ discard block |
||
204 | 204 | $template = $this->_itemTemplate; |
205 | 205 | $classPath = $this->getItemRenderer(); |
206 | 206 | } |
207 | - if($classPath !== '') |
|
207 | + if ($classPath !== '') |
|
208 | 208 | { |
209 | 209 | $control = Prado::createComponent($classPath); |
210 | 210 | $cell->getControls()->add($control); |
211 | - if($control instanceof IItemDataRenderer) |
|
211 | + if ($control instanceof IItemDataRenderer) |
|
212 | 212 | { |
213 | 213 | $control->setItemIndex($cell->getParent()->getItemIndex()); |
214 | 214 | $control->setItemType($itemType); |
215 | 215 | } |
216 | - if($control instanceof \Prado\IDataRenderer) |
|
217 | - $control->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
|
216 | + if ($control instanceof \Prado\IDataRenderer) |
|
217 | + $control->attachEventHandler('OnDataBinding', [$this, 'dataBindColumn']); |
|
218 | 218 | } |
219 | - elseif($template !== null) |
|
219 | + elseif ($template !== null) |
|
220 | 220 | $template->instantiateIn($cell); |
221 | - elseif($itemType !== TListItemType::EditItem) |
|
221 | + elseif ($itemType !== TListItemType::EditItem) |
|
222 | 222 | $cell->setText(' '); |
223 | 223 | } |
224 | - elseif($itemType === TListItemType::Header) |
|
224 | + elseif ($itemType === TListItemType::Header) |
|
225 | 225 | { |
226 | - if(($classPath = $this->getHeaderRenderer()) !== '') |
|
226 | + if (($classPath = $this->getHeaderRenderer()) !== '') |
|
227 | 227 | $this->initializeHeaderCell($cell, $columnIndex); |
228 | - elseif($this->_headerTemplate !== null) |
|
228 | + elseif ($this->_headerTemplate !== null) |
|
229 | 229 | $this->_headerTemplate->instantiateIn($cell); |
230 | 230 | else |
231 | 231 | $this->initializeHeaderCell($cell, $columnIndex); |
232 | 232 | } |
233 | - elseif($itemType === TListItemType::Footer) |
|
233 | + elseif ($itemType === TListItemType::Footer) |
|
234 | 234 | { |
235 | - if(($classPath = $this->getFooterRenderer()) !== '') |
|
235 | + if (($classPath = $this->getFooterRenderer()) !== '') |
|
236 | 236 | $this->initializeFooterCell($cell, $columnIndex); |
237 | - elseif($this->_footerTemplate !== null) |
|
237 | + elseif ($this->_footerTemplate !== null) |
|
238 | 238 | $this->_footerTemplate->instantiateIn($cell); |
239 | 239 | else |
240 | 240 | $this->initializeFooterCell($cell, $columnIndex); |
@@ -112,10 +112,11 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function setEditItemTemplate($value) |
114 | 114 | { |
115 | - if($value instanceof ITemplate || $value === null) |
|
116 | - $this->_editItemTemplate = $value; |
|
117 | - else |
|
118 | - throw new TInvalidDataTypeException('templatecolumn_template_required', 'EditItemTemplate'); |
|
115 | + if($value instanceof ITemplate || $value === null) { |
|
116 | + $this->_editItemTemplate = $value; |
|
117 | + } else { |
|
118 | + throw new TInvalidDataTypeException('templatecolumn_template_required', 'EditItemTemplate'); |
|
119 | + } |
|
119 | 120 | } |
120 | 121 | |
121 | 122 | /** |
@@ -132,10 +133,11 @@ discard block |
||
132 | 133 | */ |
133 | 134 | public function setItemTemplate($value) |
134 | 135 | { |
135 | - if($value instanceof ITemplate || $value === null) |
|
136 | - $this->_itemTemplate = $value; |
|
137 | - else |
|
138 | - throw new TInvalidDataTypeException('templatecolumn_template_required', 'ItemTemplate'); |
|
136 | + if($value instanceof ITemplate || $value === null) { |
|
137 | + $this->_itemTemplate = $value; |
|
138 | + } else { |
|
139 | + throw new TInvalidDataTypeException('templatecolumn_template_required', 'ItemTemplate'); |
|
140 | + } |
|
139 | 141 | } |
140 | 142 | |
141 | 143 | /** |
@@ -152,10 +154,11 @@ discard block |
||
152 | 154 | */ |
153 | 155 | public function setHeaderTemplate($value) |
154 | 156 | { |
155 | - if($value instanceof ITemplate || $value === null) |
|
156 | - $this->_headerTemplate = $value; |
|
157 | - else |
|
158 | - throw new TInvalidDataTypeException('templatecolumn_template_required', 'HeaderTemplate'); |
|
157 | + if($value instanceof ITemplate || $value === null) { |
|
158 | + $this->_headerTemplate = $value; |
|
159 | + } else { |
|
160 | + throw new TInvalidDataTypeException('templatecolumn_template_required', 'HeaderTemplate'); |
|
161 | + } |
|
159 | 162 | } |
160 | 163 | |
161 | 164 | /** |
@@ -172,10 +175,11 @@ discard block |
||
172 | 175 | */ |
173 | 176 | public function setFooterTemplate($value) |
174 | 177 | { |
175 | - if($value instanceof ITemplate || $value === null) |
|
176 | - $this->_footerTemplate = $value; |
|
177 | - else |
|
178 | - throw new TInvalidDataTypeException('templatecolumn_template_required', 'FooterTemplate'); |
|
178 | + if($value instanceof ITemplate || $value === null) { |
|
179 | + $this->_footerTemplate = $value; |
|
180 | + } else { |
|
181 | + throw new TInvalidDataTypeException('templatecolumn_template_required', 'FooterTemplate'); |
|
182 | + } |
|
179 | 183 | } |
180 | 184 | |
181 | 185 | /** |
@@ -198,8 +202,7 @@ discard block |
||
198 | 202 | $classPath = $this->getItemRenderer(); |
199 | 203 | $template = $this->_itemTemplate; |
200 | 204 | } |
201 | - } |
|
202 | - else |
|
205 | + } else |
|
203 | 206 | { |
204 | 207 | $template = $this->_itemTemplate; |
205 | 208 | $classPath = $this->getItemRenderer(); |
@@ -213,31 +216,32 @@ discard block |
||
213 | 216 | $control->setItemIndex($cell->getParent()->getItemIndex()); |
214 | 217 | $control->setItemType($itemType); |
215 | 218 | } |
216 | - if($control instanceof \Prado\IDataRenderer) |
|
217 | - $control->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
|
219 | + if($control instanceof \Prado\IDataRenderer) { |
|
220 | + $control->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
|
221 | + } |
|
222 | + } elseif($template !== null) { |
|
223 | + $template->instantiateIn($cell); |
|
224 | + } elseif($itemType !== TListItemType::EditItem) { |
|
225 | + $cell->setText(' '); |
|
218 | 226 | } |
219 | - elseif($template !== null) |
|
220 | - $template->instantiateIn($cell); |
|
221 | - elseif($itemType !== TListItemType::EditItem) |
|
222 | - $cell->setText(' '); |
|
223 | - } |
|
224 | - elseif($itemType === TListItemType::Header) |
|
227 | + } elseif($itemType === TListItemType::Header) |
|
225 | 228 | { |
226 | - if(($classPath = $this->getHeaderRenderer()) !== '') |
|
227 | - $this->initializeHeaderCell($cell, $columnIndex); |
|
228 | - elseif($this->_headerTemplate !== null) |
|
229 | - $this->_headerTemplate->instantiateIn($cell); |
|
230 | - else |
|
231 | - $this->initializeHeaderCell($cell, $columnIndex); |
|
232 | - } |
|
233 | - elseif($itemType === TListItemType::Footer) |
|
229 | + if(($classPath = $this->getHeaderRenderer()) !== '') { |
|
230 | + $this->initializeHeaderCell($cell, $columnIndex); |
|
231 | + } elseif($this->_headerTemplate !== null) { |
|
232 | + $this->_headerTemplate->instantiateIn($cell); |
|
233 | + } else { |
|
234 | + $this->initializeHeaderCell($cell, $columnIndex); |
|
235 | + } |
|
236 | + } elseif($itemType === TListItemType::Footer) |
|
234 | 237 | { |
235 | - if(($classPath = $this->getFooterRenderer()) !== '') |
|
236 | - $this->initializeFooterCell($cell, $columnIndex); |
|
237 | - elseif($this->_footerTemplate !== null) |
|
238 | - $this->_footerTemplate->instantiateIn($cell); |
|
239 | - else |
|
240 | - $this->initializeFooterCell($cell, $columnIndex); |
|
238 | + if(($classPath = $this->getFooterRenderer()) !== '') { |
|
239 | + $this->initializeFooterCell($cell, $columnIndex); |
|
240 | + } elseif($this->_footerTemplate !== null) { |
|
241 | + $this->_footerTemplate->instantiateIn($cell); |
|
242 | + } else { |
|
243 | + $this->initializeFooterCell($cell, $columnIndex); |
|
244 | + } |
|
241 | 245 | } |
242 | 246 | } |
243 | 247 |