Completed
Push — scrutinizer ( c2ef4a )
by Fabio
21:50
created
framework/Web/UI/WebControls/TSlider.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@
 block discarded – undo
179 179
 	 * Returns the value of the TSlider control.
180 180
 	 * This method is required by {@link IDataRenderer}.
181 181
 	 * It is the same as {@link getValue()}.
182
-	 * @return string the value of the TSlider control.
182
+	 * @return double the value of the TSlider control.
183 183
 	 * @see getValue
184 184
 	 */
185 185
 	public function getData()
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
  */
47 47
 class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer
48 48
 {
49
-	const MAX_STEPS=200;
49
+	const MAX_STEPS = 200;
50 50
 	/**
51 51
 	 * @var TSliderHandle handle component
52 52
 	 */
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 	/*
55 55
 	 * @var boolean Wether the data has changed during postback
56 56
 	 */
57
-	private $_dataChanged=false;
57
+	private $_dataChanged = false;
58 58
 	/**
59 59
 	 * @var TSliderClientScript Clients side javascripts
60 60
 	 */
61
-	private $_clientScript=null;
61
+	private $_clientScript = null;
62 62
 
63 63
 	/**
64 64
 	 * @return TSliderDirection Direction of slider (Horizontal or Vertical). Defaults to Horizontal.
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public function setDirection($value)
75 75
 	{
76
-		$this->setViewState('Direction', TPropertyValue::ensureEnum($value,'TSliderDirection'),TSliderDirection::Horizontal);
76
+		$this->setViewState('Direction', TPropertyValue::ensureEnum($value, 'TSliderDirection'), TSliderDirection::Horizontal);
77 77
 	}
78 78
 
79 79
 	/**
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 */
82 82
 	public function getCssUrl()
83 83
 	{
84
-		return $this->getViewState('CssUrl','');
84
+		return $this->getViewState('CssUrl', '');
85 85
 	}
86 86
 
87 87
 	/**
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function setCssUrl($value)
91 91
 	{
92
-		$this->setViewState('CssUrl',TPropertyValue::ensureString($value),'');
92
+		$this->setViewState('CssUrl', TPropertyValue::ensureString($value), '');
93 93
 	}
94 94
 
95 95
 	/**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function getMaxValue()
99 99
 	{
100
-		return $this->getViewState('MaxValue',100.0);
100
+		return $this->getViewState('MaxValue', 100.0);
101 101
 	}
102 102
 
103 103
 	/**
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	public function setMaxValue($value)
107 107
 	{
108
-		$this->setViewState('MaxValue', TPropertyValue::ensureFloat($value),100.0);
108
+		$this->setViewState('MaxValue', TPropertyValue::ensureFloat($value), 100.0);
109 109
 	}
110 110
 
111 111
 	/**
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 */
114 114
 	public function getMinValue()
115 115
 	{
116
-		return $this->getViewState('MinValue',0.0);
116
+		return $this->getViewState('MinValue', 0.0);
117 117
 	}
118 118
 
119 119
 	/**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public function setMinValue($value)
123 123
 	{
124
-		$this->setViewState('MinValue', TPropertyValue::ensureFloat($value),0.0);
124
+		$this->setViewState('MinValue', TPropertyValue::ensureFloat($value), 0.0);
125 125
 	}
126 126
 
127 127
 	/**
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	/**
148 148
 	 * @return boolean wether to display a progress indicator or not. Defaults to true.
149 149
 	 */
150
-	public function getProgressIndicator ()
150
+	public function getProgressIndicator()
151 151
 	{
152 152
 		return $this->getViewState('ProgressIndicator', true);
153 153
 	}
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	/**
156 156
 	 * @param boolean wether to display a progress indicator or not. Defaults to true.
157 157
 	 */
158
-	public function setProgressIndicator ($value)
158
+	public function setProgressIndicator($value)
159 159
 	{
160 160
 		$this->setViewState('ProgressIndicator', TPropertyValue::ensureBoolean($value), true);
161 161
 	}
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	 */
165 165
 	public function getValue()
166 166
 	{
167
-		return $this->getViewState('Value',0.0);
167
+		return $this->getViewState('Value', 0.0);
168 168
 	}
169 169
 
170 170
 	/**
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	 */
173 173
 	public function setValue($value)
174 174
 	{
175
-		$this->setViewState('Value', TPropertyValue::ensureFloat($value),0.0);
175
+		$this->setViewState('Value', TPropertyValue::ensureFloat($value), 0.0);
176 176
 	}
177 177
 
178 178
 	/**
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	 */
225 225
 	public function getAutoPostBack()
226 226
 	{
227
-		return $this->getViewState('AutoPostBack',false);
227
+		return $this->getViewState('AutoPostBack', false);
228 228
 	}
229 229
 
230 230
 	/**
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 	 */
236 236
 	public function setAutoPostBack($value)
237 237
 	{
238
-		$this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),false);
238
+		$this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), false);
239 239
 	}
240 240
 
241 241
 	/**
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	 */
281 281
 	public function onValueChanged($param)
282 282
 	{
283
-		$this->raiseEvent('OnValueChanged',$this,$param);
283
+		$this->raiseEvent('OnValueChanged', $this, $param);
284 284
 	}
285 285
 
286 286
 	/**
@@ -290,13 +290,13 @@  discard block
 block discarded – undo
290 290
 	 * @param array the input data collection
291 291
 	 * @return boolean whether the data of the component has been changed
292 292
 	 */
293
-	public function loadPostData($key,$values)
293
+	public function loadPostData($key, $values)
294 294
 	{
295
-		$value=(float)$values[$this->getClientID().'_1'];
296
-		if($this->getValue()!==$value)
295
+		$value = (float) $values[$this->getClientID() . '_1'];
296
+		if ($this->getValue() !== $value)
297 297
 		{
298 298
 			$this->setValue($value);
299
-			return $this->_dataChanged=true;
299
+			return $this->_dataChanged = true;
300 300
 		}
301 301
 		else
302 302
 			return false;
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	 */
316 316
 	public function getClientSide()
317 317
 	{
318
-		if($this->_clientScript===null)
318
+		if ($this->_clientScript === null)
319 319
 			$this->_clientScript = $this->createClientScript();
320 320
 		return $this->_clientScript;
321 321
 	}
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 	/**
332 332
 	 * @return string the HTML tag name for slider. Defaults to div.
333 333
 	 */
334
-	public function getTagName ()
334
+	public function getTagName()
335 335
 	{
336 336
 		return "div";
337 337
 	}
@@ -343,11 +343,11 @@  discard block
 block discarded – undo
343 343
 	protected function addAttributesToRender($writer)
344 344
 	{
345 345
 		parent::addAttributesToRender($writer);
346
-		$writer->addAttribute('id',$this->getClientID());
347
-		if ($this->getCssClass()==='')
346
+		$writer->addAttribute('id', $this->getClientID());
347
+		if ($this->getCssClass() === '')
348 348
 		{
349
-			$class=($this->getDirection()==TSliderDirection::Horizontal)?'HorizontalSlider':'VerticalSlider';
350
-			$writer->addAttribute('class', 'Slider '.$class);
349
+			$class = ($this->getDirection() == TSliderDirection::Horizontal) ? 'HorizontalSlider' : 'VerticalSlider';
350
+			$writer->addAttribute('class', 'Slider ' . $class);
351 351
 		}
352 352
 
353 353
 	}
@@ -359,13 +359,13 @@  discard block
 block discarded – undo
359 359
 	{
360 360
 		// Render the 'Track'
361 361
 		$writer->addAttribute('class', 'Track');
362
-		$writer->addAttribute('id', $this->getClientID().'_track');
362
+		$writer->addAttribute('id', $this->getClientID() . '_track');
363 363
 		$writer->renderBeginTag('div');
364 364
 		// Render the 'Progress Indicator'
365 365
 		if ($this->getProgressIndicator())
366 366
 		{
367 367
 			$writer->addAttribute('class', 'Progress');
368
-			$writer->addAttribute('id', $this->getClientID().'_progress');
368
+			$writer->addAttribute('id', $this->getClientID() . '_progress');
369 369
 			$writer->renderBeginTag('div');
370 370
 			$writer->renderEndTag();
371 371
 		}
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 
391 391
 		// Render the 'Handle'
392 392
 		$writer->addAttribute('class', 'Handle');
393
-		$writer->addAttribute('id', $this->getClientID().'_handle');
393
+		$writer->addAttribute('id', $this->getClientID() . '_handle');
394 394
 		$writer->renderBeginTag('div');
395 395
 		$writer->renderEndTag();
396 396
 	}
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 	 * This method is invoked right before the control rendering, if the control is visible.
400 400
 	 * @param mixed event parameter
401 401
 	 */
402
-	public function onPreRender ($param)
402
+	public function onPreRender($param)
403 403
 	{
404 404
 		parent::onPreRender($param);
405 405
 		$this->registerStyleSheet();
@@ -414,14 +414,14 @@  discard block
 block discarded – undo
414 414
 	 */
415 415
 	protected function registerStyleSheet()
416 416
 	{
417
-		if(($url=$this->getCssUrl())==='')
417
+		if (($url = $this->getCssUrl()) === '')
418 418
 		{
419
-			$manager=$this->getApplication()->getAssetManager();
419
+			$manager = $this->getApplication()->getAssetManager();
420 420
 			// publish the assets
421
-			$url=$manager->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'TSlider');
422
-			$url.='/TSlider.css';
421
+			$url = $manager->publishFilePath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'TSlider');
422
+			$url .= '/TSlider.css';
423 423
 		}
424
-		$this->getPage()->getClientScript()->registerStyleSheetFile($url,$url);
424
+		$this->getPage()->getClientScript()->registerStyleSheetFile($url, $url);
425 425
 	}
426 426
 
427 427
 	/**
@@ -429,13 +429,13 @@  discard block
 block discarded – undo
429 429
 	 */
430 430
 	protected function registerSliderClientScript()
431 431
 	{
432
-		$page=$this->getPage();
432
+		$page = $this->getPage();
433 433
 		$cs = $page->getClientScript();
434 434
 		$cs->registerPradoScript("slider");
435
-		$id=$this->getClientID();
436
-		$cs->registerHiddenField($id.'_1',$this->getValue());
435
+		$id = $this->getClientID();
436
+		$cs->registerHiddenField($id . '_1', $this->getValue());
437 437
 		$page->registerRequiresPostData($this);
438
-		$cs->registerPostBackControl($this->getClientClassName(),$this->getSliderOptions());
438
+		$cs->registerPostBackControl($this->getClientClassName(), $this->getSliderOptions());
439 439
 	}
440 440
 
441 441
 	/**
@@ -450,20 +450,20 @@  discard block
 block discarded – undo
450 450
 		$options['AutoPostBack'] = $this->getAutoPostBack();
451 451
 
452 452
 		// Slider Control options
453
-		$minValue=$this->getMinValue();
454
-		$maxValue=$this->getMaxValue();
453
+		$minValue = $this->getMinValue();
454
+		$maxValue = $this->getMaxValue();
455 455
 		$options['axis'] = strtolower($this->getDirection());
456 456
 		$options['maximum'] = $maxValue;
457 457
 		$options['minimum'] = $minValue;
458 458
 		$options['range'] = array($minValue, $maxValue);
459 459
 		$options['sliderValue'] = $this->getValue();
460 460
 		$options['disabled'] = !$this->getEnabled();
461
-		$values=$this->getValues();
461
+		$values = $this->getValues();
462 462
 		if (!empty($values))
463 463
 		{
464 464
 			// Values are provided. Check if min/max are present in them
465
-			if (!in_array($minValue, $values)) $values[]=$minValue;
466
-			if (!in_array($maxValue, $values)) $values[]=$maxValue;
465
+			if (!in_array($minValue, $values)) $values[] = $minValue;
466
+			if (!in_array($maxValue, $values)) $values[] = $maxValue;
467 467
 			// Remove all values outsize the range [min..max]
468 468
 			foreach ($values as $idx=>$value)
469 469
 			{
@@ -474,21 +474,21 @@  discard block
 block discarded – undo
474 474
 		else
475 475
 		{
476 476
 			// Values are not provided, generate automatically using stepsize
477
-			$step=$this->getStepSize();
477
+			$step = $this->getStepSize();
478 478
 			// We want at most self::MAX_STEPS values, so, change the step if necessary
479
-			if (($maxValue-$minValue)/$step > self::MAX_STEPS)
479
+			if (($maxValue - $minValue) / $step > self::MAX_STEPS)
480 480
 			{
481
-				$step=($maxValue-$minValue)/self::MAX_STEPS;
481
+				$step = ($maxValue - $minValue) / self::MAX_STEPS;
482 482
 			}
483
-			$values=array();
484
-			for ($i=$minValue;$i<=$maxValue;$i+=$step)
485
-				$values[]=$i;
483
+			$values = array();
484
+			for ($i = $minValue; $i <= $maxValue; $i += $step)
485
+				$values[] = $i;
486 486
 			// Add max if it's not in the array because of step
487
-			if (!in_array($maxValue, $values)) $values[]=$maxValue;
487
+			if (!in_array($maxValue, $values)) $values[] = $maxValue;
488 488
 		}
489 489
 		$options['values'] = $values;
490
-		if($this->_clientScript!==null)
491
-			$options = array_merge($options,$this->_clientScript->getOptions()->toArray());
490
+		if ($this->_clientScript !== null)
491
+			$options = array_merge($options, $this->_clientScript->getOptions()->toArray());
492 492
 		return $options;
493 493
 	}
494 494
 }
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 	 */
518 518
 	public function setOnChange($javascript)
519 519
 	{
520
-		$code=TJavascript::quoteJsLiteral("function (value) { {$javascript} }");
520
+		$code = TJavascript::quoteJsLiteral("function (value) { {$javascript} }");
521 521
 		$this->setFunction('onChange', $code);
522 522
 	}
523 523
 
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	 */
535 535
 	public function setOnSlide($javascript)
536 536
 	{
537
-		$code=TJavascript::quoteJsLiteral("function (value) { {$javascript} }");
537
+		$code = TJavascript::quoteJsLiteral("function (value) { {$javascript} }");
538 538
 		$this->setFunction('onSlide', $code);
539 539
 	}
540 540
 
@@ -563,8 +563,8 @@  discard block
 block discarded – undo
563 563
  */
564 564
 class TSliderDirection extends TEnumerable
565 565
 {
566
-	const Horizontal='Horizontal';
567
-	const Vertical='Vertical';
566
+	const Horizontal = 'Horizontal';
567
+	const Vertical = 'Vertical';
568 568
 }
569 569
 
570 570
 
Please login to merge, or discard this patch.
Braces   +27 added lines, -15 removed lines patch added patch discarded remove patch
@@ -297,9 +297,9 @@  discard block
 block discarded – undo
297 297
 		{
298 298
 			$this->setValue($value);
299 299
 			return $this->_dataChanged=true;
300
+		} else {
301
+					return false;
300 302
 		}
301
-		else
302
-			return false;
303 303
 	}
304 304
 
305 305
 	/**
@@ -315,8 +315,9 @@  discard block
 block discarded – undo
315 315
 	 */
316 316
 	public function getClientSide()
317 317
 	{
318
-		if($this->_clientScript===null)
319
-			$this->_clientScript = $this->createClientScript();
318
+		if($this->_clientScript===null) {
319
+					$this->_clientScript = $this->createClientScript();
320
+		}
320 321
 		return $this->_clientScript;
321 322
 	}
322 323
 
@@ -462,16 +463,23 @@  discard block
 block discarded – undo
462 463
 		if (!empty($values))
463 464
 		{
464 465
 			// Values are provided. Check if min/max are present in them
465
-			if (!in_array($minValue, $values)) $values[]=$minValue;
466
-			if (!in_array($maxValue, $values)) $values[]=$maxValue;
466
+			if (!in_array($minValue, $values)) {
467
+				$values[]=$minValue;
468
+			}
469
+			if (!in_array($maxValue, $values)) {
470
+				$values[]=$maxValue;
471
+			}
467 472
 			// Remove all values outsize the range [min..max]
468 473
 			foreach ($values as $idx=>$value)
469 474
 			{
470
-				if ($value < $minValue) unset ($values[$idx]);
471
-				if ($value > $maxValue) unset ($values[$idx]);
475
+				if ($value < $minValue) {
476
+					unset ($values[$idx]);
477
+				}
478
+				if ($value > $maxValue) {
479
+					unset ($values[$idx]);
480
+				}
472 481
 			}
473
-		}
474
-		else
482
+		} else
475 483
 		{
476 484
 			// Values are not provided, generate automatically using stepsize
477 485
 			$step=$this->getStepSize();
@@ -481,14 +489,18 @@  discard block
 block discarded – undo
481 489
 				$step=($maxValue-$minValue)/self::MAX_STEPS;
482 490
 			}
483 491
 			$values=array();
484
-			for ($i=$minValue;$i<=$maxValue;$i+=$step)
485
-				$values[]=$i;
492
+			for ($i=$minValue;$i<=$maxValue;$i+=$step) {
493
+							$values[]=$i;
494
+			}
486 495
 			// Add max if it's not in the array because of step
487
-			if (!in_array($maxValue, $values)) $values[]=$maxValue;
496
+			if (!in_array($maxValue, $values)) {
497
+				$values[]=$maxValue;
498
+			}
488 499
 		}
489 500
 		$options['values'] = $values;
490
-		if($this->_clientScript!==null)
491
-			$options = array_merge($options,$this->_clientScript->getOptions()->toArray());
501
+		if($this->_clientScript!==null) {
502
+					$options = array_merge($options,$this->_clientScript->getOptions()->toArray());
503
+		}
492 504
 		return $options;
493 505
 	}
494 506
 }
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TStyle.php 3 patches
Doc Comments   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	}
230 230
 
231 231
 	/**
232
-	 * @return TDisplayStyle display style
232
+	 * @return string display style
233 233
 	 */
234 234
 	public function getDisplayStyle()
235 235
 	{
@@ -286,6 +286,7 @@  discard block
 block discarded – undo
286 286
 	 * Sets custom style fields from a string.
287 287
 	 * Custom style fields will be overwritten by style fields explicitly defined.
288 288
 	 * @param string the custom style of the control
289
+	 * @param string $value
289 290
 	 */
290 291
 	public function setCustomStyle($value)
291 292
 	{
@@ -305,6 +306,8 @@  discard block
 block discarded – undo
305 306
 	 * Style fields set by this method will overwrite those set by {@link setCustomStyle}.
306 307
 	 * @param string style field name
307 308
 	 * @param string style field value
309
+	 * @param string $name
310
+	 * @param string $value
308 311
 	 */
309 312
 	public function setStyleField($name,$value)
310 313
 	{
@@ -695,7 +698,7 @@  discard block
 block discarded – undo
695 698
 
696 699
 
697 700
 	/**
698
-	 * @return boolean whether the table borders should be collapsed. Defaults to false.
701
+	 * @return boolean|null whether the table borders should be collapsed. Defaults to false.
699 702
 	 */
700 703
 	public function getBorderCollapse()
701 704
 	{
@@ -858,7 +861,7 @@  discard block
 block discarded – undo
858 861
 	}
859 862
 
860 863
 	/**
861
-	 * @return boolean whether the content wraps within the table item. Defaults to true.
864
+	 * @return boolean|null whether the content wraps within the table item. Defaults to true.
862 865
 	 */
863 866
 	public function getWrap()
864 867
 	{
Please login to merge, or discard this patch.
Spacing   +192 added lines, -192 removed lines patch added patch discarded remove patch
@@ -28,23 +28,23 @@  discard block
 block discarded – undo
28 28
 	/**
29 29
 	 * @var array storage of CSS fields
30 30
 	 */
31
-	private $_fields=array();
31
+	private $_fields = array();
32 32
 	/**
33 33
 	 * @var TFont font object
34 34
 	 */
35
-	private $_font=null;
35
+	private $_font = null;
36 36
 	/**
37 37
 	 * @var string CSS class name
38 38
 	 */
39
-	private $_class=null;
39
+	private $_class = null;
40 40
 	/**
41 41
 	 * @var string CSS style string (those not represented by specific fields of TStyle)
42 42
 	 */
43
-	private $_customStyle=null;
43
+	private $_customStyle = null;
44 44
 	/**
45 45
 	 * @var string display style
46 46
 	 */
47
-	private $_displayStyle='Fixed';
47
+	private $_displayStyle = 'Fixed';
48 48
 
49 49
 	/**
50 50
 	 * Returns an array with the names of all variables of this object that should NOT be serialized
@@ -55,15 +55,15 @@  discard block
 block discarded – undo
55 55
 	protected function __getZappableSleepProps(&$exprops)
56 56
 	{
57 57
 		parent::__getZappableSleepProps($exprops);
58
-		if ($this->_fields===array())
58
+		if ($this->_fields === array())
59 59
 			$exprops[] = "\0TStyle\0_fields";
60
-		if($this->_font===null)
60
+		if ($this->_font === null)
61 61
 			$exprops[] = "\0TStyle\0_font";
62
-		if($this->_class===null)
62
+		if ($this->_class === null)
63 63
 			$exprops[] = "\0TStyle\0_class";
64
-		if ($this->_customStyle===null)
64
+		if ($this->_customStyle === null)
65 65
 			$exprops[] = "\0TStyle\0_customStyle";
66
-		if ($this->_displayStyle==='Fixed')
66
+		if ($this->_displayStyle === 'Fixed')
67 67
 			$exprops[] = "\0TStyle\0_displayStyle";
68 68
 	}
69 69
 
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
 	 * Constructor.
72 72
 	 * @param TStyle style to copy from
73 73
 	 */
74
-	public function __construct($style=null)
74
+	public function __construct($style = null)
75 75
 	{
76
-		if($style!==null)
76
+		if ($style !== null)
77 77
 			$this->copyFrom($style);
78 78
 	}
79 79
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	public function __clone()
84 84
 	{
85
-		if($this->_font!==null)
85
+		if ($this->_font !== null)
86 86
 			$this->_font = clone($this->_font);
87 87
 	}
88 88
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function getBackColor()
93 93
 	{
94
-		return isset($this->_fields['background-color'])?$this->_fields['background-color']:'';
94
+		return isset($this->_fields['background-color']) ? $this->_fields['background-color'] : '';
95 95
 	}
96 96
 
97 97
 	/**
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 	 */
100 100
 	public function setBackColor($value)
101 101
 	{
102
-		if(trim($value)==='')
102
+		if (trim($value) === '')
103 103
 			unset($this->_fields['background-color']);
104 104
 		else
105
-			$this->_fields['background-color']=$value;
105
+			$this->_fields['background-color'] = $value;
106 106
 	}
107 107
 
108 108
 	/**
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 */
111 111
 	public function getBorderColor()
112 112
 	{
113
-		return isset($this->_fields['border-color'])?$this->_fields['border-color']:'';
113
+		return isset($this->_fields['border-color']) ? $this->_fields['border-color'] : '';
114 114
 	}
115 115
 
116 116
 	/**
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	public function setBorderColor($value)
120 120
 	{
121
-		if(trim($value)==='')
121
+		if (trim($value) === '')
122 122
 			unset($this->_fields['border-color']);
123 123
 		else
124
-			$this->_fields['border-color']=$value;
124
+			$this->_fields['border-color'] = $value;
125 125
 	}
126 126
 
127 127
 	/**
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 */
130 130
 	public function getBorderStyle()
131 131
 	{
132
-		return isset($this->_fields['border-style'])?$this->_fields['border-style']:'';
132
+		return isset($this->_fields['border-style']) ? $this->_fields['border-style'] : '';
133 133
 	}
134 134
 
135 135
 	/**
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	public function setBorderStyle($value)
140 140
 	{
141
-		if(trim($value)==='')
141
+		if (trim($value) === '')
142 142
 			unset($this->_fields['border-style']);
143 143
 		else
144
-			$this->_fields['border-style']=$value;
144
+			$this->_fields['border-style'] = $value;
145 145
 	}
146 146
 
147 147
 	/**
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	 */
150 150
 	public function getBorderWidth()
151 151
 	{
152
-		return isset($this->_fields['border-width'])?$this->_fields['border-width']:'';
152
+		return isset($this->_fields['border-width']) ? $this->_fields['border-width'] : '';
153 153
 	}
154 154
 
155 155
 	/**
@@ -157,10 +157,10 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	public function setBorderWidth($value)
159 159
 	{
160
-		if(trim($value)==='')
160
+		if (trim($value) === '')
161 161
 			unset($this->_fields['border-width']);
162 162
 		else
163
-			$this->_fields['border-width']=$value;
163
+			$this->_fields['border-width'] = $value;
164 164
 	}
165 165
 
166 166
 	/**
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	public function getCssClass()
170 170
 	{
171
-		return $this->_class===null?'':$this->_class;
171
+		return $this->_class === null ? '' : $this->_class;
172 172
 	}
173 173
 
174 174
 	/**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	 */
177 177
 	public function hasCssClass()
178 178
 	{
179
-		return ($this->_class!==null);
179
+		return ($this->_class !== null);
180 180
 	}
181 181
 
182 182
 	/**
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	 */
185 185
 	public function setCssClass($value)
186 186
 	{
187
-		$this->_class=$value;
187
+		$this->_class = $value;
188 188
 	}
189 189
 
190 190
 	/**
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
 	 */
193 193
 	public function getFont()
194 194
 	{
195
-		if($this->_font===null)
196
-			$this->_font=new TFont;
195
+		if ($this->_font === null)
196
+			$this->_font = new TFont;
197 197
 		return $this->_font;
198 198
 	}
199 199
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 	public function setDisplayStyle($value)
212 212
 	{
213 213
 		$this->_displayStyle = TPropertyValue::ensureEnum($value, 'TDisplayStyle');
214
-		switch($this->_displayStyle)
214
+		switch ($this->_displayStyle)
215 215
 		{
216 216
 			case TDisplayStyle::None:
217 217
 				$this->_fields['display'] = 'none';
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 	 */
242 242
 	public function getForeColor()
243 243
 	{
244
-		return isset($this->_fields['color'])?$this->_fields['color']:'';
244
+		return isset($this->_fields['color']) ? $this->_fields['color'] : '';
245 245
 	}
246 246
 
247 247
 	/**
@@ -249,10 +249,10 @@  discard block
 block discarded – undo
249 249
 	 */
250 250
 	public function setForeColor($value)
251 251
 	{
252
-		if(trim($value)==='')
252
+		if (trim($value) === '')
253 253
 			unset($this->_fields['color']);
254 254
 		else
255
-			$this->_fields['color']=$value;
255
+			$this->_fields['color'] = $value;
256 256
 	}
257 257
 
258 258
 	/**
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 	 */
261 261
 	public function getHeight()
262 262
 	{
263
-		return isset($this->_fields['height'])?$this->_fields['height']:'';
263
+		return isset($this->_fields['height']) ? $this->_fields['height'] : '';
264 264
 	}
265 265
 
266 266
 	/**
@@ -268,10 +268,10 @@  discard block
 block discarded – undo
268 268
 	 */
269 269
 	public function setHeight($value)
270 270
 	{
271
-		if(trim($value)==='')
271
+		if (trim($value) === '')
272 272
 			unset($this->_fields['height']);
273 273
 		else
274
-			$this->_fields['height']=$value;
274
+			$this->_fields['height'] = $value;
275 275
 	}
276 276
 
277 277
 	/**
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	 */
280 280
 	public function getCustomStyle()
281 281
 	{
282
-		return $this->_customStyle===null?'':$this->_customStyle;
282
+		return $this->_customStyle === null ? '' : $this->_customStyle;
283 283
 	}
284 284
 
285 285
 	/**
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 	 */
290 290
 	public function setCustomStyle($value)
291 291
 	{
292
-		$this->_customStyle=$value;
292
+		$this->_customStyle = $value;
293 293
 	}
294 294
 
295 295
 	/**
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	 */
298 298
 	public function getStyleField($name)
299 299
 	{
300
-		return isset($this->_fields[$name])?$this->_fields[$name]:'';
300
+		return isset($this->_fields[$name]) ? $this->_fields[$name] : '';
301 301
 	}
302 302
 
303 303
 	/**
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
 	 * @param string style field name
307 307
 	 * @param string style field value
308 308
 	 */
309
-	public function setStyleField($name,$value)
309
+	public function setStyleField($name, $value)
310 310
 	{
311
-		$this->_fields[$name]=$value;
311
+		$this->_fields[$name] = $value;
312 312
 	}
313 313
 
314 314
 	/**
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 	 */
334 334
 	public function getWidth()
335 335
 	{
336
-		return isset($this->_fields['width'])?$this->_fields['width']:'';
336
+		return isset($this->_fields['width']) ? $this->_fields['width'] : '';
337 337
 	}
338 338
 
339 339
 	/**
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 	 */
342 342
 	public function setWidth($value)
343 343
 	{
344
-		$this->_fields['width']=$value;
344
+		$this->_fields['width'] = $value;
345 345
 	}
346 346
 
347 347
 	/**
@@ -349,10 +349,10 @@  discard block
 block discarded – undo
349 349
 	 */
350 350
 	public function reset()
351 351
 	{
352
-		$this->_fields=array();
353
-		$this->_font=null;
354
-		$this->_class=null;
355
-		$this->_customStyle=null;
352
+		$this->_fields = array();
353
+		$this->_font = null;
354
+		$this->_class = null;
355
+		$this->_customStyle = null;
356 356
 	}
357 357
 
358 358
 	/**
@@ -363,14 +363,14 @@  discard block
 block discarded – undo
363 363
 	 */
364 364
 	public function copyFrom($style)
365 365
 	{
366
-		if($style instanceof TStyle)
366
+		if ($style instanceof TStyle)
367 367
 		{
368
-			$this->_fields=array_merge($this->_fields,$style->_fields);
369
-			if($style->_class!==null)
370
-				$this->_class=$style->_class;
371
-			if($style->_customStyle!==null)
372
-				$this->_customStyle=$style->_customStyle;
373
-			if($style->_font!==null)
368
+			$this->_fields = array_merge($this->_fields, $style->_fields);
369
+			if ($style->_class !== null)
370
+				$this->_class = $style->_class;
371
+			if ($style->_customStyle !== null)
372
+				$this->_customStyle = $style->_customStyle;
373
+			if ($style->_font !== null)
374 374
 				$this->getFont()->copyFrom($style->_font);
375 375
 		}
376 376
 	}
@@ -383,14 +383,14 @@  discard block
 block discarded – undo
383 383
 	 */
384 384
 	public function mergeWith($style)
385 385
 	{
386
-		if($style instanceof TStyle)
386
+		if ($style instanceof TStyle)
387 387
 		{
388
-			$this->_fields=array_merge($style->_fields,$this->_fields);
389
-			if($this->_class===null)
390
-				$this->_class=$style->_class;
391
-			if($this->_customStyle===null)
392
-				$this->_customStyle=$style->_customStyle;
393
-			if($style->_font!==null)
388
+			$this->_fields = array_merge($style->_fields, $this->_fields);
389
+			if ($this->_class === null)
390
+				$this->_class = $style->_class;
391
+			if ($this->_customStyle === null)
392
+				$this->_customStyle = $style->_customStyle;
393
+			if ($style->_font !== null)
394 394
 				$this->getFont()->mergeWith($style->_font);
395 395
 		}
396 396
 	}
@@ -401,20 +401,20 @@  discard block
 block discarded – undo
401 401
 	 */
402 402
 	public function addAttributesToRender($writer)
403 403
 	{
404
-		if($this->_customStyle!==null)
404
+		if ($this->_customStyle !== null)
405 405
 		{
406
-			foreach(explode(';',$this->_customStyle) as $style)
406
+			foreach (explode(';', $this->_customStyle) as $style)
407 407
 			{
408
-				$arr=explode(':',$style,2);
409
-				if(isset($arr[1]) && trim($arr[0])!=='')
410
-					$writer->addStyleAttribute(trim($arr[0]),trim($arr[1]));
408
+				$arr = explode(':', $style, 2);
409
+				if (isset($arr[1]) && trim($arr[0]) !== '')
410
+					$writer->addStyleAttribute(trim($arr[0]), trim($arr[1]));
411 411
 			}
412 412
 		}
413 413
 		$writer->addStyleAttributes($this->_fields);
414
-		if($this->_font!==null)
414
+		if ($this->_font !== null)
415 415
 			$this->_font->addAttributesToRender($writer);
416
-		if($this->_class!==null)
417
-			$writer->addAttribute('class',$this->_class);
416
+		if ($this->_class !== null)
417
+			$writer->addAttribute('class', $this->_class);
418 418
 	}
419 419
 
420 420
 	/**
@@ -442,10 +442,10 @@  discard block
 block discarded – undo
442 442
  */
443 443
 class TDisplayStyle extends TEnumerable
444 444
 {
445
-	const None='None';
446
-	const Dynamic='Dynamic';
447
-	const Fixed='Fixed';
448
-	const Hidden='Hidden';
445
+	const None = 'None';
446
+	const Dynamic = 'Dynamic';
447
+	const Fixed = 'Fixed';
448
+	const Hidden = 'Hidden';
449 449
 }
450 450
 
451 451
 /**
@@ -461,27 +461,27 @@  discard block
 block discarded – undo
461 461
 	/**
462 462
 	 * @var TVerticalAlign the URL of the background image for the table
463 463
 	 */
464
-	private $_backImageUrl=null;
464
+	private $_backImageUrl = null;
465 465
 	/**
466 466
 	 * @var THorizontalAlign horizontal alignment of the contents within the table
467 467
 	 */
468
-	private $_horizontalAlign=null;
468
+	private $_horizontalAlign = null;
469 469
 	/**
470 470
 	 * @var integer cellpadding of the table
471 471
 	 */
472
-	private $_cellPadding=null;
472
+	private $_cellPadding = null;
473 473
 	/**
474 474
 	 * @var integer cellspacing of the table
475 475
 	 */
476
-	private $_cellSpacing=null;
476
+	private $_cellSpacing = null;
477 477
 	/**
478 478
 	 * @var TTableGridLines grid line setting of the table
479 479
 	 */
480
-	private $_gridLines=null;
480
+	private $_gridLines = null;
481 481
 	/**
482 482
 	 * @var boolean whether the table border should be collapsed
483 483
 	 */
484
-	private $_borderCollapse=null;
484
+	private $_borderCollapse = null;
485 485
 
486 486
 	/**
487 487
 	 * Returns an array with the names of all variables of this object that should NOT be serialized
@@ -492,17 +492,17 @@  discard block
 block discarded – undo
492 492
 	protected function __getZappableSleepProps(&$exprops)
493 493
 	{
494 494
 		parent::__getZappableSleepProps($exprops);
495
-		if ($this->_backImageUrl===null)
495
+		if ($this->_backImageUrl === null)
496 496
 			$exprops[] = "\0TTableStyle\0_backImageUrl";
497
-		if ($this->_horizontalAlign===null)
497
+		if ($this->_horizontalAlign === null)
498 498
 			$exprops[] = "\0TTableStyle\0_horizontalAlign";
499
-		if ($this->_cellPadding===null)
499
+		if ($this->_cellPadding === null)
500 500
 			$exprops[] = "\0TTableStyle\0_cellPadding";
501
-		if ($this->_cellSpacing===null)
501
+		if ($this->_cellSpacing === null)
502 502
 			$exprops[] = "\0TTableStyle\0_cellSpacing";
503
-		if ($this->_gridLines===null)
503
+		if ($this->_gridLines === null)
504 504
 			$exprops[] = "\0TTableStyle\0_gridLines";
505
-		if ($this->_borderCollapse===null)
505
+		if ($this->_borderCollapse === null)
506 506
 			$exprops[] = "\0TTableStyle\0_borderCollapse";
507 507
 	}
508 508
 
@@ -513,12 +513,12 @@  discard block
 block discarded – undo
513 513
 	 */
514 514
 	public function reset()
515 515
 	{
516
-		$this->_backImageUrl=null;
517
-		$this->_horizontalAlign=null;
518
-		$this->_cellPadding=null;
519
-		$this->_cellSpacing=null;
520
-		$this->_gridLines=null;
521
-		$this->_borderCollapse=null;
516
+		$this->_backImageUrl = null;
517
+		$this->_horizontalAlign = null;
518
+		$this->_cellPadding = null;
519
+		$this->_cellSpacing = null;
520
+		$this->_gridLines = null;
521
+		$this->_borderCollapse = null;
522 522
 	}
523 523
 
524 524
 	/**
@@ -530,20 +530,20 @@  discard block
 block discarded – undo
530 530
 	public function copyFrom($style)
531 531
 	{
532 532
 		parent::copyFrom($style);
533
-		if($style instanceof TTableStyle)
533
+		if ($style instanceof TTableStyle)
534 534
 		{
535
-			if($style->_backImageUrl!==null)
536
-				$this->_backImageUrl=$style->_backImageUrl;
537
-			if($style->_horizontalAlign!==null)
538
-				$this->_horizontalAlign=$style->_horizontalAlign;
539
-			if($style->_cellPadding!==null)
540
-				$this->_cellPadding=$style->_cellPadding;
541
-			if($style->_cellSpacing!==null)
542
-				$this->_cellSpacing=$style->_cellSpacing;
543
-			if($style->_gridLines!==null)
544
-				$this->_gridLines=$style->_gridLines;
545
-			if($style->_borderCollapse!==null)
546
-				$this->_borderCollapse=$style->_borderCollapse;
535
+			if ($style->_backImageUrl !== null)
536
+				$this->_backImageUrl = $style->_backImageUrl;
537
+			if ($style->_horizontalAlign !== null)
538
+				$this->_horizontalAlign = $style->_horizontalAlign;
539
+			if ($style->_cellPadding !== null)
540
+				$this->_cellPadding = $style->_cellPadding;
541
+			if ($style->_cellSpacing !== null)
542
+				$this->_cellSpacing = $style->_cellSpacing;
543
+			if ($style->_gridLines !== null)
544
+				$this->_gridLines = $style->_gridLines;
545
+			if ($style->_borderCollapse !== null)
546
+				$this->_borderCollapse = $style->_borderCollapse;
547 547
 		}
548 548
 	}
549 549
 
@@ -556,20 +556,20 @@  discard block
 block discarded – undo
556 556
 	public function mergeWith($style)
557 557
 	{
558 558
 		parent::mergeWith($style);
559
-		if($style instanceof TTableStyle)
559
+		if ($style instanceof TTableStyle)
560 560
 		{
561
-			if($this->_backImageUrl===null && $style->_backImageUrl!==null)
562
-				$this->_backImageUrl=$style->_backImageUrl;
563
-			if($this->_horizontalAlign===null && $style->_horizontalAlign!==null)
564
-				$this->_horizontalAlign=$style->_horizontalAlign;
565
-			if($this->_cellPadding===null && $style->_cellPadding!==null)
566
-				$this->_cellPadding=$style->_cellPadding;
567
-			if($this->_cellSpacing===null && $style->_cellSpacing!==null)
568
-				$this->_cellSpacing=$style->_cellSpacing;
569
-			if($this->_gridLines===null && $style->_gridLines!==null)
570
-				$this->_gridLines=$style->_gridLines;
571
-			if($this->_borderCollapse===null && $style->_borderCollapse!==null)
572
-				$this->_borderCollapse=$style->_borderCollapse;
561
+			if ($this->_backImageUrl === null && $style->_backImageUrl !== null)
562
+				$this->_backImageUrl = $style->_backImageUrl;
563
+			if ($this->_horizontalAlign === null && $style->_horizontalAlign !== null)
564
+				$this->_horizontalAlign = $style->_horizontalAlign;
565
+			if ($this->_cellPadding === null && $style->_cellPadding !== null)
566
+				$this->_cellPadding = $style->_cellPadding;
567
+			if ($this->_cellSpacing === null && $style->_cellSpacing !== null)
568
+				$this->_cellSpacing = $style->_cellSpacing;
569
+			if ($this->_gridLines === null && $style->_gridLines !== null)
570
+				$this->_gridLines = $style->_gridLines;
571
+			if ($this->_borderCollapse === null && $style->_borderCollapse !== null)
572
+				$this->_borderCollapse = $style->_borderCollapse;
573 573
 		}
574 574
 	}
575 575
 
@@ -581,26 +581,26 @@  discard block
 block discarded – undo
581 581
 	 */
582 582
 	public function addAttributesToRender($writer)
583 583
 	{
584
-		if(($url=trim($this->getBackImageUrl()))!=='')
585
-			$writer->addStyleAttribute('background-image','url('.$url.')');
584
+		if (($url = trim($this->getBackImageUrl())) !== '')
585
+			$writer->addStyleAttribute('background-image', 'url(' . $url . ')');
586 586
 
587
-		if(($horizontalAlign=$this->getHorizontalAlign())!==THorizontalAlign::NotSet)
588
-			$writer->addStyleAttribute('text-align',strtolower($horizontalAlign));
587
+		if (($horizontalAlign = $this->getHorizontalAlign()) !== THorizontalAlign::NotSet)
588
+			$writer->addStyleAttribute('text-align', strtolower($horizontalAlign));
589 589
 
590
-		if(($cellPadding=$this->getCellPadding())>=0)
591
-			$writer->addAttribute('cellpadding',"$cellPadding");
590
+		if (($cellPadding = $this->getCellPadding()) >= 0)
591
+			$writer->addAttribute('cellpadding', "$cellPadding");
592 592
 
593
-		if(($cellSpacing=$this->getCellSpacing())>=0)
594
-			$writer->addAttribute('cellspacing',"$cellSpacing");
593
+		if (($cellSpacing = $this->getCellSpacing()) >= 0)
594
+			$writer->addAttribute('cellspacing', "$cellSpacing");
595 595
 
596
-		if($this->getBorderCollapse())
597
-			$writer->addStyleAttribute('border-collapse','collapse');
596
+		if ($this->getBorderCollapse())
597
+			$writer->addStyleAttribute('border-collapse', 'collapse');
598 598
 
599
-		switch($this->getGridLines())
599
+		switch ($this->getGridLines())
600 600
 		{
601
-			case TTableGridLines::Horizontal : $writer->addAttribute('rules','rows'); break;
602
-			case TTableGridLines::Vertical : $writer->addAttribute('rules','cols'); break;
603
-			case TTableGridLines::Both : $writer->addAttribute('rules','all'); break;
601
+			case TTableGridLines::Horizontal : $writer->addAttribute('rules', 'rows'); break;
602
+			case TTableGridLines::Vertical : $writer->addAttribute('rules', 'cols'); break;
603
+			case TTableGridLines::Both : $writer->addAttribute('rules', 'all'); break;
604 604
 		}
605 605
 
606 606
 		parent::addAttributesToRender($writer);
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
 	 */
612 612
 	public function getBackImageUrl()
613 613
 	{
614
-		return $this->_backImageUrl===null?'':$this->_backImageUrl;
614
+		return $this->_backImageUrl === null ? '' : $this->_backImageUrl;
615 615
 	}
616 616
 
617 617
 	/**
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 	 */
621 621
 	public function setBackImageUrl($value)
622 622
 	{
623
-		$this->_backImageUrl=$value;
623
+		$this->_backImageUrl = $value;
624 624
 	}
625 625
 
626 626
 	/**
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 	 */
629 629
 	public function getHorizontalAlign()
630 630
 	{
631
-		return $this->_horizontalAlign===null?THorizontalAlign::NotSet:$this->_horizontalAlign;
631
+		return $this->_horizontalAlign === null ? THorizontalAlign::NotSet : $this->_horizontalAlign;
632 632
 	}
633 633
 
634 634
 	/**
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 	 */
638 638
 	public function setHorizontalAlign($value)
639 639
 	{
640
-		$this->_horizontalAlign=TPropertyValue::ensureEnum($value,'THorizontalAlign');
640
+		$this->_horizontalAlign = TPropertyValue::ensureEnum($value, 'THorizontalAlign');
641 641
 	}
642 642
 
643 643
 	/**
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 	 */
646 646
 	public function getCellPadding()
647 647
 	{
648
-		return $this->_cellPadding===null?-1:$this->_cellPadding;
648
+		return $this->_cellPadding === null ?-1 : $this->_cellPadding;
649 649
 	}
650 650
 
651 651
 	/**
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
 	 */
655 655
 	public function setCellPadding($value)
656 656
 	{
657
-		if(($this->_cellPadding=TPropertyValue::ensureInteger($value))<-1)
657
+		if (($this->_cellPadding = TPropertyValue::ensureInteger($value)) < -1)
658 658
 			throw new TInvalidDataValueException('tablestyle_cellpadding_invalid');
659 659
 	}
660 660
 
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 	 */
664 664
 	public function getCellSpacing()
665 665
 	{
666
-		return $this->_cellSpacing===null?-1:$this->_cellSpacing;
666
+		return $this->_cellSpacing === null ?-1 : $this->_cellSpacing;
667 667
 	}
668 668
 
669 669
 	/**
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 	 */
673 673
 	public function setCellSpacing($value)
674 674
 	{
675
-		if(($this->_cellSpacing=TPropertyValue::ensureInteger($value))<-1)
675
+		if (($this->_cellSpacing = TPropertyValue::ensureInteger($value)) < -1)
676 676
 			throw new TInvalidDataValueException('tablestyle_cellspacing_invalid');
677 677
 	}
678 678
 
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
 	 */
682 682
 	public function getGridLines()
683 683
 	{
684
-		return $this->_gridLines===null?TTableGridLines::None:$this->_gridLines;
684
+		return $this->_gridLines === null ? TTableGridLines::None : $this->_gridLines;
685 685
 	}
686 686
 
687 687
 	/**
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
 	 */
691 691
 	public function setGridLines($value)
692 692
 	{
693
-		$this->_gridLines=TPropertyValue::ensureEnum($value,'TTableGridLines');
693
+		$this->_gridLines = TPropertyValue::ensureEnum($value, 'TTableGridLines');
694 694
 	}
695 695
 
696 696
 
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 	 */
700 700
 	public function getBorderCollapse()
701 701
 	{
702
-		return $this->_borderCollapse===null?false:$this->_borderCollapse;
702
+		return $this->_borderCollapse === null ? false : $this->_borderCollapse;
703 703
 	}
704 704
 
705 705
 	/**
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 	 */
708 708
 	public function setBorderCollapse($value)
709 709
 	{
710
-		$this->_borderCollapse=TPropertyValue::ensureBoolean($value);
710
+		$this->_borderCollapse = TPropertyValue::ensureBoolean($value);
711 711
 	}
712 712
 }
713 713
 
@@ -724,15 +724,15 @@  discard block
 block discarded – undo
724 724
 	/**
725 725
 	 * @var THorizontalAlign horizontal alignment of the contents within the table item
726 726
 	 */
727
-	private $_horizontalAlign=null;
727
+	private $_horizontalAlign = null;
728 728
 	/**
729 729
 	 * @var TVerticalAlign vertical alignment of the contents within the table item
730 730
 	 */
731
-	private $_verticalAlign=null;
731
+	private $_verticalAlign = null;
732 732
 	/**
733 733
 	 * @var boolean whether the content wraps within the table item
734 734
 	 */
735
-	private $_wrap=null;
735
+	private $_wrap = null;
736 736
 
737 737
 	/**
738 738
 	 * Returns an array with the names of all variables of this object that should NOT be serialized
@@ -743,11 +743,11 @@  discard block
 block discarded – undo
743 743
 	protected function __getZappableSleepProps(&$exprops)
744 744
 	{
745 745
 		parent::__getZappableSleepProps($exprops);
746
-		if ($this->_horizontalAlign===null)
746
+		if ($this->_horizontalAlign === null)
747 747
 			$exprops[] = "\0TTableItemStyle\0_horizontalAlign";
748
-		if ($this->_verticalAlign===null)
748
+		if ($this->_verticalAlign === null)
749 749
 			$exprops[] = "\0TTableItemStyle\0_verticalAlign";
750
-		if ($this->_wrap===null)
750
+		if ($this->_wrap === null)
751 751
 			$exprops[] = "\0TTableItemStyle\0_wrap";
752 752
 	}
753 753
 
@@ -759,9 +759,9 @@  discard block
 block discarded – undo
759 759
 	public function reset()
760 760
 	{
761 761
 		parent::reset();
762
-		$this->_verticalAlign=null;
763
-		$this->_horizontalAlign=null;
764
-		$this->_wrap=null;
762
+		$this->_verticalAlign = null;
763
+		$this->_horizontalAlign = null;
764
+		$this->_wrap = null;
765 765
 	}
766 766
 
767 767
 	/**
@@ -773,14 +773,14 @@  discard block
 block discarded – undo
773 773
 	public function copyFrom($style)
774 774
 	{
775 775
 		parent::copyFrom($style);
776
-		if($style instanceof TTableItemStyle)
776
+		if ($style instanceof TTableItemStyle)
777 777
 		{
778
-			if($this->_verticalAlign===null && $style->_verticalAlign!==null)
779
-				$this->_verticalAlign=$style->_verticalAlign;
780
-			if($this->_horizontalAlign===null && $style->_horizontalAlign!==null)
781
-				$this->_horizontalAlign=$style->_horizontalAlign;
782
-			if($this->_wrap===null && $style->_wrap!==null)
783
-				$this->_wrap=$style->_wrap;
778
+			if ($this->_verticalAlign === null && $style->_verticalAlign !== null)
779
+				$this->_verticalAlign = $style->_verticalAlign;
780
+			if ($this->_horizontalAlign === null && $style->_horizontalAlign !== null)
781
+				$this->_horizontalAlign = $style->_horizontalAlign;
782
+			if ($this->_wrap === null && $style->_wrap !== null)
783
+				$this->_wrap = $style->_wrap;
784 784
 		}
785 785
 	}
786 786
 
@@ -793,14 +793,14 @@  discard block
 block discarded – undo
793 793
 	public function mergeWith($style)
794 794
 	{
795 795
 		parent::mergeWith($style);
796
-		if($style instanceof TTableItemStyle)
796
+		if ($style instanceof TTableItemStyle)
797 797
 		{
798
-			if($style->_verticalAlign!==null)
799
-				$this->_verticalAlign=$style->_verticalAlign;
800
-			if($style->_horizontalAlign!==null)
801
-				$this->_horizontalAlign=$style->_horizontalAlign;
802
-			if($style->_wrap!==null)
803
-				$this->_wrap=$style->_wrap;
798
+			if ($style->_verticalAlign !== null)
799
+				$this->_verticalAlign = $style->_verticalAlign;
800
+			if ($style->_horizontalAlign !== null)
801
+				$this->_horizontalAlign = $style->_horizontalAlign;
802
+			if ($style->_wrap !== null)
803
+				$this->_wrap = $style->_wrap;
804 804
 		}
805 805
 	}
806 806
 
@@ -811,14 +811,14 @@  discard block
 block discarded – undo
811 811
 	 */
812 812
 	public function addAttributesToRender($writer)
813 813
 	{
814
-		if(!$this->getWrap())
815
-			$writer->addStyleAttribute('white-space','nowrap');
814
+		if (!$this->getWrap())
815
+			$writer->addStyleAttribute('white-space', 'nowrap');
816 816
 
817
-		if(($horizontalAlign=$this->getHorizontalAlign())!==THorizontalAlign::NotSet)
818
-			$writer->addAttribute('align',strtolower($horizontalAlign));
817
+		if (($horizontalAlign = $this->getHorizontalAlign()) !== THorizontalAlign::NotSet)
818
+			$writer->addAttribute('align', strtolower($horizontalAlign));
819 819
 
820
-		if(($verticalAlign=$this->getVerticalAlign())!==TVerticalAlign::NotSet)
821
-			$writer->addAttribute('valign',strtolower($verticalAlign));
820
+		if (($verticalAlign = $this->getVerticalAlign()) !== TVerticalAlign::NotSet)
821
+			$writer->addAttribute('valign', strtolower($verticalAlign));
822 822
 
823 823
 		parent::addAttributesToRender($writer);
824 824
 	}
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 	 */
829 829
 	public function getHorizontalAlign()
830 830
 	{
831
-		return $this->_horizontalAlign===null?THorizontalAlign::NotSet:$this->_horizontalAlign;
831
+		return $this->_horizontalAlign === null ? THorizontalAlign::NotSet : $this->_horizontalAlign;
832 832
 	}
833 833
 
834 834
 	/**
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
 	 */
838 838
 	public function setHorizontalAlign($value)
839 839
 	{
840
-		$this->_horizontalAlign=TPropertyValue::ensureEnum($value,'THorizontalAlign');
840
+		$this->_horizontalAlign = TPropertyValue::ensureEnum($value, 'THorizontalAlign');
841 841
 	}
842 842
 
843 843
 	/**
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 	 */
846 846
 	public function getVerticalAlign()
847 847
 	{
848
-		return $this->_verticalAlign===null?TVerticalAlign::NotSet:$this->_verticalAlign;
848
+		return $this->_verticalAlign === null ? TVerticalAlign::NotSet : $this->_verticalAlign;
849 849
 	}
850 850
 
851 851
 	/**
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 	 */
855 855
 	public function setVerticalAlign($value)
856 856
 	{
857
-		$this->_verticalAlign=TPropertyValue::ensureEnum($value,'TVerticalAlign');
857
+		$this->_verticalAlign = TPropertyValue::ensureEnum($value, 'TVerticalAlign');
858 858
 	}
859 859
 
860 860
 	/**
@@ -862,7 +862,7 @@  discard block
 block discarded – undo
862 862
 	 */
863 863
 	public function getWrap()
864 864
 	{
865
-		return $this->_wrap===null?true:$this->_wrap;
865
+		return $this->_wrap === null ? true : $this->_wrap;
866 866
 	}
867 867
 
868 868
 	/**
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
 	 */
872 872
 	public function setWrap($value)
873 873
 	{
874
-		$this->_wrap=TPropertyValue::ensureBoolean($value);
874
+		$this->_wrap = TPropertyValue::ensureBoolean($value);
875 875
 	}
876 876
 }
877 877
 
@@ -892,11 +892,11 @@  discard block
 block discarded – undo
892 892
  */
893 893
 class THorizontalAlign extends TEnumerable
894 894
 {
895
-	const NotSet='NotSet';
896
-	const Left='Left';
897
-	const Right='Right';
898
-	const Center='Center';
899
-	const Justify='Justify';
895
+	const NotSet = 'NotSet';
896
+	const Left = 'Left';
897
+	const Right = 'Right';
898
+	const Center = 'Center';
899
+	const Justify = 'Justify';
900 900
 }
901 901
 
902 902
 /**
@@ -915,10 +915,10 @@  discard block
 block discarded – undo
915 915
  */
916 916
 class TVerticalAlign extends TEnumerable
917 917
 {
918
-	const NotSet='NotSet';
919
-	const Top='Top';
920
-	const Bottom='Bottom';
921
-	const Middle='Middle';
918
+	const NotSet = 'NotSet';
919
+	const Top = 'Top';
920
+	const Bottom = 'Bottom';
921
+	const Middle = 'Middle';
922 922
 }
923 923
 
924 924
 
@@ -938,9 +938,9 @@  discard block
 block discarded – undo
938 938
  */
939 939
 class TTableGridLines extends TEnumerable
940 940
 {
941
-	const None='None';
942
-	const Horizontal='Horizontal';
943
-	const Vertical='Vertical';
944
-	const Both='Both';
941
+	const None = 'None';
942
+	const Horizontal = 'Horizontal';
943
+	const Vertical = 'Vertical';
944
+	const Both = 'Both';
945 945
 }
946 946
 
Please login to merge, or discard this patch.
Braces   +192 added lines, -132 removed lines patch added patch discarded remove patch
@@ -55,16 +55,21 @@  discard block
 block discarded – undo
55 55
 	protected function __getZappableSleepProps(&$exprops)
56 56
 	{
57 57
 		parent::__getZappableSleepProps($exprops);
58
-		if ($this->_fields===array())
59
-			$exprops[] = "\0TStyle\0_fields";
60
-		if($this->_font===null)
61
-			$exprops[] = "\0TStyle\0_font";
62
-		if($this->_class===null)
63
-			$exprops[] = "\0TStyle\0_class";
64
-		if ($this->_customStyle===null)
65
-			$exprops[] = "\0TStyle\0_customStyle";
66
-		if ($this->_displayStyle==='Fixed')
67
-			$exprops[] = "\0TStyle\0_displayStyle";
58
+		if ($this->_fields===array()) {
59
+					$exprops[] = "\0TStyle\0_fields";
60
+		}
61
+		if($this->_font===null) {
62
+					$exprops[] = "\0TStyle\0_font";
63
+		}
64
+		if($this->_class===null) {
65
+					$exprops[] = "\0TStyle\0_class";
66
+		}
67
+		if ($this->_customStyle===null) {
68
+					$exprops[] = "\0TStyle\0_customStyle";
69
+		}
70
+		if ($this->_displayStyle==='Fixed') {
71
+					$exprops[] = "\0TStyle\0_displayStyle";
72
+		}
68 73
 	}
69 74
 
70 75
 	/**
@@ -73,8 +78,9 @@  discard block
 block discarded – undo
73 78
 	 */
74 79
 	public function __construct($style=null)
75 80
 	{
76
-		if($style!==null)
77
-			$this->copyFrom($style);
81
+		if($style!==null) {
82
+					$this->copyFrom($style);
83
+		}
78 84
 	}
79 85
 
80 86
 	/**
@@ -82,8 +88,9 @@  discard block
 block discarded – undo
82 88
 	 */
83 89
 	public function __clone()
84 90
 	{
85
-		if($this->_font!==null)
86
-			$this->_font = clone($this->_font);
91
+		if($this->_font!==null) {
92
+					$this->_font = clone($this->_font);
93
+		}
87 94
 	}
88 95
 
89 96
 	/**
@@ -99,10 +106,11 @@  discard block
 block discarded – undo
99 106
 	 */
100 107
 	public function setBackColor($value)
101 108
 	{
102
-		if(trim($value)==='')
103
-			unset($this->_fields['background-color']);
104
-		else
105
-			$this->_fields['background-color']=$value;
109
+		if(trim($value)==='') {
110
+					unset($this->_fields['background-color']);
111
+		} else {
112
+					$this->_fields['background-color']=$value;
113
+		}
106 114
 	}
107 115
 
108 116
 	/**
@@ -118,10 +126,11 @@  discard block
 block discarded – undo
118 126
 	 */
119 127
 	public function setBorderColor($value)
120 128
 	{
121
-		if(trim($value)==='')
122
-			unset($this->_fields['border-color']);
123
-		else
124
-			$this->_fields['border-color']=$value;
129
+		if(trim($value)==='') {
130
+					unset($this->_fields['border-color']);
131
+		} else {
132
+					$this->_fields['border-color']=$value;
133
+		}
125 134
 	}
126 135
 
127 136
 	/**
@@ -138,10 +147,11 @@  discard block
 block discarded – undo
138 147
 	 */
139 148
 	public function setBorderStyle($value)
140 149
 	{
141
-		if(trim($value)==='')
142
-			unset($this->_fields['border-style']);
143
-		else
144
-			$this->_fields['border-style']=$value;
150
+		if(trim($value)==='') {
151
+					unset($this->_fields['border-style']);
152
+		} else {
153
+					$this->_fields['border-style']=$value;
154
+		}
145 155
 	}
146 156
 
147 157
 	/**
@@ -157,10 +167,11 @@  discard block
 block discarded – undo
157 167
 	 */
158 168
 	public function setBorderWidth($value)
159 169
 	{
160
-		if(trim($value)==='')
161
-			unset($this->_fields['border-width']);
162
-		else
163
-			$this->_fields['border-width']=$value;
170
+		if(trim($value)==='') {
171
+					unset($this->_fields['border-width']);
172
+		} else {
173
+					$this->_fields['border-width']=$value;
174
+		}
164 175
 	}
165 176
 
166 177
 	/**
@@ -192,8 +203,9 @@  discard block
 block discarded – undo
192 203
 	 */
193 204
 	public function getFont()
194 205
 	{
195
-		if($this->_font===null)
196
-			$this->_font=new TFont;
206
+		if($this->_font===null) {
207
+					$this->_font=new TFont;
208
+		}
197 209
 		return $this->_font;
198 210
 	}
199 211
 
@@ -249,10 +261,11 @@  discard block
 block discarded – undo
249 261
 	 */
250 262
 	public function setForeColor($value)
251 263
 	{
252
-		if(trim($value)==='')
253
-			unset($this->_fields['color']);
254
-		else
255
-			$this->_fields['color']=$value;
264
+		if(trim($value)==='') {
265
+					unset($this->_fields['color']);
266
+		} else {
267
+					$this->_fields['color']=$value;
268
+		}
256 269
 	}
257 270
 
258 271
 	/**
@@ -268,10 +281,11 @@  discard block
 block discarded – undo
268 281
 	 */
269 282
 	public function setHeight($value)
270 283
 	{
271
-		if(trim($value)==='')
272
-			unset($this->_fields['height']);
273
-		else
274
-			$this->_fields['height']=$value;
284
+		if(trim($value)==='') {
285
+					unset($this->_fields['height']);
286
+		} else {
287
+					$this->_fields['height']=$value;
288
+		}
275 289
 	}
276 290
 
277 291
 	/**
@@ -366,12 +380,15 @@  discard block
 block discarded – undo
366 380
 		if($style instanceof TStyle)
367 381
 		{
368 382
 			$this->_fields=array_merge($this->_fields,$style->_fields);
369
-			if($style->_class!==null)
370
-				$this->_class=$style->_class;
371
-			if($style->_customStyle!==null)
372
-				$this->_customStyle=$style->_customStyle;
373
-			if($style->_font!==null)
374
-				$this->getFont()->copyFrom($style->_font);
383
+			if($style->_class!==null) {
384
+							$this->_class=$style->_class;
385
+			}
386
+			if($style->_customStyle!==null) {
387
+							$this->_customStyle=$style->_customStyle;
388
+			}
389
+			if($style->_font!==null) {
390
+							$this->getFont()->copyFrom($style->_font);
391
+			}
375 392
 		}
376 393
 	}
377 394
 
@@ -386,12 +403,15 @@  discard block
 block discarded – undo
386 403
 		if($style instanceof TStyle)
387 404
 		{
388 405
 			$this->_fields=array_merge($style->_fields,$this->_fields);
389
-			if($this->_class===null)
390
-				$this->_class=$style->_class;
391
-			if($this->_customStyle===null)
392
-				$this->_customStyle=$style->_customStyle;
393
-			if($style->_font!==null)
394
-				$this->getFont()->mergeWith($style->_font);
406
+			if($this->_class===null) {
407
+							$this->_class=$style->_class;
408
+			}
409
+			if($this->_customStyle===null) {
410
+							$this->_customStyle=$style->_customStyle;
411
+			}
412
+			if($style->_font!==null) {
413
+							$this->getFont()->mergeWith($style->_font);
414
+			}
395 415
 		}
396 416
 	}
397 417
 
@@ -406,15 +426,18 @@  discard block
 block discarded – undo
406 426
 			foreach(explode(';',$this->_customStyle) as $style)
407 427
 			{
408 428
 				$arr=explode(':',$style,2);
409
-				if(isset($arr[1]) && trim($arr[0])!=='')
410
-					$writer->addStyleAttribute(trim($arr[0]),trim($arr[1]));
429
+				if(isset($arr[1]) && trim($arr[0])!=='') {
430
+									$writer->addStyleAttribute(trim($arr[0]),trim($arr[1]));
431
+				}
411 432
 			}
412 433
 		}
413 434
 		$writer->addStyleAttributes($this->_fields);
414
-		if($this->_font!==null)
415
-			$this->_font->addAttributesToRender($writer);
416
-		if($this->_class!==null)
417
-			$writer->addAttribute('class',$this->_class);
435
+		if($this->_font!==null) {
436
+					$this->_font->addAttributesToRender($writer);
437
+		}
438
+		if($this->_class!==null) {
439
+					$writer->addAttribute('class',$this->_class);
440
+		}
418 441
 	}
419 442
 
420 443
 	/**
@@ -492,18 +515,24 @@  discard block
 block discarded – undo
492 515
 	protected function __getZappableSleepProps(&$exprops)
493 516
 	{
494 517
 		parent::__getZappableSleepProps($exprops);
495
-		if ($this->_backImageUrl===null)
496
-			$exprops[] = "\0TTableStyle\0_backImageUrl";
497
-		if ($this->_horizontalAlign===null)
498
-			$exprops[] = "\0TTableStyle\0_horizontalAlign";
499
-		if ($this->_cellPadding===null)
500
-			$exprops[] = "\0TTableStyle\0_cellPadding";
501
-		if ($this->_cellSpacing===null)
502
-			$exprops[] = "\0TTableStyle\0_cellSpacing";
503
-		if ($this->_gridLines===null)
504
-			$exprops[] = "\0TTableStyle\0_gridLines";
505
-		if ($this->_borderCollapse===null)
506
-			$exprops[] = "\0TTableStyle\0_borderCollapse";
518
+		if ($this->_backImageUrl===null) {
519
+					$exprops[] = "\0TTableStyle\0_backImageUrl";
520
+		}
521
+		if ($this->_horizontalAlign===null) {
522
+					$exprops[] = "\0TTableStyle\0_horizontalAlign";
523
+		}
524
+		if ($this->_cellPadding===null) {
525
+					$exprops[] = "\0TTableStyle\0_cellPadding";
526
+		}
527
+		if ($this->_cellSpacing===null) {
528
+					$exprops[] = "\0TTableStyle\0_cellSpacing";
529
+		}
530
+		if ($this->_gridLines===null) {
531
+					$exprops[] = "\0TTableStyle\0_gridLines";
532
+		}
533
+		if ($this->_borderCollapse===null) {
534
+					$exprops[] = "\0TTableStyle\0_borderCollapse";
535
+		}
507 536
 	}
508 537
 
509 538
 	/**
@@ -532,18 +561,24 @@  discard block
 block discarded – undo
532 561
 		parent::copyFrom($style);
533 562
 		if($style instanceof TTableStyle)
534 563
 		{
535
-			if($style->_backImageUrl!==null)
536
-				$this->_backImageUrl=$style->_backImageUrl;
537
-			if($style->_horizontalAlign!==null)
538
-				$this->_horizontalAlign=$style->_horizontalAlign;
539
-			if($style->_cellPadding!==null)
540
-				$this->_cellPadding=$style->_cellPadding;
541
-			if($style->_cellSpacing!==null)
542
-				$this->_cellSpacing=$style->_cellSpacing;
543
-			if($style->_gridLines!==null)
544
-				$this->_gridLines=$style->_gridLines;
545
-			if($style->_borderCollapse!==null)
546
-				$this->_borderCollapse=$style->_borderCollapse;
564
+			if($style->_backImageUrl!==null) {
565
+							$this->_backImageUrl=$style->_backImageUrl;
566
+			}
567
+			if($style->_horizontalAlign!==null) {
568
+							$this->_horizontalAlign=$style->_horizontalAlign;
569
+			}
570
+			if($style->_cellPadding!==null) {
571
+							$this->_cellPadding=$style->_cellPadding;
572
+			}
573
+			if($style->_cellSpacing!==null) {
574
+							$this->_cellSpacing=$style->_cellSpacing;
575
+			}
576
+			if($style->_gridLines!==null) {
577
+							$this->_gridLines=$style->_gridLines;
578
+			}
579
+			if($style->_borderCollapse!==null) {
580
+							$this->_borderCollapse=$style->_borderCollapse;
581
+			}
547 582
 		}
548 583
 	}
549 584
 
@@ -558,18 +593,24 @@  discard block
 block discarded – undo
558 593
 		parent::mergeWith($style);
559 594
 		if($style instanceof TTableStyle)
560 595
 		{
561
-			if($this->_backImageUrl===null && $style->_backImageUrl!==null)
562
-				$this->_backImageUrl=$style->_backImageUrl;
563
-			if($this->_horizontalAlign===null && $style->_horizontalAlign!==null)
564
-				$this->_horizontalAlign=$style->_horizontalAlign;
565
-			if($this->_cellPadding===null && $style->_cellPadding!==null)
566
-				$this->_cellPadding=$style->_cellPadding;
567
-			if($this->_cellSpacing===null && $style->_cellSpacing!==null)
568
-				$this->_cellSpacing=$style->_cellSpacing;
569
-			if($this->_gridLines===null && $style->_gridLines!==null)
570
-				$this->_gridLines=$style->_gridLines;
571
-			if($this->_borderCollapse===null && $style->_borderCollapse!==null)
572
-				$this->_borderCollapse=$style->_borderCollapse;
596
+			if($this->_backImageUrl===null && $style->_backImageUrl!==null) {
597
+							$this->_backImageUrl=$style->_backImageUrl;
598
+			}
599
+			if($this->_horizontalAlign===null && $style->_horizontalAlign!==null) {
600
+							$this->_horizontalAlign=$style->_horizontalAlign;
601
+			}
602
+			if($this->_cellPadding===null && $style->_cellPadding!==null) {
603
+							$this->_cellPadding=$style->_cellPadding;
604
+			}
605
+			if($this->_cellSpacing===null && $style->_cellSpacing!==null) {
606
+							$this->_cellSpacing=$style->_cellSpacing;
607
+			}
608
+			if($this->_gridLines===null && $style->_gridLines!==null) {
609
+							$this->_gridLines=$style->_gridLines;
610
+			}
611
+			if($this->_borderCollapse===null && $style->_borderCollapse!==null) {
612
+							$this->_borderCollapse=$style->_borderCollapse;
613
+			}
573 614
 		}
574 615
 	}
575 616
 
@@ -581,20 +622,25 @@  discard block
 block discarded – undo
581 622
 	 */
582 623
 	public function addAttributesToRender($writer)
583 624
 	{
584
-		if(($url=trim($this->getBackImageUrl()))!=='')
585
-			$writer->addStyleAttribute('background-image','url('.$url.')');
625
+		if(($url=trim($this->getBackImageUrl()))!=='') {
626
+					$writer->addStyleAttribute('background-image','url('.$url.')');
627
+		}
586 628
 
587
-		if(($horizontalAlign=$this->getHorizontalAlign())!==THorizontalAlign::NotSet)
588
-			$writer->addStyleAttribute('text-align',strtolower($horizontalAlign));
629
+		if(($horizontalAlign=$this->getHorizontalAlign())!==THorizontalAlign::NotSet) {
630
+					$writer->addStyleAttribute('text-align',strtolower($horizontalAlign));
631
+		}
589 632
 
590
-		if(($cellPadding=$this->getCellPadding())>=0)
591
-			$writer->addAttribute('cellpadding',"$cellPadding");
633
+		if(($cellPadding=$this->getCellPadding())>=0) {
634
+					$writer->addAttribute('cellpadding',"$cellPadding");
635
+		}
592 636
 
593
-		if(($cellSpacing=$this->getCellSpacing())>=0)
594
-			$writer->addAttribute('cellspacing',"$cellSpacing");
637
+		if(($cellSpacing=$this->getCellSpacing())>=0) {
638
+					$writer->addAttribute('cellspacing',"$cellSpacing");
639
+		}
595 640
 
596
-		if($this->getBorderCollapse())
597
-			$writer->addStyleAttribute('border-collapse','collapse');
641
+		if($this->getBorderCollapse()) {
642
+					$writer->addStyleAttribute('border-collapse','collapse');
643
+		}
598 644
 
599 645
 		switch($this->getGridLines())
600 646
 		{
@@ -654,8 +700,9 @@  discard block
 block discarded – undo
654 700
 	 */
655 701
 	public function setCellPadding($value)
656 702
 	{
657
-		if(($this->_cellPadding=TPropertyValue::ensureInteger($value))<-1)
658
-			throw new TInvalidDataValueException('tablestyle_cellpadding_invalid');
703
+		if(($this->_cellPadding=TPropertyValue::ensureInteger($value))<-1) {
704
+					throw new TInvalidDataValueException('tablestyle_cellpadding_invalid');
705
+		}
659 706
 	}
660 707
 
661 708
 	/**
@@ -672,8 +719,9 @@  discard block
 block discarded – undo
672 719
 	 */
673 720
 	public function setCellSpacing($value)
674 721
 	{
675
-		if(($this->_cellSpacing=TPropertyValue::ensureInteger($value))<-1)
676
-			throw new TInvalidDataValueException('tablestyle_cellspacing_invalid');
722
+		if(($this->_cellSpacing=TPropertyValue::ensureInteger($value))<-1) {
723
+					throw new TInvalidDataValueException('tablestyle_cellspacing_invalid');
724
+		}
677 725
 	}
678 726
 
679 727
 	/**
@@ -743,12 +791,15 @@  discard block
 block discarded – undo
743 791
 	protected function __getZappableSleepProps(&$exprops)
744 792
 	{
745 793
 		parent::__getZappableSleepProps($exprops);
746
-		if ($this->_horizontalAlign===null)
747
-			$exprops[] = "\0TTableItemStyle\0_horizontalAlign";
748
-		if ($this->_verticalAlign===null)
749
-			$exprops[] = "\0TTableItemStyle\0_verticalAlign";
750
-		if ($this->_wrap===null)
751
-			$exprops[] = "\0TTableItemStyle\0_wrap";
794
+		if ($this->_horizontalAlign===null) {
795
+					$exprops[] = "\0TTableItemStyle\0_horizontalAlign";
796
+		}
797
+		if ($this->_verticalAlign===null) {
798
+					$exprops[] = "\0TTableItemStyle\0_verticalAlign";
799
+		}
800
+		if ($this->_wrap===null) {
801
+					$exprops[] = "\0TTableItemStyle\0_wrap";
802
+		}
752 803
 	}
753 804
 
754 805
 	/**
@@ -775,12 +826,15 @@  discard block
 block discarded – undo
775 826
 		parent::copyFrom($style);
776 827
 		if($style instanceof TTableItemStyle)
777 828
 		{
778
-			if($this->_verticalAlign===null && $style->_verticalAlign!==null)
779
-				$this->_verticalAlign=$style->_verticalAlign;
780
-			if($this->_horizontalAlign===null && $style->_horizontalAlign!==null)
781
-				$this->_horizontalAlign=$style->_horizontalAlign;
782
-			if($this->_wrap===null && $style->_wrap!==null)
783
-				$this->_wrap=$style->_wrap;
829
+			if($this->_verticalAlign===null && $style->_verticalAlign!==null) {
830
+							$this->_verticalAlign=$style->_verticalAlign;
831
+			}
832
+			if($this->_horizontalAlign===null && $style->_horizontalAlign!==null) {
833
+							$this->_horizontalAlign=$style->_horizontalAlign;
834
+			}
835
+			if($this->_wrap===null && $style->_wrap!==null) {
836
+							$this->_wrap=$style->_wrap;
837
+			}
784 838
 		}
785 839
 	}
786 840
 
@@ -795,12 +849,15 @@  discard block
 block discarded – undo
795 849
 		parent::mergeWith($style);
796 850
 		if($style instanceof TTableItemStyle)
797 851
 		{
798
-			if($style->_verticalAlign!==null)
799
-				$this->_verticalAlign=$style->_verticalAlign;
800
-			if($style->_horizontalAlign!==null)
801
-				$this->_horizontalAlign=$style->_horizontalAlign;
802
-			if($style->_wrap!==null)
803
-				$this->_wrap=$style->_wrap;
852
+			if($style->_verticalAlign!==null) {
853
+							$this->_verticalAlign=$style->_verticalAlign;
854
+			}
855
+			if($style->_horizontalAlign!==null) {
856
+							$this->_horizontalAlign=$style->_horizontalAlign;
857
+			}
858
+			if($style->_wrap!==null) {
859
+							$this->_wrap=$style->_wrap;
860
+			}
804 861
 		}
805 862
 	}
806 863
 
@@ -811,14 +868,17 @@  discard block
 block discarded – undo
811 868
 	 */
812 869
 	public function addAttributesToRender($writer)
813 870
 	{
814
-		if(!$this->getWrap())
815
-			$writer->addStyleAttribute('white-space','nowrap');
871
+		if(!$this->getWrap()) {
872
+					$writer->addStyleAttribute('white-space','nowrap');
873
+		}
816 874
 
817
-		if(($horizontalAlign=$this->getHorizontalAlign())!==THorizontalAlign::NotSet)
818
-			$writer->addAttribute('align',strtolower($horizontalAlign));
875
+		if(($horizontalAlign=$this->getHorizontalAlign())!==THorizontalAlign::NotSet) {
876
+					$writer->addAttribute('align',strtolower($horizontalAlign));
877
+		}
819 878
 
820
-		if(($verticalAlign=$this->getVerticalAlign())!==TVerticalAlign::NotSet)
821
-			$writer->addAttribute('valign',strtolower($verticalAlign));
879
+		if(($verticalAlign=$this->getVerticalAlign())!==TVerticalAlign::NotSet) {
880
+					$writer->addAttribute('valign',strtolower($verticalAlign));
881
+		}
822 882
 
823 883
 		parent::addAttributesToRender($writer);
824 884
 	}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTable.php 3 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -144,6 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
 	/**
146 146
 	 * @param string table caption
147
+	 * @param string $value
147 148
 	 */
148 149
 	public function setCaption($value)
149 150
 	{
@@ -160,6 +161,7 @@  discard block
 block discarded – undo
160 161
 
161 162
 	/**
162 163
 	 * @param TTableCaptionAlign table caption alignment.
164
+	 * @param TTableCaptionAlign $value
163 165
 	 */
164 166
 	public function setCaptionAlign($value)
165 167
 	{
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 */
82 82
 	public function addParsedObject($object)
83 83
 	{
84
-		if($object instanceof TTableRow)
84
+		if ($object instanceof TTableRow)
85 85
 			$this->getRows()->add($object);
86 86
 	}
87 87
 
@@ -102,18 +102,18 @@  discard block
 block discarded – undo
102 102
 	protected function addAttributesToRender($writer)
103 103
 	{
104 104
 		parent::addAttributesToRender($writer);
105
-		$border=0;
106
-		if($this->getHasStyle())
105
+		$border = 0;
106
+		if ($this->getHasStyle())
107 107
 		{
108
-			if($this->getGridLines()!==TTableGridLines::None)
108
+			if ($this->getGridLines() !== TTableGridLines::None)
109 109
 			{
110
-				if(($border=$this->getBorderWidth())==='')
111
-					$border=1;
110
+				if (($border = $this->getBorderWidth()) === '')
111
+					$border = 1;
112 112
 				else
113
-					$border=(int)$border;
113
+					$border = (int) $border;
114 114
 			}
115 115
 		}
116
-		$writer->addAttribute('border',"$border");
116
+		$writer->addAttribute('border', "$border");
117 117
 	}
118 118
 
119 119
 	/**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 */
140 140
 	public function getCaption()
141 141
 	{
142
-		return $this->getViewState('Caption','');
142
+		return $this->getViewState('Caption', '');
143 143
 	}
144 144
 
145 145
 	/**
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	 */
148 148
 	public function setCaption($value)
149 149
 	{
150
-		$this->setViewState('Caption',$value,'');
150
+		$this->setViewState('Caption', $value, '');
151 151
 	}
152 152
 
153 153
 	/**
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	 */
156 156
 	public function getCaptionAlign()
157 157
 	{
158
-		return $this->getViewState('CaptionAlign',TTableCaptionAlign::NotSet);
158
+		return $this->getViewState('CaptionAlign', TTableCaptionAlign::NotSet);
159 159
 	}
160 160
 
161 161
 	/**
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 */
164 164
 	public function setCaptionAlign($value)
165 165
 	{
166
-		$this->setViewState('CaptionAlign',TPropertyValue::ensureEnum($value,'TTableCaptionAlign'),TTableCaptionAlign::NotSet);
166
+		$this->setViewState('CaptionAlign', TPropertyValue::ensureEnum($value, 'TTableCaptionAlign'), TTableCaptionAlign::NotSet);
167 167
 	}
168 168
 
169 169
 	/**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	public function getCellSpacing()
173 173
 	{
174
-		if($this->getHasStyle())
174
+		if ($this->getHasStyle())
175 175
 			return $this->getStyle()->getCellSpacing();
176 176
 		else
177 177
 			return -1;
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	 */
191 191
 	public function getCellPadding()
192 192
 	{
193
-		if($this->getHasStyle())
193
+		if ($this->getHasStyle())
194 194
 			return $this->getStyle()->getCellPadding();
195 195
 		else
196 196
 			return -1;
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	 */
210 210
 	public function getHorizontalAlign()
211 211
 	{
212
-		if($this->getHasStyle())
212
+		if ($this->getHasStyle())
213 213
 			return $this->getStyle()->getHorizontalAlign();
214 214
 		else
215 215
 			return THorizontalAlign::NotSet;
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	 */
229 229
 	public function getGridLines()
230 230
 	{
231
-		if($this->getHasStyle())
231
+		if ($this->getHasStyle())
232 232
 			return $this->getStyle()->getGridLines();
233 233
 		else
234 234
 			return TTableGridLines::None;
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	 */
248 248
 	public function getBackImageUrl()
249 249
 	{
250
-		if($this->getHasStyle())
250
+		if ($this->getHasStyle())
251 251
 			return $this->getStyle()->getBackImageUrl();
252 252
 		else
253 253
 			return '';
@@ -269,10 +269,10 @@  discard block
 block discarded – undo
269 269
 	public function renderBeginTag($writer)
270 270
 	{
271 271
 		parent::renderBeginTag($writer);
272
-		if(($caption=$this->getCaption())!=='')
272
+		if (($caption = $this->getCaption()) !== '')
273 273
 		{
274
-			if(($align=$this->getCaptionAlign())!==TTableCaptionAlign::NotSet)
275
-				$writer->addAttribute('align',strtolower($align));
274
+			if (($align = $this->getCaptionAlign()) !== TTableCaptionAlign::NotSet)
275
+				$writer->addAttribute('align', strtolower($align));
276 276
 			$writer->renderBeginTag('caption');
277 277
 			$writer->write($caption);
278 278
 			$writer->renderEndTag();
@@ -285,48 +285,48 @@  discard block
 block discarded – undo
285 285
 	 */
286 286
 	public function renderContents($writer)
287 287
 	{
288
-		if($this->getHasControls())
288
+		if ($this->getHasControls())
289 289
 		{
290
-			$renderTableSection=false;
291
-			foreach($this->getControls() as $row)
290
+			$renderTableSection = false;
291
+			foreach ($this->getControls() as $row)
292 292
 			{
293
-				if($row->getTableSection()!==TTableRowSection::Body)
293
+				if ($row->getTableSection() !== TTableRowSection::Body)
294 294
 				{
295
-					$renderTableSection=true;
295
+					$renderTableSection = true;
296 296
 					break;
297 297
 				}
298 298
 			}
299
-			if($renderTableSection)
299
+			if ($renderTableSection)
300 300
 			{
301
-				$currentSection=TTableRowSection::Header;
301
+				$currentSection = TTableRowSection::Header;
302 302
 				$writer->writeLine();
303
-				foreach($this->getControls() as $index=>$row)
303
+				foreach ($this->getControls() as $index=>$row)
304 304
 				{
305
-					if(($section=$row->getTableSection())===$currentSection)
305
+					if (($section = $row->getTableSection()) === $currentSection)
306 306
 					{
307
-						if($index===0 && $currentSection===TTableRowSection::Header)
307
+						if ($index === 0 && $currentSection === TTableRowSection::Header)
308 308
 							$writer->renderBeginTag('thead');
309 309
 					}
310 310
 					else
311 311
 					{
312
-						if($currentSection===TTableRowSection::Header)
312
+						if ($currentSection === TTableRowSection::Header)
313 313
 						{
314
-							if($index>0)
314
+							if ($index > 0)
315 315
 								$writer->renderEndTag();
316
-							if($section===TTableRowSection::Body)
316
+							if ($section === TTableRowSection::Body)
317 317
 								$writer->renderBeginTag('tbody');
318 318
 							else
319 319
 								$writer->renderBeginTag('tfoot');
320
-							$currentSection=$section;
320
+							$currentSection = $section;
321 321
 						}
322
-						else if($currentSection===TTableRowSection::Body)
322
+						else if ($currentSection === TTableRowSection::Body)
323 323
 						{
324 324
 							$writer->renderEndTag();
325
-							if($section===TTableRowSection::Footer)
325
+							if ($section === TTableRowSection::Footer)
326 326
 								$writer->renderBeginTag('tfoot');
327 327
 							else
328 328
 								throw new TConfigurationException('table_tablesection_outoforder');
329
-							$currentSection=$section;
329
+							$currentSection = $section;
330 330
 						}
331 331
 						else // Footer
332 332
 							throw new TConfigurationException('table_tablesection_outoforder');
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 			else
340 340
 			{
341 341
 				$writer->writeLine();
342
-				foreach($this->getControls() as $row)
342
+				foreach ($this->getControls() as $row)
343 343
 				{
344 344
 					$row->renderControl($writer);
345 345
 					$writer->writeLine();
@@ -369,10 +369,10 @@  discard block
 block discarded – undo
369 369
 	 * @param mixed new item
370 370
 	 * @throws TInvalidDataTypeException if the item to be inserted is not a TTableRow object.
371 371
 	 */
372
-	public function insertAt($index,$item)
372
+	public function insertAt($index, $item)
373 373
 	{
374
-		if($item instanceof TTableRow)
375
-			parent::insertAt($index,$item);
374
+		if ($item instanceof TTableRow)
375
+			parent::insertAt($index, $item);
376 376
 		else
377 377
 			throw new TInvalidDataTypeException('tablerowcollection_tablerow_required');
378 378
 	}
@@ -397,10 +397,10 @@  discard block
 block discarded – undo
397 397
  */
398 398
 class TTableCaptionAlign extends TEnumerable
399 399
 {
400
-	const NotSet='NotSet';
401
-	const Top='Top';
402
-	const Bottom='Bottom';
403
-	const Left='Left';
404
-	const Right='Right';
400
+	const NotSet = 'NotSet';
401
+	const Top = 'Top';
402
+	const Bottom = 'Bottom';
403
+	const Left = 'Left';
404
+	const Right = 'Right';
405 405
 }
406 406
 
Please login to merge, or discard this patch.
Braces   +63 added lines, -52 removed lines patch added patch discarded remove patch
@@ -81,8 +81,9 @@  discard block
 block discarded – undo
81 81
 	 */
82 82
 	public function addParsedObject($object)
83 83
 	{
84
-		if($object instanceof TTableRow)
85
-			$this->getRows()->add($object);
84
+		if($object instanceof TTableRow) {
85
+					$this->getRows()->add($object);
86
+		}
86 87
 	}
87 88
 
88 89
 	/**
@@ -107,10 +108,11 @@  discard block
 block discarded – undo
107 108
 		{
108 109
 			if($this->getGridLines()!==TTableGridLines::None)
109 110
 			{
110
-				if(($border=$this->getBorderWidth())==='')
111
-					$border=1;
112
-				else
113
-					$border=(int)$border;
111
+				if(($border=$this->getBorderWidth())==='') {
112
+									$border=1;
113
+				} else {
114
+									$border=(int)$border;
115
+				}
114 116
 			}
115 117
 		}
116 118
 		$writer->addAttribute('border',"$border");
@@ -171,10 +173,11 @@  discard block
 block discarded – undo
171 173
 	 */
172 174
 	public function getCellSpacing()
173 175
 	{
174
-		if($this->getHasStyle())
175
-			return $this->getStyle()->getCellSpacing();
176
-		else
177
-			return -1;
176
+		if($this->getHasStyle()) {
177
+					return $this->getStyle()->getCellSpacing();
178
+		} else {
179
+					return -1;
180
+		}
178 181
 	}
179 182
 
180 183
 	/**
@@ -190,10 +193,11 @@  discard block
 block discarded – undo
190 193
 	 */
191 194
 	public function getCellPadding()
192 195
 	{
193
-		if($this->getHasStyle())
194
-			return $this->getStyle()->getCellPadding();
195
-		else
196
-			return -1;
196
+		if($this->getHasStyle()) {
197
+					return $this->getStyle()->getCellPadding();
198
+		} else {
199
+					return -1;
200
+		}
197 201
 	}
198 202
 
199 203
 	/**
@@ -209,10 +213,11 @@  discard block
 block discarded – undo
209 213
 	 */
210 214
 	public function getHorizontalAlign()
211 215
 	{
212
-		if($this->getHasStyle())
213
-			return $this->getStyle()->getHorizontalAlign();
214
-		else
215
-			return THorizontalAlign::NotSet;
216
+		if($this->getHasStyle()) {
217
+					return $this->getStyle()->getHorizontalAlign();
218
+		} else {
219
+					return THorizontalAlign::NotSet;
220
+		}
216 221
 	}
217 222
 
218 223
 	/**
@@ -228,10 +233,11 @@  discard block
 block discarded – undo
228 233
 	 */
229 234
 	public function getGridLines()
230 235
 	{
231
-		if($this->getHasStyle())
232
-			return $this->getStyle()->getGridLines();
233
-		else
234
-			return TTableGridLines::None;
236
+		if($this->getHasStyle()) {
237
+					return $this->getStyle()->getGridLines();
238
+		} else {
239
+					return TTableGridLines::None;
240
+		}
235 241
 	}
236 242
 
237 243
 	/**
@@ -247,10 +253,11 @@  discard block
 block discarded – undo
247 253
 	 */
248 254
 	public function getBackImageUrl()
249 255
 	{
250
-		if($this->getHasStyle())
251
-			return $this->getStyle()->getBackImageUrl();
252
-		else
253
-			return '';
256
+		if($this->getHasStyle()) {
257
+					return $this->getStyle()->getBackImageUrl();
258
+		} else {
259
+					return '';
260
+		}
254 261
 	}
255 262
 
256 263
 	/**
@@ -271,8 +278,9 @@  discard block
 block discarded – undo
271 278
 		parent::renderBeginTag($writer);
272 279
 		if(($caption=$this->getCaption())!=='')
273 280
 		{
274
-			if(($align=$this->getCaptionAlign())!==TTableCaptionAlign::NotSet)
275
-				$writer->addAttribute('align',strtolower($align));
281
+			if(($align=$this->getCaptionAlign())!==TTableCaptionAlign::NotSet) {
282
+							$writer->addAttribute('align',strtolower($align));
283
+			}
276 284
 			$writer->renderBeginTag('caption');
277 285
 			$writer->write($caption);
278 286
 			$writer->renderEndTag();
@@ -304,39 +312,41 @@  discard block
 block discarded – undo
304 312
 				{
305 313
 					if(($section=$row->getTableSection())===$currentSection)
306 314
 					{
307
-						if($index===0 && $currentSection===TTableRowSection::Header)
308
-							$writer->renderBeginTag('thead');
309
-					}
310
-					else
315
+						if($index===0 && $currentSection===TTableRowSection::Header) {
316
+													$writer->renderBeginTag('thead');
317
+						}
318
+					} else
311 319
 					{
312 320
 						if($currentSection===TTableRowSection::Header)
313 321
 						{
314
-							if($index>0)
315
-								$writer->renderEndTag();
316
-							if($section===TTableRowSection::Body)
317
-								$writer->renderBeginTag('tbody');
318
-							else
319
-								$writer->renderBeginTag('tfoot');
322
+							if($index>0) {
323
+															$writer->renderEndTag();
324
+							}
325
+							if($section===TTableRowSection::Body) {
326
+															$writer->renderBeginTag('tbody');
327
+							} else {
328
+															$writer->renderBeginTag('tfoot');
329
+							}
320 330
 							$currentSection=$section;
321
-						}
322
-						else if($currentSection===TTableRowSection::Body)
331
+						} else if($currentSection===TTableRowSection::Body)
323 332
 						{
324 333
 							$writer->renderEndTag();
325
-							if($section===TTableRowSection::Footer)
326
-								$writer->renderBeginTag('tfoot');
327
-							else
328
-								throw new TConfigurationException('table_tablesection_outoforder');
334
+							if($section===TTableRowSection::Footer) {
335
+															$writer->renderBeginTag('tfoot');
336
+							} else {
337
+															throw new TConfigurationException('table_tablesection_outoforder');
338
+							}
329 339
 							$currentSection=$section;
330
-						}
331
-						else // Footer
340
+						} else {
341
+							// Footer
332 342
 							throw new TConfigurationException('table_tablesection_outoforder');
343
+						}
333 344
 					}
334 345
 					$row->renderControl($writer);
335 346
 					$writer->writeLine();
336 347
 				}
337 348
 				$writer->renderEndTag();
338
-			}
339
-			else
349
+			} else
340 350
 			{
341 351
 				$writer->writeLine();
342 352
 				foreach($this->getControls() as $row)
@@ -371,10 +381,11 @@  discard block
 block discarded – undo
371 381
 	 */
372 382
 	public function insertAt($index,$item)
373 383
 	{
374
-		if($item instanceof TTableRow)
375
-			parent::insertAt($index,$item);
376
-		else
377
-			throw new TInvalidDataTypeException('tablerowcollection_tablerow_required');
384
+		if($item instanceof TTableRow) {
385
+					parent::insertAt($index,$item);
386
+		} else {
387
+					throw new TInvalidDataTypeException('tablerowcollection_tablerow_required');
388
+		}
378 389
 	}
379 390
 }
380 391
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTabPanel.php 4 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 	private $_active=false;
547 547
 
548 548
 	/**
549
-	 * @return the tag name for the view element
549
+	 * @return string tag name for the view element
550 550
 	 */
551 551
 	protected function getTagName()
552 552
 	{
@@ -714,6 +714,7 @@  discard block
 block discarded – undo
714 714
 	/**
715 715
 	 * Finds the index of the tab view whose ID is the same as the one being looked for.
716 716
 	 * @param string the explicit ID of the tab view to be looked for
717
+	 * @param string $id
717 718
 	 * @return integer the index of the tab view found, -1 if not found.
718 719
 	 */
719 720
 	public function findIndexByID($id)
Please login to merge, or discard this patch.
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 	}
82 82
 
83 83
 	/**
84
-     * Returns the index of the active tab view.
85
-     * Note, this property may not return the correct index.
86
-     * To ensure the correctness, call {@link getActiveView()} first.
84
+	 * Returns the index of the active tab view.
85
+	 * Note, this property may not return the correct index.
86
+	 * To ensure the correctness, call {@link getActiveView()} first.
87 87
 	 * @return integer the zero-based index of the active tab view. If -1, it means no active tab view. Default is 0 (the first view is active).
88 88
 	 */
89 89
 	public function getActiveViewIndex()
@@ -100,24 +100,24 @@  discard block
 block discarded – undo
100 100
 		$this->setViewState('ActiveViewIndex',TPropertyValue::ensureInteger($value),0);
101 101
 	}
102 102
 
103
-    /**
104
-     * Returns the ID of the active tab view.
105
-     * Note, this property may not return the correct ID.
106
-     * To ensure the correctness, call {@link getActiveView()} first.
107
-     * @return string The ID of the active tab view. Defaults to '', meaning not set.
108
-     */
109
-    public function getActiveViewID()
110
-    {
103
+	/**
104
+	 * Returns the ID of the active tab view.
105
+	 * Note, this property may not return the correct ID.
106
+	 * To ensure the correctness, call {@link getActiveView()} first.
107
+	 * @return string The ID of the active tab view. Defaults to '', meaning not set.
108
+	 */
109
+	public function getActiveViewID()
110
+	{
111 111
 		return $this->getViewState('ActiveViewID','');
112
-    }
112
+	}
113 113
 
114
-    /**
115
-     * @param string The ID of the active tab view.
116
-     */
117
-    public function setActiveViewID($value)
118
-    {
114
+	/**
115
+	 * @param string The ID of the active tab view.
116
+	 */
117
+	public function setActiveViewID($value)
118
+	{
119 119
 		$this->setViewState('ActiveViewID',$value,'');
120
-    }
120
+	}
121 121
 
122 122
 	/**
123 123
 	 * Returns the currently active view.
@@ -172,63 +172,63 @@  discard block
 block discarded – undo
172 172
 			throw new TInvalidOperationException('tabpanel_view_inexistent');
173 173
 	}
174 174
 
175
-    /**
176
-     * @return bool status of automatic tab switch on hover
177
-     */
178
-    public function getAutoSwitch()
179
-    {
180
-        return TPropertyValue::ensureBoolean($this->getViewState('AutoSwitch'));
181
-    }
182
-
183
-    /**
184
-     * @param bool whether to enable automatic tab switch on hover
185
-     */
186
-    public function setAutoSwitch($value)
187
-    {
188
-        $this->setViewState('AutoSwitch',TPropertyValue::ensureBoolean($value));
189
-    }
190
-
191
-
192
-    /**
193
-     * @return string URL for the CSS file including all relevant CSS class definitions. Defaults to ''.
194
-     */
195
-    public function getCssUrl()
196
-    {
197
-        return $this->getViewState('CssUrl','default');
198
-    }
199
-
200
-    /**
201
-     * @param string URL for the CSS file including all relevant CSS class definitions.
202
-     */
203
-    public function setCssUrl($value)
204
-    {
205
-        $this->setViewState('CssUrl',TPropertyValue::ensureString($value),'');
206
-    }
207
-
208
-    /**
209
-     * @return string CSS class for the whole tab control div. Defaults to 'tab-panel'.
210
-     */
211
-    public function getCssClass()
212
-    {
213
-    	$cssClass=parent::getCssClass();
214
-    	return $cssClass===''?'tab-panel':$cssClass;
215
-    }
216
-
217
-    /**
218
-     * @return string CSS class for the currently displayed view div. Defaults to 'tab-view'.
219
-     */
220
-    public function getViewCssClass()
221
-    {
222
-        return $this->getViewStyle()->getCssClass();
223
-    }
224
-
225
-    /**
226
-     * @param string CSS class for the currently displayed view div.
227
-     */
228
-    public function setViewCssClass($value)
229
-    {
230
-        $this->getViewStyle()->setCssClass($value);
231
-    }
175
+	/**
176
+	 * @return bool status of automatic tab switch on hover
177
+	 */
178
+	public function getAutoSwitch()
179
+	{
180
+		return TPropertyValue::ensureBoolean($this->getViewState('AutoSwitch'));
181
+	}
182
+
183
+	/**
184
+	 * @param bool whether to enable automatic tab switch on hover
185
+	 */
186
+	public function setAutoSwitch($value)
187
+	{
188
+		$this->setViewState('AutoSwitch',TPropertyValue::ensureBoolean($value));
189
+	}
190
+
191
+
192
+	/**
193
+	 * @return string URL for the CSS file including all relevant CSS class definitions. Defaults to ''.
194
+	 */
195
+	public function getCssUrl()
196
+	{
197
+		return $this->getViewState('CssUrl','default');
198
+	}
199
+
200
+	/**
201
+	 * @param string URL for the CSS file including all relevant CSS class definitions.
202
+	 */
203
+	public function setCssUrl($value)
204
+	{
205
+		$this->setViewState('CssUrl',TPropertyValue::ensureString($value),'');
206
+	}
207
+
208
+	/**
209
+	 * @return string CSS class for the whole tab control div. Defaults to 'tab-panel'.
210
+	 */
211
+	public function getCssClass()
212
+	{
213
+		$cssClass=parent::getCssClass();
214
+		return $cssClass===''?'tab-panel':$cssClass;
215
+	}
216
+
217
+	/**
218
+	 * @return string CSS class for the currently displayed view div. Defaults to 'tab-view'.
219
+	 */
220
+	public function getViewCssClass()
221
+	{
222
+		return $this->getViewStyle()->getCssClass();
223
+	}
224
+
225
+	/**
226
+	 * @param string CSS class for the currently displayed view div.
227
+	 */
228
+	public function setViewCssClass($value)
229
+	{
230
+		$this->getViewStyle()->setCssClass($value);
231
+	}
232 232
 
233 233
 	/**
234 234
 	 * @return TStyle the style for all the view div
@@ -244,21 +244,21 @@  discard block
 block discarded – undo
244 244
 		return $style;
245 245
 	}
246 246
 
247
-    /**
248
-     * @return string CSS class for non-active tabs. Defaults to 'tab-normal'.
249
-     */
250
-    public function getTabCssClass()
251
-    {
252
-        return $this->getTabStyle()->getCssClass();
253
-    }
247
+	/**
248
+	 * @return string CSS class for non-active tabs. Defaults to 'tab-normal'.
249
+	 */
250
+	public function getTabCssClass()
251
+	{
252
+		return $this->getTabStyle()->getCssClass();
253
+	}
254 254
 
255
-    /**
256
-     * @param string CSS class for non-active tabs.
257
-     */
258
-    public function setTabCssClass($value)
259
-    {
260
-        $this->getTabStyle()->setCssClass($value);
261
-    }
255
+	/**
256
+	 * @param string CSS class for non-active tabs.
257
+	 */
258
+	public function setTabCssClass($value)
259
+	{
260
+		$this->getTabStyle()->setCssClass($value);
261
+	}
262 262
 
263 263
 	/**
264 264
 	 * @return TStyle the style for all the inactive tab div
@@ -274,21 +274,21 @@  discard block
 block discarded – undo
274 274
 		return $style;
275 275
 	}
276 276
 
277
-    /**
278
-     * @return string CSS class for the active tab. Defaults to 'tab-active'.
279
-     */
280
-    public function getActiveTabCssClass()
281
-    {
282
-        return $this->getActiveTabStyle()->getCssClass();
283
-    }
284
-
285
-    /**
286
-     * @param string CSS class for the active tab.
287
-     */
288
-    public function setActiveTabCssClass($value)
289
-    {
290
-        $this->getActiveTabStyle()->setCssClass($value);
291
-    }
277
+	/**
278
+	 * @return string CSS class for the active tab. Defaults to 'tab-active'.
279
+	 */
280
+	public function getActiveTabCssClass()
281
+	{
282
+		return $this->getActiveTabStyle()->getCssClass();
283
+	}
284
+
285
+	/**
286
+	 * @param string CSS class for the active tab.
287
+	 */
288
+	public function setActiveTabCssClass($value)
289
+	{
290
+		$this->getActiveTabStyle()->setCssClass($value);
291
+	}
292 292
 
293 293
 	/**
294 294
 	 * @return TStyle the style for the active tab div
Please login to merge, or discard this patch.
Spacing   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
  */
59 59
 class TTabPanel extends TWebControl implements IPostBackDataHandler
60 60
 {
61
-	private $_dataChanged=false;
61
+	private $_dataChanged = false;
62 62
 
63 63
 	/**
64 64
 	 * @return string tag name for the control
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
 	public function addParsedObject($object)
78 78
 	{
79
-		if($object instanceof TTabView)
79
+		if ($object instanceof TTabView)
80 80
 			$this->getControls()->add($object);
81 81
 	}
82 82
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function getActiveViewIndex()
90 90
 	{
91
-		return $this->getViewState('ActiveViewIndex',0);
91
+		return $this->getViewState('ActiveViewIndex', 0);
92 92
 	}
93 93
 
94 94
 	/**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function setActiveViewIndex($value)
99 99
 	{
100
-		$this->setViewState('ActiveViewIndex',TPropertyValue::ensureInteger($value),0);
100
+		$this->setViewState('ActiveViewIndex', TPropertyValue::ensureInteger($value), 0);
101 101
 	}
102 102
 
103 103
     /**
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public function getActiveViewID()
110 110
     {
111
-		return $this->getViewState('ActiveViewID','');
111
+		return $this->getViewState('ActiveViewID', '');
112 112
     }
113 113
 
114 114
     /**
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function setActiveViewID($value)
118 118
     {
119
-		$this->setViewState('ActiveViewID',$value,'');
119
+		$this->setViewState('ActiveViewID', $value, '');
120 120
     }
121 121
 
122 122
 	/**
@@ -128,34 +128,34 @@  discard block
 block discarded – undo
128 128
 	 */
129 129
 	public function getActiveView()
130 130
 	{
131
-		$activeView=null;
132
-		$views=$this->getViews();
133
-		if(($id=$this->getActiveViewID())!=='')
131
+		$activeView = null;
132
+		$views = $this->getViews();
133
+		if (($id = $this->getActiveViewID()) !== '')
134 134
 		{
135
-			if(($index=$views->findIndexByID($id))>=0)
136
-				$activeView=$views->itemAt($index);
135
+			if (($index = $views->findIndexByID($id)) >= 0)
136
+				$activeView = $views->itemAt($index);
137 137
 			else
138
-				throw new TInvalidDataValueException('tabpanel_activeviewid_invalid',$id);
138
+				throw new TInvalidDataValueException('tabpanel_activeviewid_invalid', $id);
139 139
 		}
140
-		else if(($index=$this->getActiveViewIndex())>=0)
140
+		else if (($index = $this->getActiveViewIndex()) >= 0)
141 141
 		{
142
-			if($index<$views->getCount())
143
-				$activeView=$views->itemAt($index);
142
+			if ($index < $views->getCount())
143
+				$activeView = $views->itemAt($index);
144 144
 			else
145
-				throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid',$index);
145
+				throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid', $index);
146 146
 		}
147 147
 		else
148 148
 		{
149
-			foreach($views as $index=>$view)
149
+			foreach ($views as $index=>$view)
150 150
 			{
151
-				if($view->getActive())
151
+				if ($view->getActive())
152 152
 				{
153
-					$activeView=$view;
153
+					$activeView = $view;
154 154
 					break;
155 155
 				}
156 156
 			}
157 157
 		}
158
-		if($activeView!==null)
158
+		if ($activeView !== null)
159 159
 			$this->activateView($activeView);
160 160
 		return $activeView;
161 161
 	}
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 */
167 167
 	public function setActiveView($view)
168 168
 	{
169
-		if($this->getViews()->indexOf($view)>=0)
169
+		if ($this->getViews()->indexOf($view) >= 0)
170 170
 			$this->activateView($view);
171 171
 		else
172 172
 			throw new TInvalidOperationException('tabpanel_view_inexistent');
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
      */
186 186
     public function setAutoSwitch($value)
187 187
     {
188
-        $this->setViewState('AutoSwitch',TPropertyValue::ensureBoolean($value));
188
+        $this->setViewState('AutoSwitch', TPropertyValue::ensureBoolean($value));
189 189
     }
190 190
 
191 191
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
      */
195 195
     public function getCssUrl()
196 196
     {
197
-        return $this->getViewState('CssUrl','default');
197
+        return $this->getViewState('CssUrl', 'default');
198 198
     }
199 199
 
200 200
     /**
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
      */
203 203
     public function setCssUrl($value)
204 204
     {
205
-        $this->setViewState('CssUrl',TPropertyValue::ensureString($value),'');
205
+        $this->setViewState('CssUrl', TPropertyValue::ensureString($value), '');
206 206
     }
207 207
 
208 208
     /**
@@ -210,8 +210,8 @@  discard block
 block discarded – undo
210 210
      */
211 211
     public function getCssClass()
212 212
     {
213
-    	$cssClass=parent::getCssClass();
214
-    	return $cssClass===''?'tab-panel':$cssClass;
213
+    	$cssClass = parent::getCssClass();
214
+    	return $cssClass === '' ? 'tab-panel' : $cssClass;
215 215
     }
216 216
 
217 217
     /**
@@ -235,11 +235,11 @@  discard block
 block discarded – undo
235 235
 	 */
236 236
 	public function getViewStyle()
237 237
 	{
238
-		if(($style=$this->getViewState('ViewStyle',null))===null)
238
+		if (($style = $this->getViewState('ViewStyle', null)) === null)
239 239
 		{
240
-			$style=new TStyle;
240
+			$style = new TStyle;
241 241
 			$style->setCssClass('tab-view');
242
-			$this->setViewState('ViewStyle',$style,null);
242
+			$this->setViewState('ViewStyle', $style, null);
243 243
 		}
244 244
 		return $style;
245 245
 	}
@@ -265,11 +265,11 @@  discard block
 block discarded – undo
265 265
 	 */
266 266
 	public function getTabStyle()
267 267
 	{
268
-		if(($style=$this->getViewState('TabStyle',null))===null)
268
+		if (($style = $this->getViewState('TabStyle', null)) === null)
269 269
 		{
270
-			$style=new TStyle;
270
+			$style = new TStyle;
271 271
 			$style->setCssClass('tab-normal');
272
-			$this->setViewState('TabStyle',$style,null);
272
+			$this->setViewState('TabStyle', $style, null);
273 273
 		}
274 274
 		return $style;
275 275
 	}
@@ -295,11 +295,11 @@  discard block
 block discarded – undo
295 295
 	 */
296 296
 	public function getActiveTabStyle()
297 297
 	{
298
-		if(($style=$this->getViewState('ActiveTabStyle',null))===null)
298
+		if (($style = $this->getViewState('ActiveTabStyle', null)) === null)
299 299
 		{
300
-			$style=new TStyle;
300
+			$style = new TStyle;
301 301
 			$style->setCssClass('tab-active');
302
-			$this->setViewState('ActiveTabStyle',$style,null);
302
+			$this->setViewState('ActiveTabStyle', $style, null);
303 303
 		}
304 304
 		return $style;
305 305
 	}
@@ -313,9 +313,9 @@  discard block
 block discarded – undo
313 313
 	{
314 314
 		$this->setActiveViewIndex(-1);
315 315
 		$this->setActiveViewID('');
316
-		foreach($this->getViews() as $index=>$v)
316
+		foreach ($this->getViews() as $index=>$v)
317 317
 		{
318
-			if($view===$v)
318
+			if ($view === $v)
319 319
 			{
320 320
 				$this->setActiveViewIndex($index);
321 321
 				$this->setActiveViewID($view->getID(false));
@@ -333,17 +333,17 @@  discard block
 block discarded – undo
333 333
 	 * @param array the input data collection
334 334
 	 * @return boolean whether the data of the control has been changed
335 335
 	 */
336
-	public function loadPostData($key,$values)
336
+	public function loadPostData($key, $values)
337 337
 	{
338
-		if(($index=$values[$this->getClientID().'_1'])!==null)
338
+		if (($index = $values[$this->getClientID() . '_1']) !== null)
339 339
 		{
340
-			$index=(int)$index;
341
-			$currentIndex=$this->getActiveViewIndex();
342
-			if($currentIndex!==$index)
340
+			$index = (int) $index;
341
+			$currentIndex = $this->getActiveViewIndex();
342
+			if ($currentIndex !== $index)
343 343
 			{
344 344
 				$this->setActiveViewID(''); // clear up view ID
345 345
 				$this->setActiveViewIndex($index);
346
-				return $this->_dataChanged=true;
346
+				return $this->_dataChanged = true;
347 347
 			}
348 348
 		}
349 349
 		return false;
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 	 */
378 378
 	protected function addAttributesToRender($writer)
379 379
 	{
380
-		$writer->addAttribute('id',$this->getClientID());
380
+		$writer->addAttribute('id', $this->getClientID());
381 381
 		$this->setCssClass($this->getCssClass());
382 382
 		parent::addAttributesToRender($writer);
383 383
 	}
@@ -390,12 +390,12 @@  discard block
 block discarded – undo
390 390
 	public function onPreRender($param)
391 391
 	{
392 392
 		parent::onPreRender($param);
393
-		$this->getActiveView();  // determine the active view
393
+		$this->getActiveView(); // determine the active view
394 394
 		$this->registerStyleSheet();
395 395
 
396
-		$page=$this->getPage();
396
+		$page = $this->getPage();
397 397
 		$page->registerRequiresPostData($this);
398
-		$page->registerRequiresPostData($this->getClientID()."_1");
398
+		$page->registerRequiresPostData($this->getClientID() . "_1");
399 399
 	}
400 400
 
401 401
 	/**
@@ -407,15 +407,15 @@  discard block
 block discarded – undo
407 407
 	{
408 408
 		$url = $this->getCssUrl();
409 409
 
410
-		if($url === '') {
410
+		if ($url === '') {
411 411
 			return;
412 412
 		}
413 413
 
414
-		if($url === 'default') {
415
-			$url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'tabpanel.css');
414
+		if ($url === 'default') {
415
+			$url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'tabpanel.css');
416 416
 		}
417 417
 
418
-		if($url !== '') {
418
+		if ($url !== '') {
419 419
 			$this->getPage()->getClientScript()->registerStyleSheetFile($url, $url);
420 420
 		}
421 421
 	}
@@ -425,18 +425,18 @@  discard block
 block discarded – undo
425 425
 	 */
426 426
 	protected function registerClientScript()
427 427
 	{
428
-		$id=$this->getClientID();
429
-		$options=TJavaScript::encode($this->getClientOptions());
430
-		$className=$this->getClientClassName();
431
-		$cs=$this->getPage()->getClientScript();
428
+		$id = $this->getClientID();
429
+		$options = TJavaScript::encode($this->getClientOptions());
430
+		$className = $this->getClientClassName();
431
+		$cs = $this->getPage()->getClientScript();
432 432
 		$cs->registerPradoScript('tabpanel');
433
-		$code="new $className($options);";
433
+		$code = "new $className($options);";
434 434
 		$cs->registerEndScript("prado:$id", $code);
435 435
 		// ensure an item is always active and visible
436 436
 		$index = $this->getActiveViewIndex();
437
-		if(!$this->getViews()->itemAt($index)->Visible)
438
-			$index=0;
439
-		$cs->registerHiddenField($id.'_1', $index);
437
+		if (!$this->getViews()->itemAt($index)->Visible)
438
+			$index = 0;
439
+		$cs->registerHiddenField($id . '_1', $index);
440 440
 	}
441 441
 
442 442
 	/**
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 		$options['NormalCssClass'] = $this->getTabCssClass();
460 460
 		$viewIDs = array();
461 461
 		$viewVis = array();
462
-		foreach($this->getViews() as $view)
462
+		foreach ($this->getViews() as $view)
463 463
 		{
464 464
 			$viewIDs[] = $view->getClientID();
465 465
 			$viewVis[] = $view->getVisible();
@@ -500,18 +500,18 @@  discard block
 block discarded – undo
500 500
 	 */
501 501
 	public function renderContents($writer)
502 502
 	{
503
-		$views=$this->getViews();
504
-		if($views->getCount()>0)
503
+		$views = $this->getViews();
504
+		if ($views->getCount() > 0)
505 505
 		{
506 506
 			$writer->writeLine();
507 507
 			// render tab bar
508
-			foreach($views as $view)
508
+			foreach ($views as $view)
509 509
 			{
510 510
 				$view->renderTab($writer);
511 511
 				$writer->writeLine();
512 512
 			}
513 513
 			// render tab views
514
-			foreach($views as $view)
514
+			foreach ($views as $view)
515 515
 			{
516 516
 				$view->renderControl($writer);
517 517
 				$writer->writeLine();
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
  */
544 544
 class TTabView extends TWebControl
545 545
 {
546
-	private $_active=false;
546
+	private $_active = false;
547 547
 
548 548
 	/**
549 549
 	 * @return the tag name for the view element
@@ -559,14 +559,14 @@  discard block
 block discarded – undo
559 559
 	 */
560 560
 	protected function addAttributesToRender($writer)
561 561
 	{
562
-		if(!$this->getActive() && $this->getPage()->getClientSupportsJavaScript())
563
-			$this->getStyle()->setStyleField('display','none');
562
+		if (!$this->getActive() && $this->getPage()->getClientSupportsJavaScript())
563
+			$this->getStyle()->setStyleField('display', 'none');
564 564
 
565 565
 		$this->getStyle()->mergeWith($this->getParent()->getViewStyle());
566 566
 
567 567
 		parent::addAttributesToRender($writer);
568 568
 
569
-		$writer->addAttribute('id',$this->getClientID());
569
+		$writer->addAttribute('id', $this->getClientID());
570 570
 	}
571 571
 
572 572
 	/**
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 	 */
575 575
 	public function getCaption()
576 576
 	{
577
-		return $this->getViewState('Caption','');
577
+		return $this->getViewState('Caption', '');
578 578
 	}
579 579
 
580 580
 	/**
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 	 */
583 583
 	public function setCaption($value)
584 584
 	{
585
-		$this->setViewState('Caption',TPropertyValue::ensureString($value),'');
585
+		$this->setViewState('Caption', TPropertyValue::ensureString($value), '');
586 586
 	}
587 587
 
588 588
 	/**
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 	 */
591 591
 	public function getNavigateUrl()
592 592
 	{
593
-		return $this->getViewState('NavigateUrl','');
593
+		return $this->getViewState('NavigateUrl', '');
594 594
 	}
595 595
 
596 596
 	/**
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 	 */
601 601
 	public function setNavigateUrl($value)
602 602
 	{
603
-		$this->setViewState('NavigateUrl',TPropertyValue::ensureString($value),'');
603
+		$this->setViewState('NavigateUrl', TPropertyValue::ensureString($value), '');
604 604
 	}
605 605
 
606 606
 	/**
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 	 */
609 609
 	public function getText()
610 610
 	{
611
-		return $this->getViewState('Text','');
611
+		return $this->getViewState('Text', '');
612 612
 	}
613 613
 
614 614
 	/**
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 	 */
619 619
 	public function setText($value)
620 620
 	{
621
-		$this->setViewState('Text',TPropertyValue::ensureString($value),'');
621
+		$this->setViewState('Text', TPropertyValue::ensureString($value), '');
622 622
 	}
623 623
 
624 624
 	/**
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
 	 */
635 635
 	public function setActive($value)
636 636
 	{
637
-		$this->_active=TPropertyValue::ensureBoolean($value);
637
+		$this->_active = TPropertyValue::ensureBoolean($value);
638 638
 	}
639 639
 
640 640
 	/**
@@ -643,9 +643,9 @@  discard block
 block discarded – undo
643 643
 	 */
644 644
 	public function renderContents($writer)
645 645
 	{
646
-		if(($text=$this->getText())!=='')
646
+		if (($text = $this->getText()) !== '')
647 647
 			$writer->write($text);
648
-		else if($this->getHasControls())
648
+		else if ($this->getHasControls())
649 649
 			parent::renderContents($writer);
650 650
 	}
651 651
 
@@ -655,11 +655,11 @@  discard block
 block discarded – undo
655 655
 	 */
656 656
 	public function renderTab($writer)
657 657
 	{
658
-		if($this->getVisible(false) && $this->getPage()->getClientSupportsJavaScript())
658
+		if ($this->getVisible(false) && $this->getPage()->getClientSupportsJavaScript())
659 659
 		{
660
-			$writer->addAttribute('id',$this->getClientID().'_0');
660
+			$writer->addAttribute('id', $this->getClientID() . '_0');
661 661
 
662
-			$style=$this->getActive()?$this->getParent()->getActiveTabStyle():$this->getParent()->getTabStyle();
662
+			$style = $this->getActive() ? $this->getParent()->getActiveTabStyle() : $this->getParent()->getTabStyle();
663 663
 			$style->addAttributesToRender($writer);
664 664
 
665 665
 			$writer->renderBeginTag($this->getTagName());
@@ -677,10 +677,10 @@  discard block
 block discarded – undo
677 677
 	 */
678 678
 	protected function renderTabContent($writer)
679 679
 	{
680
-		if(($url=$this->getNavigateUrl())==='')
681
-			$url='javascript://';
682
-		if(($caption=$this->getCaption())==='')
683
-			$caption='&nbsp;';
680
+		if (($url = $this->getNavigateUrl()) === '')
681
+			$url = 'javascript://';
682
+		if (($caption = $this->getCaption()) === '')
683
+			$caption = '&nbsp;';
684 684
 		$writer->write("<a href=\"{$url}\">{$caption}</a>");
685 685
 	}
686 686
 }
@@ -703,10 +703,10 @@  discard block
 block discarded – undo
703 703
 	 * @param mixed new item
704 704
 	 * @throws TInvalidDataTypeException if the item to be inserted is not a {@link TTabView} object.
705 705
 	 */
706
-	public function insertAt($index,$item)
706
+	public function insertAt($index, $item)
707 707
 	{
708
-		if($item instanceof TTabView)
709
-			parent::insertAt($index,$item);
708
+		if ($item instanceof TTabView)
709
+			parent::insertAt($index, $item);
710 710
 		else
711 711
 			throw new TInvalidDataTypeException('tabviewcollection_tabview_required');
712 712
 	}
@@ -718,9 +718,9 @@  discard block
 block discarded – undo
718 718
 	 */
719 719
 	public function findIndexByID($id)
720 720
 	{
721
-		foreach($this as $index=>$view)
721
+		foreach ($this as $index=>$view)
722 722
 		{
723
-			if($view->getID(false)===$id)
723
+			if ($view->getID(false) === $id)
724 724
 				return $index;
725 725
 		}
726 726
 		return -1;
Please login to merge, or discard this patch.
Braces   +50 added lines, -40 removed lines patch added patch discarded remove patch
@@ -76,8 +76,9 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
 	public function addParsedObject($object)
78 78
 	{
79
-		if($object instanceof TTabView)
80
-			$this->getControls()->add($object);
79
+		if($object instanceof TTabView) {
80
+					$this->getControls()->add($object);
81
+		}
81 82
 	}
82 83
 
83 84
 	/**
@@ -132,19 +133,19 @@  discard block
 block discarded – undo
132 133
 		$views=$this->getViews();
133 134
 		if(($id=$this->getActiveViewID())!=='')
134 135
 		{
135
-			if(($index=$views->findIndexByID($id))>=0)
136
-				$activeView=$views->itemAt($index);
137
-			else
138
-				throw new TInvalidDataValueException('tabpanel_activeviewid_invalid',$id);
139
-		}
140
-		else if(($index=$this->getActiveViewIndex())>=0)
136
+			if(($index=$views->findIndexByID($id))>=0) {
137
+							$activeView=$views->itemAt($index);
138
+			} else {
139
+							throw new TInvalidDataValueException('tabpanel_activeviewid_invalid',$id);
140
+			}
141
+		} else if(($index=$this->getActiveViewIndex())>=0)
141 142
 		{
142
-			if($index<$views->getCount())
143
-				$activeView=$views->itemAt($index);
144
-			else
145
-				throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid',$index);
146
-		}
147
-		else
143
+			if($index<$views->getCount()) {
144
+							$activeView=$views->itemAt($index);
145
+			} else {
146
+							throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid',$index);
147
+			}
148
+		} else
148 149
 		{
149 150
 			foreach($views as $index=>$view)
150 151
 			{
@@ -155,8 +156,9 @@  discard block
 block discarded – undo
155 156
 				}
156 157
 			}
157 158
 		}
158
-		if($activeView!==null)
159
-			$this->activateView($activeView);
159
+		if($activeView!==null) {
160
+					$this->activateView($activeView);
161
+		}
160 162
 		return $activeView;
161 163
 	}
162 164
 
@@ -166,10 +168,11 @@  discard block
 block discarded – undo
166 168
 	 */
167 169
 	public function setActiveView($view)
168 170
 	{
169
-		if($this->getViews()->indexOf($view)>=0)
170
-			$this->activateView($view);
171
-		else
172
-			throw new TInvalidOperationException('tabpanel_view_inexistent');
171
+		if($this->getViews()->indexOf($view)>=0) {
172
+					$this->activateView($view);
173
+		} else {
174
+					throw new TInvalidOperationException('tabpanel_view_inexistent');
175
+		}
173 176
 	}
174 177
 
175 178
     /**
@@ -320,9 +323,9 @@  discard block
 block discarded – undo
320 323
 				$this->setActiveViewIndex($index);
321 324
 				$this->setActiveViewID($view->getID(false));
322 325
 				$view->setActive(true);
326
+			} else {
327
+							$v->setActive(false);
323 328
 			}
324
-			else
325
-				$v->setActive(false);
326 329
 		}
327 330
 	}
328 331
 
@@ -434,8 +437,9 @@  discard block
 block discarded – undo
434 437
 		$cs->registerEndScript("prado:$id", $code);
435 438
 		// ensure an item is always active and visible
436 439
 		$index = $this->getActiveViewIndex();
437
-		if(!$this->getViews()->itemAt($index)->Visible)
438
-			$index=0;
440
+		if(!$this->getViews()->itemAt($index)->Visible) {
441
+					$index=0;
442
+		}
439 443
 		$cs->registerHiddenField($id.'_1', $index);
440 444
 	}
441 445
 
@@ -559,8 +563,9 @@  discard block
 block discarded – undo
559 563
 	 */
560 564
 	protected function addAttributesToRender($writer)
561 565
 	{
562
-		if(!$this->getActive() && $this->getPage()->getClientSupportsJavaScript())
563
-			$this->getStyle()->setStyleField('display','none');
566
+		if(!$this->getActive() && $this->getPage()->getClientSupportsJavaScript()) {
567
+					$this->getStyle()->setStyleField('display','none');
568
+		}
564 569
 
565 570
 		$this->getStyle()->mergeWith($this->getParent()->getViewStyle());
566 571
 
@@ -643,10 +648,11 @@  discard block
 block discarded – undo
643 648
 	 */
644 649
 	public function renderContents($writer)
645 650
 	{
646
-		if(($text=$this->getText())!=='')
647
-			$writer->write($text);
648
-		else if($this->getHasControls())
649
-			parent::renderContents($writer);
651
+		if(($text=$this->getText())!=='') {
652
+					$writer->write($text);
653
+		} else if($this->getHasControls()) {
654
+					parent::renderContents($writer);
655
+		}
650 656
 	}
651 657
 
652 658
 	/**
@@ -677,10 +683,12 @@  discard block
 block discarded – undo
677 683
 	 */
678 684
 	protected function renderTabContent($writer)
679 685
 	{
680
-		if(($url=$this->getNavigateUrl())==='')
681
-			$url='javascript://';
682
-		if(($caption=$this->getCaption())==='')
683
-			$caption='&nbsp;';
686
+		if(($url=$this->getNavigateUrl())==='') {
687
+					$url='javascript://';
688
+		}
689
+		if(($caption=$this->getCaption())==='') {
690
+					$caption='&nbsp;';
691
+		}
684 692
 		$writer->write("<a href=\"{$url}\">{$caption}</a>");
685 693
 	}
686 694
 }
@@ -705,10 +713,11 @@  discard block
 block discarded – undo
705 713
 	 */
706 714
 	public function insertAt($index,$item)
707 715
 	{
708
-		if($item instanceof TTabView)
709
-			parent::insertAt($index,$item);
710
-		else
711
-			throw new TInvalidDataTypeException('tabviewcollection_tabview_required');
716
+		if($item instanceof TTabView) {
717
+					parent::insertAt($index,$item);
718
+		} else {
719
+					throw new TInvalidDataTypeException('tabviewcollection_tabview_required');
720
+		}
712 721
 	}
713 722
 
714 723
 	/**
@@ -720,8 +729,9 @@  discard block
 block discarded – undo
720 729
 	{
721 730
 		foreach($this as $index=>$view)
722 731
 		{
723
-			if($view->getID(false)===$id)
724
-				return $index;
732
+			if($view->getID(false)===$id) {
733
+							return $index;
734
+			}
725 735
 		}
726 736
 		return -1;
727 737
 	}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTemplateColumn.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
 	}
119 119
 
120 120
 	/**
121
-	 * @return ITemplate the item template
121
+	 * @return string the item template
122 122
 	 */
123 123
 	public function getItemTemplate()
124 124
 	{
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
 	 * Various item templates
43 43
 	 * @var string
44 44
 	 */
45
-	private $_itemTemplate=null;
46
-	private $_editItemTemplate=null;
47
-	private $_headerTemplate=null;
48
-	private $_footerTemplate=null;
45
+	private $_itemTemplate = null;
46
+	private $_editItemTemplate = null;
47
+	private $_headerTemplate = null;
48
+	private $_footerTemplate = null;
49 49
 
50 50
 	/**
51 51
 	 * @return string the class name for the item cell renderer. Defaults to empty, meaning not set.
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	public function getItemRenderer()
55 55
 	{
56
-		return $this->getViewState('ItemRenderer','');
56
+		return $this->getViewState('ItemRenderer', '');
57 57
 	}
58 58
 
59 59
 	/**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	public function setItemRenderer($value)
71 71
 	{
72
-		$this->setViewState('ItemRenderer',$value,'');
72
+		$this->setViewState('ItemRenderer', $value, '');
73 73
 	}
74 74
 
75 75
 	/**
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public function getEditItemRenderer()
80 80
 	{
81
-		return $this->getViewState('EditItemRenderer','');
81
+		return $this->getViewState('EditItemRenderer', '');
82 82
 	}
83 83
 
84 84
 	/**
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function setEditItemRenderer($value)
96 96
 	{
97
-		$this->setViewState('EditItemRenderer',$value,'');
97
+		$this->setViewState('EditItemRenderer', $value, '');
98 98
 	}
99 99
 
100 100
 	/**
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public function setEditItemTemplate($value)
113 113
 	{
114
-		if($value instanceof ITemplate || $value===null)
115
-			$this->_editItemTemplate=$value;
114
+		if ($value instanceof ITemplate || $value === null)
115
+			$this->_editItemTemplate = $value;
116 116
 		else
117
-			throw new TInvalidDataTypeException('templatecolumn_template_required','EditItemTemplate');
117
+			throw new TInvalidDataTypeException('templatecolumn_template_required', 'EditItemTemplate');
118 118
 	}
119 119
 
120 120
 	/**
@@ -131,10 +131,10 @@  discard block
 block discarded – undo
131 131
 	 */
132 132
 	public function setItemTemplate($value)
133 133
 	{
134
-		if($value instanceof ITemplate || $value===null)
135
-			$this->_itemTemplate=$value;
134
+		if ($value instanceof ITemplate || $value === null)
135
+			$this->_itemTemplate = $value;
136 136
 		else
137
-			throw new TInvalidDataTypeException('templatecolumn_template_required','ItemTemplate');
137
+			throw new TInvalidDataTypeException('templatecolumn_template_required', 'ItemTemplate');
138 138
 	}
139 139
 
140 140
 	/**
@@ -151,10 +151,10 @@  discard block
 block discarded – undo
151 151
 	 */
152 152
 	public function setHeaderTemplate($value)
153 153
 	{
154
-		if($value instanceof ITemplate || $value===null)
155
-			$this->_headerTemplate=$value;
154
+		if ($value instanceof ITemplate || $value === null)
155
+			$this->_headerTemplate = $value;
156 156
 		else
157
-			throw new TInvalidDataTypeException('templatecolumn_template_required','HeaderTemplate');
157
+			throw new TInvalidDataTypeException('templatecolumn_template_required', 'HeaderTemplate');
158 158
 	}
159 159
 
160 160
 	/**
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	public function setFooterTemplate($value)
173 173
 	{
174
-		if($value instanceof ITemplate || $value===null)
175
-			$this->_footerTemplate=$value;
174
+		if ($value instanceof ITemplate || $value === null)
175
+			$this->_footerTemplate = $value;
176 176
 		else
177
-			throw new TInvalidDataTypeException('templatecolumn_template_required','FooterTemplate');
177
+			throw new TInvalidDataTypeException('templatecolumn_template_required', 'FooterTemplate');
178 178
 	}
179 179
 
180 180
 	/**
@@ -186,57 +186,57 @@  discard block
 block discarded – undo
186 186
 	 * @param integer the index to the Columns property that the cell resides in.
187 187
 	 * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)
188 188
 	 */
189
-	public function initializeCell($cell,$columnIndex,$itemType)
189
+	public function initializeCell($cell, $columnIndex, $itemType)
190 190
 	{
191
-		if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem)
191
+		if ($itemType === TListItemType::Item || $itemType === TListItemType::AlternatingItem || $itemType === TListItemType::SelectedItem || $itemType === TListItemType::EditItem)
192 192
 		{
193
-			if($itemType===TListItemType::EditItem)
193
+			if ($itemType === TListItemType::EditItem)
194 194
 			{
195
-				if(($classPath=$this->getEditItemRenderer())==='' && ($template=$this->_editItemTemplate)===null)
195
+				if (($classPath = $this->getEditItemRenderer()) === '' && ($template = $this->_editItemTemplate) === null)
196 196
 				{
197
-					$classPath=$this->getItemRenderer();
198
-					$template=$this->_itemTemplate;
197
+					$classPath = $this->getItemRenderer();
198
+					$template = $this->_itemTemplate;
199 199
 				}
200 200
 			}
201 201
 			else
202 202
 			{
203
-				$template=$this->_itemTemplate;
204
-				$classPath=$this->getItemRenderer();
203
+				$template = $this->_itemTemplate;
204
+				$classPath = $this->getItemRenderer();
205 205
 			}
206
-			if($classPath!=='')
206
+			if ($classPath !== '')
207 207
 			{
208
-				$control=Prado::createComponent($classPath);
208
+				$control = Prado::createComponent($classPath);
209 209
 				$cell->getControls()->add($control);
210
-				if($control instanceof IItemDataRenderer)
210
+				if ($control instanceof IItemDataRenderer)
211 211
 				{
212 212
 					$control->setItemIndex($cell->getParent()->getItemIndex());
213 213
 					$control->setItemType($itemType);
214 214
 				}
215
-				if($control instanceof IDataRenderer)
216
-					$control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
215
+				if ($control instanceof IDataRenderer)
216
+					$control->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn'));
217 217
 			}
218
-			else if($template!==null)
218
+			else if ($template !== null)
219 219
 				$template->instantiateIn($cell);
220
-			else if($itemType!==TListItemType::EditItem)
220
+			else if ($itemType !== TListItemType::EditItem)
221 221
 				$cell->setText('&nbsp;');
222 222
 		}
223
-		else if($itemType===TListItemType::Header)
223
+		else if ($itemType === TListItemType::Header)
224 224
 		{
225
-			if(($classPath=$this->getHeaderRenderer())!=='')
226
-				$this->initializeHeaderCell($cell,$columnIndex);
227
-			else if($this->_headerTemplate!==null)
225
+			if (($classPath = $this->getHeaderRenderer()) !== '')
226
+				$this->initializeHeaderCell($cell, $columnIndex);
227
+			else if ($this->_headerTemplate !== null)
228 228
 				$this->_headerTemplate->instantiateIn($cell);
229 229
 			else
230
-				$this->initializeHeaderCell($cell,$columnIndex);
230
+				$this->initializeHeaderCell($cell, $columnIndex);
231 231
 		}
232
-		else if($itemType===TListItemType::Footer)
232
+		else if ($itemType === TListItemType::Footer)
233 233
 		{
234
-			if(($classPath=$this->getFooterRenderer())!=='')
235
-				$this->initializeFooterCell($cell,$columnIndex);
236
-			else if($this->_footerTemplate!==null)
234
+			if (($classPath = $this->getFooterRenderer()) !== '')
235
+				$this->initializeFooterCell($cell, $columnIndex);
236
+			else if ($this->_footerTemplate !== null)
237 237
 				$this->_footerTemplate->instantiateIn($cell);
238 238
 			else
239
-				$this->initializeFooterCell($cell,$columnIndex);
239
+				$this->initializeFooterCell($cell, $columnIndex);
240 240
 		}
241 241
 	}
242 242
 
@@ -245,9 +245,9 @@  discard block
 block discarded – undo
245 245
 	 * This method is invoked when datagrid performs databinding.
246 246
 	 * It populates the content of the cell with the relevant data from data source.
247 247
 	 */
248
-	public function dataBindColumn($sender,$param)
248
+	public function dataBindColumn($sender, $param)
249 249
 	{
250
-		$item=$sender->getNamingContainer();
250
+		$item = $sender->getNamingContainer();
251 251
 		$sender->setData($item->getData());
252 252
 	}
253 253
 }
Please login to merge, or discard this patch.
Braces   +44 added lines, -40 removed lines patch added patch discarded remove patch
@@ -111,10 +111,11 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public function setEditItemTemplate($value)
113 113
 	{
114
-		if($value instanceof ITemplate || $value===null)
115
-			$this->_editItemTemplate=$value;
116
-		else
117
-			throw new TInvalidDataTypeException('templatecolumn_template_required','EditItemTemplate');
114
+		if($value instanceof ITemplate || $value===null) {
115
+					$this->_editItemTemplate=$value;
116
+		} else {
117
+					throw new TInvalidDataTypeException('templatecolumn_template_required','EditItemTemplate');
118
+		}
118 119
 	}
119 120
 
120 121
 	/**
@@ -131,10 +132,11 @@  discard block
 block discarded – undo
131 132
 	 */
132 133
 	public function setItemTemplate($value)
133 134
 	{
134
-		if($value instanceof ITemplate || $value===null)
135
-			$this->_itemTemplate=$value;
136
-		else
137
-			throw new TInvalidDataTypeException('templatecolumn_template_required','ItemTemplate');
135
+		if($value instanceof ITemplate || $value===null) {
136
+					$this->_itemTemplate=$value;
137
+		} else {
138
+					throw new TInvalidDataTypeException('templatecolumn_template_required','ItemTemplate');
139
+		}
138 140
 	}
139 141
 
140 142
 	/**
@@ -151,10 +153,11 @@  discard block
 block discarded – undo
151 153
 	 */
152 154
 	public function setHeaderTemplate($value)
153 155
 	{
154
-		if($value instanceof ITemplate || $value===null)
155
-			$this->_headerTemplate=$value;
156
-		else
157
-			throw new TInvalidDataTypeException('templatecolumn_template_required','HeaderTemplate');
156
+		if($value instanceof ITemplate || $value===null) {
157
+					$this->_headerTemplate=$value;
158
+		} else {
159
+					throw new TInvalidDataTypeException('templatecolumn_template_required','HeaderTemplate');
160
+		}
158 161
 	}
159 162
 
160 163
 	/**
@@ -171,10 +174,11 @@  discard block
 block discarded – undo
171 174
 	 */
172 175
 	public function setFooterTemplate($value)
173 176
 	{
174
-		if($value instanceof ITemplate || $value===null)
175
-			$this->_footerTemplate=$value;
176
-		else
177
-			throw new TInvalidDataTypeException('templatecolumn_template_required','FooterTemplate');
177
+		if($value instanceof ITemplate || $value===null) {
178
+					$this->_footerTemplate=$value;
179
+		} else {
180
+					throw new TInvalidDataTypeException('templatecolumn_template_required','FooterTemplate');
181
+		}
178 182
 	}
179 183
 
180 184
 	/**
@@ -197,8 +201,7 @@  discard block
 block discarded – undo
197 201
 					$classPath=$this->getItemRenderer();
198 202
 					$template=$this->_itemTemplate;
199 203
 				}
200
-			}
201
-			else
204
+			} else
202 205
 			{
203 206
 				$template=$this->_itemTemplate;
204 207
 				$classPath=$this->getItemRenderer();
@@ -212,31 +215,32 @@  discard block
 block discarded – undo
212 215
 					$control->setItemIndex($cell->getParent()->getItemIndex());
213 216
 					$control->setItemType($itemType);
214 217
 				}
215
-				if($control instanceof IDataRenderer)
216
-					$control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
218
+				if($control instanceof IDataRenderer) {
219
+									$control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
220
+				}
221
+			} else if($template!==null) {
222
+							$template->instantiateIn($cell);
223
+			} else if($itemType!==TListItemType::EditItem) {
224
+							$cell->setText('&nbsp;');
217 225
 			}
218
-			else if($template!==null)
219
-				$template->instantiateIn($cell);
220
-			else if($itemType!==TListItemType::EditItem)
221
-				$cell->setText('&nbsp;');
222
-		}
223
-		else if($itemType===TListItemType::Header)
226
+		} else if($itemType===TListItemType::Header)
224 227
 		{
225
-			if(($classPath=$this->getHeaderRenderer())!=='')
226
-				$this->initializeHeaderCell($cell,$columnIndex);
227
-			else if($this->_headerTemplate!==null)
228
-				$this->_headerTemplate->instantiateIn($cell);
229
-			else
230
-				$this->initializeHeaderCell($cell,$columnIndex);
231
-		}
232
-		else if($itemType===TListItemType::Footer)
228
+			if(($classPath=$this->getHeaderRenderer())!=='') {
229
+							$this->initializeHeaderCell($cell,$columnIndex);
230
+			} else if($this->_headerTemplate!==null) {
231
+							$this->_headerTemplate->instantiateIn($cell);
232
+			} else {
233
+							$this->initializeHeaderCell($cell,$columnIndex);
234
+			}
235
+		} else if($itemType===TListItemType::Footer)
233 236
 		{
234
-			if(($classPath=$this->getFooterRenderer())!=='')
235
-				$this->initializeFooterCell($cell,$columnIndex);
236
-			else if($this->_footerTemplate!==null)
237
-				$this->_footerTemplate->instantiateIn($cell);
238
-			else
239
-				$this->initializeFooterCell($cell,$columnIndex);
237
+			if(($classPath=$this->getFooterRenderer())!=='') {
238
+							$this->initializeFooterCell($cell,$columnIndex);
239
+			} else if($this->_footerTemplate!==null) {
240
+							$this->_footerTemplate->instantiateIn($cell);
241
+			} else {
242
+							$this->initializeFooterCell($cell,$columnIndex);
243
+			}
240 244
 		}
241 245
 	}
242 246
 
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * TTemplateColumn class file
4
- *
5
- * @author Qiang Xue <[email protected]>
6
- * @link https://github.com/pradosoft/prado
7
- * @copyright Copyright &copy; 2005-2015 The PRADO Group
8
- * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
- * @package System.Web.UI.WebControls
10
- */
3
+	 * TTemplateColumn class file
4
+	 *
5
+	 * @author Qiang Xue <[email protected]>
6
+	 * @link https://github.com/pradosoft/prado
7
+	 * @copyright Copyright &copy; 2005-2015 The PRADO Group
8
+	 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
+	 * @package System.Web.UI.WebControls
10
+	 */
11 11
 
12 12
 /**
13 13
  * TDataGridColumn class file
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTextBox.php 4 patches
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	/**
238 238
 	 * Returns the value to be validated.
239 239
 	 * This methid is required by IValidatable interface.
240
-	 * @return mixed the value of the property to be validated.
240
+	 * @return string the value of the property to be validated.
241 241
 	 */
242 242
 	public function getValidationPropertyValue()
243 243
 	{
@@ -342,6 +342,7 @@  discard block
 block discarded – undo
342 342
 	 * An automatic postback to the server will occur whenever the user
343 343
 	 * modifies the text in the TTextBox control and then tabs out of the component.
344 344
 	 * @param boolean the value indicating if postback automatically
345
+	 * @param boolean $value
345 346
 	 */
346 347
 	public function setAutoPostBack($value)
347 348
 	{
@@ -425,6 +426,7 @@  discard block
 block discarded – undo
425 426
 
426 427
 	/**
427 428
 	 * @param boolean whether the textbox is read only
429
+	 * @param boolean $value
428 430
 	 */
429 431
 	public function setReadOnly($value)
430 432
 	{
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -251,14 +251,14 @@  discard block
 block discarded – undo
251 251
 	 */
252 252
 	public function getIsValid()
253 253
 	{
254
-	    return $this->_isValid;
254
+		return $this->_isValid;
255 255
 	}
256 256
 	/**
257 257
 	 * @param bool wether this control is valid.
258 258
 	 */
259 259
 	public function setIsValid($value)
260 260
 	{
261
-	    $this->_isValid=TPropertyValue::ensureBoolean($value);
261
+		$this->_isValid=TPropertyValue::ensureBoolean($value);
262 262
 	}
263 263
 
264 264
 	/**
@@ -329,8 +329,8 @@  discard block
 block discarded – undo
329 329
 
330 330
 	/**
331 331
 	 * @return boolean a value indicating whether an automatic postback to the server
332
-     * will occur whenever the user modifies the text in the TTextBox control and
333
-     * then tabs out of the component. Defaults to false.
332
+	 * will occur whenever the user modifies the text in the TTextBox control and
333
+	 * then tabs out of the component. Defaults to false.
334 334
 	 */
335 335
 	public function getAutoPostBack()
336 336
 	{
Please login to merge, or discard this patch.
Spacing   +130 added lines, -130 removed lines patch added patch discarded remove patch
@@ -51,28 +51,28 @@  discard block
 block discarded – undo
51 51
 	/**
52 52
 	 * Default number of rows (for MultiLine text box)
53 53
 	 */
54
-	const DEFAULT_ROWS=4;
54
+	const DEFAULT_ROWS = 4;
55 55
 	/**
56 56
 	 * Default number of columns (for MultiLine text box)
57 57
 	 */
58
-	const DEFAULT_COLUMNS=20;
58
+	const DEFAULT_COLUMNS = 20;
59 59
 	/**
60 60
 	 * @var mixed safe text parser
61 61
 	 */
62
-	private static $_safeTextParser=null;
62
+	private static $_safeTextParser = null;
63 63
 	/**
64 64
 	 * @var string safe textbox content with javascript stripped off
65 65
 	 */
66 66
 	private $_safeText;
67
-	private $_dataChanged=false;
68
-	private $_isValid=true;
67
+	private $_dataChanged = false;
68
+	private $_isValid = true;
69 69
 
70 70
 	/**
71 71
 	 * @return string tag name of the textbox
72 72
 	 */
73 73
 	protected function getTagName()
74 74
 	{
75
-		return ($this->getTextMode()==='MultiLine')?'textarea':'input';
75
+		return ($this->getTextMode() === 'MultiLine') ? 'textarea' : 'input';
76 76
 	}
77 77
 
78 78
 	/**
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public function getEnableClientScript()
82 82
 	{
83
-		return $this->getViewState('EnableClientScript',true);
83
+		return $this->getViewState('EnableClientScript', true);
84 84
 	}
85 85
 
86 86
 	/**
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function setEnableClientScript($value)
90 90
 	{
91
-		$this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true);
91
+		$this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true);
92 92
 	}
93 93
 
94 94
 	/**
@@ -98,69 +98,69 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	protected function addAttributesToRender($writer)
100 100
 	{
101
-		$page=$this->getPage();
101
+		$page = $this->getPage();
102 102
 		$page->ensureRenderInForm($this);
103
-		if(($uid=$this->getUniqueID())!=='')
104
-			$writer->addAttribute('name',$uid);
105
-		if(($textMode=$this->getTextMode())===TTextBoxMode::MultiLine)
103
+		if (($uid = $this->getUniqueID()) !== '')
104
+			$writer->addAttribute('name', $uid);
105
+		if (($textMode = $this->getTextMode()) === TTextBoxMode::MultiLine)
106 106
 		{
107
-			if(($rows=$this->getRows())<=0)
108
-				$rows=self::DEFAULT_ROWS;
109
-			if(($cols=$this->getColumns())<=0)
110
-				$cols=self::DEFAULT_COLUMNS;
111
-			$writer->addAttribute('rows',"$rows");
112
-			$writer->addAttribute('cols',"$cols");
113
-			if(!$this->getWrap())
114
-				$writer->addAttribute('wrap','off');
107
+			if (($rows = $this->getRows()) <= 0)
108
+				$rows = self::DEFAULT_ROWS;
109
+			if (($cols = $this->getColumns()) <= 0)
110
+				$cols = self::DEFAULT_COLUMNS;
111
+			$writer->addAttribute('rows', "$rows");
112
+			$writer->addAttribute('cols', "$cols");
113
+			if (!$this->getWrap())
114
+				$writer->addAttribute('wrap', 'off');
115 115
 		}
116 116
 		else
117 117
 		{
118
-			if($textMode===TTextBoxMode::SingleLine)
118
+			if ($textMode === TTextBoxMode::SingleLine)
119 119
 			{
120
-				$writer->addAttribute('type','text');
121
-				if(($text=$this->getText())!=='')
122
-					$writer->addAttribute('value',$text);
120
+				$writer->addAttribute('type', 'text');
121
+				if (($text = $this->getText()) !== '')
122
+					$writer->addAttribute('value', $text);
123 123
 			}
124 124
 			else
125 125
 			{
126
-				if($this->getPersistPassword() && ($text=$this->getText())!=='')
127
-					$writer->addAttribute('value',$text);
128
-				$writer->addAttribute('type','password');
126
+				if ($this->getPersistPassword() && ($text = $this->getText()) !== '')
127
+					$writer->addAttribute('value', $text);
128
+				$writer->addAttribute('type', 'password');
129 129
 			}
130 130
 
131
-			if(($act=$this->getAutoCompleteType())!=='None')
131
+			if (($act = $this->getAutoCompleteType()) !== 'None')
132 132
 			{
133
-				if($act==='Disabled')
134
-					$writer->addAttribute('autocomplete','off');
135
-				else if($act==='Search')
136
-					$writer->addAttribute('vcard_name','search');
137
-				else if($act==='HomeCountryRegion')
138
-					$writer->addAttribute('vcard_name','HomeCountry');
139
-				else if($act==='BusinessCountryRegion')
140
-					$writer->addAttribute('vcard_name','BusinessCountry');
133
+				if ($act === 'Disabled')
134
+					$writer->addAttribute('autocomplete', 'off');
135
+				else if ($act === 'Search')
136
+					$writer->addAttribute('vcard_name', 'search');
137
+				else if ($act === 'HomeCountryRegion')
138
+					$writer->addAttribute('vcard_name', 'HomeCountry');
139
+				else if ($act === 'BusinessCountryRegion')
140
+					$writer->addAttribute('vcard_name', 'BusinessCountry');
141 141
 				else
142 142
 				{
143
-					if(strpos($act,'Business')===0)
144
-						$act='Business'.'.'.substr($act,8);
145
-					else if(strpos($act,'Home')===0)
146
-						$act='Home'.'.'.substr($act,4);
147
-					$writer->addAttribute('vcard_name','vCard.'.$act);
143
+					if (strpos($act, 'Business') === 0)
144
+						$act = 'Business' . '.' . substr($act, 8);
145
+					else if (strpos($act, 'Home') === 0)
146
+						$act = 'Home' . '.' . substr($act, 4);
147
+					$writer->addAttribute('vcard_name', 'vCard.' . $act);
148 148
 				}
149 149
 			}
150 150
 
151
-			if(($cols=$this->getColumns())>0)
152
-				$writer->addAttribute('size',"$cols");
153
-			if(($maxLength=$this->getMaxLength())>0)
154
-				$writer->addAttribute('maxlength',"$maxLength");
151
+			if (($cols = $this->getColumns()) > 0)
152
+				$writer->addAttribute('size', "$cols");
153
+			if (($maxLength = $this->getMaxLength()) > 0)
154
+				$writer->addAttribute('maxlength', "$maxLength");
155 155
 		}
156
-		if($this->getReadOnly())
157
-			$writer->addAttribute('readonly','readonly');
158
-		$isEnabled=$this->getEnabled(true);
159
-		if(!$isEnabled && $this->getEnabled())  // in this case parent will not render 'disabled'
160
-			$writer->addAttribute('disabled','disabled');
161
-		if($isEnabled
156
+		if ($this->getReadOnly())
157
+			$writer->addAttribute('readonly', 'readonly');
158
+		$isEnabled = $this->getEnabled(true);
159
+		if (!$isEnabled && $this->getEnabled())  // in this case parent will not render 'disabled'
160
+			$writer->addAttribute('disabled', 'disabled');
161
+		if ($isEnabled
162 162
 			&& $this->getEnableClientScript()
163
-			&& ( $this->getAutoPostBack() || $textMode===TTextBoxMode::SingleLine)
163
+			&& ($this->getAutoPostBack() || $textMode === TTextBoxMode::SingleLine)
164 164
 			&& $page->getClientSupportsJavaScript())
165 165
 		{
166 166
 			$this->renderClientControlScript($writer);
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
 	 */
174 174
 	protected function renderClientControlScript($writer)
175 175
 	{
176
-		$writer->addAttribute('id',$this->getClientID());
176
+		$writer->addAttribute('id', $this->getClientID());
177 177
 		$cs = $this->getPage()->getClientScript();
178
-		$cs->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions());
178
+		$cs->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions());
179 179
 	}
180 180
 
181 181
 	/**
@@ -210,15 +210,15 @@  discard block
 block discarded – undo
210 210
 	 * @param array the input data collection
211 211
 	 * @return boolean whether the data of the component has been changed
212 212
 	 */
213
-	public function loadPostData($key,$values)
213
+	public function loadPostData($key, $values)
214 214
 	{
215
-		$value=$values[$key];
216
-		if($this->getAutoTrim())
217
-			$value=trim($value);
218
-		if(!$this->getReadOnly() && $this->getText()!==$value)
215
+		$value = $values[$key];
216
+		if ($this->getAutoTrim())
217
+			$value = trim($value);
218
+		if (!$this->getReadOnly() && $this->getText() !== $value)
219 219
 		{
220 220
 			$this->setText($value);
221
-			return $this->_dataChanged=true;
221
+			return $this->_dataChanged = true;
222 222
 		}
223 223
 		else
224 224
 			return false;
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	 */
259 259
 	public function setIsValid($value)
260 260
 	{
261
-	    $this->_isValid=TPropertyValue::ensureBoolean($value);
261
+	    $this->_isValid = TPropertyValue::ensureBoolean($value);
262 262
 	}
263 263
 
264 264
 	/**
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 	 */
272 272
 	public function onTextChanged($param)
273 273
 	{
274
-		$this->raiseEvent('OnTextChanged',$this,$param);
274
+		$this->raiseEvent('OnTextChanged', $this, $param);
275 275
 	}
276 276
 
277 277
 	/**
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 	 */
284 284
 	public function raisePostDataChangedEvent()
285 285
 	{
286
-		if($this->getAutoPostBack() && $this->getCausesValidation())
286
+		if ($this->getAutoPostBack() && $this->getCausesValidation())
287 287
 			$this->getPage()->validate($this->getValidationGroup());
288 288
 		$this->onTextChanged(null);
289 289
 	}
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 	 */
295 295
 	public function renderContents($writer)
296 296
 	{
297
-		if($this->getTextMode()==='MultiLine')
297
+		if ($this->getTextMode() === 'MultiLine')
298 298
 			$writer->write(THttpUtility::htmlEncode($this->getText()));
299 299
 	}
300 300
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	public function renderBeginTag($writer)
307 307
 	{
308 308
 		parent::renderBeginTag($writer);
309
-		if($this->getTextMode()==='MultiLine')
309
+		if ($this->getTextMode() === 'MultiLine')
310 310
 			$writer->write("\n");
311 311
 	}
312 312
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	 */
316 316
 	public function getAutoCompleteType()
317 317
 	{
318
-		return $this->getViewState('AutoCompleteType',TTextBoxAutoCompleteType::None);
318
+		return $this->getViewState('AutoCompleteType', TTextBoxAutoCompleteType::None);
319 319
 	}
320 320
 
321 321
 	/**
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 	 */
325 325
 	public function setAutoCompleteType($value)
326 326
 	{
327
-		$this->setViewState('AutoCompleteType',TPropertyValue::ensureEnum($value,'TTextBoxAutoCompleteType'),TTextBoxAutoCompleteType::None);
327
+		$this->setViewState('AutoCompleteType', TPropertyValue::ensureEnum($value, 'TTextBoxAutoCompleteType'), TTextBoxAutoCompleteType::None);
328 328
 	}
329 329
 
330 330
 	/**
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 	 */
335 335
 	public function getAutoPostBack()
336 336
 	{
337
-		return $this->getViewState('AutoPostBack',false);
337
+		return $this->getViewState('AutoPostBack', false);
338 338
 	}
339 339
 
340 340
 	/**
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	 */
346 346
 	public function setAutoPostBack($value)
347 347
 	{
348
-		$this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),false);
348
+		$this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), false);
349 349
 	}
350 350
 
351 351
 	/**
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 	 */
354 354
 	public function getAutoTrim()
355 355
 	{
356
-		return $this->getViewState('AutoTrim',false);
356
+		return $this->getViewState('AutoTrim', false);
357 357
 	}
358 358
 
359 359
 	/**
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 	 */
363 363
 	public function setAutoTrim($value)
364 364
 	{
365
-		$this->setViewState('AutoTrim',TPropertyValue::ensureBoolean($value),false);
365
+		$this->setViewState('AutoTrim', TPropertyValue::ensureBoolean($value), false);
366 366
 	}
367 367
 
368 368
 	/**
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 	 */
371 371
 	public function getCausesValidation()
372 372
 	{
373
-		return $this->getViewState('CausesValidation',true);
373
+		return $this->getViewState('CausesValidation', true);
374 374
 	}
375 375
 
376 376
 	/**
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 	 */
379 379
 	public function setCausesValidation($value)
380 380
 	{
381
-		$this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true);
381
+		$this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true);
382 382
 	}
383 383
 
384 384
 	/**
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 	 */
387 387
 	public function getColumns()
388 388
 	{
389
-		return $this->getViewState('Columns',0);
389
+		return $this->getViewState('Columns', 0);
390 390
 	}
391 391
 
392 392
 	/**
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 	 */
396 396
 	public function setColumns($value)
397 397
 	{
398
-		$this->setViewState('Columns',TPropertyValue::ensureInteger($value),0);
398
+		$this->setViewState('Columns', TPropertyValue::ensureInteger($value), 0);
399 399
 	}
400 400
 
401 401
 	/**
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 	 */
404 404
 	public function getMaxLength()
405 405
 	{
406
-		return $this->getViewState('MaxLength',0);
406
+		return $this->getViewState('MaxLength', 0);
407 407
 	}
408 408
 
409 409
 	/**
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 	 */
413 413
 	public function setMaxLength($value)
414 414
 	{
415
-		$this->setViewState('MaxLength',TPropertyValue::ensureInteger($value),0);
415
+		$this->setViewState('MaxLength', TPropertyValue::ensureInteger($value), 0);
416 416
 	}
417 417
 
418 418
 	/**
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 	 */
421 421
 	public function getReadOnly()
422 422
 	{
423
-		return $this->getViewState('ReadOnly',false);
423
+		return $this->getViewState('ReadOnly', false);
424 424
 	}
425 425
 
426 426
 	/**
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 	 */
429 429
 	public function setReadOnly($value)
430 430
 	{
431
-		$this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false);
431
+		$this->setViewState('ReadOnly', TPropertyValue::ensureBoolean($value), false);
432 432
 	}
433 433
 
434 434
 	/**
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 	 */
437 437
 	public function getRows()
438 438
 	{
439
-		return $this->getViewState('Rows',self::DEFAULT_ROWS);
439
+		return $this->getViewState('Rows', self::DEFAULT_ROWS);
440 440
 	}
441 441
 
442 442
 	/**
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 	 */
446 446
 	public function setRows($value)
447 447
 	{
448
-		$this->setViewState('Rows',TPropertyValue::ensureInteger($value),self::DEFAULT_ROWS);
448
+		$this->setViewState('Rows', TPropertyValue::ensureInteger($value), self::DEFAULT_ROWS);
449 449
 	}
450 450
 
451 451
 	/**
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 	 */
454 454
 	public function getPersistPassword()
455 455
 	{
456
-		return $this->getViewState('PersistPassword',false);
456
+		return $this->getViewState('PersistPassword', false);
457 457
 	}
458 458
 
459 459
 	/**
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 	 */
462 462
 	public function setPersistPassword($value)
463 463
 	{
464
-		$this->setViewState('PersistPassword',TPropertyValue::ensureBoolean($value),false);
464
+		$this->setViewState('PersistPassword', TPropertyValue::ensureBoolean($value), false);
465 465
 	}
466 466
 
467 467
 	/**
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 	 */
470 470
 	public function getText()
471 471
 	{
472
-		return $this->getViewState('Text','');
472
+		return $this->getViewState('Text', '');
473 473
 	}
474 474
 
475 475
 	/**
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 	 */
479 479
 	public function setText($value)
480 480
 	{
481
-		$this->setViewState('Text',TPropertyValue::ensureString($value),'');
481
+		$this->setViewState('Text', TPropertyValue::ensureString($value), '');
482 482
 		$this->_safeText = null;
483 483
 	}
484 484
 
@@ -513,8 +513,8 @@  discard block
 block discarded – undo
513 513
 	 */
514 514
 	public function getSafeText()
515 515
 	{
516
-		if($this->_safeText===null)
517
-			$this->_safeText=$this->getSafeTextParser()->parse($this->getText());
516
+		if ($this->_safeText === null)
517
+			$this->_safeText = $this->getSafeTextParser()->parse($this->getText());
518 518
 		return $this->_safeText;
519 519
 	}
520 520
 
@@ -523,8 +523,8 @@  discard block
 block discarded – undo
523 523
 	 */
524 524
 	protected function getSafeTextParser()
525 525
 	{
526
-		if(!self::$_safeTextParser)
527
-			self::$_safeTextParser=Prado::createComponent('System.3rdParty.SafeHtml.TSafeHtmlParser');
526
+		if (!self::$_safeTextParser)
527
+			self::$_safeTextParser = Prado::createComponent('System.3rdParty.SafeHtml.TSafeHtmlParser');
528 528
 		return self::$_safeTextParser;
529 529
 	}
530 530
 
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 	 */
534 534
 	public function getTextMode()
535 535
 	{
536
-		return $this->getViewState('TextMode',TTextBoxMode::SingleLine);
536
+		return $this->getViewState('TextMode', TTextBoxMode::SingleLine);
537 537
 	}
538 538
 
539 539
 	/**
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 	 */
544 544
 	public function setTextMode($value)
545 545
 	{
546
-		$this->setViewState('TextMode',TPropertyValue::ensureEnum($value,'TTextBoxMode'),TTextBoxMode::SingleLine);
546
+		$this->setViewState('TextMode', TPropertyValue::ensureEnum($value, 'TTextBoxMode'), TTextBoxMode::SingleLine);
547 547
 	}
548 548
 
549 549
 	/**
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 	 */
552 552
 	public function getValidationGroup()
553 553
 	{
554
-		return $this->getViewState('ValidationGroup','');
554
+		return $this->getViewState('ValidationGroup', '');
555 555
 	}
556 556
 
557 557
 	/**
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 	 */
560 560
 	public function setValidationGroup($value)
561 561
 	{
562
-		$this->setViewState('ValidationGroup',$value,'');
562
+		$this->setViewState('ValidationGroup', $value, '');
563 563
 	}
564 564
 
565 565
 	/**
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 	 */
568 568
 	public function getWrap()
569 569
 	{
570
-		return $this->getViewState('Wrap',true);
570
+		return $this->getViewState('Wrap', true);
571 571
 	}
572 572
 
573 573
 	/**
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 	 */
577 577
 	public function setWrap($value)
578 578
 	{
579
-		$this->setViewState('Wrap',TPropertyValue::ensureBoolean($value),true);
579
+		$this->setViewState('Wrap', TPropertyValue::ensureBoolean($value), true);
580 580
 	}
581 581
 }
582 582
 
@@ -596,9 +596,9 @@  discard block
 block discarded – undo
596 596
  */
597 597
 class TTextBoxMode extends TEnumerable
598 598
 {
599
-	const SingleLine='SingleLine';
600
-	const MultiLine='MultiLine';
601
-	const Password='Password';
599
+	const SingleLine = 'SingleLine';
600
+	const MultiLine = 'MultiLine';
601
+	const Password = 'Password';
602 602
 }
603 603
 
604 604
 /**
@@ -612,37 +612,37 @@  discard block
 block discarded – undo
612 612
  */
613 613
 class TTextBoxAutoCompleteType extends TEnumerable
614 614
 {
615
-	const BusinessCity='BusinessCity';
616
-	const BusinessCountryRegion='BusinessCountryRegion';
617
-	const BusinessFax='BusinessFax';
618
-	const BusinessPhone='BusinessPhone';
619
-	const BusinessState='BusinessState';
620
-	const BusinessStreetAddress='BusinessStreetAddress';
621
-	const BusinessUrl='BusinessUrl';
622
-	const BusinessZipCode='BusinessZipCode';
623
-	const Cellular='Cellular';
624
-	const Company='Company';
625
-	const Department='Department';
626
-	const Disabled='Disabled';
627
-	const DisplayName='DisplayName';
628
-	const Email='Email';
629
-	const FirstName='FirstName';
630
-	const Gender='Gender';
631
-	const HomeCity='HomeCity';
632
-	const HomeCountryRegion='HomeCountryRegion';
633
-	const HomeFax='HomeFax';
634
-	const Homepage='Homepage';
635
-	const HomePhone='HomePhone';
636
-	const HomeState='HomeState';
637
-	const HomeStreetAddress='HomeStreetAddress';
638
-	const HomeZipCode='HomeZipCode';
639
-	const JobTitle='JobTitle';
640
-	const LastName='LastName';
641
-	const MiddleName='MiddleName';
642
-	const None='None';
643
-	const Notes='Notes';
644
-	const Office='Office';
645
-	const Pager='Pager';
646
-	const Search='Search';
615
+	const BusinessCity = 'BusinessCity';
616
+	const BusinessCountryRegion = 'BusinessCountryRegion';
617
+	const BusinessFax = 'BusinessFax';
618
+	const BusinessPhone = 'BusinessPhone';
619
+	const BusinessState = 'BusinessState';
620
+	const BusinessStreetAddress = 'BusinessStreetAddress';
621
+	const BusinessUrl = 'BusinessUrl';
622
+	const BusinessZipCode = 'BusinessZipCode';
623
+	const Cellular = 'Cellular';
624
+	const Company = 'Company';
625
+	const Department = 'Department';
626
+	const Disabled = 'Disabled';
627
+	const DisplayName = 'DisplayName';
628
+	const Email = 'Email';
629
+	const FirstName = 'FirstName';
630
+	const Gender = 'Gender';
631
+	const HomeCity = 'HomeCity';
632
+	const HomeCountryRegion = 'HomeCountryRegion';
633
+	const HomeFax = 'HomeFax';
634
+	const Homepage = 'Homepage';
635
+	const HomePhone = 'HomePhone';
636
+	const HomeState = 'HomeState';
637
+	const HomeStreetAddress = 'HomeStreetAddress';
638
+	const HomeZipCode = 'HomeZipCode';
639
+	const JobTitle = 'JobTitle';
640
+	const LastName = 'LastName';
641
+	const MiddleName = 'MiddleName';
642
+	const None = 'None';
643
+	const Notes = 'Notes';
644
+	const Office = 'Office';
645
+	const Pager = 'Pager';
646
+	const Search = 'Search';
647 647
 }
648 648
 
Please login to merge, or discard this patch.
Braces   +66 added lines, -50 removed lines patch added patch discarded remove patch
@@ -100,64 +100,74 @@  discard block
 block discarded – undo
100 100
 	{
101 101
 		$page=$this->getPage();
102 102
 		$page->ensureRenderInForm($this);
103
-		if(($uid=$this->getUniqueID())!=='')
104
-			$writer->addAttribute('name',$uid);
103
+		if(($uid=$this->getUniqueID())!=='') {
104
+					$writer->addAttribute('name',$uid);
105
+		}
105 106
 		if(($textMode=$this->getTextMode())===TTextBoxMode::MultiLine)
106 107
 		{
107
-			if(($rows=$this->getRows())<=0)
108
-				$rows=self::DEFAULT_ROWS;
109
-			if(($cols=$this->getColumns())<=0)
110
-				$cols=self::DEFAULT_COLUMNS;
108
+			if(($rows=$this->getRows())<=0) {
109
+							$rows=self::DEFAULT_ROWS;
110
+			}
111
+			if(($cols=$this->getColumns())<=0) {
112
+							$cols=self::DEFAULT_COLUMNS;
113
+			}
111 114
 			$writer->addAttribute('rows',"$rows");
112 115
 			$writer->addAttribute('cols',"$cols");
113
-			if(!$this->getWrap())
114
-				$writer->addAttribute('wrap','off');
115
-		}
116
-		else
116
+			if(!$this->getWrap()) {
117
+							$writer->addAttribute('wrap','off');
118
+			}
119
+		} else
117 120
 		{
118 121
 			if($textMode===TTextBoxMode::SingleLine)
119 122
 			{
120 123
 				$writer->addAttribute('type','text');
121
-				if(($text=$this->getText())!=='')
122
-					$writer->addAttribute('value',$text);
123
-			}
124
-			else
124
+				if(($text=$this->getText())!=='') {
125
+									$writer->addAttribute('value',$text);
126
+				}
127
+			} else
125 128
 			{
126
-				if($this->getPersistPassword() && ($text=$this->getText())!=='')
127
-					$writer->addAttribute('value',$text);
129
+				if($this->getPersistPassword() && ($text=$this->getText())!=='') {
130
+									$writer->addAttribute('value',$text);
131
+				}
128 132
 				$writer->addAttribute('type','password');
129 133
 			}
130 134
 
131 135
 			if(($act=$this->getAutoCompleteType())!=='None')
132 136
 			{
133
-				if($act==='Disabled')
134
-					$writer->addAttribute('autocomplete','off');
135
-				else if($act==='Search')
136
-					$writer->addAttribute('vcard_name','search');
137
-				else if($act==='HomeCountryRegion')
138
-					$writer->addAttribute('vcard_name','HomeCountry');
139
-				else if($act==='BusinessCountryRegion')
140
-					$writer->addAttribute('vcard_name','BusinessCountry');
141
-				else
137
+				if($act==='Disabled') {
138
+									$writer->addAttribute('autocomplete','off');
139
+				} else if($act==='Search') {
140
+									$writer->addAttribute('vcard_name','search');
141
+				} else if($act==='HomeCountryRegion') {
142
+									$writer->addAttribute('vcard_name','HomeCountry');
143
+				} else if($act==='BusinessCountryRegion') {
144
+									$writer->addAttribute('vcard_name','BusinessCountry');
145
+				} else
142 146
 				{
143
-					if(strpos($act,'Business')===0)
144
-						$act='Business'.'.'.substr($act,8);
145
-					else if(strpos($act,'Home')===0)
146
-						$act='Home'.'.'.substr($act,4);
147
+					if(strpos($act,'Business')===0) {
148
+											$act='Business'.'.'.substr($act,8);
149
+					} else if(strpos($act,'Home')===0) {
150
+											$act='Home'.'.'.substr($act,4);
151
+					}
147 152
 					$writer->addAttribute('vcard_name','vCard.'.$act);
148 153
 				}
149 154
 			}
150 155
 
151
-			if(($cols=$this->getColumns())>0)
152
-				$writer->addAttribute('size',"$cols");
153
-			if(($maxLength=$this->getMaxLength())>0)
154
-				$writer->addAttribute('maxlength',"$maxLength");
156
+			if(($cols=$this->getColumns())>0) {
157
+							$writer->addAttribute('size',"$cols");
158
+			}
159
+			if(($maxLength=$this->getMaxLength())>0) {
160
+							$writer->addAttribute('maxlength',"$maxLength");
161
+			}
162
+		}
163
+		if($this->getReadOnly()) {
164
+					$writer->addAttribute('readonly','readonly');
155 165
 		}
156
-		if($this->getReadOnly())
157
-			$writer->addAttribute('readonly','readonly');
158 166
 		$isEnabled=$this->getEnabled(true);
159
-		if(!$isEnabled && $this->getEnabled())  // in this case parent will not render 'disabled'
167
+		if(!$isEnabled && $this->getEnabled()) {
168
+			// in this case parent will not render 'disabled'
160 169
 			$writer->addAttribute('disabled','disabled');
170
+		}
161 171
 		if($isEnabled
162 172
 			&& $this->getEnableClientScript()
163 173
 			&& ( $this->getAutoPostBack() || $textMode===TTextBoxMode::SingleLine)
@@ -213,15 +223,16 @@  discard block
 block discarded – undo
213 223
 	public function loadPostData($key,$values)
214 224
 	{
215 225
 		$value=$values[$key];
216
-		if($this->getAutoTrim())
217
-			$value=trim($value);
226
+		if($this->getAutoTrim()) {
227
+					$value=trim($value);
228
+		}
218 229
 		if(!$this->getReadOnly() && $this->getText()!==$value)
219 230
 		{
220 231
 			$this->setText($value);
221 232
 			return $this->_dataChanged=true;
233
+		} else {
234
+					return false;
222 235
 		}
223
-		else
224
-			return false;
225 236
 	}
226 237
 
227 238
 	/**
@@ -283,8 +294,9 @@  discard block
 block discarded – undo
283 294
 	 */
284 295
 	public function raisePostDataChangedEvent()
285 296
 	{
286
-		if($this->getAutoPostBack() && $this->getCausesValidation())
287
-			$this->getPage()->validate($this->getValidationGroup());
297
+		if($this->getAutoPostBack() && $this->getCausesValidation()) {
298
+					$this->getPage()->validate($this->getValidationGroup());
299
+		}
288 300
 		$this->onTextChanged(null);
289 301
 	}
290 302
 
@@ -294,8 +306,9 @@  discard block
 block discarded – undo
294 306
 	 */
295 307
 	public function renderContents($writer)
296 308
 	{
297
-		if($this->getTextMode()==='MultiLine')
298
-			$writer->write(THttpUtility::htmlEncode($this->getText()));
309
+		if($this->getTextMode()==='MultiLine') {
310
+					$writer->write(THttpUtility::htmlEncode($this->getText()));
311
+		}
299 312
 	}
300 313
 
301 314
 	/**
@@ -306,8 +319,9 @@  discard block
 block discarded – undo
306 319
 	public function renderBeginTag($writer)
307 320
 	{
308 321
 		parent::renderBeginTag($writer);
309
-		if($this->getTextMode()==='MultiLine')
310
-			$writer->write("\n");
322
+		if($this->getTextMode()==='MultiLine') {
323
+					$writer->write("\n");
324
+		}
311 325
 	}
312 326
 
313 327
 	/**
@@ -513,8 +527,9 @@  discard block
 block discarded – undo
513 527
 	 */
514 528
 	public function getSafeText()
515 529
 	{
516
-		if($this->_safeText===null)
517
-			$this->_safeText=$this->getSafeTextParser()->parse($this->getText());
530
+		if($this->_safeText===null) {
531
+					$this->_safeText=$this->getSafeTextParser()->parse($this->getText());
532
+		}
518 533
 		return $this->_safeText;
519 534
 	}
520 535
 
@@ -523,8 +538,9 @@  discard block
 block discarded – undo
523 538
 	 */
524 539
 	protected function getSafeTextParser()
525 540
 	{
526
-		if(!self::$_safeTextParser)
527
-			self::$_safeTextParser=Prado::createComponent('System.3rdParty.SafeHtml.TSafeHtmlParser');
541
+		if(!self::$_safeTextParser) {
542
+					self::$_safeTextParser=Prado::createComponent('System.3rdParty.SafeHtml.TSafeHtmlParser');
543
+		}
528 544
 		return self::$_safeTextParser;
529 545
 	}
530 546
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTextHighlighter.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -157,6 +157,7 @@
 block discarded – undo
157 157
 	 * Processes a text string.
158 158
 	 * This method is required by the parent class.
159 159
 	 * @param string text string to be processed
160
+	 * @param string $text
160 161
 	 * @return string the processed text result
161 162
 	 */
162 163
 	public function processText($text)
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
  * @package System.Web.UI.WebControls
10 10
  */
11 11
 
12
-Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter',false);
13
-Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter.Renderer.Html',false);
12
+Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter', false);
13
+Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter.Renderer.Html', false);
14 14
 Prado::using('System.Web.UI.WebControls.TTextProcessor');
15 15
 
16 16
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
  */
36 36
 class TTextHighlighter extends TTextProcessor
37 37
 {
38
-	private static $_lineNumberStyle=array(TTextHighlighterLineNumberStyle::Li => HL_NUMBERS_LI, TTextHighlighterLineNumberStyle::Table => HL_NUMBERS_TABLE);
38
+	private static $_lineNumberStyle = array(TTextHighlighterLineNumberStyle::Li => HL_NUMBERS_LI, TTextHighlighterLineNumberStyle::Table => HL_NUMBERS_TABLE);
39 39
 
40 40
 	/**
41 41
 	 * @return string tag name of the panel
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public function setLineNumberStyle($value)
113 113
 	{
114
-		$this->setViewState('LineNumberStyle', TPropertyValue::ensureEnum($value,'TTextHighlighterLineNumberStyle'));
114
+		$this->setViewState('LineNumberStyle', TPropertyValue::ensureEnum($value, 'TTextHighlighterLineNumberStyle'));
115 115
 	}
116 116
 
117 117
 	/**
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
 	 */
147 147
 	protected function registerStyleSheet()
148 148
 	{
149
-		$cs=$this->getPage()->getClientScript();
150
-		$cssFile=Prado::getPathOfNamespace('System.3rdParty.TextHighlighter.highlight','.css');
151
-		$cssKey='prado:TTextHighlighter:'.$cssFile;
152
-		if(!$cs->isStyleSheetFileRegistered($cssKey))
149
+		$cs = $this->getPage()->getClientScript();
150
+		$cssFile = Prado::getPathOfNamespace('System.3rdParty.TextHighlighter.highlight', '.css');
151
+		$cssKey = 'prado:TTextHighlighter:' . $cssFile;
152
+		if (!$cs->isStyleSheetFileRegistered($cssKey))
153 153
 			$cs->registerStyleSheetFile($cssKey, $this->publishFilePath($cssFile));
154 154
 	}
155 155
 
@@ -163,16 +163,16 @@  discard block
 block discarded – undo
163 163
 	{
164 164
 		try
165 165
 		{
166
-			$highlighter=Text_Highlighter::factory($this->getLanguage());
166
+			$highlighter = Text_Highlighter::factory($this->getLanguage());
167 167
 		}
168
-		catch(Exception $e)
168
+		catch (Exception $e)
169 169
 		{
170
-			$highlighter=false;
170
+			$highlighter = false;
171 171
 		}
172
-		if($highlighter===false)
173
-			return ('<pre>'.htmlentities(trim($text)).'</pre>');
172
+		if ($highlighter === false)
173
+			return ('<pre>' . htmlentities(trim($text)) . '</pre>');
174 174
 
175
-		$options["use_language"]=true;
175
+		$options["use_language"] = true;
176 176
 		$options["tabsize"] = $this->getTabSize();
177 177
 		if ($this->getShowLineNumbers())
178 178
 			$options["numbers"] = self::$_lineNumberStyle[$this->getLineNumberStyle()];
@@ -205,6 +205,6 @@  discard block
 block discarded – undo
205 205
  */
206 206
 class TTextHighlighterLineNumberStyle extends TEnumerable
207 207
 {
208
-	const Li='Li';
209
-	const Table='Table';
208
+	const Li = 'Li';
209
+	const Table = 'Table';
210 210
 }
Please login to merge, or discard this patch.
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -149,8 +149,9 @@  discard block
 block discarded – undo
149 149
 		$cs=$this->getPage()->getClientScript();
150 150
 		$cssFile=Prado::getPathOfNamespace('System.3rdParty.TextHighlighter.highlight','.css');
151 151
 		$cssKey='prado:TTextHighlighter:'.$cssFile;
152
-		if(!$cs->isStyleSheetFileRegistered($cssKey))
153
-			$cs->registerStyleSheetFile($cssKey, $this->publishFilePath($cssFile));
152
+		if(!$cs->isStyleSheetFileRegistered($cssKey)) {
153
+					$cs->registerStyleSheetFile($cssKey, $this->publishFilePath($cssFile));
154
+		}
154 155
 	}
155 156
 
156 157
 	/**
@@ -164,18 +165,19 @@  discard block
 block discarded – undo
164 165
 		try
165 166
 		{
166 167
 			$highlighter=Text_Highlighter::factory($this->getLanguage());
167
-		}
168
-		catch(Exception $e)
168
+		} catch(Exception $e)
169 169
 		{
170 170
 			$highlighter=false;
171 171
 		}
172
-		if($highlighter===false)
173
-			return ('<pre>'.htmlentities(trim($text)).'</pre>');
172
+		if($highlighter===false) {
173
+					return ('<pre>'.htmlentities(trim($text)).'</pre>');
174
+		}
174 175
 
175 176
 		$options["use_language"]=true;
176 177
 		$options["tabsize"] = $this->getTabSize();
177
-		if ($this->getShowLineNumbers())
178
-			$options["numbers"] = self::$_lineNumberStyle[$this->getLineNumberStyle()];
178
+		if ($this->getShowLineNumbers()) {
179
+					$options["numbers"] = self::$_lineNumberStyle[$this->getLineNumberStyle()];
180
+		}
179 181
 		$highlighter->setRenderer(new Text_Highlighter_Renderer_Html($options));
180 182
 		return $highlighter->highlight(trim($text));
181 183
 	}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TWebControl.php 3 patches
Doc Comments   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,6 +55,7 @@  discard block
 block discarded – undo
55 55
 	 * control does work with javascript and your class wants to flag that it requires an id
56 56
 	 * to operate properly.  Once set to true, it stays that way.
57 57
 	 * @param boolean pass true to enable enforcement of the tag attribute id.
58
+	 * @param boolean $value
58 59
 	 */
59 60
 	public function setEnsureId($value)
60 61
 	{
@@ -62,7 +63,7 @@  discard block
 block discarded – undo
62 63
 	}
63 64
 
64 65
 	/**
65
-	 * @return whether this web control must have an id
66
+	 * @return boolean this web control must have an id
66 67
 	 */
67 68
 	public function getEnsureId()
68 69
 	{
@@ -215,6 +216,7 @@  discard block
 block discarded – undo
215 216
 
216 217
 	/**
217 218
 	 * @param string the foreground color of the control
219
+	 * @param string $value
218 220
 	 */
219 221
 	public function setForeColor($value)
220 222
 	{
@@ -241,7 +243,7 @@  discard block
 block discarded – undo
241 243
 	}
242 244
 
243 245
 	/**
244
-	 * @return TDisplayStyle display style of the control, default is TDisplayStyle::Fixed
246
+	 * @return string display style of the control, default is TDisplayStyle::Fixed
245 247
 	 */
246 248
 	public function getDisplay()
247 249
 	{
@@ -269,6 +271,7 @@  discard block
 block discarded – undo
269 271
 
270 272
 	/**
271 273
 	 * @param string the height of the control
274
+	 * @param string $value
272 275
 	 */
273 276
 	public function setHeight($value)
274 277
 	{
@@ -390,6 +393,7 @@  discard block
 block discarded – undo
390 393
 
391 394
 	/**
392 395
 	 * @param string the width of the control
396
+	 * @param string $value
393 397
 	 */
394 398
 	public function setWidth($value)
395 399
 	{
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	/**
43 43
 	 *	@var boolean ensures the inclusion the id in the tag rendering.
44 44
 	 */
45
-	private $_ensureid=false;
45
+	private $_ensureid = false;
46 46
 
47 47
 	/**
48 48
 	 *	@var TWebControlDecorator this render things before and after both the open and close tag
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
 	/**
73 73
 	 * @return TWebControlDecorator
74 74
 	 */
75
-	public function getDecorator($create=true)
75
+	public function getDecorator($create = true)
76 76
 	{
77
-		if($create && !$this->_decorator)
77
+		if ($create && !$this->_decorator)
78 78
 			$this->_decorator = Prado::createComponent('TWebControlDecorator', $this);
79 79
 		return $this->_decorator;
80 80
 	}
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 		$this->setAccessKey($control->getAccessKey());
91 91
 		$this->setToolTip($control->getToolTip());
92 92
 		$this->setTabIndex($control->getTabIndex());
93
-		if(!$control->getEnabled())
93
+		if (!$control->getEnabled())
94 94
 			$this->setEnabled(false);
95
-		if($control->getHasAttributes())
95
+		if ($control->getHasAttributes())
96 96
 			$this->getAttributes()->copyFrom($control->getAttributes());
97 97
 	}
98 98
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 */
102 102
 	public function getAccessKey()
103 103
 	{
104
-		return $this->getViewState('AccessKey','');
104
+		return $this->getViewState('AccessKey', '');
105 105
 	}
106 106
 
107 107
 	/**
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 	 */
114 114
 	public function setAccessKey($value)
115 115
 	{
116
-		if(strlen($value)>1)
117
-			throw new TInvalidDataValueException('webcontrol_accesskey_invalid',get_class($this),$value);
118
-		$this->setViewState('AccessKey',$value,'');
116
+		if (strlen($value) > 1)
117
+			throw new TInvalidDataValueException('webcontrol_accesskey_invalid', get_class($this), $value);
118
+		$this->setViewState('AccessKey', $value, '');
119 119
 	}
120 120
 
121 121
 	/**
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	 */
124 124
 	public function getBackColor()
125 125
 	{
126
-		if($style=$this->getViewState('Style',null))
126
+		if ($style = $this->getViewState('Style', null))
127 127
 			return $style->getBackColor();
128 128
 		else
129 129
 			return '';
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 */
143 143
 	public function getBorderColor()
144 144
 	{
145
-		if($style=$this->getViewState('Style',null))
145
+		if ($style = $this->getViewState('Style', null))
146 146
 			return $style->getBorderColor();
147 147
 		else
148 148
 			return '';
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	 */
162 162
 	public function getBorderStyle()
163 163
 	{
164
-		if($style=$this->getViewState('Style',null))
164
+		if ($style = $this->getViewState('Style', null))
165 165
 			return $style->getBorderStyle();
166 166
 		else
167 167
 			return '';
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	 */
181 181
 	public function getBorderWidth()
182 182
 	{
183
-		if($style=$this->getViewState('Style',null))
183
+		if ($style = $this->getViewState('Style', null))
184 184
 			return $style->getBorderWidth();
185 185
 		else
186 186
 			return '';
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 */
208 208
 	public function getForeColor()
209 209
 	{
210
-		if($style=$this->getViewState('Style',null))
210
+		if ($style = $this->getViewState('Style', null))
211 211
 			return $style->getForeColor();
212 212
 		else
213 213
 			return '';
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 	 */
227 227
 	public function getHeight()
228 228
 	{
229
-		if($style=$this->getViewState('Style',null))
229
+		if ($style = $this->getViewState('Style', null))
230 230
 			return $style->getHeight();
231 231
 		else
232 232
 			return '';
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	public function getCssClass()
263 263
 	{
264
-		if($style=$this->getViewState('Style',null))
264
+		if ($style = $this->getViewState('Style', null))
265 265
 			return $style->getCssClass();
266 266
 		else
267 267
 			return '';
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	 */
281 281
 	public function getHasStyle()
282 282
 	{
283
-		return $this->getViewState('Style',null)!==null;
283
+		return $this->getViewState('Style', null) !== null;
284 284
 	}
285 285
 
286 286
 	/**
@@ -298,12 +298,12 @@  discard block
 block discarded – undo
298 298
 	 */
299 299
 	public function getStyle()
300 300
 	{
301
-		if($style=$this->getViewState('Style',null))
301
+		if ($style = $this->getViewState('Style', null))
302 302
 			return $style;
303 303
 		else
304 304
 		{
305
-			$style=$this->createStyle();
306
-			$this->setViewState('Style',$style,null);
305
+			$style = $this->createStyle();
306
+			$this->setViewState('Style', $style, null);
307 307
 			return $style;
308 308
 		}
309 309
 	}
@@ -316,10 +316,10 @@  discard block
 block discarded – undo
316 316
 	 */
317 317
 	public function setStyle($value)
318 318
 	{
319
-		if(is_string($value))
319
+		if (is_string($value))
320 320
 			$this->getStyle()->setCustomStyle($value);
321 321
 		else
322
-			throw new TInvalidDataValueException('webcontrol_style_invalid',get_class($this));
322
+			throw new TInvalidDataValueException('webcontrol_style_invalid', get_class($this));
323 323
 	}
324 324
 
325 325
 	/**
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 	 */
336 336
 	public function getTabIndex()
337 337
 	{
338
-		return $this->getViewState('TabIndex',0);
338
+		return $this->getViewState('TabIndex', 0);
339 339
 	}
340 340
 
341 341
 	/**
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	 */
346 346
 	public function setTabIndex($value)
347 347
 	{
348
-		$this->setViewState('TabIndex',TPropertyValue::ensureInteger($value),0);
348
+		$this->setViewState('TabIndex', TPropertyValue::ensureInteger($value), 0);
349 349
 	}
350 350
 
351 351
 	/**
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 	 */
365 365
 	public function getToolTip()
366 366
 	{
367
-		return $this->getViewState('ToolTip','');
367
+		return $this->getViewState('ToolTip', '');
368 368
 	}
369 369
 
370 370
 	/**
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 	 */
375 375
 	public function setToolTip($value)
376 376
 	{
377
-		$this->setViewState('ToolTip',$value,'');
377
+		$this->setViewState('ToolTip', $value, '');
378 378
 	}
379 379
 
380 380
 	/**
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 	 */
383 383
 	public function getWidth()
384 384
 	{
385
-		if($style=$this->getViewState('Style',null))
385
+		if ($style = $this->getViewState('Style', null))
386 386
 			return $style->getWidth();
387 387
 		else
388 388
 			return '';
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 	 * @param TEventParameter event parameter to be passed to the event handlers
405 405
 	 */
406 406
 	public function onPreRender($param) {
407
-		if($decorator = $this->getDecorator(false))
407
+		if ($decorator = $this->getDecorator(false))
408 408
 			$decorator->instantiate();
409 409
 
410 410
 		parent::onPreRender($param);
@@ -419,22 +419,22 @@  discard block
 block discarded – undo
419 419
 	 */
420 420
 	protected function addAttributesToRender($writer)
421 421
 	{
422
-		if($this->getID()!=='' || $this->getEnsureId())
423
-			$writer->addAttribute('id',$this->getClientID());
424
-		if(($accessKey=$this->getAccessKey())!=='')
425
-			$writer->addAttribute('accesskey',$accessKey);
426
-		if(!$this->getEnabled())
427
-			$writer->addAttribute('disabled','disabled');
428
-		if(($tabIndex=$this->getTabIndex())>0)
429
-			$writer->addAttribute('tabindex',"$tabIndex");
430
-		if(($toolTip=$this->getToolTip())!=='')
431
-			$writer->addAttribute('title',$toolTip);
432
-		if($style=$this->getViewState('Style',null))
422
+		if ($this->getID() !== '' || $this->getEnsureId())
423
+			$writer->addAttribute('id', $this->getClientID());
424
+		if (($accessKey = $this->getAccessKey()) !== '')
425
+			$writer->addAttribute('accesskey', $accessKey);
426
+		if (!$this->getEnabled())
427
+			$writer->addAttribute('disabled', 'disabled');
428
+		if (($tabIndex = $this->getTabIndex()) > 0)
429
+			$writer->addAttribute('tabindex', "$tabIndex");
430
+		if (($toolTip = $this->getToolTip()) !== '')
431
+			$writer->addAttribute('title', $toolTip);
432
+		if ($style = $this->getViewState('Style', null))
433 433
 			$style->addAttributesToRender($writer);
434
-		if($this->getHasAttributes())
434
+		if ($this->getHasAttributes())
435 435
 		{
436
-			foreach($this->getAttributes() as $name=>$value)
437
-				$writer->addAttribute($name,$value);
436
+			foreach ($this->getAttributes() as $name=>$value)
437
+				$writer->addAttribute($name, $value);
438 438
 		}
439 439
 	}
440 440
 
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 	 */
461 461
 	public function renderBeginTag($writer)
462 462
 	{
463
-		if($decorator = $this->getDecorator(false)) {
463
+		if ($decorator = $this->getDecorator(false)) {
464 464
 			$decorator->renderPreTagText($writer);
465 465
 			$this->addAttributesToRender($writer);
466 466
 			$writer->renderBeginTag($this->getTagName());
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 	 */
489 489
 	public function renderEndTag($writer)
490 490
 	{
491
-		if($decorator = $this->getDecorator(false)) {
491
+		if ($decorator = $this->getDecorator(false)) {
492 492
 			$decorator->renderPostContentsText($writer);
493 493
 			$writer->renderEndTag();
494 494
 			$decorator->renderPostTagText($writer);
Please login to merge, or discard this patch.
Braces   +87 added lines, -65 removed lines patch added patch discarded remove patch
@@ -74,8 +74,9 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public function getDecorator($create=true)
76 76
 	{
77
-		if($create && !$this->_decorator)
78
-			$this->_decorator = Prado::createComponent('TWebControlDecorator', $this);
77
+		if($create && !$this->_decorator) {
78
+					$this->_decorator = Prado::createComponent('TWebControlDecorator', $this);
79
+		}
79 80
 		return $this->_decorator;
80 81
 	}
81 82
 
@@ -90,10 +91,12 @@  discard block
 block discarded – undo
90 91
 		$this->setAccessKey($control->getAccessKey());
91 92
 		$this->setToolTip($control->getToolTip());
92 93
 		$this->setTabIndex($control->getTabIndex());
93
-		if(!$control->getEnabled())
94
-			$this->setEnabled(false);
95
-		if($control->getHasAttributes())
96
-			$this->getAttributes()->copyFrom($control->getAttributes());
94
+		if(!$control->getEnabled()) {
95
+					$this->setEnabled(false);
96
+		}
97
+		if($control->getHasAttributes()) {
98
+					$this->getAttributes()->copyFrom($control->getAttributes());
99
+		}
97 100
 	}
98 101
 
99 102
 	/**
@@ -113,8 +116,9 @@  discard block
 block discarded – undo
113 116
 	 */
114 117
 	public function setAccessKey($value)
115 118
 	{
116
-		if(strlen($value)>1)
117
-			throw new TInvalidDataValueException('webcontrol_accesskey_invalid',get_class($this),$value);
119
+		if(strlen($value)>1) {
120
+					throw new TInvalidDataValueException('webcontrol_accesskey_invalid',get_class($this),$value);
121
+		}
118 122
 		$this->setViewState('AccessKey',$value,'');
119 123
 	}
120 124
 
@@ -123,10 +127,11 @@  discard block
 block discarded – undo
123 127
 	 */
124 128
 	public function getBackColor()
125 129
 	{
126
-		if($style=$this->getViewState('Style',null))
127
-			return $style->getBackColor();
128
-		else
129
-			return '';
130
+		if($style=$this->getViewState('Style',null)) {
131
+					return $style->getBackColor();
132
+		} else {
133
+					return '';
134
+		}
130 135
 	}
131 136
 
132 137
 	/**
@@ -142,10 +147,11 @@  discard block
 block discarded – undo
142 147
 	 */
143 148
 	public function getBorderColor()
144 149
 	{
145
-		if($style=$this->getViewState('Style',null))
146
-			return $style->getBorderColor();
147
-		else
148
-			return '';
150
+		if($style=$this->getViewState('Style',null)) {
151
+					return $style->getBorderColor();
152
+		} else {
153
+					return '';
154
+		}
149 155
 	}
150 156
 
151 157
 	/**
@@ -161,10 +167,11 @@  discard block
 block discarded – undo
161 167
 	 */
162 168
 	public function getBorderStyle()
163 169
 	{
164
-		if($style=$this->getViewState('Style',null))
165
-			return $style->getBorderStyle();
166
-		else
167
-			return '';
170
+		if($style=$this->getViewState('Style',null)) {
171
+					return $style->getBorderStyle();
172
+		} else {
173
+					return '';
174
+		}
168 175
 	}
169 176
 
170 177
 	/**
@@ -180,10 +187,11 @@  discard block
 block discarded – undo
180 187
 	 */
181 188
 	public function getBorderWidth()
182 189
 	{
183
-		if($style=$this->getViewState('Style',null))
184
-			return $style->getBorderWidth();
185
-		else
186
-			return '';
190
+		if($style=$this->getViewState('Style',null)) {
191
+					return $style->getBorderWidth();
192
+		} else {
193
+					return '';
194
+		}
187 195
 	}
188 196
 
189 197
 	/**
@@ -207,10 +215,11 @@  discard block
 block discarded – undo
207 215
 	 */
208 216
 	public function getForeColor()
209 217
 	{
210
-		if($style=$this->getViewState('Style',null))
211
-			return $style->getForeColor();
212
-		else
213
-			return '';
218
+		if($style=$this->getViewState('Style',null)) {
219
+					return $style->getForeColor();
220
+		} else {
221
+					return '';
222
+		}
214 223
 	}
215 224
 
216 225
 	/**
@@ -226,10 +235,11 @@  discard block
 block discarded – undo
226 235
 	 */
227 236
 	public function getHeight()
228 237
 	{
229
-		if($style=$this->getViewState('Style',null))
230
-			return $style->getHeight();
231
-		else
232
-			return '';
238
+		if($style=$this->getViewState('Style',null)) {
239
+					return $style->getHeight();
240
+		} else {
241
+					return '';
242
+		}
233 243
 	}
234 244
 
235 245
 	/**
@@ -261,10 +271,11 @@  discard block
 block discarded – undo
261 271
 	 */
262 272
 	public function getCssClass()
263 273
 	{
264
-		if($style=$this->getViewState('Style',null))
265
-			return $style->getCssClass();
266
-		else
267
-			return '';
274
+		if($style=$this->getViewState('Style',null)) {
275
+					return $style->getCssClass();
276
+		} else {
277
+					return '';
278
+		}
268 279
 	}
269 280
 
270 281
 	/**
@@ -298,9 +309,9 @@  discard block
 block discarded – undo
298 309
 	 */
299 310
 	public function getStyle()
300 311
 	{
301
-		if($style=$this->getViewState('Style',null))
302
-			return $style;
303
-		else
312
+		if($style=$this->getViewState('Style',null)) {
313
+					return $style;
314
+		} else
304 315
 		{
305 316
 			$style=$this->createStyle();
306 317
 			$this->setViewState('Style',$style,null);
@@ -316,10 +327,11 @@  discard block
 block discarded – undo
316 327
 	 */
317 328
 	public function setStyle($value)
318 329
 	{
319
-		if(is_string($value))
320
-			$this->getStyle()->setCustomStyle($value);
321
-		else
322
-			throw new TInvalidDataValueException('webcontrol_style_invalid',get_class($this));
330
+		if(is_string($value)) {
331
+					$this->getStyle()->setCustomStyle($value);
332
+		} else {
333
+					throw new TInvalidDataValueException('webcontrol_style_invalid',get_class($this));
334
+		}
323 335
 	}
324 336
 
325 337
 	/**
@@ -382,10 +394,11 @@  discard block
 block discarded – undo
382 394
 	 */
383 395
 	public function getWidth()
384 396
 	{
385
-		if($style=$this->getViewState('Style',null))
386
-			return $style->getWidth();
387
-		else
388
-			return '';
397
+		if($style=$this->getViewState('Style',null)) {
398
+					return $style->getWidth();
399
+		} else {
400
+					return '';
401
+		}
389 402
 	}
390 403
 
391 404
 	/**
@@ -404,8 +417,9 @@  discard block
 block discarded – undo
404 417
 	 * @param TEventParameter event parameter to be passed to the event handlers
405 418
 	 */
406 419
 	public function onPreRender($param) {
407
-		if($decorator = $this->getDecorator(false))
408
-			$decorator->instantiate();
420
+		if($decorator = $this->getDecorator(false)) {
421
+					$decorator->instantiate();
422
+		}
409 423
 
410 424
 		parent::onPreRender($param);
411 425
 	}
@@ -419,22 +433,29 @@  discard block
 block discarded – undo
419 433
 	 */
420 434
 	protected function addAttributesToRender($writer)
421 435
 	{
422
-		if($this->getID()!=='' || $this->getEnsureId())
423
-			$writer->addAttribute('id',$this->getClientID());
424
-		if(($accessKey=$this->getAccessKey())!=='')
425
-			$writer->addAttribute('accesskey',$accessKey);
426
-		if(!$this->getEnabled())
427
-			$writer->addAttribute('disabled','disabled');
428
-		if(($tabIndex=$this->getTabIndex())>0)
429
-			$writer->addAttribute('tabindex',"$tabIndex");
430
-		if(($toolTip=$this->getToolTip())!=='')
431
-			$writer->addAttribute('title',$toolTip);
432
-		if($style=$this->getViewState('Style',null))
433
-			$style->addAttributesToRender($writer);
436
+		if($this->getID()!=='' || $this->getEnsureId()) {
437
+					$writer->addAttribute('id',$this->getClientID());
438
+		}
439
+		if(($accessKey=$this->getAccessKey())!=='') {
440
+					$writer->addAttribute('accesskey',$accessKey);
441
+		}
442
+		if(!$this->getEnabled()) {
443
+					$writer->addAttribute('disabled','disabled');
444
+		}
445
+		if(($tabIndex=$this->getTabIndex())>0) {
446
+					$writer->addAttribute('tabindex',"$tabIndex");
447
+		}
448
+		if(($toolTip=$this->getToolTip())!=='') {
449
+					$writer->addAttribute('title',$toolTip);
450
+		}
451
+		if($style=$this->getViewState('Style',null)) {
452
+					$style->addAttributesToRender($writer);
453
+		}
434 454
 		if($this->getHasAttributes())
435 455
 		{
436
-			foreach($this->getAttributes() as $name=>$value)
437
-				$writer->addAttribute($name,$value);
456
+			foreach($this->getAttributes() as $name=>$value) {
457
+							$writer->addAttribute($name,$value);
458
+			}
438 459
 		}
439 460
 	}
440 461
 
@@ -492,7 +513,8 @@  discard block
 block discarded – undo
492 513
 			$decorator->renderPostContentsText($writer);
493 514
 			$writer->renderEndTag();
494 515
 			$decorator->renderPostTagText($writer);
495
-		} else
496
-			$writer->renderEndTag($writer);
516
+		} else {
517
+					$writer->renderEndTag($writer);
518
+		}
497 519
 	}
498 520
 }
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TWizard.php 3 patches
Doc Comments   +13 added lines patch added patch discarded remove patch
@@ -664,6 +664,7 @@  discard block
 block discarded – undo
664 664
 	 * This event is raised when a cancel navigation button is clicked in the
665 665
 	 * current active step.
666 666
 	 * @param TEventParameter event parameter
667
+	 * @param TCommandEventParameter $param
667 668
 	 */
668 669
 	public function onCancelButtonClick($param)
669 670
 	{
@@ -677,6 +678,7 @@  discard block
 block discarded – undo
677 678
 	 * This event is raised when a finish navigation button is clicked in the
678 679
 	 * current active step.
679 680
 	 * @param TWizardNavigationEventParameter event parameter
681
+	 * @param TWizardNavigationEventParameter $param
680 682
 	 */
681 683
 	public function onCompleteButtonClick($param)
682 684
 	{
@@ -690,6 +692,7 @@  discard block
 block discarded – undo
690 692
 	 * This event is raised when a next navigation button is clicked in the
691 693
 	 * current active step.
692 694
 	 * @param TWizardNavigationEventParameter event parameter
695
+	 * @param TWizardNavigationEventParameter $param
693 696
 	 */
694 697
 	public function onNextButtonClick($param)
695 698
 	{
@@ -701,6 +704,7 @@  discard block
 block discarded – undo
701 704
 	 * This event is raised when a previous navigation button is clicked in the
702 705
 	 * current active step.
703 706
 	 * @param TWizardNavigationEventParameter event parameter
707
+	 * @param TWizardNavigationEventParameter $param
704 708
 	 */
705 709
 	public function onPreviousButtonClick($param)
706 710
 	{
@@ -711,6 +715,7 @@  discard block
 block discarded – undo
711 715
 	 * Raises <b>OnSideBarButtonClick</b> event.
712 716
 	 * This event is raised when a link button in the side bar is clicked.
713 717
 	 * @param TWizardNavigationEventParameter event parameter
718
+	 * @param TWizardNavigationEventParameter $param
714 719
 	 */
715 720
 	public function onSideBarButtonClick($param)
716 721
 	{
@@ -739,6 +744,7 @@  discard block
 block discarded – undo
739 744
 	 * This method should only be used by control developers.
740 745
 	 * It is invoked when a step is added into the step collection of the wizard.
741 746
 	 * @param TWizardStep wizard step to be added into multiview.
747
+	 * @param TWizardStep $step
742 748
 	 */
743 749
 	public function addedWizardStep($step)
744 750
 	{
@@ -1282,6 +1288,7 @@  discard block
 block discarded – undo
1282 1288
 	 * Determines the index of the previous step based on history.
1283 1289
 	 * @param boolean whether the first item in the history stack should be popped
1284 1290
 	 * up after calling this method.
1291
+	 * @param boolean $popStack
1285 1292
 	 */
1286 1293
 	protected function getPreviousStepIndex($popStack)
1287 1294
 	{
@@ -1325,6 +1332,7 @@  discard block
 block discarded – undo
1325 1332
 
1326 1333
 	/**
1327 1334
 	 * @param integer index of the step
1335
+	 * @param integer $index
1328 1336
 	 * @return boolean whether navigation to the specified step is allowed
1329 1337
 	 */
1330 1338
 	protected function allowNavigationToStep($index)
@@ -1837,6 +1845,7 @@  discard block
 block discarded – undo
1837 1845
 	/**
1838 1846
 	 * Constructor.
1839 1847
 	 * @param integer current step index
1848
+	 * @param integer $currentStep
1840 1849
 	 */
1841 1850
 	public function __construct($currentStep)
1842 1851
 	{
@@ -1878,6 +1887,7 @@  discard block
 block discarded – undo
1878 1887
 
1879 1888
 	/**
1880 1889
 	 * @param boolean whether navigation to the next step should be canceled.
1890
+	 * @param boolean $value
1881 1891
 	 */
1882 1892
 	public function setCancelNavigation($value)
1883 1893
 	{
@@ -1945,6 +1955,7 @@  discard block
 block discarded – undo
1945 1955
 	/**
1946 1956
 	 * Constructor.
1947 1957
 	 * @param TWizard the wizard owning this template
1958
+	 * @param TWizard $wizard
1948 1959
 	 */
1949 1960
 	public function __construct($wizard)
1950 1961
 	{
@@ -1975,6 +1986,8 @@  discard block
 block discarded – undo
1975 1986
 	 * @param TWizardNavigationButtonStyle button style
1976 1987
 	 * @param boolean whether the button should cause validation
1977 1988
 	 * @param string command name for the button's OnCommand event
1989
+	 * @param TWizardNavigationButtonStyle $buttonStyle
1990
+	 * @param boolean $causesValidation
1978 1991
 	 * @throws TInvalidDataValueException if the button type is not recognized
1979 1992
 	 */
1980 1993
 	protected function createNavigationButton($buttonStyle,$causesValidation,$commandName)
Please login to merge, or discard this patch.
Spacing   +348 added lines, -348 removed lines patch added patch discarded remove patch
@@ -85,56 +85,56 @@  discard block
 block discarded – undo
85 85
 	 * Wizard step types.
86 86
 	 * @deprecated deprecated since version 3.0.4 (use TWizardStepType constants instead)
87 87
 	 */
88
-	const ST_AUTO='Auto';
89
-	const ST_START='Start';
90
-	const ST_STEP='Step';
91
-	const ST_FINISH='Finish';
92
-	const ST_COMPLETE='Complete';
88
+	const ST_AUTO = 'Auto';
89
+	const ST_START = 'Start';
90
+	const ST_STEP = 'Step';
91
+	const ST_FINISH = 'Finish';
92
+	const ST_COMPLETE = 'Complete';
93 93
 	/**
94 94
 	 * Navigation commands.
95 95
 	 */
96
-	const CMD_PREVIOUS='PreviousStep';
97
-	const CMD_NEXT='NextStep';
98
-	const CMD_CANCEL='Cancel';
99
-	const CMD_COMPLETE='Complete';
100
-	const CMD_MOVETO='MoveTo';
96
+	const CMD_PREVIOUS = 'PreviousStep';
97
+	const CMD_NEXT = 'NextStep';
98
+	const CMD_CANCEL = 'Cancel';
99
+	const CMD_COMPLETE = 'Complete';
100
+	const CMD_MOVETO = 'MoveTo';
101 101
 	/**
102 102
 	 * Side bar button ID
103 103
 	 */
104
-	const ID_SIDEBAR_BUTTON='SideBarButton';
104
+	const ID_SIDEBAR_BUTTON = 'SideBarButton';
105 105
 	/**
106 106
 	 * Side bar data list
107 107
 	 */
108
-	const ID_SIDEBAR_LIST='SideBarList';
108
+	const ID_SIDEBAR_LIST = 'SideBarList';
109 109
 
110 110
 	/**
111 111
 	 * @var TMultiView multiview that contains the wizard steps
112 112
 	 */
113
-	private $_multiView=null;
113
+	private $_multiView = null;
114 114
 	/**
115 115
 	 * @var mixed navigation template for the start step.
116 116
 	 */
117
-	private $_startNavigationTemplate=null;
117
+	private $_startNavigationTemplate = null;
118 118
 	/**
119 119
 	 * @var mixed navigation template for internal steps.
120 120
 	 */
121
-	private $_stepNavigationTemplate=null;
121
+	private $_stepNavigationTemplate = null;
122 122
 	/**
123 123
 	 * @var mixed navigation template for the finish step.
124 124
 	 */
125
-	private $_finishNavigationTemplate=null;
125
+	private $_finishNavigationTemplate = null;
126 126
 	/**
127 127
 	 * @var mixed template for wizard header.
128 128
 	 */
129
-	private $_headerTemplate=null;
129
+	private $_headerTemplate = null;
130 130
 	/**
131 131
 	 * @var mixed template for the side bar.
132 132
 	 */
133
-	private $_sideBarTemplate=null;
133
+	private $_sideBarTemplate = null;
134 134
 	/**
135 135
 	 * @var TWizardStepCollection
136 136
 	 */
137
-	private $_wizardSteps=null;
137
+	private $_wizardSteps = null;
138 138
 	/**
139 139
 	 * @var TPanel container of the wizard header
140 140
 	 */
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	/**
167 167
 	 * @var boolean whether ActiveStepIndex was already set
168 168
 	 */
169
-	private $_activeStepIndexSet=false;
169
+	private $_activeStepIndexSet = false;
170 170
 	/**
171 171
 	 * @var TDataList side bar data list.
172 172
 	 */
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	/**
175 175
 	 * @var boolean whether navigation should be cancelled (a status set in OnSideBarButtonClick)
176 176
 	 */
177
-	private $_cancelNavigation=false;
177
+	private $_cancelNavigation = false;
178 178
 
179 179
 	/**
180 180
 	 * @return string tag name for the wizard
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	 */
193 193
 	public function addParsedObject($object)
194 194
 	{
195
-		if($object instanceof TWizardStep)
195
+		if ($object instanceof TWizardStep)
196 196
 			$this->getWizardSteps()->add($object);
197 197
 	}
198 198
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	 */
211 211
 	public function setActiveStep($step)
212 212
 	{
213
-		if(($index=$this->getWizardSteps()->indexOf($step))<0)
213
+		if (($index = $this->getWizardSteps()->indexOf($step)) < 0)
214 214
 			throw new TInvalidOperationException('wizard_step_invalid');
215 215
 		$this->setActiveStepIndex($index);
216 216
 	}
@@ -228,13 +228,13 @@  discard block
 block discarded – undo
228 228
 	 */
229 229
 	public function setActiveStepIndex($value)
230 230
 	{
231
-		$value=TPropertyValue::ensureInteger($value);
232
-		$multiView=$this->getMultiView();
233
-		if($multiView->getActiveViewIndex()!==$value)
231
+		$value = TPropertyValue::ensureInteger($value);
232
+		$multiView = $this->getMultiView();
233
+		if ($multiView->getActiveViewIndex() !== $value)
234 234
 		{
235 235
 			$multiView->setActiveViewIndex($value);
236
-			$this->_activeStepIndexSet=true;
237
-			if($this->_sideBarDataList!==null && $this->getSideBarTemplate()!==null)
236
+			$this->_activeStepIndexSet = true;
237
+			if ($this->_sideBarDataList !== null && $this->getSideBarTemplate() !== null)
238 238
 			{
239 239
 				$this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex());
240 240
 				$this->_sideBarDataList->dataBind();
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
 	 */
248 248
 	public function getWizardSteps()
249 249
 	{
250
-		if($this->_wizardSteps===null)
251
-			$this->_wizardSteps=new TWizardStepCollection($this);
250
+		if ($this->_wizardSteps === null)
251
+			$this->_wizardSteps = new TWizardStepCollection($this);
252 252
 		return $this->_wizardSteps;
253 253
 	}
254 254
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	 */
258 258
 	public function getShowCancelButton()
259 259
 	{
260
-		return $this->getViewState('ShowCancelButton',false);
260
+		return $this->getViewState('ShowCancelButton', false);
261 261
 	}
262 262
 
263 263
 	/**
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	 */
266 266
 	public function setShowCancelButton($value)
267 267
 	{
268
-		$this->setViewState('ShowCancelButton',TPropertyValue::ensureBoolean($value),false);
268
+		$this->setViewState('ShowCancelButton', TPropertyValue::ensureBoolean($value), false);
269 269
 	}
270 270
 
271 271
 	/**
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 	 */
274 274
 	public function getShowSideBar()
275 275
 	{
276
-		return $this->getViewState('ShowSideBar',true);
276
+		return $this->getViewState('ShowSideBar', true);
277 277
 	}
278 278
 
279 279
 	/**
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 	 */
282 282
 	public function setShowSideBar($value)
283 283
 	{
284
-		$this->setViewState('ShowSideBar',TPropertyValue::ensureBoolean($value),true);
284
+		$this->setViewState('ShowSideBar', TPropertyValue::ensureBoolean($value), true);
285 285
 	}
286 286
 
287 287
 	/**
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	 */
298 298
 	public function setStartNavigationTemplate($value)
299 299
 	{
300
-		$this->_startNavigationTemplate=$value;
300
+		$this->_startNavigationTemplate = $value;
301 301
 		$this->requiresControlsRecreation();
302 302
 	}
303 303
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 	 */
315 315
 	public function setStepNavigationTemplate($value)
316 316
 	{
317
-		$this->_stepNavigationTemplate=$value;
317
+		$this->_stepNavigationTemplate = $value;
318 318
 		$this->requiresControlsRecreation();
319 319
 	}
320 320
 
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 	 */
332 332
 	public function setFinishNavigationTemplate($value)
333 333
 	{
334
-		$this->_finishNavigationTemplate=$value;
334
+		$this->_finishNavigationTemplate = $value;
335 335
 		$this->requiresControlsRecreation();
336 336
 	}
337 337
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 	 */
349 349
 	public function setHeaderTemplate($value)
350 350
 	{
351
-		$this->_headerTemplate=$value;
351
+		$this->_headerTemplate = $value;
352 352
 		$this->requiresControlsRecreation();
353 353
 	}
354 354
 
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 	 */
366 366
 	public function setSideBarTemplate($value)
367 367
 	{
368
-		$this->_sideBarTemplate=$value;
368
+		$this->_sideBarTemplate = $value;
369 369
 		$this->requiresControlsRecreation();
370 370
 	}
371 371
 
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 	 */
375 375
 	public function getHeaderText()
376 376
 	{
377
-		return $this->getViewState('HeaderText','');
377
+		return $this->getViewState('HeaderText', '');
378 378
 	}
379 379
 
380 380
 	/**
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 	 */
383 383
 	public function setHeaderText($value)
384 384
 	{
385
-		$this->setViewState('HeaderText',TPropertyValue::ensureString($value),'');
385
+		$this->setViewState('HeaderText', TPropertyValue::ensureString($value), '');
386 386
 	}
387 387
 
388 388
 	/**
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 	 */
392 392
 	public function getCancelDestinationUrl()
393 393
 	{
394
-		return $this->getViewState('CancelDestinationUrl','');
394
+		return $this->getViewState('CancelDestinationUrl', '');
395 395
 	}
396 396
 
397 397
 	/**
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 	 */
401 401
 	public function setCancelDestinationUrl($value)
402 402
 	{
403
-		$this->setViewState('CancelDestinationUrl',TPropertyValue::ensureString($value),'');
403
+		$this->setViewState('CancelDestinationUrl', TPropertyValue::ensureString($value), '');
404 404
 	}
405 405
 
406 406
 	/**
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 	 */
410 410
 	public function getFinishDestinationUrl()
411 411
 	{
412
-		return $this->getViewState('FinishDestinationUrl','');
412
+		return $this->getViewState('FinishDestinationUrl', '');
413 413
 	}
414 414
 
415 415
 	/**
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 	 */
418 418
 	public function setFinishDestinationUrl($value)
419 419
 	{
420
-		$this->setViewState('FinishDestinationUrl',TPropertyValue::ensureString($value),'');
420
+		$this->setViewState('FinishDestinationUrl', TPropertyValue::ensureString($value), '');
421 421
 	}
422 422
 
423 423
 	/**
@@ -425,10 +425,10 @@  discard block
 block discarded – undo
425 425
 	 */
426 426
 	public function getSideBarButtonStyle()
427 427
 	{
428
-		if(($style=$this->getViewState('SideBarButtonStyle',null))===null)
428
+		if (($style = $this->getViewState('SideBarButtonStyle', null)) === null)
429 429
 		{
430
-			$style=new TStyle;
431
-			$this->setViewState('SideBarButtonStyle',$style,null);
430
+			$style = new TStyle;
431
+			$this->setViewState('SideBarButtonStyle', $style, null);
432 432
 		}
433 433
 		return $style;
434 434
 	}
@@ -438,10 +438,10 @@  discard block
 block discarded – undo
438 438
 	 */
439 439
 	public function getNavigationButtonStyle()
440 440
 	{
441
-		if(($style=$this->getViewState('NavigationButtonStyle',null))===null)
441
+		if (($style = $this->getViewState('NavigationButtonStyle', null)) === null)
442 442
 		{
443
-			$style=new TStyle;
444
-			$this->setViewState('NavigationButtonStyle',$style,null);
443
+			$style = new TStyle;
444
+			$this->setViewState('NavigationButtonStyle', $style, null);
445 445
 		}
446 446
 		return $style;
447 447
 	}
@@ -451,11 +451,11 @@  discard block
 block discarded – undo
451 451
 	 */
452 452
 	public function getStartNextButtonStyle()
453 453
 	{
454
-		if(($style=$this->getViewState('StartNextButtonStyle',null))===null)
454
+		if (($style = $this->getViewState('StartNextButtonStyle', null)) === null)
455 455
 		{
456
-			$style=new TWizardNavigationButtonStyle;
456
+			$style = new TWizardNavigationButtonStyle;
457 457
 			$style->setButtonText('Next');
458
-			$this->setViewState('StartNextButtonStyle',$style,null);
458
+			$this->setViewState('StartNextButtonStyle', $style, null);
459 459
 		}
460 460
 		return $style;
461 461
 	}
@@ -465,11 +465,11 @@  discard block
 block discarded – undo
465 465
 	 */
466 466
 	public function getStepNextButtonStyle()
467 467
 	{
468
-		if(($style=$this->getViewState('StepNextButtonStyle',null))===null)
468
+		if (($style = $this->getViewState('StepNextButtonStyle', null)) === null)
469 469
 		{
470
-			$style=new TWizardNavigationButtonStyle;
470
+			$style = new TWizardNavigationButtonStyle;
471 471
 			$style->setButtonText('Next');
472
-			$this->setViewState('StepNextButtonStyle',$style,null);
472
+			$this->setViewState('StepNextButtonStyle', $style, null);
473 473
 		}
474 474
 		return $style;
475 475
 	}
@@ -479,11 +479,11 @@  discard block
 block discarded – undo
479 479
 	 */
480 480
 	public function getStepPreviousButtonStyle()
481 481
 	{
482
-		if(($style=$this->getViewState('StepPreviousButtonStyle',null))===null)
482
+		if (($style = $this->getViewState('StepPreviousButtonStyle', null)) === null)
483 483
 		{
484
-			$style=new TWizardNavigationButtonStyle;
484
+			$style = new TWizardNavigationButtonStyle;
485 485
 			$style->setButtonText('Previous');
486
-			$this->setViewState('StepPreviousButtonStyle',$style,null);
486
+			$this->setViewState('StepPreviousButtonStyle', $style, null);
487 487
 		}
488 488
 		return $style;
489 489
 	}
@@ -493,11 +493,11 @@  discard block
 block discarded – undo
493 493
 	 */
494 494
 	public function getFinishCompleteButtonStyle()
495 495
 	{
496
-		if(($style=$this->getViewState('FinishCompleteButtonStyle',null))===null)
496
+		if (($style = $this->getViewState('FinishCompleteButtonStyle', null)) === null)
497 497
 		{
498
-			$style=new TWizardNavigationButtonStyle;
498
+			$style = new TWizardNavigationButtonStyle;
499 499
 			$style->setButtonText('Complete');
500
-			$this->setViewState('FinishCompleteButtonStyle',$style,null);
500
+			$this->setViewState('FinishCompleteButtonStyle', $style, null);
501 501
 		}
502 502
 		return $style;
503 503
 	}
@@ -507,11 +507,11 @@  discard block
 block discarded – undo
507 507
 	 */
508 508
 	public function getFinishPreviousButtonStyle()
509 509
 	{
510
-		if(($style=$this->getViewState('FinishPreviousButtonStyle',null))===null)
510
+		if (($style = $this->getViewState('FinishPreviousButtonStyle', null)) === null)
511 511
 		{
512
-			$style=new TWizardNavigationButtonStyle;
512
+			$style = new TWizardNavigationButtonStyle;
513 513
 			$style->setButtonText('Previous');
514
-			$this->setViewState('FinishPreviousButtonStyle',$style,null);
514
+			$this->setViewState('FinishPreviousButtonStyle', $style, null);
515 515
 		}
516 516
 		return $style;
517 517
 	}
@@ -521,11 +521,11 @@  discard block
 block discarded – undo
521 521
 	 */
522 522
 	public function getCancelButtonStyle()
523 523
 	{
524
-		if(($style=$this->getViewState('CancelButtonStyle',null))===null)
524
+		if (($style = $this->getViewState('CancelButtonStyle', null)) === null)
525 525
 		{
526
-			$style=new TWizardNavigationButtonStyle;
526
+			$style = new TWizardNavigationButtonStyle;
527 527
 			$style->setButtonText('Cancel');
528
-			$this->setViewState('CancelButtonStyle',$style,null);
528
+			$this->setViewState('CancelButtonStyle', $style, null);
529 529
 		}
530 530
 		return $style;
531 531
 	}
@@ -535,10 +535,10 @@  discard block
 block discarded – undo
535 535
 	 */
536 536
 	public function getSideBarStyle()
537 537
 	{
538
-		if(($style=$this->getViewState('SideBarStyle',null))===null)
538
+		if (($style = $this->getViewState('SideBarStyle', null)) === null)
539 539
 		{
540
-			$style=new TPanelStyle;
541
-			$this->setViewState('SideBarStyle',$style,null);
540
+			$style = new TPanelStyle;
541
+			$this->setViewState('SideBarStyle', $style, null);
542 542
 		}
543 543
 		return $style;
544 544
 	}
@@ -548,10 +548,10 @@  discard block
 block discarded – undo
548 548
 	 */
549 549
 	public function getHeaderStyle()
550 550
 	{
551
-		if(($style=$this->getViewState('HeaderStyle',null))===null)
551
+		if (($style = $this->getViewState('HeaderStyle', null)) === null)
552 552
 		{
553
-			$style=new TPanelStyle;
554
-			$this->setViewState('HeaderStyle',$style,null);
553
+			$style = new TPanelStyle;
554
+			$this->setViewState('HeaderStyle', $style, null);
555 555
 		}
556 556
 		return $style;
557 557
 	}
@@ -561,10 +561,10 @@  discard block
 block discarded – undo
561 561
 	 */
562 562
 	public function getStepStyle()
563 563
 	{
564
-		if(($style=$this->getViewState('StepStyle',null))===null)
564
+		if (($style = $this->getViewState('StepStyle', null)) === null)
565 565
 		{
566
-			$style=new TPanelStyle;
567
-			$this->setViewState('StepStyle',$style,null);
566
+			$style = new TPanelStyle;
567
+			$this->setViewState('StepStyle', $style, null);
568 568
 		}
569 569
 		return $style;
570 570
 	}
@@ -574,10 +574,10 @@  discard block
 block discarded – undo
574 574
 	 */
575 575
 	public function getNavigationStyle()
576 576
 	{
577
-		if(($style=$this->getViewState('NavigationStyle',null))===null)
577
+		if (($style = $this->getViewState('NavigationStyle', null)) === null)
578 578
 		{
579
-			$style=new TPanelStyle;
580
-			$this->setViewState('NavigationStyle',$style,null);
579
+			$style = new TPanelStyle;
580
+			$this->setViewState('NavigationStyle', $style, null);
581 581
 		}
582 582
 		return $style;
583 583
 	}
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 	 */
588 588
 	public function getUseDefaultLayout()
589 589
 	{
590
-		return $this->getViewState('UseDefaultLayout',true);
590
+		return $this->getViewState('UseDefaultLayout', true);
591 591
 	}
592 592
 
593 593
 	/**
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 	 */
598 598
 	public function setUseDefaultLayout($value)
599 599
 	{
600
-		$this->setViewState('UseDefaultLayout',TPropertyValue::ensureBoolean($value),true);
600
+		$this->setViewState('UseDefaultLayout', TPropertyValue::ensureBoolean($value), true);
601 601
 	}
602 602
 
603 603
 	/**
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 	 */
657 657
 	public function onActiveStepChanged($param)
658 658
 	{
659
-		$this->raiseEvent('OnActiveStepChanged',$this,$param);
659
+		$this->raiseEvent('OnActiveStepChanged', $this, $param);
660 660
 	}
661 661
 
662 662
 	/**
@@ -667,8 +667,8 @@  discard block
 block discarded – undo
667 667
 	 */
668 668
 	public function onCancelButtonClick($param)
669 669
 	{
670
-		$this->raiseEvent('OnCancelButtonClick',$this,$param);
671
-		if(($url=$this->getCancelDestinationUrl())!=='')
670
+		$this->raiseEvent('OnCancelButtonClick', $this, $param);
671
+		if (($url = $this->getCancelDestinationUrl()) !== '')
672 672
 			$this->getResponse()->redirect($url);
673 673
 	}
674 674
 
@@ -680,8 +680,8 @@  discard block
 block discarded – undo
680 680
 	 */
681 681
 	public function onCompleteButtonClick($param)
682 682
 	{
683
-		$this->raiseEvent('OnCompleteButtonClick',$this,$param);
684
-		if(($url=$this->getFinishDestinationUrl())!=='')
683
+		$this->raiseEvent('OnCompleteButtonClick', $this, $param);
684
+		if (($url = $this->getFinishDestinationUrl()) !== '')
685 685
 			$this->getResponse()->redirect($url);
686 686
 	}
687 687
 
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 	 */
694 694
 	public function onNextButtonClick($param)
695 695
 	{
696
-		$this->raiseEvent('OnNextButtonClick',$this,$param);
696
+		$this->raiseEvent('OnNextButtonClick', $this, $param);
697 697
 	}
698 698
 
699 699
 	/**
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
 	 */
705 705
 	public function onPreviousButtonClick($param)
706 706
 	{
707
-		$this->raiseEvent('OnPreviousButtonClick',$this,$param);
707
+		$this->raiseEvent('OnPreviousButtonClick', $this, $param);
708 708
 	}
709 709
 
710 710
 	/**
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 	 */
715 715
 	public function onSideBarButtonClick($param)
716 716
 	{
717
-		$this->raiseEvent('OnSideBarButtonClick',$this,$param);
717
+		$this->raiseEvent('OnSideBarButtonClick', $this, $param);
718 718
 	}
719 719
 
720 720
 	/**
@@ -724,11 +724,11 @@  discard block
 block discarded – undo
724 724
 	 */
725 725
 	public function getMultiView()
726 726
 	{
727
-		if($this->_multiView===null)
727
+		if ($this->_multiView === null)
728 728
 		{
729
-			$this->_multiView=new TMultiView;
729
+			$this->_multiView = new TMultiView;
730 730
 			$this->_multiView->setID('WizardMultiView');
731
-			$this->_multiView->attachEventHandler('OnActiveViewChanged',array($this,'onActiveStepChanged'));
731
+			$this->_multiView->attachEventHandler('OnActiveViewChanged', array($this, 'onActiveStepChanged'));
732 732
 			$this->_multiView->ignoreBubbleEvents();
733 733
 		}
734 734
 		return $this->_multiView;
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 	 */
743 743
 	public function addedWizardStep($step)
744 744
 	{
745
-		if(($wizard=$step->getWizard())!==null)
745
+		if (($wizard = $step->getWizard()) !== null)
746 746
 			$wizard->getWizardSteps()->remove($step);
747 747
 		$step->setWizard($this);
748 748
 		$this->wizardStepsChanged();
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
 		parent::onInit($param);
771 771
 		$this->ensureChildControls();
772 772
 		$this->setEnsureId(true);
773
-		if($this->getActiveStepIndex()<0 && $this->getWizardSteps()->getCount()>0)
773
+		if ($this->getActiveStepIndex() < 0 && $this->getWizardSteps()->getCount() > 0)
774 774
 			$this->setActiveStepIndex(0);
775 775
 	}
776 776
 
@@ -780,9 +780,9 @@  discard block
 block discarded – undo
780 780
 	 */
781 781
 	public function saveState()
782 782
 	{
783
-		$index=$this->getActiveStepIndex();
784
-		$history=$this->getHistory();
785
-		if(!$history->getCount() || $history->peek()!==$index)
783
+		$index = $this->getActiveStepIndex();
784
+		$history = $this->getHistory();
785
+		if (!$history->getCount() || $history->peek() !== $index)
786 786
 			$history->push($index);
787 787
 	}
788 788
 
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 	 */
792 792
 	protected function requiresControlsRecreation()
793 793
 	{
794
-		if($this->getChildControlsCreated())
794
+		if ($this->getChildControlsCreated())
795 795
 			$this->setChildControlsCreated(false);
796 796
 	}
797 797
 
@@ -802,9 +802,9 @@  discard block
 block discarded – undo
802 802
 	public function render($writer)
803 803
 	{
804 804
 		$this->ensureChildControls();
805
-		if($this->getHasControls())
805
+		if ($this->getHasControls())
806 806
 		{
807
-			if($this->getUseDefaultLayout())
807
+			if ($this->getUseDefaultLayout())
808 808
 			{
809 809
 				$this->applyControlProperties();
810 810
 				$this->renderBeginTag($writer);
@@ -846,9 +846,9 @@  discard block
 block discarded – undo
846 846
 	 */
847 847
 	protected function applyHeaderProperties()
848 848
 	{
849
-		if(($style=$this->getViewState('HeaderStyle',null))!==null)
849
+		if (($style = $this->getViewState('HeaderStyle', null)) !== null)
850 850
 			$this->_header->getStyle()->mergeWith($style);
851
-		if($this->getHeaderTemplate()===null)
851
+		if ($this->getHeaderTemplate() === null)
852 852
 		{
853 853
 			$this->_header->getControls()->clear();
854 854
 			$this->_header->getControls()->add($this->getHeaderText());
@@ -861,21 +861,21 @@  discard block
 block discarded – undo
861 861
 	protected function applySideBarProperties()
862 862
 	{
863 863
 		$this->_sideBar->setVisible($this->getShowSideBar());
864
-		if($this->_sideBarDataList!==null && $this->getShowSideBar())
864
+		if ($this->_sideBarDataList !== null && $this->getShowSideBar())
865 865
 		{
866 866
 			$this->_sideBarDataList->setDataSource($this->getWizardSteps());
867 867
 			$this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex());
868 868
 			$this->_sideBarDataList->dataBind();
869
-			if(($style=$this->getViewState('SideBarButtonStyle',null))!==null)
869
+			if (($style = $this->getViewState('SideBarButtonStyle', null)) !== null)
870 870
 			{
871
-				foreach($this->_sideBarDataList->getItems() as $item)
871
+				foreach ($this->_sideBarDataList->getItems() as $item)
872 872
 				{
873
-					if(($button=$item->findControl('SideBarButton'))!==null)
873
+					if (($button = $item->findControl('SideBarButton')) !== null)
874 874
 						$button->getStyle()->mergeWith($style);
875 875
 				}
876 876
 			}
877 877
 		}
878
-		if(($style=$this->getViewState('SideBarStyle',null))!==null)
878
+		if (($style = $this->getViewState('SideBarStyle', null)) !== null)
879 879
 			$this->_sideBar->getStyle()->mergeWith($style);
880 880
 	}
881 881
 
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
 	 */
885 885
 	protected function applyStepContentProperties()
886 886
 	{
887
-		if(($style=$this->getViewState('StepStyle',null))!==null)
887
+		if (($style = $this->getViewState('StepStyle', null)) !== null)
888 888
 			$this->_stepContent->getStyle()->mergeWith($style);
889 889
 	}
890 890
 
@@ -893,116 +893,116 @@  discard block
 block discarded – undo
893 893
 	 */
894 894
 	protected function applyNavigationProperties()
895 895
 	{
896
-		$wizardSteps=$this->getWizardSteps();
897
-		$activeStep=$this->getActiveStep();
898
-		$activeStepIndex=$this->getActiveStepIndex();
896
+		$wizardSteps = $this->getWizardSteps();
897
+		$activeStep = $this->getActiveStep();
898
+		$activeStepIndex = $this->getActiveStepIndex();
899 899
 
900
-		if(!$this->_navigation)
900
+		if (!$this->_navigation)
901 901
 			return;
902
-		else if($activeStepIndex<0 || $activeStepIndex>=$wizardSteps->getCount())
902
+		else if ($activeStepIndex < 0 || $activeStepIndex >= $wizardSteps->getCount())
903 903
 		{
904 904
 			$this->_navigation->setVisible(false);
905 905
 			return;
906 906
 		}
907 907
 
908 908
 		// set visibility of different types of navigation panel
909
-		$showStandard=true;
910
-		foreach($wizardSteps as $step)
909
+		$showStandard = true;
910
+		foreach ($wizardSteps as $step)
911 911
 		{
912
-			if(($step instanceof TTemplatedWizardStep) && ($container=$step->getNavigationContainer())!==null)
912
+			if (($step instanceof TTemplatedWizardStep) && ($container = $step->getNavigationContainer()) !== null)
913 913
 			{
914
-				if($activeStep===$step)
914
+				if ($activeStep === $step)
915 915
 				{
916 916
 					$container->setVisible(true);
917
-					$showStandard=false;
917
+					$showStandard = false;
918 918
 				}
919 919
 				else
920 920
 					$container->setVisible(false);
921 921
 			}
922 922
 		}
923
-		$activeStepType=$this->getStepType($activeStep);
924
-		if($activeStepType===TWizardStepType::Complete)
923
+		$activeStepType = $this->getStepType($activeStep);
924
+		if ($activeStepType === TWizardStepType::Complete)
925 925
 		{
926 926
 			$this->_sideBar->setVisible(false);
927 927
 			$this->_header->setVisible(false);
928 928
 		}
929
-		$this->_startNavigation->setVisible($showStandard && $activeStepType===self::ST_START);
930
-		$this->_stepNavigation->setVisible($showStandard && $activeStepType===self::ST_STEP);
931
-		$this->_finishNavigation->setVisible($showStandard && $activeStepType===self::ST_FINISH);
929
+		$this->_startNavigation->setVisible($showStandard && $activeStepType === self::ST_START);
930
+		$this->_stepNavigation->setVisible($showStandard && $activeStepType === self::ST_STEP);
931
+		$this->_finishNavigation->setVisible($showStandard && $activeStepType === self::ST_FINISH);
932 932
 
933
-		if(($navigationStyle=$this->getViewState('NavigationStyle',null))!==null)
933
+		if (($navigationStyle = $this->getViewState('NavigationStyle', null)) !== null)
934 934
 			$this->_navigation->getStyle()->mergeWith($navigationStyle);
935 935
 
936
-		$displayCancelButton=$this->getShowCancelButton();
937
-		$cancelButtonStyle=$this->getCancelButtonStyle();
938
-		$buttonStyle=$this->getViewState('NavigationButtonStyle',null);
939
-		if($buttonStyle!==null)
936
+		$displayCancelButton = $this->getShowCancelButton();
937
+		$cancelButtonStyle = $this->getCancelButtonStyle();
938
+		$buttonStyle = $this->getViewState('NavigationButtonStyle', null);
939
+		if ($buttonStyle !== null)
940 940
 			$cancelButtonStyle->mergeWith($buttonStyle);
941 941
 
942 942
 		// apply styles to start navigation buttons
943
-		if(($cancelButton=$this->_startNavigation->getCancelButton())!==null)
943
+		if (($cancelButton = $this->_startNavigation->getCancelButton()) !== null)
944 944
 		{
945 945
 			$cancelButton->setVisible($displayCancelButton);
946 946
 			$cancelButtonStyle->apply($cancelButton);
947 947
 		}
948
-		if(($button=$this->_startNavigation->getNextButton())!==null)
948
+		if (($button = $this->_startNavigation->getNextButton()) !== null)
949 949
 		{
950 950
 			$button->setVisible(true);
951
-			$style=$this->getStartNextButtonStyle();
952
-			if($buttonStyle!==null)
951
+			$style = $this->getStartNextButtonStyle();
952
+			if ($buttonStyle !== null)
953 953
 				$style->mergeWith($buttonStyle);
954 954
 			$style->apply($button);
955
-			if($activeStepType===TWizardStepType::Start)
955
+			if ($activeStepType === TWizardStepType::Start)
956 956
 				$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
957 957
 		}
958 958
 
959 959
 		// apply styles to finish navigation buttons
960
-		if(($cancelButton=$this->_finishNavigation->getCancelButton())!==null)
960
+		if (($cancelButton = $this->_finishNavigation->getCancelButton()) !== null)
961 961
 		{
962 962
 			$cancelButton->setVisible($displayCancelButton);
963 963
 			$cancelButtonStyle->apply($cancelButton);
964 964
 		}
965
-		if(($button=$this->_finishNavigation->getPreviousButton())!==null)
965
+		if (($button = $this->_finishNavigation->getPreviousButton()) !== null)
966 966
 		{
967 967
 			$button->setVisible($this->allowNavigationToPreviousStep());
968
-			$style=$this->getFinishPreviousButtonStyle();
969
-			if($buttonStyle!==null)
968
+			$style = $this->getFinishPreviousButtonStyle();
969
+			if ($buttonStyle !== null)
970 970
 				$style->mergeWith($buttonStyle);
971 971
 			$style->apply($button);
972 972
 		}
973
-		if(($button=$this->_finishNavigation->getCompleteButton())!==null)
973
+		if (($button = $this->_finishNavigation->getCompleteButton()) !== null)
974 974
 		{
975 975
 			$button->setVisible(true);
976
-			$style=$this->getFinishCompleteButtonStyle();
977
-			if($buttonStyle!==null)
976
+			$style = $this->getFinishCompleteButtonStyle();
977
+			if ($buttonStyle !== null)
978 978
 				$style->mergeWith($buttonStyle);
979 979
 			$style->apply($button);
980
-			if($activeStepType===TWizardStepType::Finish)
980
+			if ($activeStepType === TWizardStepType::Finish)
981 981
 				$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
982 982
 		}
983 983
 
984 984
 		// apply styles to step navigation buttons
985
-		if(($cancelButton=$this->_stepNavigation->getCancelButton())!==null)
985
+		if (($cancelButton = $this->_stepNavigation->getCancelButton()) !== null)
986 986
 		{
987 987
 			$cancelButton->setVisible($displayCancelButton);
988 988
 			$cancelButtonStyle->apply($cancelButton);
989 989
 		}
990
-		if(($button=$this->_stepNavigation->getPreviousButton())!==null)
990
+		if (($button = $this->_stepNavigation->getPreviousButton()) !== null)
991 991
 		{
992 992
 			$button->setVisible($this->allowNavigationToPreviousStep());
993
-			$style=$this->getStepPreviousButtonStyle();
994
-			if($buttonStyle!==null)
993
+			$style = $this->getStepPreviousButtonStyle();
994
+			if ($buttonStyle !== null)
995 995
 				$style->mergeWith($buttonStyle);
996 996
 			$style->apply($button);
997 997
 		}
998
-		if(($button=$this->_stepNavigation->getNextButton())!==null)
998
+		if (($button = $this->_stepNavigation->getNextButton()) !== null)
999 999
 		{
1000 1000
 			$button->setVisible(true);
1001
-			$style=$this->getStepNextButtonStyle();
1002
-			if($buttonStyle!==null)
1001
+			$style = $this->getStepNextButtonStyle();
1002
+			if ($buttonStyle !== null)
1003 1003
 				$style->mergeWith($buttonStyle);
1004 1004
 			$style->apply($button);
1005
-			if($activeStepType===TWizardStepType::Step)
1005
+			if ($activeStepType === TWizardStepType::Step)
1006 1006
 				$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
1007 1007
 		}
1008 1008
 	}
@@ -1012,10 +1012,10 @@  discard block
 block discarded – undo
1012 1012
 	 */
1013 1013
 	protected function getHistory()
1014 1014
 	{
1015
-		if(($history=$this->getControlState('History',null))===null)
1015
+		if (($history = $this->getControlState('History', null)) === null)
1016 1016
 		{
1017
-			$history=new TStack;
1018
-			$this->setControlState('History',$history);
1017
+			$history = new TStack;
1018
+			$this->setControlState('History', $history);
1019 1019
 		}
1020 1020
 		return $history;
1021 1021
 	}
@@ -1027,17 +1027,17 @@  discard block
 block discarded – undo
1027 1027
 	 */
1028 1028
 	protected function getStepType($wizardStep)
1029 1029
 	{
1030
-		if(($type=$wizardStep->getStepType())===TWizardStepType::Auto)
1030
+		if (($type = $wizardStep->getStepType()) === TWizardStepType::Auto)
1031 1031
 		{
1032
-			$steps=$this->getWizardSteps();
1033
-			if(($index=$steps->indexOf($wizardStep))>=0)
1032
+			$steps = $this->getWizardSteps();
1033
+			if (($index = $steps->indexOf($wizardStep)) >= 0)
1034 1034
 			{
1035
-				$stepCount=$steps->getCount();
1036
-				if($stepCount===1 || ($index<$stepCount-1 && $steps->itemAt($index+1)->getStepType()===TWizardStepType::Complete))
1035
+				$stepCount = $steps->getCount();
1036
+				if ($stepCount === 1 || ($index < $stepCount - 1 && $steps->itemAt($index + 1)->getStepType() === TWizardStepType::Complete))
1037 1037
 					return TWizardStepType::Finish;
1038
-				else if($index===0)
1038
+				else if ($index === 0)
1039 1039
 					return TWizardStepType::Start;
1040
-				else if($index===$stepCount-1)
1040
+				else if ($index === $stepCount - 1)
1041 1041
 					return TWizardStepType::Finish;
1042 1042
 				else
1043 1043
 					return TWizardStepType::Step;
@@ -1055,14 +1055,14 @@  discard block
 block discarded – undo
1055 1055
 	protected function reset()
1056 1056
 	{
1057 1057
 		$this->getControls()->clear();
1058
-		$this->_header=null;
1059
-		$this->_stepContent=null;
1060
-		$this->_sideBar=null;
1061
-		$this->_sideBarDataList=null;
1062
-		$this->_navigation=null;
1063
-		$this->_startNavigation=null;
1064
-		$this->_stepNavigation=null;
1065
-		$this->_finishNavigation=null;
1058
+		$this->_header = null;
1059
+		$this->_stepContent = null;
1060
+		$this->_sideBar = null;
1061
+		$this->_sideBarDataList = null;
1062
+		$this->_navigation = null;
1063
+		$this->_startNavigation = null;
1064
+		$this->_stepNavigation = null;
1065
+		$this->_finishNavigation = null;
1066 1066
 	}
1067 1067
 
1068 1068
 	/**
@@ -1083,8 +1083,8 @@  discard block
 block discarded – undo
1083 1083
 	 */
1084 1084
 	protected function createHeader()
1085 1085
 	{
1086
-		$this->_header=new TPanel;
1087
-		if(($template=$this->getHeaderTemplate())!==null)
1086
+		$this->_header = new TPanel;
1087
+		if (($template = $this->getHeaderTemplate()) !== null)
1088 1088
 			$template->instantiateIn($this->_header);
1089 1089
 		else
1090 1090
 			$this->_header->getControls()->add($this->getHeaderText());
@@ -1096,18 +1096,18 @@  discard block
 block discarded – undo
1096 1096
 	 */
1097 1097
 	protected function createSideBar()
1098 1098
 	{
1099
-		if($this->getShowSideBar())
1099
+		if ($this->getShowSideBar())
1100 1100
 		{
1101
-			if(($template=$this->getSideBarTemplate())===null)
1102
-				$template=new TWizardSideBarTemplate;
1103
-			$this->_sideBar=new TPanel;
1101
+			if (($template = $this->getSideBarTemplate()) === null)
1102
+				$template = new TWizardSideBarTemplate;
1103
+			$this->_sideBar = new TPanel;
1104 1104
 			$template->instantiateIn($this->_sideBar);
1105 1105
 			$this->getControls()->add($this->_sideBar);
1106 1106
 
1107
-			if(($this->_sideBarDataList=$this->_sideBar->findControl(self::ID_SIDEBAR_LIST))!==null)
1107
+			if (($this->_sideBarDataList = $this->_sideBar->findControl(self::ID_SIDEBAR_LIST)) !== null)
1108 1108
 			{
1109
-				$this->_sideBarDataList->attachEventHandler('OnItemCommand',array($this,'dataListItemCommand'));
1110
-				$this->_sideBarDataList->attachEventHandler('OnItemDataBound',array($this,'dataListItemDataBound'));
1109
+				$this->_sideBarDataList->attachEventHandler('OnItemCommand', array($this, 'dataListItemCommand'));
1110
+				$this->_sideBarDataList->attachEventHandler('OnItemDataBound', array($this, 'dataListItemDataBound'));
1111 1111
 				$this->_sideBarDataList->setDataSource($this->getWizardSteps());
1112 1112
 				$this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex());
1113 1113
 				$this->_sideBarDataList->dataBind();
@@ -1115,7 +1115,7 @@  discard block
 block discarded – undo
1115 1115
 		}
1116 1116
 		else
1117 1117
 		{
1118
-			$this->_sideBar=new TPanel;
1118
+			$this->_sideBar = new TPanel;
1119 1119
 			$this->getControls()->add($this->_sideBar);
1120 1120
 		}
1121 1121
 	}
@@ -1127,28 +1127,28 @@  discard block
 block discarded – undo
1127 1127
 	 * @param mixed sender of the event
1128 1128
 	 * @param TDataListCommandEventParameter
1129 1129
 	 */
1130
-	public function dataListItemCommand($sender,$param)
1130
+	public function dataListItemCommand($sender, $param)
1131 1131
 	{
1132
-		$item=$param->getItem();
1133
-		if($param->getCommandName()===self::CMD_MOVETO)
1132
+		$item = $param->getItem();
1133
+		if ($param->getCommandName() === self::CMD_MOVETO)
1134 1134
 		{
1135
-			$stepIndex=$this->getActiveStepIndex();
1136
-			$newStepIndex=TPropertyValue::ensureInteger($param->getCommandParameter());
1137
-			$navParam=new TWizardNavigationEventParameter($stepIndex);
1135
+			$stepIndex = $this->getActiveStepIndex();
1136
+			$newStepIndex = TPropertyValue::ensureInteger($param->getCommandParameter());
1137
+			$navParam = new TWizardNavigationEventParameter($stepIndex);
1138 1138
 			$navParam->setNextStepIndex($newStepIndex);
1139 1139
 
1140 1140
 			// if the button clicked causes validation which fails,
1141 1141
 			// by default we will cancel navigation to the new step
1142
-			$button=$param->getCommandSource();
1143
-			if(($button instanceof IButtonControl) && $button->getCausesValidation() && ($page=$this->getPage())!==null && !$page->getIsValid())
1142
+			$button = $param->getCommandSource();
1143
+			if (($button instanceof IButtonControl) && $button->getCausesValidation() && ($page = $this->getPage()) !== null && !$page->getIsValid())
1144 1144
 				$navParam->setCancelNavigation(true);
1145 1145
 
1146
-			$this->_activeStepIndexSet=false;
1146
+			$this->_activeStepIndexSet = false;
1147 1147
 			$this->onSideBarButtonClick($navParam);
1148
-			$this->_cancelNavigation=$navParam->getCancelNavigation();
1149
-			if(!$this->_cancelNavigation)
1148
+			$this->_cancelNavigation = $navParam->getCancelNavigation();
1149
+			if (!$this->_cancelNavigation)
1150 1150
 			{
1151
-				if(!$this->_activeStepIndexSet && $this->allowNavigationToStep($newStepIndex))
1151
+				if (!$this->_activeStepIndexSet && $this->allowNavigationToStep($newStepIndex))
1152 1152
 					$this->setActiveStepIndex($newStepIndex);
1153 1153
 			}
1154 1154
 			else
@@ -1163,22 +1163,22 @@  discard block
 block discarded – undo
1163 1163
 	 * @param mixed sender of the event
1164 1164
 	 * @param TDataListItemEventParameter
1165 1165
 	 */
1166
-	public function dataListItemDataBound($sender,$param)
1166
+	public function dataListItemDataBound($sender, $param)
1167 1167
 	{
1168
-		$item=$param->getItem();
1169
-		$itemType=$item->getItemType();
1170
-		if($itemType==='Item' || $itemType==='AlternatingItem' || $itemType==='SelectedItem' || $itemType==='EditItem')
1168
+		$item = $param->getItem();
1169
+		$itemType = $item->getItemType();
1170
+		if ($itemType === 'Item' || $itemType === 'AlternatingItem' || $itemType === 'SelectedItem' || $itemType === 'EditItem')
1171 1171
 		{
1172
-			if(($button=$item->findControl(self::ID_SIDEBAR_BUTTON))!==null)
1172
+			if (($button = $item->findControl(self::ID_SIDEBAR_BUTTON)) !== null)
1173 1173
 			{
1174
-				$step=$item->getData();
1175
-				if(($this->getStepType($step)===TWizardStepType::Complete))
1174
+				$step = $item->getData();
1175
+				if (($this->getStepType($step) === TWizardStepType::Complete))
1176 1176
 					$button->setEnabled(false);
1177
-				if(($title=$step->getTitle())!=='')
1177
+				if (($title = $step->getTitle()) !== '')
1178 1178
 					$button->setText($title);
1179 1179
 				else
1180 1180
 					$button->setText($step->getID(false));
1181
-				$index=$this->getWizardSteps()->indexOf($step);
1181
+				$index = $this->getWizardSteps()->indexOf($step);
1182 1182
 				$button->setCommandName(self::CMD_MOVETO);
1183 1183
 				$button->setCommandParameter("$index");
1184 1184
 			}
@@ -1190,16 +1190,16 @@  discard block
 block discarded – undo
1190 1190
 	 */
1191 1191
 	protected function createStepContent()
1192 1192
 	{
1193
-		foreach($this->getWizardSteps() as $step)
1193
+		foreach ($this->getWizardSteps() as $step)
1194 1194
 		{
1195
-			if($step instanceof TTemplatedWizardStep)
1195
+			if ($step instanceof TTemplatedWizardStep)
1196 1196
 				$step->ensureChildControls();
1197 1197
 		}
1198
-		$multiView=$this->getMultiView();
1199
-		$this->_stepContent=new TPanel;
1198
+		$multiView = $this->getMultiView();
1199
+		$this->_stepContent = new TPanel;
1200 1200
 		$this->_stepContent->getControls()->add($multiView);
1201 1201
 		$this->getControls()->add($this->_stepContent);
1202
-		if($multiView->getViews()->getCount())
1202
+		if ($multiView->getViews()->getCount())
1203 1203
 			$multiView->setActiveViewIndex(0);
1204 1204
 	}
1205 1205
 
@@ -1208,23 +1208,23 @@  discard block
 block discarded – undo
1208 1208
 	 */
1209 1209
 	protected function createNavigation()
1210 1210
 	{
1211
-		$this->_navigation=new TPanel;
1211
+		$this->_navigation = new TPanel;
1212 1212
 		$this->getControls()->add($this->_navigation);
1213
-		$controls=$this->_navigation->getControls();
1214
-		foreach($this->getWizardSteps() as $step)
1213
+		$controls = $this->_navigation->getControls();
1214
+		foreach ($this->getWizardSteps() as $step)
1215 1215
 		{
1216
-			if($step instanceof TTemplatedWizardStep)
1216
+			if ($step instanceof TTemplatedWizardStep)
1217 1217
 			{
1218 1218
 				$step->instantiateNavigationTemplate();
1219
-				if(($panel=$step->getNavigationContainer())!==null)
1219
+				if (($panel = $step->getNavigationContainer()) !== null)
1220 1220
 					$controls->add($panel);
1221 1221
 			}
1222 1222
 		}
1223
-		$this->_startNavigation=$this->createStartNavigation();
1223
+		$this->_startNavigation = $this->createStartNavigation();
1224 1224
 		$controls->add($this->_startNavigation);
1225
-		$this->_stepNavigation=$this->createStepNavigation();
1225
+		$this->_stepNavigation = $this->createStepNavigation();
1226 1226
 		$controls->add($this->_stepNavigation);
1227
-		$this->_finishNavigation=$this->createFinishNavigation();
1227
+		$this->_finishNavigation = $this->createFinishNavigation();
1228 1228
 		$controls->add($this->_finishNavigation);
1229 1229
 	}
1230 1230
 
@@ -1233,9 +1233,9 @@  discard block
 block discarded – undo
1233 1233
 	 */
1234 1234
 	protected function createStartNavigation()
1235 1235
 	{
1236
-		if(($template=$this->getStartNavigationTemplate())===null)
1237
-			$template=new TWizardStartNavigationTemplate($this);
1238
-		$navigation=new TWizardNavigationContainer;
1236
+		if (($template = $this->getStartNavigationTemplate()) === null)
1237
+			$template = new TWizardStartNavigationTemplate($this);
1238
+		$navigation = new TWizardNavigationContainer;
1239 1239
 		$template->instantiateIn($navigation);
1240 1240
 		return $navigation;
1241 1241
 	}
@@ -1245,9 +1245,9 @@  discard block
 block discarded – undo
1245 1245
 	 */
1246 1246
 	protected function createStepNavigation()
1247 1247
 	{
1248
-		if(($template=$this->getStepNavigationTemplate())===null)
1249
-			$template=new TWizardStepNavigationTemplate($this);
1250
-		$navigation=new TWizardNavigationContainer;
1248
+		if (($template = $this->getStepNavigationTemplate()) === null)
1249
+			$template = new TWizardStepNavigationTemplate($this);
1250
+		$navigation = new TWizardNavigationContainer;
1251 1251
 		$template->instantiateIn($navigation);
1252 1252
 		return $navigation;
1253 1253
 	}
@@ -1257,9 +1257,9 @@  discard block
 block discarded – undo
1257 1257
 	 */
1258 1258
 	protected function createFinishNavigation()
1259 1259
 	{
1260
-		if(($template=$this->getFinishNavigationTemplate())===null)
1261
-			$template=new TWizardFinishNavigationTemplate($this);
1262
-		$navigation=new TWizardNavigationContainer;
1260
+		if (($template = $this->getFinishNavigationTemplate()) === null)
1261
+			$template = new TWizardFinishNavigationTemplate($this);
1262
+		$navigation = new TWizardNavigationContainer;
1263 1263
 		$template->instantiateIn($navigation);
1264 1264
 		return $navigation;
1265 1265
 	}
@@ -1270,7 +1270,7 @@  discard block
 block discarded – undo
1270 1270
 	 */
1271 1271
 	public function wizardStepsChanged()
1272 1272
 	{
1273
-		if($this->_sideBarDataList!==null)
1273
+		if ($this->_sideBarDataList !== null)
1274 1274
 		{
1275 1275
 			$this->_sideBarDataList->setDataSource($this->getWizardSteps());
1276 1276
 			$this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex());
@@ -1285,28 +1285,28 @@  discard block
 block discarded – undo
1285 1285
 	 */
1286 1286
 	protected function getPreviousStepIndex($popStack)
1287 1287
 	{
1288
-		$history=$this->getHistory();
1289
-		if($history->getCount()>=0)
1288
+		$history = $this->getHistory();
1289
+		if ($history->getCount() >= 0)
1290 1290
 		{
1291
-			$activeStepIndex=$this->getActiveStepIndex();
1292
-			$previousStepIndex=-1;
1293
-			if($popStack)
1291
+			$activeStepIndex = $this->getActiveStepIndex();
1292
+			$previousStepIndex = -1;
1293
+			if ($popStack)
1294 1294
 			{
1295
-				$previousStepIndex=$history->pop();
1296
-				if($activeStepIndex===$previousStepIndex && $history->getCount()>0)
1297
-					$previousStepIndex=$history->pop();
1295
+				$previousStepIndex = $history->pop();
1296
+				if ($activeStepIndex === $previousStepIndex && $history->getCount() > 0)
1297
+					$previousStepIndex = $history->pop();
1298 1298
 			}
1299 1299
 			else
1300 1300
 			{
1301
-				$previousStepIndex=$history->peek();
1302
-				if($activeStepIndex===$previousStepIndex && $history->getCount()>1)
1301
+				$previousStepIndex = $history->peek();
1302
+				if ($activeStepIndex === $previousStepIndex && $history->getCount() > 1)
1303 1303
 				{
1304
-					$saveIndex=$history->pop();
1305
-					$previousStepIndex=$history->peek();
1304
+					$saveIndex = $history->pop();
1305
+					$previousStepIndex = $history->peek();
1306 1306
 					$history->push($saveIndex);
1307 1307
 				}
1308 1308
 			}
1309
-			return $activeStepIndex===$previousStepIndex ? -1 : $previousStepIndex;
1309
+			return $activeStepIndex === $previousStepIndex ? -1 : $previousStepIndex;
1310 1310
 		}
1311 1311
 		else
1312 1312
 			return -1;
@@ -1317,7 +1317,7 @@  discard block
 block discarded – undo
1317 1317
 	 */
1318 1318
 	protected function allowNavigationToPreviousStep()
1319 1319
 	{
1320
-		if(($index=$this->getPreviousStepIndex(false))!==-1)
1320
+		if (($index = $this->getPreviousStepIndex(false)) !== -1)
1321 1321
 			return $this->getWizardSteps()->itemAt($index)->getAllowReturn();
1322 1322
 		else
1323 1323
 			return false;
@@ -1329,7 +1329,7 @@  discard block
 block discarded – undo
1329 1329
 	 */
1330 1330
 	protected function allowNavigationToStep($index)
1331 1331
 	{
1332
-		if($this->getHistory()->contains($index))
1332
+		if ($this->getHistory()->contains($index))
1333 1333
 			return $this->getWizardSteps()->itemAt($index)->getAllowReturn();
1334 1334
 		else
1335 1335
 			return true;
@@ -1343,87 +1343,87 @@  discard block
 block discarded – undo
1343 1343
 	 * @param TEventParameter event parameter
1344 1344
 	 * @throws TInvalidDataValueException if a navigation command is associated with an invalid parameter
1345 1345
 	 */
1346
-	public function bubbleEvent($sender,$param)
1346
+	public function bubbleEvent($sender, $param)
1347 1347
 	{
1348
-		if($param instanceof TCommandEventParameter)
1348
+		if ($param instanceof TCommandEventParameter)
1349 1349
 		{
1350
-			$command=$param->getCommandName();
1351
-			if(strcasecmp($command,self::CMD_CANCEL)===0)
1350
+			$command = $param->getCommandName();
1351
+			if (strcasecmp($command, self::CMD_CANCEL) === 0)
1352 1352
 			{
1353 1353
 				$this->onCancelButtonClick($param);
1354 1354
 				return true;
1355 1355
 			}
1356 1356
 
1357
-			$type=$this->getStepType($this->getActiveStep());
1358
-			$index=$this->getActiveStepIndex();
1359
-			$navParam=new TWizardNavigationEventParameter($index);
1360
-			if(($sender instanceof IButtonControl) && $sender->getCausesValidation() && ($page=$this->getPage())!==null && !$page->getIsValid())
1357
+			$type = $this->getStepType($this->getActiveStep());
1358
+			$index = $this->getActiveStepIndex();
1359
+			$navParam = new TWizardNavigationEventParameter($index);
1360
+			if (($sender instanceof IButtonControl) && $sender->getCausesValidation() && ($page = $this->getPage()) !== null && !$page->getIsValid())
1361 1361
 				$navParam->setCancelNavigation(true);
1362 1362
 
1363
-			$handled=false;
1364
-			$movePrev=false;
1365
-			$this->_activeStepIndexSet=false;
1363
+			$handled = false;
1364
+			$movePrev = false;
1365
+			$this->_activeStepIndexSet = false;
1366 1366
 
1367
-			if(strcasecmp($command,self::CMD_NEXT)===0)
1367
+			if (strcasecmp($command, self::CMD_NEXT) === 0)
1368 1368
 			{
1369
-				if($type!==self::ST_START && $type!==self::ST_STEP)
1370
-					throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_NEXT);
1371
-				if($index<$this->getWizardSteps()->getCount()-1)
1372
-					$navParam->setNextStepIndex($index+1);
1369
+				if ($type !== self::ST_START && $type !== self::ST_STEP)
1370
+					throw new TInvalidDataValueException('wizard_command_invalid', self::CMD_NEXT);
1371
+				if ($index < $this->getWizardSteps()->getCount() - 1)
1372
+					$navParam->setNextStepIndex($index + 1);
1373 1373
 				$this->onNextButtonClick($navParam);
1374
-				$handled=true;
1374
+				$handled = true;
1375 1375
 			}
1376
-			else if(strcasecmp($command,self::CMD_PREVIOUS)===0)
1376
+			else if (strcasecmp($command, self::CMD_PREVIOUS) === 0)
1377 1377
 			{
1378
-				if($type!==self::ST_FINISH && $type!==self::ST_STEP)
1379
-					throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_PREVIOUS);
1380
-				$movePrev=true;
1381
-				if(($prevIndex=$this->getPreviousStepIndex(false))>=0)
1378
+				if ($type !== self::ST_FINISH && $type !== self::ST_STEP)
1379
+					throw new TInvalidDataValueException('wizard_command_invalid', self::CMD_PREVIOUS);
1380
+				$movePrev = true;
1381
+				if (($prevIndex = $this->getPreviousStepIndex(false)) >= 0)
1382 1382
 					$navParam->setNextStepIndex($prevIndex);
1383 1383
 				$this->onPreviousButtonClick($navParam);
1384
-				$handled=true;
1384
+				$handled = true;
1385 1385
 			}
1386
-			else if(strcasecmp($command,self::CMD_COMPLETE)===0)
1386
+			else if (strcasecmp($command, self::CMD_COMPLETE) === 0)
1387 1387
 			{
1388
-				if($type!==self::ST_FINISH)
1389
-					throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_COMPLETE);
1390
-				if($index<$this->getWizardSteps()->getCount()-1)
1391
-					$navParam->setNextStepIndex($index+1);
1388
+				if ($type !== self::ST_FINISH)
1389
+					throw new TInvalidDataValueException('wizard_command_invalid', self::CMD_COMPLETE);
1390
+				if ($index < $this->getWizardSteps()->getCount() - 1)
1391
+					$navParam->setNextStepIndex($index + 1);
1392 1392
 				$this->onCompleteButtonClick($navParam);
1393
-				$handled=true;
1393
+				$handled = true;
1394 1394
 			}
1395
-			else if(strcasecmp($command,self::CMD_MOVETO)===0)
1395
+			else if (strcasecmp($command, self::CMD_MOVETO) === 0)
1396 1396
 			{
1397
-				if($this->_cancelNavigation)  // may be set in onSideBarButtonClick
1397
+				if ($this->_cancelNavigation)  // may be set in onSideBarButtonClick
1398 1398
 					$navParam->setCancelNavigation(true);
1399
-				$requestedStep=$param->getCommandParameter();
1399
+				$requestedStep = $param->getCommandParameter();
1400 1400
 				if (!is_numeric($requestedStep))
1401 1401
 				{
1402
-					$requestedIndex=-1;
1402
+					$requestedIndex = -1;
1403 1403
 					foreach ($this->getWizardSteps() as $index=>$step)
1404
-						if ($step->getId()===$requestedStep)
1404
+						if ($step->getId() === $requestedStep)
1405 1405
 						{
1406
-							$requestedIndex=$index;
1406
+							$requestedIndex = $index;
1407 1407
 							break;
1408 1408
 						}
1409
-					if ($requestedIndex<0)
1409
+					if ($requestedIndex < 0)
1410 1410
 						throw new TConfigurationException('wizard_step_invalid');
1411 1411
 				}
1412 1412
 				else
1413
-					$requestedIndex=TPropertyValue::ensureInteger($requestedStep);
1413
+					$requestedIndex = TPropertyValue::ensureInteger($requestedStep);
1414 1414
 				$navParam->setNextStepIndex($requestedIndex);
1415
-				$handled=true;
1415
+				$handled = true;
1416 1416
 			}
1417 1417
 
1418
-			if($handled)
1418
+			if ($handled)
1419 1419
 			{
1420
-				if(!$navParam->getCancelNavigation())
1420
+				if (!$navParam->getCancelNavigation())
1421 1421
 				{
1422
-					$nextStepIndex=$navParam->getNextStepIndex();
1423
-					if(!$this->_activeStepIndexSet && $this->allowNavigationToStep($nextStepIndex))
1422
+					$nextStepIndex = $navParam->getNextStepIndex();
1423
+					if (!$this->_activeStepIndexSet && $this->allowNavigationToStep($nextStepIndex))
1424 1424
 					{
1425
-						if($movePrev)
1426
-							$this->getPreviousStepIndex(true);  // pop out the previous move from history
1425
+						if ($movePrev)
1426
+							$this->getPreviousStepIndex(true); // pop out the previous move from history
1427 1427
 						$this->setActiveStepIndex($nextStepIndex);
1428 1428
 					}
1429 1429
 				}
@@ -1469,7 +1469,7 @@  discard block
 block discarded – undo
1469 1469
 	 */
1470 1470
 	public function setWizard($wizard)
1471 1471
 	{
1472
-		$this->_wizard=$wizard;
1472
+		$this->_wizard = $wizard;
1473 1473
 	}
1474 1474
 
1475 1475
 	/**
@@ -1477,7 +1477,7 @@  discard block
 block discarded – undo
1477 1477
 	 */
1478 1478
 	public function getTitle()
1479 1479
 	{
1480
-		return $this->getViewState('Title','');
1480
+		return $this->getViewState('Title', '');
1481 1481
 	}
1482 1482
 
1483 1483
 	/**
@@ -1485,8 +1485,8 @@  discard block
 block discarded – undo
1485 1485
 	 */
1486 1486
 	public function setTitle($value)
1487 1487
 	{
1488
-		$this->setViewState('Title',$value,'');
1489
-		if($this->_wizard)
1488
+		$this->setViewState('Title', $value, '');
1489
+		if ($this->_wizard)
1490 1490
 			$this->_wizard->wizardStepsChanged();
1491 1491
 	}
1492 1492
 
@@ -1495,7 +1495,7 @@  discard block
 block discarded – undo
1495 1495
 	 */
1496 1496
 	public function getAllowReturn()
1497 1497
 	{
1498
-		return $this->getViewState('AllowReturn',true);
1498
+		return $this->getViewState('AllowReturn', true);
1499 1499
 	}
1500 1500
 
1501 1501
 	/**
@@ -1503,7 +1503,7 @@  discard block
 block discarded – undo
1503 1503
 	 */
1504 1504
 	public function setAllowReturn($value)
1505 1505
 	{
1506
-		$this->setViewState('AllowReturn',TPropertyValue::ensureBoolean($value),true);
1506
+		$this->setViewState('AllowReturn', TPropertyValue::ensureBoolean($value), true);
1507 1507
 	}
1508 1508
 
1509 1509
 	/**
@@ -1511,7 +1511,7 @@  discard block
 block discarded – undo
1511 1511
 	 */
1512 1512
 	public function getStepType()
1513 1513
 	{
1514
-		return $this->getViewState('StepType',TWizardStepType::Auto);
1514
+		return $this->getViewState('StepType', TWizardStepType::Auto);
1515 1515
 	}
1516 1516
 
1517 1517
 	/**
@@ -1519,11 +1519,11 @@  discard block
 block discarded – undo
1519 1519
 	 */
1520 1520
 	public function setStepType($type)
1521 1521
 	{
1522
-		$type=TPropertyValue::ensureEnum($type,'TWizardStepType');
1523
-		if($type!==$this->getStepType())
1522
+		$type = TPropertyValue::ensureEnum($type, 'TWizardStepType');
1523
+		if ($type !== $this->getStepType())
1524 1524
 		{
1525
-			$this->setViewState('StepType',$type,TWizardStepType::Auto);
1526
-			if($this->_wizard)
1525
+			$this->setViewState('StepType', $type, TWizardStepType::Auto);
1526
+			if ($this->_wizard)
1527 1527
 				$this->_wizard->wizardStepsChanged();
1528 1528
 		}
1529 1529
 	}
@@ -1578,15 +1578,15 @@  discard block
 block discarded – undo
1578 1578
 	/**
1579 1579
 	 * @var ITemplate the template for displaying the navigation UI of a wizard step.
1580 1580
 	 */
1581
-	private $_navigationTemplate=null;
1581
+	private $_navigationTemplate = null;
1582 1582
 	/**
1583 1583
 	 * @var ITemplate the template for displaying the content within the wizard step.
1584 1584
 	 */
1585
-	private $_contentTemplate=null;
1585
+	private $_contentTemplate = null;
1586 1586
 	/**
1587 1587
 	 * @var TWizardNavigationContainer
1588 1588
 	 */
1589
-	private $_navigationContainer=null;
1589
+	private $_navigationContainer = null;
1590 1590
 
1591 1591
 	/**
1592 1592
 	 * Creates child controls.
@@ -1595,7 +1595,7 @@  discard block
 block discarded – undo
1595 1595
 	public function createChildControls()
1596 1596
 	{
1597 1597
 		$this->getControls()->clear();
1598
-		if($this->_contentTemplate)
1598
+		if ($this->_contentTemplate)
1599 1599
 			$this->_contentTemplate->instantiateIn($this);
1600 1600
 	}
1601 1601
 
@@ -1622,7 +1622,7 @@  discard block
 block discarded – undo
1622 1622
 	 */
1623 1623
 	public function setContentTemplate($value)
1624 1624
 	{
1625
-		$this->_contentTemplate=$value;
1625
+		$this->_contentTemplate = $value;
1626 1626
 	}
1627 1627
 
1628 1628
 	/**
@@ -1638,7 +1638,7 @@  discard block
 block discarded – undo
1638 1638
 	 */
1639 1639
 	public function setNavigationTemplate($value)
1640 1640
 	{
1641
-		$this->_navigationTemplate=$value;
1641
+		$this->_navigationTemplate = $value;
1642 1642
 	}
1643 1643
 
1644 1644
 	/**
@@ -1655,9 +1655,9 @@  discard block
 block discarded – undo
1655 1655
 	 */
1656 1656
 	public function instantiateNavigationTemplate()
1657 1657
 	{
1658
-		if(!$this->_navigationContainer && $this->_navigationTemplate)
1658
+		if (!$this->_navigationContainer && $this->_navigationTemplate)
1659 1659
 		{
1660
-			$this->_navigationContainer=new TWizardNavigationContainer;
1660
+			$this->_navigationContainer = new TWizardNavigationContainer;
1661 1661
 			$this->_navigationTemplate->instantiateIn($this->_navigationContainer);
1662 1662
 		}
1663 1663
 	}
@@ -1687,7 +1687,7 @@  discard block
 block discarded – undo
1687 1687
 	 */
1688 1688
 	public function __construct(TWizard $wizard)
1689 1689
 	{
1690
-		$this->_wizard=$wizard;
1690
+		$this->_wizard = $wizard;
1691 1691
 	}
1692 1692
 
1693 1693
 	/**
@@ -1698,12 +1698,12 @@  discard block
 block discarded – undo
1698 1698
 	 * @param mixed new item
1699 1699
 	 * @throws TInvalidDataTypeException if the item being added is not TWizardStep.
1700 1700
 	 */
1701
-	public function insertAt($index,$item)
1701
+	public function insertAt($index, $item)
1702 1702
 	{
1703
-		if($item instanceof TWizardStep)
1703
+		if ($item instanceof TWizardStep)
1704 1704
 		{
1705
-			parent::insertAt($index,$item);
1706
-			$this->_wizard->getMultiView()->getViews()->insertAt($index,$item);
1705
+			parent::insertAt($index, $item);
1706
+			$this->_wizard->getMultiView()->getViews()->insertAt($index, $item);
1707 1707
 			$this->_wizard->addedWizardStep($item);
1708 1708
 		}
1709 1709
 		else
@@ -1717,7 +1717,7 @@  discard block
 block discarded – undo
1717 1717
 	 */
1718 1718
 	public function removeAt($index)
1719 1719
 	{
1720
-		$step=parent::removeAt($index);
1720
+		$step = parent::removeAt($index);
1721 1721
 		$this->_wizard->getMultiView()->getViews()->remove($step);
1722 1722
 		$this->_wizard->removedWizardStep($step);
1723 1723
 		return $step;
@@ -1739,10 +1739,10 @@  discard block
 block discarded – undo
1739 1739
  */
1740 1740
 class TWizardNavigationContainer extends TControl implements INamingContainer
1741 1741
 {
1742
-	private $_previousButton=null;
1743
-	private $_nextButton=null;
1744
-	private $_cancelButton=null;
1745
-	private $_completeButton=null;
1742
+	private $_previousButton = null;
1743
+	private $_nextButton = null;
1744
+	private $_cancelButton = null;
1745
+	private $_completeButton = null;
1746 1746
 
1747 1747
 	/**
1748 1748
 	 * @return mixed the previous button
@@ -1757,7 +1757,7 @@  discard block
 block discarded – undo
1757 1757
 	 */
1758 1758
 	public function setPreviousButton($value)
1759 1759
 	{
1760
-		$this->_previousButton=$value;
1760
+		$this->_previousButton = $value;
1761 1761
 	}
1762 1762
 
1763 1763
 	/**
@@ -1773,7 +1773,7 @@  discard block
 block discarded – undo
1773 1773
 	 */
1774 1774
 	public function setNextButton($value)
1775 1775
 	{
1776
-		$this->_nextButton=$value;
1776
+		$this->_nextButton = $value;
1777 1777
 	}
1778 1778
 
1779 1779
 	/**
@@ -1789,7 +1789,7 @@  discard block
 block discarded – undo
1789 1789
 	 */
1790 1790
 	public function setCancelButton($value)
1791 1791
 	{
1792
-		$this->_cancelButton=$value;
1792
+		$this->_cancelButton = $value;
1793 1793
 	}
1794 1794
 
1795 1795
 	/**
@@ -1805,7 +1805,7 @@  discard block
 block discarded – undo
1805 1805
 	 */
1806 1806
 	public function setCompleteButton($value)
1807 1807
 	{
1808
-		$this->_completeButton=$value;
1808
+		$this->_completeButton = $value;
1809 1809
 	}
1810 1810
 }
1811 1811
 
@@ -1830,7 +1830,7 @@  discard block
 block discarded – undo
1830 1830
  */
1831 1831
 class TWizardNavigationEventParameter extends TEventParameter
1832 1832
 {
1833
-	private $_cancel=false;
1833
+	private $_cancel = false;
1834 1834
 	private $_currentStep;
1835 1835
 	private $_nextStep;
1836 1836
 
@@ -1840,8 +1840,8 @@  discard block
 block discarded – undo
1840 1840
 	 */
1841 1841
 	public function __construct($currentStep)
1842 1842
 	{
1843
-		$this->_currentStep=$currentStep;
1844
-		$this->_nextStep=$currentStep;
1843
+		$this->_currentStep = $currentStep;
1844
+		$this->_nextStep = $currentStep;
1845 1845
 	}
1846 1846
 
1847 1847
 	/**
@@ -1865,7 +1865,7 @@  discard block
 block discarded – undo
1865 1865
 	 */
1866 1866
 	public function setNextStepIndex($index)
1867 1867
 	{
1868
-		$this->_nextStep=TPropertyValue::ensureInteger($index);
1868
+		$this->_nextStep = TPropertyValue::ensureInteger($index);
1869 1869
 	}
1870 1870
 
1871 1871
 	/**
@@ -1881,7 +1881,7 @@  discard block
 block discarded – undo
1881 1881
 	 */
1882 1882
 	public function setCancelNavigation($value)
1883 1883
 	{
1884
-		$this->_cancel=TPropertyValue::ensureBoolean($value);
1884
+		$this->_cancel = TPropertyValue::ensureBoolean($value);
1885 1885
 	}
1886 1886
 }
1887 1887
 
@@ -1901,7 +1901,7 @@  discard block
 block discarded – undo
1901 1901
 	 */
1902 1902
 	public function instantiateIn($parent)
1903 1903
 	{
1904
-		$dataList=new TDataList;
1904
+		$dataList = new TDataList;
1905 1905
 		$dataList->setID(TWizard::ID_SIDEBAR_LIST);
1906 1906
 		$dataList->getSelectedItemStyle()->getFont()->setBold(true);
1907 1907
 		$dataList->setItemTemplate(new TWizardSideBarListItemTemplate);
@@ -1925,7 +1925,7 @@  discard block
 block discarded – undo
1925 1925
 	 */
1926 1926
 	public function instantiateIn($parent)
1927 1927
 	{
1928
-		$button=new TLinkButton;
1928
+		$button = new TLinkButton;
1929 1929
 		$button->setID(TWizard::ID_SIDEBAR_BUTTON);
1930 1930
 		$parent->getControls()->add($button);
1931 1931
 	}
@@ -1948,7 +1948,7 @@  discard block
 block discarded – undo
1948 1948
 	 */
1949 1949
 	public function __construct($wizard)
1950 1950
 	{
1951
-		$this->_wizard=$wizard;
1951
+		$this->_wizard = $wizard;
1952 1952
 	}
1953 1953
 
1954 1954
 	/**
@@ -1977,22 +1977,22 @@  discard block
 block discarded – undo
1977 1977
 	 * @param string command name for the button's OnCommand event
1978 1978
 	 * @throws TInvalidDataValueException if the button type is not recognized
1979 1979
 	 */
1980
-	protected function createNavigationButton($buttonStyle,$causesValidation,$commandName)
1980
+	protected function createNavigationButton($buttonStyle, $causesValidation, $commandName)
1981 1981
 	{
1982
-		switch($buttonStyle->getButtonType())
1982
+		switch ($buttonStyle->getButtonType())
1983 1983
 		{
1984 1984
 			case TWizardNavigationButtonType::Button:
1985
-				$button=new TButton;
1985
+				$button = new TButton;
1986 1986
 				break;
1987 1987
 			case TWizardNavigationButtonType::Link:
1988
-				$button=new TLinkButton;
1988
+				$button = new TLinkButton;
1989 1989
 				break;
1990 1990
 			case TWizardNavigationButtonType::Image:
1991
-				$button=new TImageButton;
1991
+				$button = new TImageButton;
1992 1992
 				$button->setImageUrl($buttonStyle->getImageUrl());
1993 1993
 				break;
1994 1994
 			default:
1995
-				throw new TInvalidDataValueException('wizard_buttontype_unknown',$buttonStyle->getButtonType());
1995
+				throw new TInvalidDataValueException('wizard_buttontype_unknown', $buttonStyle->getButtonType());
1996 1996
 		}
1997 1997
 		$button->setText($buttonStyle->getButtonText());
1998 1998
 		$button->setCausesValidation($causesValidation);
@@ -2017,10 +2017,10 @@  discard block
 block discarded – undo
2017 2017
 	 */
2018 2018
 	public function instantiateIn($parent)
2019 2019
 	{
2020
-		$nextButton=$this->createNavigationButton($this->getWizard()->getStartNextButtonStyle(),true,TWizard::CMD_NEXT);
2021
-		$cancelButton=$this->createNavigationButton($this->getWizard()->getCancelButtonStyle(),false,TWizard::CMD_CANCEL);
2020
+		$nextButton = $this->createNavigationButton($this->getWizard()->getStartNextButtonStyle(), true, TWizard::CMD_NEXT);
2021
+		$cancelButton = $this->createNavigationButton($this->getWizard()->getCancelButtonStyle(), false, TWizard::CMD_CANCEL);
2022 2022
 
2023
-		$controls=$parent->getControls();
2023
+		$controls = $parent->getControls();
2024 2024
 		$controls->add($nextButton);
2025 2025
 		$controls->add("\n");
2026 2026
 		$controls->add($cancelButton);
@@ -2046,11 +2046,11 @@  discard block
 block discarded – undo
2046 2046
 	 */
2047 2047
 	public function instantiateIn($parent)
2048 2048
 	{
2049
-		$previousButton=$this->createNavigationButton($this->getWizard()->getFinishPreviousButtonStyle(),false,TWizard::CMD_PREVIOUS);
2050
-		$completeButton=$this->createNavigationButton($this->getWizard()->getFinishCompleteButtonStyle(),true,TWizard::CMD_COMPLETE);
2051
-		$cancelButton=$this->createNavigationButton($this->getWizard()->getCancelButtonStyle(),false,TWizard::CMD_CANCEL);
2049
+		$previousButton = $this->createNavigationButton($this->getWizard()->getFinishPreviousButtonStyle(), false, TWizard::CMD_PREVIOUS);
2050
+		$completeButton = $this->createNavigationButton($this->getWizard()->getFinishCompleteButtonStyle(), true, TWizard::CMD_COMPLETE);
2051
+		$cancelButton = $this->createNavigationButton($this->getWizard()->getCancelButtonStyle(), false, TWizard::CMD_CANCEL);
2052 2052
 
2053
-		$controls=$parent->getControls();
2053
+		$controls = $parent->getControls();
2054 2054
 		$controls->add($previousButton);
2055 2055
 		$controls->add("\n");
2056 2056
 		$controls->add($completeButton);
@@ -2079,11 +2079,11 @@  discard block
 block discarded – undo
2079 2079
 	 */
2080 2080
 	public function instantiateIn($parent)
2081 2081
 	{
2082
-		$previousButton=$this->createNavigationButton($this->getWizard()->getStepPreviousButtonStyle(),false,TWizard::CMD_PREVIOUS);
2083
-		$nextButton=$this->createNavigationButton($this->getWizard()->getStepNextButtonStyle(),true,TWizard::CMD_NEXT);
2084
-		$cancelButton=$this->createNavigationButton($this->getWizard()->getCancelButtonStyle(),false,TWizard::CMD_CANCEL);
2082
+		$previousButton = $this->createNavigationButton($this->getWizard()->getStepPreviousButtonStyle(), false, TWizard::CMD_PREVIOUS);
2083
+		$nextButton = $this->createNavigationButton($this->getWizard()->getStepNextButtonStyle(), true, TWizard::CMD_NEXT);
2084
+		$cancelButton = $this->createNavigationButton($this->getWizard()->getCancelButtonStyle(), false, TWizard::CMD_CANCEL);
2085 2085
 
2086
-		$controls=$parent->getControls();
2086
+		$controls = $parent->getControls();
2087 2087
 		$controls->add($previousButton);
2088 2088
 		$controls->add("\n");
2089 2089
 		$controls->add($nextButton);
@@ -2113,9 +2113,9 @@  discard block
 block discarded – undo
2113 2113
  */
2114 2114
 class TWizardNavigationButtonType extends TEnumerable
2115 2115
 {
2116
-	const Button='Button';
2117
-	const Image='Image';
2118
-	const Link='Link';
2116
+	const Button = 'Button';
2117
+	const Image = 'Image';
2118
+	const Link = 'Link';
2119 2119
 }
2120 2120
 
2121 2121
 
@@ -2136,10 +2136,10 @@  discard block
 block discarded – undo
2136 2136
  */
2137 2137
 class TWizardStepType extends TEnumerable
2138 2138
 {
2139
-	const Auto='Auto';
2140
-	const Complete='Complete';
2141
-	const Start='Start';
2142
-	const Step='Step';
2143
-	const Finish='Finish';
2139
+	const Auto = 'Auto';
2140
+	const Complete = 'Complete';
2141
+	const Start = 'Start';
2142
+	const Step = 'Step';
2143
+	const Finish = 'Finish';
2144 2144
 }
2145 2145
 
Please login to merge, or discard this patch.
Braces   +199 added lines, -150 removed lines patch added patch discarded remove patch
@@ -192,8 +192,9 @@  discard block
 block discarded – undo
192 192
 	 */
193 193
 	public function addParsedObject($object)
194 194
 	{
195
-		if($object instanceof TWizardStep)
196
-			$this->getWizardSteps()->add($object);
195
+		if($object instanceof TWizardStep) {
196
+					$this->getWizardSteps()->add($object);
197
+		}
197 198
 	}
198 199
 
199 200
 	/**
@@ -210,8 +211,9 @@  discard block
 block discarded – undo
210 211
 	 */
211 212
 	public function setActiveStep($step)
212 213
 	{
213
-		if(($index=$this->getWizardSteps()->indexOf($step))<0)
214
-			throw new TInvalidOperationException('wizard_step_invalid');
214
+		if(($index=$this->getWizardSteps()->indexOf($step))<0) {
215
+					throw new TInvalidOperationException('wizard_step_invalid');
216
+		}
215 217
 		$this->setActiveStepIndex($index);
216 218
 	}
217 219
 
@@ -247,8 +249,9 @@  discard block
 block discarded – undo
247 249
 	 */
248 250
 	public function getWizardSteps()
249 251
 	{
250
-		if($this->_wizardSteps===null)
251
-			$this->_wizardSteps=new TWizardStepCollection($this);
252
+		if($this->_wizardSteps===null) {
253
+					$this->_wizardSteps=new TWizardStepCollection($this);
254
+		}
252 255
 		return $this->_wizardSteps;
253 256
 	}
254 257
 
@@ -668,8 +671,9 @@  discard block
 block discarded – undo
668 671
 	public function onCancelButtonClick($param)
669 672
 	{
670 673
 		$this->raiseEvent('OnCancelButtonClick',$this,$param);
671
-		if(($url=$this->getCancelDestinationUrl())!=='')
672
-			$this->getResponse()->redirect($url);
674
+		if(($url=$this->getCancelDestinationUrl())!=='') {
675
+					$this->getResponse()->redirect($url);
676
+		}
673 677
 	}
674 678
 
675 679
 	/**
@@ -681,8 +685,9 @@  discard block
 block discarded – undo
681 685
 	public function onCompleteButtonClick($param)
682 686
 	{
683 687
 		$this->raiseEvent('OnCompleteButtonClick',$this,$param);
684
-		if(($url=$this->getFinishDestinationUrl())!=='')
685
-			$this->getResponse()->redirect($url);
688
+		if(($url=$this->getFinishDestinationUrl())!=='') {
689
+					$this->getResponse()->redirect($url);
690
+		}
686 691
 	}
687 692
 
688 693
 	/**
@@ -742,8 +747,9 @@  discard block
 block discarded – undo
742 747
 	 */
743 748
 	public function addedWizardStep($step)
744 749
 	{
745
-		if(($wizard=$step->getWizard())!==null)
746
-			$wizard->getWizardSteps()->remove($step);
750
+		if(($wizard=$step->getWizard())!==null) {
751
+					$wizard->getWizardSteps()->remove($step);
752
+		}
747 753
 		$step->setWizard($this);
748 754
 		$this->wizardStepsChanged();
749 755
 	}
@@ -770,8 +776,9 @@  discard block
 block discarded – undo
770 776
 		parent::onInit($param);
771 777
 		$this->ensureChildControls();
772 778
 		$this->setEnsureId(true);
773
-		if($this->getActiveStepIndex()<0 && $this->getWizardSteps()->getCount()>0)
774
-			$this->setActiveStepIndex(0);
779
+		if($this->getActiveStepIndex()<0 && $this->getWizardSteps()->getCount()>0) {
780
+					$this->setActiveStepIndex(0);
781
+		}
775 782
 	}
776 783
 
777 784
 	/**
@@ -782,8 +789,9 @@  discard block
 block discarded – undo
782 789
 	{
783 790
 		$index=$this->getActiveStepIndex();
784 791
 		$history=$this->getHistory();
785
-		if(!$history->getCount() || $history->peek()!==$index)
786
-			$history->push($index);
792
+		if(!$history->getCount() || $history->peek()!==$index) {
793
+					$history->push($index);
794
+		}
787 795
 	}
788 796
 
789 797
 	/**
@@ -791,8 +799,9 @@  discard block
 block discarded – undo
791 799
 	 */
792 800
 	protected function requiresControlsRecreation()
793 801
 	{
794
-		if($this->getChildControlsCreated())
795
-			$this->setChildControlsCreated(false);
802
+		if($this->getChildControlsCreated()) {
803
+					$this->setChildControlsCreated(false);
804
+		}
796 805
 	}
797 806
 
798 807
 	/**
@@ -816,8 +825,7 @@  discard block
 block discarded – undo
816 825
 				$this->_navigation->renderControl($writer);
817 826
 				$writer->write("\n</td></tr></table>\n");
818 827
 				$this->renderEndTag($writer);
819
-			}
820
-			else
828
+			} else
821 829
 			{
822 830
 				$this->applyControlProperties();
823 831
 				$this->renderBeginTag($writer);
@@ -846,8 +854,9 @@  discard block
 block discarded – undo
846 854
 	 */
847 855
 	protected function applyHeaderProperties()
848 856
 	{
849
-		if(($style=$this->getViewState('HeaderStyle',null))!==null)
850
-			$this->_header->getStyle()->mergeWith($style);
857
+		if(($style=$this->getViewState('HeaderStyle',null))!==null) {
858
+					$this->_header->getStyle()->mergeWith($style);
859
+		}
851 860
 		if($this->getHeaderTemplate()===null)
852 861
 		{
853 862
 			$this->_header->getControls()->clear();
@@ -870,13 +879,15 @@  discard block
 block discarded – undo
870 879
 			{
871 880
 				foreach($this->_sideBarDataList->getItems() as $item)
872 881
 				{
873
-					if(($button=$item->findControl('SideBarButton'))!==null)
874
-						$button->getStyle()->mergeWith($style);
882
+					if(($button=$item->findControl('SideBarButton'))!==null) {
883
+											$button->getStyle()->mergeWith($style);
884
+					}
875 885
 				}
876 886
 			}
877 887
 		}
878
-		if(($style=$this->getViewState('SideBarStyle',null))!==null)
879
-			$this->_sideBar->getStyle()->mergeWith($style);
888
+		if(($style=$this->getViewState('SideBarStyle',null))!==null) {
889
+					$this->_sideBar->getStyle()->mergeWith($style);
890
+		}
880 891
 	}
881 892
 
882 893
 	/**
@@ -884,8 +895,9 @@  discard block
 block discarded – undo
884 895
 	 */
885 896
 	protected function applyStepContentProperties()
886 897
 	{
887
-		if(($style=$this->getViewState('StepStyle',null))!==null)
888
-			$this->_stepContent->getStyle()->mergeWith($style);
898
+		if(($style=$this->getViewState('StepStyle',null))!==null) {
899
+					$this->_stepContent->getStyle()->mergeWith($style);
900
+		}
889 901
 	}
890 902
 
891 903
 	/**
@@ -897,9 +909,9 @@  discard block
 block discarded – undo
897 909
 		$activeStep=$this->getActiveStep();
898 910
 		$activeStepIndex=$this->getActiveStepIndex();
899 911
 
900
-		if(!$this->_navigation)
901
-			return;
902
-		else if($activeStepIndex<0 || $activeStepIndex>=$wizardSteps->getCount())
912
+		if(!$this->_navigation) {
913
+					return;
914
+		} else if($activeStepIndex<0 || $activeStepIndex>=$wizardSteps->getCount())
903 915
 		{
904 916
 			$this->_navigation->setVisible(false);
905 917
 			return;
@@ -915,9 +927,9 @@  discard block
 block discarded – undo
915 927
 				{
916 928
 					$container->setVisible(true);
917 929
 					$showStandard=false;
930
+				} else {
931
+									$container->setVisible(false);
918 932
 				}
919
-				else
920
-					$container->setVisible(false);
921 933
 			}
922 934
 		}
923 935
 		$activeStepType=$this->getStepType($activeStep);
@@ -930,14 +942,16 @@  discard block
 block discarded – undo
930 942
 		$this->_stepNavigation->setVisible($showStandard && $activeStepType===self::ST_STEP);
931 943
 		$this->_finishNavigation->setVisible($showStandard && $activeStepType===self::ST_FINISH);
932 944
 
933
-		if(($navigationStyle=$this->getViewState('NavigationStyle',null))!==null)
934
-			$this->_navigation->getStyle()->mergeWith($navigationStyle);
945
+		if(($navigationStyle=$this->getViewState('NavigationStyle',null))!==null) {
946
+					$this->_navigation->getStyle()->mergeWith($navigationStyle);
947
+		}
935 948
 
936 949
 		$displayCancelButton=$this->getShowCancelButton();
937 950
 		$cancelButtonStyle=$this->getCancelButtonStyle();
938 951
 		$buttonStyle=$this->getViewState('NavigationButtonStyle',null);
939
-		if($buttonStyle!==null)
940
-			$cancelButtonStyle->mergeWith($buttonStyle);
952
+		if($buttonStyle!==null) {
953
+					$cancelButtonStyle->mergeWith($buttonStyle);
954
+		}
941 955
 
942 956
 		// apply styles to start navigation buttons
943 957
 		if(($cancelButton=$this->_startNavigation->getCancelButton())!==null)
@@ -949,11 +963,13 @@  discard block
 block discarded – undo
949 963
 		{
950 964
 			$button->setVisible(true);
951 965
 			$style=$this->getStartNextButtonStyle();
952
-			if($buttonStyle!==null)
953
-				$style->mergeWith($buttonStyle);
966
+			if($buttonStyle!==null) {
967
+							$style->mergeWith($buttonStyle);
968
+			}
954 969
 			$style->apply($button);
955
-			if($activeStepType===TWizardStepType::Start)
956
-				$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
970
+			if($activeStepType===TWizardStepType::Start) {
971
+							$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
972
+			}
957 973
 		}
958 974
 
959 975
 		// apply styles to finish navigation buttons
@@ -966,19 +982,22 @@  discard block
 block discarded – undo
966 982
 		{
967 983
 			$button->setVisible($this->allowNavigationToPreviousStep());
968 984
 			$style=$this->getFinishPreviousButtonStyle();
969
-			if($buttonStyle!==null)
970
-				$style->mergeWith($buttonStyle);
985
+			if($buttonStyle!==null) {
986
+							$style->mergeWith($buttonStyle);
987
+			}
971 988
 			$style->apply($button);
972 989
 		}
973 990
 		if(($button=$this->_finishNavigation->getCompleteButton())!==null)
974 991
 		{
975 992
 			$button->setVisible(true);
976 993
 			$style=$this->getFinishCompleteButtonStyle();
977
-			if($buttonStyle!==null)
978
-				$style->mergeWith($buttonStyle);
994
+			if($buttonStyle!==null) {
995
+							$style->mergeWith($buttonStyle);
996
+			}
979 997
 			$style->apply($button);
980
-			if($activeStepType===TWizardStepType::Finish)
981
-				$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
998
+			if($activeStepType===TWizardStepType::Finish) {
999
+							$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
1000
+			}
982 1001
 		}
983 1002
 
984 1003
 		// apply styles to step navigation buttons
@@ -991,19 +1010,22 @@  discard block
 block discarded – undo
991 1010
 		{
992 1011
 			$button->setVisible($this->allowNavigationToPreviousStep());
993 1012
 			$style=$this->getStepPreviousButtonStyle();
994
-			if($buttonStyle!==null)
995
-				$style->mergeWith($buttonStyle);
1013
+			if($buttonStyle!==null) {
1014
+							$style->mergeWith($buttonStyle);
1015
+			}
996 1016
 			$style->apply($button);
997 1017
 		}
998 1018
 		if(($button=$this->_stepNavigation->getNextButton())!==null)
999 1019
 		{
1000 1020
 			$button->setVisible(true);
1001 1021
 			$style=$this->getStepNextButtonStyle();
1002
-			if($buttonStyle!==null)
1003
-				$style->mergeWith($buttonStyle);
1022
+			if($buttonStyle!==null) {
1023
+							$style->mergeWith($buttonStyle);
1024
+			}
1004 1025
 			$style->apply($button);
1005
-			if($activeStepType===TWizardStepType::Step)
1006
-				$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
1026
+			if($activeStepType===TWizardStepType::Step) {
1027
+							$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
1028
+			}
1007 1029
 		}
1008 1030
 	}
1009 1031
 
@@ -1033,20 +1055,21 @@  discard block
 block discarded – undo
1033 1055
 			if(($index=$steps->indexOf($wizardStep))>=0)
1034 1056
 			{
1035 1057
 				$stepCount=$steps->getCount();
1036
-				if($stepCount===1 || ($index<$stepCount-1 && $steps->itemAt($index+1)->getStepType()===TWizardStepType::Complete))
1037
-					return TWizardStepType::Finish;
1038
-				else if($index===0)
1039
-					return TWizardStepType::Start;
1040
-				else if($index===$stepCount-1)
1041
-					return TWizardStepType::Finish;
1042
-				else
1043
-					return TWizardStepType::Step;
1058
+				if($stepCount===1 || ($index<$stepCount-1 && $steps->itemAt($index+1)->getStepType()===TWizardStepType::Complete)) {
1059
+									return TWizardStepType::Finish;
1060
+				} else if($index===0) {
1061
+									return TWizardStepType::Start;
1062
+				} else if($index===$stepCount-1) {
1063
+									return TWizardStepType::Finish;
1064
+				} else {
1065
+									return TWizardStepType::Step;
1066
+				}
1067
+			} else {
1068
+							return $type;
1044 1069
 			}
1045
-			else
1046
-				return $type;
1070
+		} else {
1071
+					return $type;
1047 1072
 		}
1048
-		else
1049
-			return $type;
1050 1073
 	}
1051 1074
 
1052 1075
 	/**
@@ -1084,10 +1107,11 @@  discard block
 block discarded – undo
1084 1107
 	protected function createHeader()
1085 1108
 	{
1086 1109
 		$this->_header=new TPanel;
1087
-		if(($template=$this->getHeaderTemplate())!==null)
1088
-			$template->instantiateIn($this->_header);
1089
-		else
1090
-			$this->_header->getControls()->add($this->getHeaderText());
1110
+		if(($template=$this->getHeaderTemplate())!==null) {
1111
+					$template->instantiateIn($this->_header);
1112
+		} else {
1113
+					$this->_header->getControls()->add($this->getHeaderText());
1114
+		}
1091 1115
 		$this->getControls()->add($this->_header);
1092 1116
 	}
1093 1117
 
@@ -1098,8 +1122,9 @@  discard block
 block discarded – undo
1098 1122
 	{
1099 1123
 		if($this->getShowSideBar())
1100 1124
 		{
1101
-			if(($template=$this->getSideBarTemplate())===null)
1102
-				$template=new TWizardSideBarTemplate;
1125
+			if(($template=$this->getSideBarTemplate())===null) {
1126
+							$template=new TWizardSideBarTemplate;
1127
+			}
1103 1128
 			$this->_sideBar=new TPanel;
1104 1129
 			$template->instantiateIn($this->_sideBar);
1105 1130
 			$this->getControls()->add($this->_sideBar);
@@ -1112,8 +1137,7 @@  discard block
 block discarded – undo
1112 1137
 				$this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex());
1113 1138
 				$this->_sideBarDataList->dataBind();
1114 1139
 			}
1115
-		}
1116
-		else
1140
+		} else
1117 1141
 		{
1118 1142
 			$this->_sideBar=new TPanel;
1119 1143
 			$this->getControls()->add($this->_sideBar);
@@ -1140,19 +1164,21 @@  discard block
 block discarded – undo
1140 1164
 			// if the button clicked causes validation which fails,
1141 1165
 			// by default we will cancel navigation to the new step
1142 1166
 			$button=$param->getCommandSource();
1143
-			if(($button instanceof IButtonControl) && $button->getCausesValidation() && ($page=$this->getPage())!==null && !$page->getIsValid())
1144
-				$navParam->setCancelNavigation(true);
1167
+			if(($button instanceof IButtonControl) && $button->getCausesValidation() && ($page=$this->getPage())!==null && !$page->getIsValid()) {
1168
+							$navParam->setCancelNavigation(true);
1169
+			}
1145 1170
 
1146 1171
 			$this->_activeStepIndexSet=false;
1147 1172
 			$this->onSideBarButtonClick($navParam);
1148 1173
 			$this->_cancelNavigation=$navParam->getCancelNavigation();
1149 1174
 			if(!$this->_cancelNavigation)
1150 1175
 			{
1151
-				if(!$this->_activeStepIndexSet && $this->allowNavigationToStep($newStepIndex))
1152
-					$this->setActiveStepIndex($newStepIndex);
1176
+				if(!$this->_activeStepIndexSet && $this->allowNavigationToStep($newStepIndex)) {
1177
+									$this->setActiveStepIndex($newStepIndex);
1178
+				}
1179
+			} else {
1180
+							$this->setActiveStepIndex($stepIndex);
1153 1181
 			}
1154
-			else
1155
-				$this->setActiveStepIndex($stepIndex);
1156 1182
 		}
1157 1183
 	}
1158 1184
 
@@ -1172,12 +1198,14 @@  discard block
 block discarded – undo
1172 1198
 			if(($button=$item->findControl(self::ID_SIDEBAR_BUTTON))!==null)
1173 1199
 			{
1174 1200
 				$step=$item->getData();
1175
-				if(($this->getStepType($step)===TWizardStepType::Complete))
1176
-					$button->setEnabled(false);
1177
-				if(($title=$step->getTitle())!=='')
1178
-					$button->setText($title);
1179
-				else
1180
-					$button->setText($step->getID(false));
1201
+				if(($this->getStepType($step)===TWizardStepType::Complete)) {
1202
+									$button->setEnabled(false);
1203
+				}
1204
+				if(($title=$step->getTitle())!=='') {
1205
+									$button->setText($title);
1206
+				} else {
1207
+									$button->setText($step->getID(false));
1208
+				}
1181 1209
 				$index=$this->getWizardSteps()->indexOf($step);
1182 1210
 				$button->setCommandName(self::CMD_MOVETO);
1183 1211
 				$button->setCommandParameter("$index");
@@ -1192,15 +1220,17 @@  discard block
 block discarded – undo
1192 1220
 	{
1193 1221
 		foreach($this->getWizardSteps() as $step)
1194 1222
 		{
1195
-			if($step instanceof TTemplatedWizardStep)
1196
-				$step->ensureChildControls();
1223
+			if($step instanceof TTemplatedWizardStep) {
1224
+							$step->ensureChildControls();
1225
+			}
1197 1226
 		}
1198 1227
 		$multiView=$this->getMultiView();
1199 1228
 		$this->_stepContent=new TPanel;
1200 1229
 		$this->_stepContent->getControls()->add($multiView);
1201 1230
 		$this->getControls()->add($this->_stepContent);
1202
-		if($multiView->getViews()->getCount())
1203
-			$multiView->setActiveViewIndex(0);
1231
+		if($multiView->getViews()->getCount()) {
1232
+					$multiView->setActiveViewIndex(0);
1233
+		}
1204 1234
 	}
1205 1235
 
1206 1236
 	/**
@@ -1216,8 +1246,9 @@  discard block
 block discarded – undo
1216 1246
 			if($step instanceof TTemplatedWizardStep)
1217 1247
 			{
1218 1248
 				$step->instantiateNavigationTemplate();
1219
-				if(($panel=$step->getNavigationContainer())!==null)
1220
-					$controls->add($panel);
1249
+				if(($panel=$step->getNavigationContainer())!==null) {
1250
+									$controls->add($panel);
1251
+				}
1221 1252
 			}
1222 1253
 		}
1223 1254
 		$this->_startNavigation=$this->createStartNavigation();
@@ -1233,8 +1264,9 @@  discard block
 block discarded – undo
1233 1264
 	 */
1234 1265
 	protected function createStartNavigation()
1235 1266
 	{
1236
-		if(($template=$this->getStartNavigationTemplate())===null)
1237
-			$template=new TWizardStartNavigationTemplate($this);
1267
+		if(($template=$this->getStartNavigationTemplate())===null) {
1268
+					$template=new TWizardStartNavigationTemplate($this);
1269
+		}
1238 1270
 		$navigation=new TWizardNavigationContainer;
1239 1271
 		$template->instantiateIn($navigation);
1240 1272
 		return $navigation;
@@ -1245,8 +1277,9 @@  discard block
 block discarded – undo
1245 1277
 	 */
1246 1278
 	protected function createStepNavigation()
1247 1279
 	{
1248
-		if(($template=$this->getStepNavigationTemplate())===null)
1249
-			$template=new TWizardStepNavigationTemplate($this);
1280
+		if(($template=$this->getStepNavigationTemplate())===null) {
1281
+					$template=new TWizardStepNavigationTemplate($this);
1282
+		}
1250 1283
 		$navigation=new TWizardNavigationContainer;
1251 1284
 		$template->instantiateIn($navigation);
1252 1285
 		return $navigation;
@@ -1257,8 +1290,9 @@  discard block
 block discarded – undo
1257 1290
 	 */
1258 1291
 	protected function createFinishNavigation()
1259 1292
 	{
1260
-		if(($template=$this->getFinishNavigationTemplate())===null)
1261
-			$template=new TWizardFinishNavigationTemplate($this);
1293
+		if(($template=$this->getFinishNavigationTemplate())===null) {
1294
+					$template=new TWizardFinishNavigationTemplate($this);
1295
+		}
1262 1296
 		$navigation=new TWizardNavigationContainer;
1263 1297
 		$template->instantiateIn($navigation);
1264 1298
 		return $navigation;
@@ -1293,10 +1327,10 @@  discard block
 block discarded – undo
1293 1327
 			if($popStack)
1294 1328
 			{
1295 1329
 				$previousStepIndex=$history->pop();
1296
-				if($activeStepIndex===$previousStepIndex && $history->getCount()>0)
1297
-					$previousStepIndex=$history->pop();
1298
-			}
1299
-			else
1330
+				if($activeStepIndex===$previousStepIndex && $history->getCount()>0) {
1331
+									$previousStepIndex=$history->pop();
1332
+				}
1333
+			} else
1300 1334
 			{
1301 1335
 				$previousStepIndex=$history->peek();
1302 1336
 				if($activeStepIndex===$previousStepIndex && $history->getCount()>1)
@@ -1307,9 +1341,9 @@  discard block
 block discarded – undo
1307 1341
 				}
1308 1342
 			}
1309 1343
 			return $activeStepIndex===$previousStepIndex ? -1 : $previousStepIndex;
1344
+		} else {
1345
+					return -1;
1310 1346
 		}
1311
-		else
1312
-			return -1;
1313 1347
 	}
1314 1348
 
1315 1349
 	/**
@@ -1317,10 +1351,11 @@  discard block
 block discarded – undo
1317 1351
 	 */
1318 1352
 	protected function allowNavigationToPreviousStep()
1319 1353
 	{
1320
-		if(($index=$this->getPreviousStepIndex(false))!==-1)
1321
-			return $this->getWizardSteps()->itemAt($index)->getAllowReturn();
1322
-		else
1323
-			return false;
1354
+		if(($index=$this->getPreviousStepIndex(false))!==-1) {
1355
+					return $this->getWizardSteps()->itemAt($index)->getAllowReturn();
1356
+		} else {
1357
+					return false;
1358
+		}
1324 1359
 	}
1325 1360
 
1326 1361
 	/**
@@ -1329,10 +1364,11 @@  discard block
 block discarded – undo
1329 1364
 	 */
1330 1365
 	protected function allowNavigationToStep($index)
1331 1366
 	{
1332
-		if($this->getHistory()->contains($index))
1333
-			return $this->getWizardSteps()->itemAt($index)->getAllowReturn();
1334
-		else
1335
-			return true;
1367
+		if($this->getHistory()->contains($index)) {
1368
+					return $this->getWizardSteps()->itemAt($index)->getAllowReturn();
1369
+		} else {
1370
+					return true;
1371
+		}
1336 1372
 	}
1337 1373
 
1338 1374
 	/**
@@ -1357,8 +1393,9 @@  discard block
 block discarded – undo
1357 1393
 			$type=$this->getStepType($this->getActiveStep());
1358 1394
 			$index=$this->getActiveStepIndex();
1359 1395
 			$navParam=new TWizardNavigationEventParameter($index);
1360
-			if(($sender instanceof IButtonControl) && $sender->getCausesValidation() && ($page=$this->getPage())!==null && !$page->getIsValid())
1361
-				$navParam->setCancelNavigation(true);
1396
+			if(($sender instanceof IButtonControl) && $sender->getCausesValidation() && ($page=$this->getPage())!==null && !$page->getIsValid()) {
1397
+							$navParam->setCancelNavigation(true);
1398
+			}
1362 1399
 
1363 1400
 			$handled=false;
1364 1401
 			$movePrev=false;
@@ -1366,51 +1403,58 @@  discard block
 block discarded – undo
1366 1403
 
1367 1404
 			if(strcasecmp($command,self::CMD_NEXT)===0)
1368 1405
 			{
1369
-				if($type!==self::ST_START && $type!==self::ST_STEP)
1370
-					throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_NEXT);
1371
-				if($index<$this->getWizardSteps()->getCount()-1)
1372
-					$navParam->setNextStepIndex($index+1);
1406
+				if($type!==self::ST_START && $type!==self::ST_STEP) {
1407
+									throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_NEXT);
1408
+				}
1409
+				if($index<$this->getWizardSteps()->getCount()-1) {
1410
+									$navParam->setNextStepIndex($index+1);
1411
+				}
1373 1412
 				$this->onNextButtonClick($navParam);
1374 1413
 				$handled=true;
1375
-			}
1376
-			else if(strcasecmp($command,self::CMD_PREVIOUS)===0)
1414
+			} else if(strcasecmp($command,self::CMD_PREVIOUS)===0)
1377 1415
 			{
1378
-				if($type!==self::ST_FINISH && $type!==self::ST_STEP)
1379
-					throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_PREVIOUS);
1416
+				if($type!==self::ST_FINISH && $type!==self::ST_STEP) {
1417
+									throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_PREVIOUS);
1418
+				}
1380 1419
 				$movePrev=true;
1381
-				if(($prevIndex=$this->getPreviousStepIndex(false))>=0)
1382
-					$navParam->setNextStepIndex($prevIndex);
1420
+				if(($prevIndex=$this->getPreviousStepIndex(false))>=0) {
1421
+									$navParam->setNextStepIndex($prevIndex);
1422
+				}
1383 1423
 				$this->onPreviousButtonClick($navParam);
1384 1424
 				$handled=true;
1385
-			}
1386
-			else if(strcasecmp($command,self::CMD_COMPLETE)===0)
1425
+			} else if(strcasecmp($command,self::CMD_COMPLETE)===0)
1387 1426
 			{
1388
-				if($type!==self::ST_FINISH)
1389
-					throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_COMPLETE);
1390
-				if($index<$this->getWizardSteps()->getCount()-1)
1391
-					$navParam->setNextStepIndex($index+1);
1427
+				if($type!==self::ST_FINISH) {
1428
+									throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_COMPLETE);
1429
+				}
1430
+				if($index<$this->getWizardSteps()->getCount()-1) {
1431
+									$navParam->setNextStepIndex($index+1);
1432
+				}
1392 1433
 				$this->onCompleteButtonClick($navParam);
1393 1434
 				$handled=true;
1394
-			}
1395
-			else if(strcasecmp($command,self::CMD_MOVETO)===0)
1435
+			} else if(strcasecmp($command,self::CMD_MOVETO)===0)
1396 1436
 			{
1397
-				if($this->_cancelNavigation)  // may be set in onSideBarButtonClick
1437
+				if($this->_cancelNavigation) {
1438
+					// may be set in onSideBarButtonClick
1398 1439
 					$navParam->setCancelNavigation(true);
1440
+				}
1399 1441
 				$requestedStep=$param->getCommandParameter();
1400 1442
 				if (!is_numeric($requestedStep))
1401 1443
 				{
1402 1444
 					$requestedIndex=-1;
1403
-					foreach ($this->getWizardSteps() as $index=>$step)
1404
-						if ($step->getId()===$requestedStep)
1445
+					foreach ($this->getWizardSteps() as $index=>$step) {
1446
+											if ($step->getId()===$requestedStep)
1405 1447
 						{
1406 1448
 							$requestedIndex=$index;
1449
+					}
1407 1450
 							break;
1408 1451
 						}
1409
-					if ($requestedIndex<0)
1410
-						throw new TConfigurationException('wizard_step_invalid');
1452
+					if ($requestedIndex<0) {
1453
+											throw new TConfigurationException('wizard_step_invalid');
1454
+					}
1455
+				} else {
1456
+									$requestedIndex=TPropertyValue::ensureInteger($requestedStep);
1411 1457
 				}
1412
-				else
1413
-					$requestedIndex=TPropertyValue::ensureInteger($requestedStep);
1414 1458
 				$navParam->setNextStepIndex($requestedIndex);
1415 1459
 				$handled=true;
1416 1460
 			}
@@ -1422,13 +1466,15 @@  discard block
 block discarded – undo
1422 1466
 					$nextStepIndex=$navParam->getNextStepIndex();
1423 1467
 					if(!$this->_activeStepIndexSet && $this->allowNavigationToStep($nextStepIndex))
1424 1468
 					{
1425
-						if($movePrev)
1426
-							$this->getPreviousStepIndex(true);  // pop out the previous move from history
1469
+						if($movePrev) {
1470
+													$this->getPreviousStepIndex(true);
1471
+						}
1472
+						// pop out the previous move from history
1427 1473
 						$this->setActiveStepIndex($nextStepIndex);
1428 1474
 					}
1475
+				} else {
1476
+									$this->setActiveStepIndex($index);
1429 1477
 				}
1430
-				else
1431
-					$this->setActiveStepIndex($index);
1432 1478
 				return true;
1433 1479
 			}
1434 1480
 		}
@@ -1486,8 +1532,9 @@  discard block
 block discarded – undo
1486 1532
 	public function setTitle($value)
1487 1533
 	{
1488 1534
 		$this->setViewState('Title',$value,'');
1489
-		if($this->_wizard)
1490
-			$this->_wizard->wizardStepsChanged();
1535
+		if($this->_wizard) {
1536
+					$this->_wizard->wizardStepsChanged();
1537
+		}
1491 1538
 	}
1492 1539
 
1493 1540
 	/**
@@ -1523,8 +1570,9 @@  discard block
 block discarded – undo
1523 1570
 		if($type!==$this->getStepType())
1524 1571
 		{
1525 1572
 			$this->setViewState('StepType',$type,TWizardStepType::Auto);
1526
-			if($this->_wizard)
1527
-				$this->_wizard->wizardStepsChanged();
1573
+			if($this->_wizard) {
1574
+							$this->_wizard->wizardStepsChanged();
1575
+			}
1528 1576
 		}
1529 1577
 	}
1530 1578
 }
@@ -1595,8 +1643,9 @@  discard block
 block discarded – undo
1595 1643
 	public function createChildControls()
1596 1644
 	{
1597 1645
 		$this->getControls()->clear();
1598
-		if($this->_contentTemplate)
1599
-			$this->_contentTemplate->instantiateIn($this);
1646
+		if($this->_contentTemplate) {
1647
+					$this->_contentTemplate->instantiateIn($this);
1648
+		}
1600 1649
 	}
1601 1650
 
1602 1651
 	/**
@@ -1705,9 +1754,9 @@  discard block
 block discarded – undo
1705 1754
 			parent::insertAt($index,$item);
1706 1755
 			$this->_wizard->getMultiView()->getViews()->insertAt($index,$item);
1707 1756
 			$this->_wizard->addedWizardStep($item);
1757
+		} else {
1758
+					throw new TInvalidDataTypeException('wizardstepcollection_wizardstep_required');
1708 1759
 		}
1709
-		else
1710
-			throw new TInvalidDataTypeException('wizardstepcollection_wizardstep_required');
1711 1760
 	}
1712 1761
 
1713 1762
 	/**
Please login to merge, or discard this patch.