Passed
Branch php-cs-fixer (b9836a)
by Fabio
15:58
created
framework/Web/UI/WebControls/TDropDownList.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -75,14 +75,14 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function loadPostData($key, $values)
77 77
 	{
78
-		if(!$this->getEnabled(true))
78
+		if (!$this->getEnabled(true))
79 79
 			return false;
80 80
 		$this->ensureDataBound();
81
-		$selection = isset($values[$key])?$values[$key]:null;
82
-		if($selection !== null)
81
+		$selection = isset($values[$key]) ? $values[$key] : null;
82
+		if ($selection !== null)
83 83
 		{
84 84
 			$index = $this->getItems()->findIndexByValue($selection, false);
85
-			if($this->getSelectedIndex() !== $index)
85
+			if ($this->getSelectedIndex() !== $index)
86 86
 			{
87 87
 				$this->setSelectedIndex($index);
88 88
 				return $this->_dataChanged = true;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	public function raisePostDataChangedEvent()
102 102
 	{
103
-		if($this->getAutoPostBack() && $this->getCausesValidation())
103
+		if ($this->getAutoPostBack() && $this->getCausesValidation())
104 104
 			$this->getPage()->validate($this->getValidationGroup());
105 105
 		$this->onSelectedIndexChanged(null);
106 106
 	}
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,8 +75,9 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function loadPostData($key, $values)
77 77
 	{
78
-		if(!$this->getEnabled(true))
79
-			return false;
78
+		if(!$this->getEnabled(true)) {
79
+					return false;
80
+		}
80 81
 		$this->ensureDataBound();
81 82
 		$selection = isset($values[$key])?$values[$key]:null;
82 83
 		if($selection !== null)
@@ -100,8 +101,9 @@  discard block
 block discarded – undo
100 101
 	 */
101 102
 	public function raisePostDataChangedEvent()
102 103
 	{
103
-		if($this->getAutoPostBack() && $this->getCausesValidation())
104
-			$this->getPage()->validate($this->getValidationGroup());
104
+		if($this->getAutoPostBack() && $this->getCausesValidation()) {
105
+					$this->getPage()->validate($this->getValidationGroup());
106
+		}
105 107
 		$this->onSelectedIndexChanged(null);
106 108
 	}
107 109
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/THtmlArea.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 	 */
312 312
 	protected function addAttributesToRender($writer)
313 313
 	{
314
-		if($this->getEnableVisualEdit() && $this->getEnabled(true))
314
+		if ($this->getEnableVisualEdit() && $this->getEnabled(true))
315 315
 		{
316 316
 			$writer->addAttribute('id', $this->getClientID());
317 317
 			$this->registerEditorClientScript($writer);
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 
359 359
 		$options = TJavaScript::encode($options, true, true);
360 360
 		$script = "new {$this->getClientClassName()}($options)";
361
-		$scripts->registerEndScript('prado:THtmlArea' . $this->ClientID, $script);
361
+		$scripts->registerEndScript('prado:THtmlArea'.$this->ClientID, $script);
362 362
 	}
363 363
 
364 364
 	/**
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 	 */
367 367
 	protected function getScriptUrl()
368 368
 	{
369
-		return $this->getScriptDeploymentPath() . '/tiny_mce/tiny_mce.js';
369
+		return $this->getScriptDeploymentPath().'/tiny_mce/tiny_mce.js';
370 370
 	}
371 371
 
372 372
 	/**
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 	{
378 378
 		$tarfile = Prado::getPathOfNamespace('Vendor.pradosoft.prado-tinymce3.tiny_mce', '.tar');
379 379
 		$md5sum = Prado::getPathOfNamespace('Vendor.pradosoft.prado-tinymce3.tiny_mce', '.md5');
380
-		if($tarfile === null || $md5sum === null)
380
+		if ($tarfile === null || $md5sum === null)
381 381
 			throw new TConfigurationException('htmlarea_tarfile_invalid');
382 382
 		$url = $this->getApplication()->getAssetManager()->publishTarFile($tarfile, $md5sum);
383 383
 		$this->copyCustomPlugins($url);
@@ -386,12 +386,12 @@  discard block
 block discarded – undo
386 386
 
387 387
 	protected function copyCustomPlugins($url)
388 388
 	{
389
-		if($plugins = $this->getCustomPluginPath())
389
+		if ($plugins = $this->getCustomPluginPath())
390 390
 		{
391 391
 			$assets = $this->getApplication()->getAssetManager();
392 392
 			$path = is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins);
393
-			$dest = $assets->getBasePath() . '/' . basename($url) . '/tiny_mce/plugins/' . basename($path);
394
-			if(!is_dir($dest) || $this->getApplication()->getMode() !== TApplicationMode::Performance)
393
+			$dest = $assets->getBasePath().'/'.basename($url).'/tiny_mce/plugins/'.basename($path);
394
+			if (!is_dir($dest) || $this->getApplication()->getMode() !== TApplicationMode::Performance)
395 395
 				$assets->copyDirectory($path, $dest);
396 396
 		}
397 397
 	}
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 		$options['theme_advanced_toolbar_align'] = 'left';
419 419
 		$options['theme_advanced_path_location'] = 'bottom';
420 420
 		$options['extended_valid_elements'] = 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]';
421
-		if($this->getReadOnly())
421
+		if ($this->getReadOnly())
422 422
 			$options['readonly'] = true;
423 423
 
424 424
 		$options = array_merge($options, $this->parseEditorOptions($this->getOptions()));
@@ -433,11 +433,11 @@  discard block
 block discarded – undo
433 433
 	{
434 434
 		$options = [];
435 435
 		$substrings = preg_split('/,\s*\n|\n/', trim($string));
436
-		foreach($substrings as $bits)
436
+		foreach ($substrings as $bits)
437 437
 		{
438 438
 			$option = explode(":", $bits, 2);
439 439
 
440
-			if(count($option) == 2)
440
+			if (count($option) == 2)
441 441
 			{
442 442
 				$value = trim(trim($option[1]), "'\"");
443 443
 				if (($s = strtolower($value)) === 'false')
@@ -456,15 +456,15 @@  discard block
 block discarded – undo
456 456
 	protected function getLanguageSuffix($culture)
457 457
 	{
458 458
 		$app = $this->getApplication()->getGlobalization();
459
-		if(empty($culture) && ($app !== null))
459
+		if (empty($culture) && ($app !== null))
460 460
 			$culture = $app->getCulture();
461 461
 		$variants = [];
462
-		if($app !== null)
462
+		if ($app !== null)
463 463
 			$variants = $app->getCultureVariants($culture);
464 464
 
465
-		foreach($variants as $variant)
465
+		foreach ($variants as $variant)
466 466
 		{
467
-			if(isset(self::$_langs[$variant]))
467
+			if (isset(self::$_langs[$variant]))
468 468
 				return self::$_langs[$variant];
469 469
 		}
470 470
 
Please login to merge, or discard this patch.
Braces   +23 added lines, -16 removed lines patch added patch discarded remove patch
@@ -377,8 +377,9 @@  discard block
 block discarded – undo
377 377
 	{
378 378
 		$tarfile = Prado::getPathOfNamespace('Vendor.pradosoft.prado-tinymce3.tiny_mce', '.tar');
379 379
 		$md5sum = Prado::getPathOfNamespace('Vendor.pradosoft.prado-tinymce3.tiny_mce', '.md5');
380
-		if($tarfile === null || $md5sum === null)
381
-			throw new TConfigurationException('htmlarea_tarfile_invalid');
380
+		if($tarfile === null || $md5sum === null) {
381
+					throw new TConfigurationException('htmlarea_tarfile_invalid');
382
+		}
382 383
 		$url = $this->getApplication()->getAssetManager()->publishTarFile($tarfile, $md5sum);
383 384
 		$this->copyCustomPlugins($url);
384 385
 		return $url;
@@ -391,8 +392,9 @@  discard block
 block discarded – undo
391 392
 			$assets = $this->getApplication()->getAssetManager();
392 393
 			$path = is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins);
393 394
 			$dest = $assets->getBasePath() . '/' . basename($url) . '/tiny_mce/plugins/' . basename($path);
394
-			if(!is_dir($dest) || $this->getApplication()->getMode() !== TApplicationMode::Performance)
395
-				$assets->copyDirectory($path, $dest);
395
+			if(!is_dir($dest) || $this->getApplication()->getMode() !== TApplicationMode::Performance) {
396
+							$assets->copyDirectory($path, $dest);
397
+			}
396 398
 		}
397 399
 	}
398 400
 
@@ -418,8 +420,9 @@  discard block
 block discarded – undo
418 420
 		$options['theme_advanced_toolbar_align'] = 'left';
419 421
 		$options['theme_advanced_path_location'] = 'bottom';
420 422
 		$options['extended_valid_elements'] = 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]';
421
-		if($this->getReadOnly())
422
-			$options['readonly'] = true;
423
+		if($this->getReadOnly()) {
424
+					$options['readonly'] = true;
425
+		}
423 426
 
424 427
 		$options = array_merge($options, $this->parseEditorOptions($this->getOptions()));
425 428
 		return $options;
@@ -440,10 +443,11 @@  discard block
 block discarded – undo
440 443
 			if(count($option) == 2)
441 444
 			{
442 445
 				$value = trim(trim($option[1]), "'\"");
443
-				if (($s = strtolower($value)) === 'false')
444
-					$value = false;
445
-				elseif ($s === 'true')
446
-					$value = true;
446
+				if (($s = strtolower($value)) === 'false') {
447
+									$value = false;
448
+				} elseif ($s === 'true') {
449
+									$value = true;
450
+				}
447 451
 				$options[trim($option[0])] = $value;
448 452
 			}
449 453
 		}
@@ -456,16 +460,19 @@  discard block
 block discarded – undo
456 460
 	protected function getLanguageSuffix($culture)
457 461
 	{
458 462
 		$app = $this->getApplication()->getGlobalization();
459
-		if(empty($culture) && ($app !== null))
460
-			$culture = $app->getCulture();
463
+		if(empty($culture) && ($app !== null)) {
464
+					$culture = $app->getCulture();
465
+		}
461 466
 		$variants = [];
462
-		if($app !== null)
463
-			$variants = $app->getCultureVariants($culture);
467
+		if($app !== null) {
468
+					$variants = $app->getCultureVariants($culture);
469
+		}
464 470
 
465 471
 		foreach($variants as $variant)
466 472
 		{
467
-			if(isset(self::$_langs[$variant]))
468
-				return self::$_langs[$variant];
473
+			if(isset(self::$_langs[$variant])) {
474
+							return self::$_langs[$variant];
475
+			}
469 476
 		}
470 477
 
471 478
 		return 'en';
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTabView.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	protected function addAttributesToRender($writer)
55 55
 	{
56
-		if(!$this->getActive() && $this->getPage()->getClientSupportsJavaScript())
56
+		if (!$this->getActive() && $this->getPage()->getClientSupportsJavaScript())
57 57
 			$this->getStyle()->setStyleField('display', 'none');
58 58
 
59 59
 		$this->getStyle()->mergeWith($this->getParent()->getViewStyle());
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
 	 */
138 138
 	public function renderContents($writer)
139 139
 	{
140
-		if(($text = $this->getText()) !== '')
140
+		if (($text = $this->getText()) !== '')
141 141
 			$writer->write($text);
142
-		elseif($this->getHasControls())
142
+		elseif ($this->getHasControls())
143 143
 			parent::renderContents($writer);
144 144
 	}
145 145
 
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
 	 */
150 150
 	public function renderTab($writer)
151 151
 	{
152
-		if($this->getVisible(false) && $this->getPage()->getClientSupportsJavaScript())
152
+		if ($this->getVisible(false) && $this->getPage()->getClientSupportsJavaScript())
153 153
 		{
154
-			$writer->addAttribute('id', $this->getClientID() . '_0');
154
+			$writer->addAttribute('id', $this->getClientID().'_0');
155 155
 
156
-			$style = $this->getActive()?$this->getParent()->getActiveTabStyle():$this->getParent()->getTabStyle();
156
+			$style = $this->getActive() ? $this->getParent()->getActiveTabStyle() : $this->getParent()->getTabStyle();
157 157
 			$style->addAttributesToRender($writer);
158 158
 
159 159
 			$writer->renderBeginTag($this->getTagName());
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	protected function renderTabContent($writer)
173 173
 	{
174
-		if(($url = $this->getNavigateUrl()) === '')
174
+		if (($url = $this->getNavigateUrl()) === '')
175 175
 			$url = 'javascript://';
176
-		if(($caption = $this->getCaption()) === '')
176
+		if (($caption = $this->getCaption()) === '')
177 177
 			$caption = ' ';
178 178
 		$writer->write("<a href=\"{$url}\">{$caption}</a>");
179 179
 	}
Please login to merge, or discard this patch.
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -53,8 +53,9 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	protected function addAttributesToRender($writer)
55 55
 	{
56
-		if(!$this->getActive() && $this->getPage()->getClientSupportsJavaScript())
57
-			$this->getStyle()->setStyleField('display', 'none');
56
+		if(!$this->getActive() && $this->getPage()->getClientSupportsJavaScript()) {
57
+					$this->getStyle()->setStyleField('display', 'none');
58
+		}
58 59
 
59 60
 		$this->getStyle()->mergeWith($this->getParent()->getViewStyle());
60 61
 
@@ -137,10 +138,11 @@  discard block
 block discarded – undo
137 138
 	 */
138 139
 	public function renderContents($writer)
139 140
 	{
140
-		if(($text = $this->getText()) !== '')
141
-			$writer->write($text);
142
-		elseif($this->getHasControls())
143
-			parent::renderContents($writer);
141
+		if(($text = $this->getText()) !== '') {
142
+					$writer->write($text);
143
+		} elseif($this->getHasControls()) {
144
+					parent::renderContents($writer);
145
+		}
144 146
 	}
145 147
 
146 148
 	/**
@@ -171,10 +173,12 @@  discard block
 block discarded – undo
171 173
 	 */
172 174
 	protected function renderTabContent($writer)
173 175
 	{
174
-		if(($url = $this->getNavigateUrl()) === '')
175
-			$url = 'javascript://';
176
-		if(($caption = $this->getCaption()) === '')
177
-			$caption = '&nbsp;';
176
+		if(($url = $this->getNavigateUrl()) === '') {
177
+					$url = 'javascript://';
178
+		}
179
+		if(($caption = $this->getCaption()) === '') {
180
+					$caption = '&nbsp;';
181
+		}
178 182
 		$writer->write("<a href=\"{$url}\">{$caption}</a>");
179 183
 	}
180 184
 }
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TImageMap.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public function addParsedObject($object)
48 48
 	{
49
-		if($object instanceof THotSpot)
49
+		if ($object instanceof THotSpot)
50 50
 			$this->getHotSpots()->add($object);
51 51
 	}
52 52
 
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 	protected function addAttributesToRender($writer)
59 59
 	{
60 60
 		parent::addAttributesToRender($writer);
61
-		if($this->getHotSpots()->getCount() > 0)
61
+		if ($this->getHotSpots()->getCount() > 0)
62 62
 		{
63
-			$writer->addAttribute('usemap', '#' . self::MAP_NAME_PREFIX . $this->getClientID());
63
+			$writer->addAttribute('usemap', '#'.self::MAP_NAME_PREFIX.$this->getClientID());
64 64
 			$writer->addAttribute('id', $this->getUniqueID());
65 65
 		}
66
-		if($this->getEnabled() && !$this->getEnabled(true))
66
+		if ($this->getEnabled() && !$this->getEnabled(true))
67 67
 			$writer->addAttribute('disabled', 'disabled');
68 68
 	}
69 69
 
@@ -77,32 +77,32 @@  discard block
 block discarded – undo
77 77
 
78 78
 		$hotspots = $this->getHotSpots();
79 79
 
80
-		if($hotspots->getCount() > 0)
80
+		if ($hotspots->getCount() > 0)
81 81
 		{
82 82
 			$clientID = $this->getClientID();
83 83
 			$cs = $this->getPage()->getClientScript();
84 84
 			$writer->writeLine();
85
-			$writer->addAttribute('name', self::MAP_NAME_PREFIX . $clientID);
85
+			$writer->addAttribute('name', self::MAP_NAME_PREFIX.$clientID);
86 86
 			$writer->renderBeginTag('map');
87 87
 			$writer->writeLine();
88
-			if(($mode = $this->getHotSpotMode()) === THotSpotMode::NotSet)
88
+			if (($mode = $this->getHotSpotMode()) === THotSpotMode::NotSet)
89 89
 				$mode = THotSpotMode::Navigate;
90 90
 			$target = $this->getTarget();
91 91
 			$i = 0;
92 92
 			$options['EventTarget'] = $this->getUniqueID();
93 93
 			$options['StopEvent'] = true;
94 94
 			$cs = $this->getPage()->getClientScript();
95
-			foreach($hotspots as $hotspot)
95
+			foreach ($hotspots as $hotspot)
96 96
 			{
97
-				if($hotspot->getHotSpotMode() === THotSpotMode::NotSet)
97
+				if ($hotspot->getHotSpotMode() === THotSpotMode::NotSet)
98 98
 					$hotspot->setHotSpotMode($mode);
99
-				if($target !== '' && $hotspot->getTarget() === '')
99
+				if ($target !== '' && $hotspot->getTarget() === '')
100 100
 					$hotspot->setTarget($target);
101
-				if($hotspot->getHotSpotMode() === THotSpotMode::PostBack)
101
+				if ($hotspot->getHotSpotMode() === THotSpotMode::PostBack)
102 102
 				{
103
-					$id = $clientID . '_' . $i;
103
+					$id = $clientID.'_'.$i;
104 104
 					$writer->addAttribute('id', $id);
105
-					$writer->addAttribute('href', '#' . $id); //create unique no-op url references
105
+					$writer->addAttribute('href', '#'.$id); //create unique no-op url references
106 106
 					$options['ID'] = $id;
107 107
 					$options['EventParameter'] = "$i";
108 108
 					$options['CausesValidation'] = $hotspot->getCausesValidation();
@@ -136,24 +136,24 @@  discard block
 block discarded – undo
136 136
 	public function raisePostBackEvent($param)
137 137
 	{
138 138
 		$postBackValue = null;
139
-		if($param !== '')
139
+		if ($param !== '')
140 140
 		{
141 141
 			$index = TPropertyValue::ensureInteger($param);
142 142
 			$hotspots = $this->getHotSpots();
143
-			if($index >= 0 && $index < $hotspots->getCount())
143
+			if ($index >= 0 && $index < $hotspots->getCount())
144 144
 			{
145 145
 				$hotspot = $hotspots->itemAt($index);
146
-				if(($mode = $hotspot->getHotSpotMode()) === THotSpotMode::NotSet)
146
+				if (($mode = $hotspot->getHotSpotMode()) === THotSpotMode::NotSet)
147 147
 					$mode = $this->getHotSpotMode();
148
-				if($mode === THotSpotMode::PostBack)
148
+				if ($mode === THotSpotMode::PostBack)
149 149
 				{
150 150
 					$postBackValue = $hotspot->getPostBackValue();
151
-					if($hotspot->getCausesValidation())
151
+					if ($hotspot->getCausesValidation())
152 152
 						$this->getPage()->validate($hotspot->getValidationGroup());
153 153
 				}
154 154
 			}
155 155
 		}
156
-		if($postBackValue !== null)
156
+		if ($postBackValue !== null)
157 157
 			$this->onClick(new TImageMapEventParameter($postBackValue));
158 158
 	}
159 159
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	 */
182 182
 	public function getHotSpots()
183 183
 	{
184
-		if(($hotspots = $this->getViewState('HotSpots', null)) === null)
184
+		if (($hotspots = $this->getViewState('HotSpots', null)) === null)
185 185
 		{
186 186
 			$hotspots = new THotSpotCollection;
187 187
 			$this->setViewState('HotSpots', $hotspots);
Please login to merge, or discard this patch.
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -46,8 +46,9 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public function addParsedObject($object)
48 48
 	{
49
-		if($object instanceof THotSpot)
50
-			$this->getHotSpots()->add($object);
49
+		if($object instanceof THotSpot) {
50
+					$this->getHotSpots()->add($object);
51
+		}
51 52
 	}
52 53
 
53 54
 	/**
@@ -63,8 +64,9 @@  discard block
 block discarded – undo
63 64
 			$writer->addAttribute('usemap', '#' . self::MAP_NAME_PREFIX . $this->getClientID());
64 65
 			$writer->addAttribute('id', $this->getUniqueID());
65 66
 		}
66
-		if($this->getEnabled() && !$this->getEnabled(true))
67
-			$writer->addAttribute('disabled', 'disabled');
67
+		if($this->getEnabled() && !$this->getEnabled(true)) {
68
+					$writer->addAttribute('disabled', 'disabled');
69
+		}
68 70
 	}
69 71
 
70 72
 	/**
@@ -85,8 +87,9 @@  discard block
 block discarded – undo
85 87
 			$writer->addAttribute('name', self::MAP_NAME_PREFIX . $clientID);
86 88
 			$writer->renderBeginTag('map');
87 89
 			$writer->writeLine();
88
-			if(($mode = $this->getHotSpotMode()) === THotSpotMode::NotSet)
89
-				$mode = THotSpotMode::Navigate;
90
+			if(($mode = $this->getHotSpotMode()) === THotSpotMode::NotSet) {
91
+							$mode = THotSpotMode::Navigate;
92
+			}
90 93
 			$target = $this->getTarget();
91 94
 			$i = 0;
92 95
 			$options['EventTarget'] = $this->getUniqueID();
@@ -94,10 +97,12 @@  discard block
 block discarded – undo
94 97
 			$cs = $this->getPage()->getClientScript();
95 98
 			foreach($hotspots as $hotspot)
96 99
 			{
97
-				if($hotspot->getHotSpotMode() === THotSpotMode::NotSet)
98
-					$hotspot->setHotSpotMode($mode);
99
-				if($target !== '' && $hotspot->getTarget() === '')
100
-					$hotspot->setTarget($target);
100
+				if($hotspot->getHotSpotMode() === THotSpotMode::NotSet) {
101
+									$hotspot->setHotSpotMode($mode);
102
+				}
103
+				if($target !== '' && $hotspot->getTarget() === '') {
104
+									$hotspot->setTarget($target);
105
+				}
101 106
 				if($hotspot->getHotSpotMode() === THotSpotMode::PostBack)
102 107
 				{
103 108
 					$id = $clientID . '_' . $i;
@@ -143,18 +148,21 @@  discard block
 block discarded – undo
143 148
 			if($index >= 0 && $index < $hotspots->getCount())
144 149
 			{
145 150
 				$hotspot = $hotspots->itemAt($index);
146
-				if(($mode = $hotspot->getHotSpotMode()) === THotSpotMode::NotSet)
147
-					$mode = $this->getHotSpotMode();
151
+				if(($mode = $hotspot->getHotSpotMode()) === THotSpotMode::NotSet) {
152
+									$mode = $this->getHotSpotMode();
153
+				}
148 154
 				if($mode === THotSpotMode::PostBack)
149 155
 				{
150 156
 					$postBackValue = $hotspot->getPostBackValue();
151
-					if($hotspot->getCausesValidation())
152
-						$this->getPage()->validate($hotspot->getValidationGroup());
157
+					if($hotspot->getCausesValidation()) {
158
+											$this->getPage()->validate($hotspot->getValidationGroup());
159
+					}
153 160
 				}
154 161
 			}
155 162
 		}
156
-		if($postBackValue !== null)
157
-			$this->onClick(new TImageMapEventParameter($postBackValue));
163
+		if($postBackValue !== null) {
164
+					$this->onClick(new TImageMapEventParameter($postBackValue));
165
+		}
158 166
 	}
159 167
 
160 168
 	/**
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TRepeatInfo.php 2 patches
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	public function setRepeatColumns($value)
102 102
 	{
103
-		if(($value = TPropertyValue::ensureInteger($value)) < 0)
103
+		if (($value = TPropertyValue::ensureInteger($value)) < 0)
104 104
 			throw new TInvalidDataValueException('repeatinfo_repeatcolumns_invalid');
105 105
 		$this->_repeatColumns = $value;
106 106
 	}
@@ -144,16 +144,16 @@  discard block
 block discarded – undo
144 144
 	 */
145 145
 	public function renderRepeater($writer, IRepeatInfoUser $user)
146 146
 	{
147
-		if($this->_repeatLayout === TRepeatLayout::Table)
147
+		if ($this->_repeatLayout === TRepeatLayout::Table)
148 148
 		{
149 149
 			$control = new TTable;
150
-			if($this->_caption !== '')
150
+			if ($this->_caption !== '')
151 151
 			{
152 152
 				$control->setCaption($this->_caption);
153 153
 				$control->setCaptionAlign($this->_captionAlign);
154 154
 			}
155 155
 		}
156
-		elseif($this->_repeatLayout === TRepeatLayout::Raw)
156
+		elseif ($this->_repeatLayout === TRepeatLayout::Raw)
157 157
 		{
158 158
 			$this->renderRawContents($writer, $user);
159 159
 			return;
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
 			$control = new TWebControl;
163 163
 		$control->setID($user->getClientID());
164 164
 		$control->copyBaseAttributes($user);
165
-		if($user->getHasStyle())
165
+		if ($user->getHasStyle())
166 166
 			$control->getStyle()->copyFrom($user->getStyle());
167 167
 		$control->renderBeginTag($writer);
168 168
 		$writer->writeLine();
169 169
 
170
-		if($this->_repeatDirection === TRepeatDirection::Vertical)
170
+		if ($this->_repeatDirection === TRepeatDirection::Vertical)
171 171
 			$this->renderVerticalContents($writer, $user);
172 172
 		else
173 173
 			$this->renderHorizontalContents($writer, $user);
@@ -182,19 +182,19 @@  discard block
 block discarded – undo
182 182
 	 */
183 183
 	protected function renderRawContents($writer, $user)
184 184
 	{
185
-		if($user->getHasHeader())
185
+		if ($user->getHasHeader())
186 186
 			$user->renderItem($writer, $this, 'Header', -1);
187 187
 
188 188
 		// render items
189 189
 		$hasSeparators = $user->getHasSeparators();
190 190
 		$itemCount = $user->getItemCount();
191
-		for($i = 0;$i < $itemCount;++$i)
191
+		for ($i = 0; $i < $itemCount; ++$i)
192 192
 		{
193 193
 			$user->renderItem($writer, $this, 'Item', $i);
194
-			if($hasSeparators && $i != $itemCount - 1)
194
+			if ($hasSeparators && $i != $itemCount - 1)
195 195
 				$user->renderItem($writer, $this, 'Separator', $i);
196 196
 		}
197
-		if($user->getHasFooter())
197
+		if ($user->getHasFooter())
198 198
 			$user->renderItem($writer, $this, 'Footer', -1);
199 199
 	}
200 200
 
@@ -208,31 +208,31 @@  discard block
 block discarded – undo
208 208
 		$tableLayout = ($this->_repeatLayout === TRepeatLayout::Table);
209 209
 		$hasSeparators = $user->getHasSeparators();
210 210
 		$itemCount = $user->getItemCount();
211
-		$columns = $this->_repeatColumns === 0?$itemCount:$this->_repeatColumns;
212
-		$totalColumns = $hasSeparators?$columns + $columns:$columns;
211
+		$columns = $this->_repeatColumns === 0 ? $itemCount : $this->_repeatColumns;
212
+		$totalColumns = $hasSeparators ? $columns + $columns : $columns;
213 213
 		$needBreak = $columns < $itemCount;
214 214
 
215
-		if($user->getHasHeader())
215
+		if ($user->getHasHeader())
216 216
 			$this->renderHeader($writer, $user, $tableLayout, $totalColumns, $needBreak);
217 217
 
218 218
 		// render items
219
-		if($tableLayout)
219
+		if ($tableLayout)
220 220
 		{
221 221
 			$writer->renderBeginTag('tbody');
222 222
 			$column = 0;
223
-			for($i = 0;$i < $itemCount;++$i)
223
+			for ($i = 0; $i < $itemCount; ++$i)
224 224
 			{
225
-				if($column == 0)
225
+				if ($column == 0)
226 226
 					$writer->renderBeginTag('tr');
227
-				if(($style = $user->generateItemStyle('Item', $i)) !== null)
227
+				if (($style = $user->generateItemStyle('Item', $i)) !== null)
228 228
 					$style->addAttributesToRender($writer);
229 229
 				$writer->renderBeginTag('td');
230 230
 				$user->renderItem($writer, $this, 'Item', $i);
231 231
 				$writer->renderEndTag();
232 232
 				$writer->writeLine();
233
-				if($hasSeparators && $i != $itemCount - 1)
233
+				if ($hasSeparators && $i != $itemCount - 1)
234 234
 				{
235
-					if(($style = $user->generateItemStyle('Separator', $i)) !== null)
235
+					if (($style = $user->generateItemStyle('Separator', $i)) !== null)
236 236
 						$style->addAttributesToRender($writer);
237 237
 					$writer->renderBeginTag('td');
238 238
 					$user->renderItem($writer, $this, 'Separator', $i);
@@ -240,15 +240,15 @@  discard block
 block discarded – undo
240 240
 					$writer->writeLine();
241 241
 				}
242 242
 				$column++;
243
-				if($i == $itemCount - 1)
243
+				if ($i == $itemCount - 1)
244 244
 				{
245 245
 					$restColumns = $columns - $column;
246
-					if($hasSeparators)
247
-						$restColumns = $restColumns?$restColumns + $restColumns + 1:1;
248
-					for($j = 0;$j < $restColumns;++$j)
246
+					if ($hasSeparators)
247
+						$restColumns = $restColumns ? $restColumns + $restColumns + 1 : 1;
248
+					for ($j = 0; $j < $restColumns; ++$j)
249 249
 						$writer->write("<td></td>\n");
250 250
 				}
251
-				if($column == $columns || $i == $itemCount - 1)
251
+				if ($column == $columns || $i == $itemCount - 1)
252 252
 				{
253 253
 					$writer->renderEndTag();
254 254
 					$writer->writeLine();
@@ -260,15 +260,15 @@  discard block
 block discarded – undo
260 260
 		else
261 261
 		{
262 262
 			$column = 0;
263
-			for($i = 0;$i < $itemCount;++$i)
263
+			for ($i = 0; $i < $itemCount; ++$i)
264 264
 			{
265 265
 				$user->renderItem($writer, $this, 'Item', $i);
266
-				if($hasSeparators && $i != $itemCount - 1)
266
+				if ($hasSeparators && $i != $itemCount - 1)
267 267
 					$user->renderItem($writer, $this, 'Separator', $i);
268 268
 				$column++;
269
-				if($column == $columns || $i == $itemCount - 1)
269
+				if ($column == $columns || $i == $itemCount - 1)
270 270
 				{
271
-					if($needBreak)
271
+					if ($needBreak)
272 272
 						$writer->writeBreak();
273 273
 					$column = 0;
274 274
 				}
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 			}
277 277
 		}
278 278
 
279
-		if($user->getHasFooter())
279
+		if ($user->getHasFooter())
280 280
 			$this->renderFooter($writer, $user, $tableLayout, $totalColumns, $needBreak);
281 281
 	}
282 282
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 		$tableLayout = ($this->_repeatLayout === TRepeatLayout::Table);
291 291
 		$hasSeparators = $user->getHasSeparators();
292 292
 		$itemCount = $user->getItemCount();
293
-		if($this->_repeatColumns <= 1)
293
+		if ($this->_repeatColumns <= 1)
294 294
 		{
295 295
 			$rows = $itemCount;
296 296
 			$columns = 1;
@@ -299,69 +299,69 @@  discard block
 block discarded – undo
299 299
 		else
300 300
 		{
301 301
 			$columns = $this->_repeatColumns;
302
-			$rows = (int)(($itemCount + $columns - 1) / $columns);
303
-			if($rows == 0 && $itemCount > 0)
302
+			$rows = (int) (($itemCount + $columns - 1) / $columns);
303
+			if ($rows == 0 && $itemCount > 0)
304 304
 				$rows = 1;
305
-			if(($lastColumns = $itemCount % $columns) == 0)
305
+			if (($lastColumns = $itemCount % $columns) == 0)
306 306
 				$lastColumns = $columns;
307 307
 		}
308
-		$totalColumns = $hasSeparators?$columns + $columns:$columns;
308
+		$totalColumns = $hasSeparators ? $columns + $columns : $columns;
309 309
 
310
-		if($user->getHasHeader())
310
+		if ($user->getHasHeader())
311 311
 			$this->renderHeader($writer, $user, $tableLayout, $totalColumns, false);
312 312
 
313
-		if($tableLayout)
313
+		if ($tableLayout)
314 314
 		{
315 315
 			$writer->renderBeginTag('tbody');
316 316
 			$renderedItems = 0;
317
-			for($row = 0;$row < $rows;++$row)
317
+			for ($row = 0; $row < $rows; ++$row)
318 318
 			{
319 319
 				$index = $row;
320 320
 				$writer->renderBeginTag('tr');
321
-				for($col = 0;$col < $columns;++$col)
321
+				for ($col = 0; $col < $columns; ++$col)
322 322
 				{
323
-					if($renderedItems >= $itemCount)
323
+					if ($renderedItems >= $itemCount)
324 324
 						break;
325
-					if($col > 0)
325
+					if ($col > 0)
326 326
 					{
327 327
 						$index += $rows;
328
-						if($col - 1 >= $lastColumns)
328
+						if ($col - 1 >= $lastColumns)
329 329
 							$index--;
330 330
 					}
331
-					if($index >= $itemCount)
331
+					if ($index >= $itemCount)
332 332
 						continue;
333 333
 					$renderedItems++;
334
-					if(($style = $user->generateItemStyle('Item', $index)) !== null)
334
+					if (($style = $user->generateItemStyle('Item', $index)) !== null)
335 335
 						$style->addAttributesToRender($writer);
336 336
 					$writer->renderBeginTag('td');
337 337
 					$user->renderItem($writer, $this, 'Item', $index);
338 338
 					$writer->renderEndTag();
339 339
 					$writer->writeLine();
340
-					if(!$hasSeparators)
340
+					if (!$hasSeparators)
341 341
 						continue;
342
-					if($renderedItems < $itemCount - 1)
342
+					if ($renderedItems < $itemCount - 1)
343 343
 					{
344
-						if($columns == 1)
344
+						if ($columns == 1)
345 345
 						{
346 346
 							$writer->renderEndTag();
347 347
 							$writer->renderBeginTag('tr');
348 348
 						}
349
-						if(($style = $user->generateItemStyle('Separator', $index)) !== null)
349
+						if (($style = $user->generateItemStyle('Separator', $index)) !== null)
350 350
 							$style->addAttributesToRender($writer);
351 351
 						$writer->renderBeginTag('td');
352 352
 						$user->renderItem($writer, $this, 'Separator', $index);
353 353
 						$writer->renderEndTag();
354 354
 						$writer->writeLine();
355 355
 					}
356
-					elseif($columns > 1)
356
+					elseif ($columns > 1)
357 357
 						$writer->write("<td></td>\n");
358 358
 				}
359
-				if($row == $rows - 1)
359
+				if ($row == $rows - 1)
360 360
 				{
361 361
 					$restColumns = $columns - $lastColumns;
362
-					if($hasSeparators)
362
+					if ($hasSeparators)
363 363
 						$restColumns += $restColumns;
364
-					for($col = 0;$col < $restColumns;++$col)
364
+					for ($col = 0; $col < $restColumns; ++$col)
365 365
 						$writer->write("<td></td>\n");
366 366
 				}
367 367
 				$writer->renderEndTag();
@@ -372,40 +372,40 @@  discard block
 block discarded – undo
372 372
 		else
373 373
 		{
374 374
 			$renderedItems = 0;
375
-			for($row = 0;$row < $rows;++$row)
375
+			for ($row = 0; $row < $rows; ++$row)
376 376
 			{
377 377
 				$index = $row;
378
-				for($col = 0;$col < $columns;++$col)
378
+				for ($col = 0; $col < $columns; ++$col)
379 379
 				{
380
-					if($renderedItems >= $itemCount)
380
+					if ($renderedItems >= $itemCount)
381 381
 						break;
382
-					if($col > 0)
382
+					if ($col > 0)
383 383
 					{
384 384
 						$index += $rows;
385
-						if($col - 1 >= $lastColumns)
385
+						if ($col - 1 >= $lastColumns)
386 386
 							$index--;
387 387
 					}
388
-					if($index >= $itemCount)
388
+					if ($index >= $itemCount)
389 389
 						continue;
390 390
 					$renderedItems++;
391 391
 					$user->renderItem($writer, $this, 'Item', $index);
392 392
 					$writer->writeLine();
393
-					if(!$hasSeparators)
393
+					if (!$hasSeparators)
394 394
 						continue;
395
-					if($renderedItems < $itemCount - 1)
395
+					if ($renderedItems < $itemCount - 1)
396 396
 					{
397
-						if($columns == 1)
397
+						if ($columns == 1)
398 398
 							$writer->writeBreak();
399 399
 						$user->renderItem($writer, $this, 'Separator', $index);
400 400
 					}
401 401
 					$writer->writeLine();
402 402
 				}
403
-				if($row < $rows - 1 || $user->getHasFooter())
403
+				if ($row < $rows - 1 || $user->getHasFooter())
404 404
 					$writer->writeBreak();
405 405
 			}
406 406
 		}
407 407
 
408
-		if($user->getHasFooter())
408
+		if ($user->getHasFooter())
409 409
 			$this->renderFooter($writer, $user, $tableLayout, $totalColumns, false);
410 410
 
411 411
 	}
@@ -420,14 +420,14 @@  discard block
 block discarded – undo
420 420
 	 */
421 421
 	protected function renderHeader($writer, $user, $tableLayout, $columns, $needBreak)
422 422
 	{
423
-		if($tableLayout)
423
+		if ($tableLayout)
424 424
 		{
425 425
 			$writer->renderBeginTag('thead');
426 426
 			$writer->renderBeginTag('tr');
427
-			if($columns > 1)
427
+			if ($columns > 1)
428 428
 				$writer->addAttribute('colspan', "$columns");
429 429
 			$writer->addAttribute('scope', 'col');
430
-			if(($style = $user->generateItemStyle('Header', -1)) !== null)
430
+			if (($style = $user->generateItemStyle('Header', -1)) !== null)
431 431
 				$style->addAttributesToRender($writer);
432 432
 			$writer->renderBeginTag('th');
433 433
 			$user->renderItem($writer, $this, 'Header', -1);
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 		else
439 439
 		{
440 440
 			$user->renderItem($writer, $this, 'Header', -1);
441
-			if($needBreak)
441
+			if ($needBreak)
442 442
 				$writer->writeBreak();
443 443
 		}
444 444
 		$writer->writeLine();
@@ -453,13 +453,13 @@  discard block
 block discarded – undo
453 453
 	 */
454 454
 	protected function renderFooter($writer, $user, $tableLayout, $columns)
455 455
 	{
456
-		if($tableLayout)
456
+		if ($tableLayout)
457 457
 		{
458 458
 			$writer->renderBeginTag('tfoot');
459 459
 			$writer->renderBeginTag('tr');
460
-			if($columns > 1)
460
+			if ($columns > 1)
461 461
 				$writer->addAttribute('colspan', "$columns");
462
-			if(($style = $user->generateItemStyle('Footer', -1)) !== null)
462
+			if (($style = $user->generateItemStyle('Footer', -1)) !== null)
463 463
 				$style->addAttributesToRender($writer);
464 464
 			$writer->renderBeginTag('td');
465 465
 			$user->renderItem($writer, $this, 'Footer', -1);
Please login to merge, or discard this patch.
Braces   +127 added lines, -94 removed lines patch added patch discarded remove patch
@@ -100,8 +100,9 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	public function setRepeatColumns($value)
102 102
 	{
103
-		if(($value = TPropertyValue::ensureInteger($value)) < 0)
104
-			throw new TInvalidDataValueException('repeatinfo_repeatcolumns_invalid');
103
+		if(($value = TPropertyValue::ensureInteger($value)) < 0) {
104
+					throw new TInvalidDataValueException('repeatinfo_repeatcolumns_invalid');
105
+		}
105 106
 		$this->_repeatColumns = $value;
106 107
 	}
107 108
 
@@ -152,25 +153,26 @@  discard block
 block discarded – undo
152 153
 				$control->setCaption($this->_caption);
153 154
 				$control->setCaptionAlign($this->_captionAlign);
154 155
 			}
155
-		}
156
-		elseif($this->_repeatLayout === TRepeatLayout::Raw)
156
+		} elseif($this->_repeatLayout === TRepeatLayout::Raw)
157 157
 		{
158 158
 			$this->renderRawContents($writer, $user);
159 159
 			return;
160
+		} else {
161
+					$control = new TWebControl;
160 162
 		}
161
-		else
162
-			$control = new TWebControl;
163 163
 		$control->setID($user->getClientID());
164 164
 		$control->copyBaseAttributes($user);
165
-		if($user->getHasStyle())
166
-			$control->getStyle()->copyFrom($user->getStyle());
165
+		if($user->getHasStyle()) {
166
+					$control->getStyle()->copyFrom($user->getStyle());
167
+		}
167 168
 		$control->renderBeginTag($writer);
168 169
 		$writer->writeLine();
169 170
 
170
-		if($this->_repeatDirection === TRepeatDirection::Vertical)
171
-			$this->renderVerticalContents($writer, $user);
172
-		else
173
-			$this->renderHorizontalContents($writer, $user);
171
+		if($this->_repeatDirection === TRepeatDirection::Vertical) {
172
+					$this->renderVerticalContents($writer, $user);
173
+		} else {
174
+					$this->renderHorizontalContents($writer, $user);
175
+		}
174 176
 
175 177
 		$control->renderEndTag($writer);
176 178
 	}
@@ -182,8 +184,9 @@  discard block
 block discarded – undo
182 184
 	 */
183 185
 	protected function renderRawContents($writer, $user)
184 186
 	{
185
-		if($user->getHasHeader())
186
-			$user->renderItem($writer, $this, 'Header', -1);
187
+		if($user->getHasHeader()) {
188
+					$user->renderItem($writer, $this, 'Header', -1);
189
+		}
187 190
 
188 191
 		// render items
189 192
 		$hasSeparators = $user->getHasSeparators();
@@ -191,11 +194,13 @@  discard block
 block discarded – undo
191 194
 		for($i = 0;$i < $itemCount;++$i)
192 195
 		{
193 196
 			$user->renderItem($writer, $this, 'Item', $i);
194
-			if($hasSeparators && $i != $itemCount - 1)
195
-				$user->renderItem($writer, $this, 'Separator', $i);
197
+			if($hasSeparators && $i != $itemCount - 1) {
198
+							$user->renderItem($writer, $this, 'Separator', $i);
199
+			}
200
+		}
201
+		if($user->getHasFooter()) {
202
+					$user->renderItem($writer, $this, 'Footer', -1);
196 203
 		}
197
-		if($user->getHasFooter())
198
-			$user->renderItem($writer, $this, 'Footer', -1);
199 204
 	}
200 205
 
201 206
 	/**
@@ -212,8 +217,9 @@  discard block
 block discarded – undo
212 217
 		$totalColumns = $hasSeparators?$columns + $columns:$columns;
213 218
 		$needBreak = $columns < $itemCount;
214 219
 
215
-		if($user->getHasHeader())
216
-			$this->renderHeader($writer, $user, $tableLayout, $totalColumns, $needBreak);
220
+		if($user->getHasHeader()) {
221
+					$this->renderHeader($writer, $user, $tableLayout, $totalColumns, $needBreak);
222
+		}
217 223
 
218 224
 		// render items
219 225
 		if($tableLayout)
@@ -222,18 +228,21 @@  discard block
 block discarded – undo
222 228
 			$column = 0;
223 229
 			for($i = 0;$i < $itemCount;++$i)
224 230
 			{
225
-				if($column == 0)
226
-					$writer->renderBeginTag('tr');
227
-				if(($style = $user->generateItemStyle('Item', $i)) !== null)
228
-					$style->addAttributesToRender($writer);
231
+				if($column == 0) {
232
+									$writer->renderBeginTag('tr');
233
+				}
234
+				if(($style = $user->generateItemStyle('Item', $i)) !== null) {
235
+									$style->addAttributesToRender($writer);
236
+				}
229 237
 				$writer->renderBeginTag('td');
230 238
 				$user->renderItem($writer, $this, 'Item', $i);
231 239
 				$writer->renderEndTag();
232 240
 				$writer->writeLine();
233 241
 				if($hasSeparators && $i != $itemCount - 1)
234 242
 				{
235
-					if(($style = $user->generateItemStyle('Separator', $i)) !== null)
236
-						$style->addAttributesToRender($writer);
243
+					if(($style = $user->generateItemStyle('Separator', $i)) !== null) {
244
+											$style->addAttributesToRender($writer);
245
+					}
237 246
 					$writer->renderBeginTag('td');
238 247
 					$user->renderItem($writer, $this, 'Separator', $i);
239 248
 					$writer->renderEndTag();
@@ -243,10 +252,12 @@  discard block
 block discarded – undo
243 252
 				if($i == $itemCount - 1)
244 253
 				{
245 254
 					$restColumns = $columns - $column;
246
-					if($hasSeparators)
247
-						$restColumns = $restColumns?$restColumns + $restColumns + 1:1;
248
-					for($j = 0;$j < $restColumns;++$j)
249
-						$writer->write("<td></td>\n");
255
+					if($hasSeparators) {
256
+											$restColumns = $restColumns?$restColumns + $restColumns + 1:1;
257
+					}
258
+					for($j = 0;$j < $restColumns;++$j) {
259
+											$writer->write("<td></td>\n");
260
+					}
250 261
 				}
251 262
 				if($column == $columns || $i == $itemCount - 1)
252 263
 				{
@@ -256,28 +267,30 @@  discard block
 block discarded – undo
256 267
 				}
257 268
 			}
258 269
 			$writer->renderEndTag();
259
-		}
260
-		else
270
+		} else
261 271
 		{
262 272
 			$column = 0;
263 273
 			for($i = 0;$i < $itemCount;++$i)
264 274
 			{
265 275
 				$user->renderItem($writer, $this, 'Item', $i);
266
-				if($hasSeparators && $i != $itemCount - 1)
267
-					$user->renderItem($writer, $this, 'Separator', $i);
276
+				if($hasSeparators && $i != $itemCount - 1) {
277
+									$user->renderItem($writer, $this, 'Separator', $i);
278
+				}
268 279
 				$column++;
269 280
 				if($column == $columns || $i == $itemCount - 1)
270 281
 				{
271
-					if($needBreak)
272
-						$writer->writeBreak();
282
+					if($needBreak) {
283
+											$writer->writeBreak();
284
+					}
273 285
 					$column = 0;
274 286
 				}
275 287
 				$writer->writeLine();
276 288
 			}
277 289
 		}
278 290
 
279
-		if($user->getHasFooter())
280
-			$this->renderFooter($writer, $user, $tableLayout, $totalColumns, $needBreak);
291
+		if($user->getHasFooter()) {
292
+					$this->renderFooter($writer, $user, $tableLayout, $totalColumns, $needBreak);
293
+		}
281 294
 	}
282 295
 
283 296
 	/**
@@ -295,20 +308,22 @@  discard block
 block discarded – undo
295 308
 			$rows = $itemCount;
296 309
 			$columns = 1;
297 310
 			$lastColumns = 1;
298
-		}
299
-		else
311
+		} else
300 312
 		{
301 313
 			$columns = $this->_repeatColumns;
302 314
 			$rows = (int)(($itemCount + $columns - 1) / $columns);
303
-			if($rows == 0 && $itemCount > 0)
304
-				$rows = 1;
305
-			if(($lastColumns = $itemCount % $columns) == 0)
306
-				$lastColumns = $columns;
315
+			if($rows == 0 && $itemCount > 0) {
316
+							$rows = 1;
317
+			}
318
+			if(($lastColumns = $itemCount % $columns) == 0) {
319
+							$lastColumns = $columns;
320
+			}
307 321
 		}
308 322
 		$totalColumns = $hasSeparators?$columns + $columns:$columns;
309 323
 
310
-		if($user->getHasHeader())
311
-			$this->renderHeader($writer, $user, $tableLayout, $totalColumns, false);
324
+		if($user->getHasHeader()) {
325
+					$this->renderHeader($writer, $user, $tableLayout, $totalColumns, false);
326
+		}
312 327
 
313 328
 		if($tableLayout)
314 329
 		{
@@ -320,25 +335,30 @@  discard block
 block discarded – undo
320 335
 				$writer->renderBeginTag('tr');
321 336
 				for($col = 0;$col < $columns;++$col)
322 337
 				{
323
-					if($renderedItems >= $itemCount)
324
-						break;
338
+					if($renderedItems >= $itemCount) {
339
+											break;
340
+					}
325 341
 					if($col > 0)
326 342
 					{
327 343
 						$index += $rows;
328
-						if($col - 1 >= $lastColumns)
329
-							$index--;
344
+						if($col - 1 >= $lastColumns) {
345
+													$index--;
346
+						}
347
+					}
348
+					if($index >= $itemCount) {
349
+											continue;
330 350
 					}
331
-					if($index >= $itemCount)
332
-						continue;
333 351
 					$renderedItems++;
334
-					if(($style = $user->generateItemStyle('Item', $index)) !== null)
335
-						$style->addAttributesToRender($writer);
352
+					if(($style = $user->generateItemStyle('Item', $index)) !== null) {
353
+											$style->addAttributesToRender($writer);
354
+					}
336 355
 					$writer->renderBeginTag('td');
337 356
 					$user->renderItem($writer, $this, 'Item', $index);
338 357
 					$writer->renderEndTag();
339 358
 					$writer->writeLine();
340
-					if(!$hasSeparators)
341
-						continue;
359
+					if(!$hasSeparators) {
360
+											continue;
361
+					}
342 362
 					if($renderedItems < $itemCount - 1)
343 363
 					{
344 364
 						if($columns == 1)
@@ -346,30 +366,32 @@  discard block
 block discarded – undo
346 366
 							$writer->renderEndTag();
347 367
 							$writer->renderBeginTag('tr');
348 368
 						}
349
-						if(($style = $user->generateItemStyle('Separator', $index)) !== null)
350
-							$style->addAttributesToRender($writer);
369
+						if(($style = $user->generateItemStyle('Separator', $index)) !== null) {
370
+													$style->addAttributesToRender($writer);
371
+						}
351 372
 						$writer->renderBeginTag('td');
352 373
 						$user->renderItem($writer, $this, 'Separator', $index);
353 374
 						$writer->renderEndTag();
354 375
 						$writer->writeLine();
376
+					} elseif($columns > 1) {
377
+											$writer->write("<td></td>\n");
355 378
 					}
356
-					elseif($columns > 1)
357
-						$writer->write("<td></td>\n");
358 379
 				}
359 380
 				if($row == $rows - 1)
360 381
 				{
361 382
 					$restColumns = $columns - $lastColumns;
362
-					if($hasSeparators)
363
-						$restColumns += $restColumns;
364
-					for($col = 0;$col < $restColumns;++$col)
365
-						$writer->write("<td></td>\n");
383
+					if($hasSeparators) {
384
+											$restColumns += $restColumns;
385
+					}
386
+					for($col = 0;$col < $restColumns;++$col) {
387
+											$writer->write("<td></td>\n");
388
+					}
366 389
 				}
367 390
 				$writer->renderEndTag();
368 391
 				$writer->writeLine();
369 392
 			}
370 393
 			$writer->renderEndTag();
371
-		}
372
-		else
394
+		} else
373 395
 		{
374 396
 			$renderedItems = 0;
375 397
 			for($row = 0;$row < $rows;++$row)
@@ -377,36 +399,43 @@  discard block
 block discarded – undo
377 399
 				$index = $row;
378 400
 				for($col = 0;$col < $columns;++$col)
379 401
 				{
380
-					if($renderedItems >= $itemCount)
381
-						break;
402
+					if($renderedItems >= $itemCount) {
403
+											break;
404
+					}
382 405
 					if($col > 0)
383 406
 					{
384 407
 						$index += $rows;
385
-						if($col - 1 >= $lastColumns)
386
-							$index--;
408
+						if($col - 1 >= $lastColumns) {
409
+													$index--;
410
+						}
411
+					}
412
+					if($index >= $itemCount) {
413
+											continue;
387 414
 					}
388
-					if($index >= $itemCount)
389
-						continue;
390 415
 					$renderedItems++;
391 416
 					$user->renderItem($writer, $this, 'Item', $index);
392 417
 					$writer->writeLine();
393
-					if(!$hasSeparators)
394
-						continue;
418
+					if(!$hasSeparators) {
419
+											continue;
420
+					}
395 421
 					if($renderedItems < $itemCount - 1)
396 422
 					{
397
-						if($columns == 1)
398
-							$writer->writeBreak();
423
+						if($columns == 1) {
424
+													$writer->writeBreak();
425
+						}
399 426
 						$user->renderItem($writer, $this, 'Separator', $index);
400 427
 					}
401 428
 					$writer->writeLine();
402 429
 				}
403
-				if($row < $rows - 1 || $user->getHasFooter())
404
-					$writer->writeBreak();
430
+				if($row < $rows - 1 || $user->getHasFooter()) {
431
+									$writer->writeBreak();
432
+				}
405 433
 			}
406 434
 		}
407 435
 
408
-		if($user->getHasFooter())
409
-			$this->renderFooter($writer, $user, $tableLayout, $totalColumns, false);
436
+		if($user->getHasFooter()) {
437
+					$this->renderFooter($writer, $user, $tableLayout, $totalColumns, false);
438
+		}
410 439
 
411 440
 	}
412 441
 
@@ -424,22 +453,24 @@  discard block
 block discarded – undo
424 453
 		{
425 454
 			$writer->renderBeginTag('thead');
426 455
 			$writer->renderBeginTag('tr');
427
-			if($columns > 1)
428
-				$writer->addAttribute('colspan', "$columns");
456
+			if($columns > 1) {
457
+							$writer->addAttribute('colspan', "$columns");
458
+			}
429 459
 			$writer->addAttribute('scope', 'col');
430
-			if(($style = $user->generateItemStyle('Header', -1)) !== null)
431
-				$style->addAttributesToRender($writer);
460
+			if(($style = $user->generateItemStyle('Header', -1)) !== null) {
461
+							$style->addAttributesToRender($writer);
462
+			}
432 463
 			$writer->renderBeginTag('th');
433 464
 			$user->renderItem($writer, $this, 'Header', -1);
434 465
 			$writer->renderEndTag();
435 466
 			$writer->renderEndTag();
436 467
 			$writer->renderEndTag();
437
-		}
438
-		else
468
+		} else
439 469
 		{
440 470
 			$user->renderItem($writer, $this, 'Header', -1);
441
-			if($needBreak)
442
-				$writer->writeBreak();
471
+			if($needBreak) {
472
+							$writer->writeBreak();
473
+			}
443 474
 		}
444 475
 		$writer->writeLine();
445 476
 	}
@@ -457,18 +488,20 @@  discard block
 block discarded – undo
457 488
 		{
458 489
 			$writer->renderBeginTag('tfoot');
459 490
 			$writer->renderBeginTag('tr');
460
-			if($columns > 1)
461
-				$writer->addAttribute('colspan', "$columns");
462
-			if(($style = $user->generateItemStyle('Footer', -1)) !== null)
463
-				$style->addAttributesToRender($writer);
491
+			if($columns > 1) {
492
+							$writer->addAttribute('colspan', "$columns");
493
+			}
494
+			if(($style = $user->generateItemStyle('Footer', -1)) !== null) {
495
+							$style->addAttributesToRender($writer);
496
+			}
464 497
 			$writer->renderBeginTag('td');
465 498
 			$user->renderItem($writer, $this, 'Footer', -1);
466 499
 			$writer->renderEndTag();
467 500
 			$writer->renderEndTag();
468 501
 			$writer->renderEndTag();
502
+		} else {
503
+					$user->renderItem($writer, $this, 'Footer', -1);
469 504
 		}
470
-		else
471
-			$user->renderItem($writer, $this, 'Footer', -1);
472 505
 		$writer->writeLine();
473 506
 	}
474 507
 }
475 508
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDataGridColumn.php 2 patches
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function setID($value)
91 91
 	{
92
-		if(!preg_match(TControl::ID_FORMAT, $value))
92
+		if (!preg_match(TControl::ID_FORMAT, $value))
93 93
 			throw new TInvalidDataValueException('datagridcolumn_id_invalid', get_class($this), $value);
94 94
 		$this->_id = $value;
95 95
 	}
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	public function getHeaderStyle($createStyle = true)
158 158
 	{
159
-		if(($style = $this->getViewState('HeaderStyle', null)) === null && $createStyle)
159
+		if (($style = $this->getViewState('HeaderStyle', null)) === null && $createStyle)
160 160
 		{
161 161
 			$style = new TTableItemStyle;
162 162
 			$this->setViewState('HeaderStyle', $style, null);
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	 */
211 211
 	public function getFooterStyle($createStyle = true)
212 212
 	{
213
-		if(($style = $this->getViewState('FooterStyle', null)) === null && $createStyle)
213
+		if (($style = $this->getViewState('FooterStyle', null)) === null && $createStyle)
214 214
 		{
215 215
 			$style = new TTableItemStyle;
216 216
 			$this->setViewState('FooterStyle', $style, null);
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	 */
225 225
 	public function getItemStyle($createStyle = true)
226 226
 	{
227
-		if(($style = $this->getViewState('ItemStyle', null)) === null && $createStyle)
227
+		if (($style = $this->getViewState('ItemStyle', null)) === null && $createStyle)
228 228
 		{
229 229
 			$style = new TTableItemStyle;
230 230
 			$this->setViewState('ItemStyle', $style, null);
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 	 */
292 292
 	protected function getViewState($key, $defaultValue = null)
293 293
 	{
294
-		return isset($this->_viewState[$key])?$this->_viewState[$key]:$defaultValue;
294
+		return isset($this->_viewState[$key]) ? $this->_viewState[$key] : $defaultValue;
295 295
 	}
296 296
 
297 297
 	/**
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 	 */
305 305
 	protected function setViewState($key, $value, $defaultValue = null)
306 306
 	{
307
-		if($value === $defaultValue)
307
+		if ($value === $defaultValue)
308 308
 			unset($this->_viewState[$key]);
309 309
 		else
310 310
 			$this->_viewState[$key] = $value;
@@ -384,9 +384,9 @@  discard block
 block discarded – undo
384 384
 	 */
385 385
 	public function initializeCell($cell, $columnIndex, $itemType)
386 386
 	{
387
-		if($itemType === TListItemType::Header)
387
+		if ($itemType === TListItemType::Header)
388 388
 			$this->initializeHeaderCell($cell, $columnIndex);
389
-		elseif($itemType === TListItemType::Footer)
389
+		elseif ($itemType === TListItemType::Footer)
390 390
 			$this->initializeFooterCell($cell, $columnIndex);
391 391
 	}
392 392
 
@@ -419,13 +419,13 @@  discard block
 block discarded – undo
419 419
 	{
420 420
 		$text = $this->getHeaderText();
421 421
 
422
-		if(($classPath = $this->getHeaderRenderer()) !== '')
422
+		if (($classPath = $this->getHeaderRenderer()) !== '')
423 423
 		{
424 424
 			$control = Prado::createComponent($classPath);
425 425
 			$cell->getControls()->add($control);
426
-			if($control instanceof \Prado\IDataRenderer)
426
+			if ($control instanceof \Prado\IDataRenderer)
427 427
 			{
428
-				if($control instanceof IItemDataRenderer)
428
+				if ($control instanceof IItemDataRenderer)
429 429
 				{
430 430
 					$item = $cell->getParent();
431 431
 					$control->setItemIndex($item->getItemIndex());
@@ -434,21 +434,21 @@  discard block
 block discarded – undo
434 434
 				$control->setData($text);
435 435
 			}
436 436
 		}
437
-		elseif($this->getAllowSorting())
437
+		elseif ($this->getAllowSorting())
438 438
 		{
439 439
 			$sortExpression = $this->getSortExpression();
440
-			if(($url = $this->getHeaderImageUrl()) !== '')
440
+			if (($url = $this->getHeaderImageUrl()) !== '')
441 441
 			{
442 442
 				$button = new TImageButton;
443 443
 				$button->setImageUrl($url);
444 444
 				$button->setCommandName(TDataGrid::CMD_SORT);
445 445
 				$button->setCommandParameter($sortExpression);
446
-				if($text !== '')
446
+				if ($text !== '')
447 447
 					$button->setAlternateText($text);
448 448
 				$button->setCausesValidation(false);
449 449
 				$cell->getControls()->add($button);
450 450
 			}
451
-			elseif($text !== '')
451
+			elseif ($text !== '')
452 452
 			{
453 453
 				$button = new TLinkButton;
454 454
 				$button->setText($text);
@@ -462,15 +462,15 @@  discard block
 block discarded – undo
462 462
 		}
463 463
 		else
464 464
 		{
465
-			if(($url = $this->getHeaderImageUrl()) !== '')
465
+			if (($url = $this->getHeaderImageUrl()) !== '')
466 466
 			{
467 467
 				$image = new TImage;
468 468
 				$image->setImageUrl($url);
469
-				if($text !== '')
469
+				if ($text !== '')
470 470
 					$image->setAlternateText($text);
471 471
 				$cell->getControls()->add($image);
472 472
 			}
473
-			elseif($text !== '')
473
+			elseif ($text !== '')
474 474
 				$cell->setText($text);
475 475
 			else
476 476
 				$cell->setText('&nbsp;');
@@ -490,13 +490,13 @@  discard block
 block discarded – undo
490 490
 	protected function initializeFooterCell($cell, $columnIndex)
491 491
 	{
492 492
 		$text = $this->getFooterText();
493
-		if(($classPath = $this->getFooterRenderer()) !== '')
493
+		if (($classPath = $this->getFooterRenderer()) !== '')
494 494
 		{
495 495
 			$control = Prado::createComponent($classPath);
496 496
 			$cell->getControls()->add($control);
497
-			if($control instanceof \Prado\IDataRenderer)
497
+			if ($control instanceof \Prado\IDataRenderer)
498 498
 			{
499
-				if($control instanceof IItemDataRenderer)
499
+				if ($control instanceof IItemDataRenderer)
500 500
 				{
501 501
 					$item = $cell->getParent();
502 502
 					$control->setItemIndex($item->getItemIndex());
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 				$control->setData($text);
506 506
 			}
507 507
 		}
508
-		elseif($text !== '')
508
+		elseif ($text !== '')
509 509
 			$cell->setText($text);
510 510
 		else
511 511
 			$cell->setText('&nbsp;');
@@ -525,18 +525,18 @@  discard block
 block discarded – undo
525 525
 	 */
526 526
 	protected function formatDataValue($formatString, $value)
527 527
 	{
528
-		if($formatString === '')
528
+		if ($formatString === '')
529 529
 			return TPropertyValue::ensureString($value);
530
-		elseif($formatString[0] === '#')
530
+		elseif ($formatString[0] === '#')
531 531
 		{
532 532
 			$expression = strtr(substr($formatString, 1), ['{0}' => '$value']);
533 533
 			try
534 534
 			{
535
-				if(eval("\$result=$expression;") === false)
535
+				if (eval("\$result=$expression;") === false)
536 536
 					throw new Exception('');
537 537
 				return $result;
538 538
 			}
539
-			catch(Exception $e)
539
+			catch (Exception $e)
540 540
 			{
541 541
 				throw new TInvalidDataValueException('datagridcolumn_expression_invalid', get_class($this), $expression, $e->getMessage());
542 542
 			}
Please login to merge, or discard this patch.
Braces   +41 added lines, -39 removed lines patch added patch discarded remove patch
@@ -89,8 +89,9 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function setID($value)
91 91
 	{
92
-		if(!preg_match(TControl::ID_FORMAT, $value))
93
-			throw new TInvalidDataValueException('datagridcolumn_id_invalid', get_class($this), $value);
92
+		if(!preg_match(TControl::ID_FORMAT, $value)) {
93
+					throw new TInvalidDataValueException('datagridcolumn_id_invalid', get_class($this), $value);
94
+		}
94 95
 		$this->_id = $value;
95 96
 	}
96 97
 
@@ -304,10 +305,11 @@  discard block
 block discarded – undo
304 305
 	 */
305 306
 	protected function setViewState($key, $value, $defaultValue = null)
306 307
 	{
307
-		if($value === $defaultValue)
308
-			unset($this->_viewState[$key]);
309
-		else
310
-			$this->_viewState[$key] = $value;
308
+		if($value === $defaultValue) {
309
+					unset($this->_viewState[$key]);
310
+		} else {
311
+					$this->_viewState[$key] = $value;
312
+		}
311 313
 	}
312 314
 
313 315
 	/**
@@ -384,10 +386,11 @@  discard block
 block discarded – undo
384 386
 	 */
385 387
 	public function initializeCell($cell, $columnIndex, $itemType)
386 388
 	{
387
-		if($itemType === TListItemType::Header)
388
-			$this->initializeHeaderCell($cell, $columnIndex);
389
-		elseif($itemType === TListItemType::Footer)
390
-			$this->initializeFooterCell($cell, $columnIndex);
389
+		if($itemType === TListItemType::Header) {
390
+					$this->initializeHeaderCell($cell, $columnIndex);
391
+		} elseif($itemType === TListItemType::Footer) {
392
+					$this->initializeFooterCell($cell, $columnIndex);
393
+		}
391 394
 	}
392 395
 
393 396
 	/**
@@ -433,8 +436,7 @@  discard block
 block discarded – undo
433 436
 				}
434 437
 				$control->setData($text);
435 438
 			}
436
-		}
437
-		elseif($this->getAllowSorting())
439
+		} elseif($this->getAllowSorting())
438 440
 		{
439 441
 			$sortExpression = $this->getSortExpression();
440 442
 			if(($url = $this->getHeaderImageUrl()) !== '')
@@ -443,12 +445,12 @@  discard block
 block discarded – undo
443 445
 				$button->setImageUrl($url);
444 446
 				$button->setCommandName(TDataGrid::CMD_SORT);
445 447
 				$button->setCommandParameter($sortExpression);
446
-				if($text !== '')
447
-					$button->setAlternateText($text);
448
+				if($text !== '') {
449
+									$button->setAlternateText($text);
450
+				}
448 451
 				$button->setCausesValidation(false);
449 452
 				$cell->getControls()->add($button);
450
-			}
451
-			elseif($text !== '')
453
+			} elseif($text !== '')
452 454
 			{
453 455
 				$button = new TLinkButton;
454 456
 				$button->setText($text);
@@ -456,24 +458,24 @@  discard block
 block discarded – undo
456 458
 				$button->setCommandParameter($sortExpression);
457 459
 				$button->setCausesValidation(false);
458 460
 				$cell->getControls()->add($button);
461
+			} else {
462
+							$cell->setText('&nbsp;');
459 463
 			}
460
-			else
461
-				$cell->setText('&nbsp;');
462
-		}
463
-		else
464
+		} else
464 465
 		{
465 466
 			if(($url = $this->getHeaderImageUrl()) !== '')
466 467
 			{
467 468
 				$image = new TImage;
468 469
 				$image->setImageUrl($url);
469
-				if($text !== '')
470
-					$image->setAlternateText($text);
470
+				if($text !== '') {
471
+									$image->setAlternateText($text);
472
+				}
471 473
 				$cell->getControls()->add($image);
474
+			} elseif($text !== '') {
475
+							$cell->setText($text);
476
+			} else {
477
+							$cell->setText('&nbsp;');
472 478
 			}
473
-			elseif($text !== '')
474
-				$cell->setText($text);
475
-			else
476
-				$cell->setText('&nbsp;');
477 479
 		}
478 480
 	}
479 481
 
@@ -504,11 +506,11 @@  discard block
 block discarded – undo
504 506
 				}
505 507
 				$control->setData($text);
506 508
 			}
509
+		} elseif($text !== '') {
510
+					$cell->setText($text);
511
+		} else {
512
+					$cell->setText('&nbsp;');
507 513
 		}
508
-		elseif($text !== '')
509
-			$cell->setText($text);
510
-		else
511
-			$cell->setText('&nbsp;');
512 514
 	}
513 515
 
514 516
 	/**
@@ -525,23 +527,23 @@  discard block
 block discarded – undo
525 527
 	 */
526 528
 	protected function formatDataValue($formatString, $value)
527 529
 	{
528
-		if($formatString === '')
529
-			return TPropertyValue::ensureString($value);
530
-		elseif($formatString[0] === '#')
530
+		if($formatString === '') {
531
+					return TPropertyValue::ensureString($value);
532
+		} elseif($formatString[0] === '#')
531 533
 		{
532 534
 			$expression = strtr(substr($formatString, 1), ['{0}' => '$value']);
533 535
 			try
534 536
 			{
535
-				if(eval("\$result=$expression;") === false)
536
-					throw new Exception('');
537
+				if(eval("\$result=$expression;") === false) {
538
+									throw new Exception('');
539
+				}
537 540
 				return $result;
538
-			}
539
-			catch(Exception $e)
541
+			} catch(Exception $e)
540 542
 			{
541 543
 				throw new TInvalidDataValueException('datagridcolumn_expression_invalid', get_class($this), $expression, $e->getMessage());
542 544
 			}
545
+		} else {
546
+					return sprintf($formatString, $value);
543 547
 		}
544
-		else
545
-			return sprintf($formatString, $value);
546 548
 	}
547 549
 }
548 550
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TXmlTransform.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
    * @throws TConfigurationException If XSL extension is not available
57 57
    */
58 58
   public function __construct() {
59
-	if(!class_exists('XSLTProcessor', false)) {
59
+	if (!class_exists('XSLTProcessor', false)) {
60 60
 	  throw new TConfigurationException('xmltransform_xslextension_required');
61 61
 	}
62 62
   }
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
    * @param string The path to the XML style sheet.  It must be in namespace format.
73 73
    */
74 74
   public function setTransformPath($value) {
75
-	if(!is_file($value)) {
75
+	if (!is_file($value)) {
76 76
 	  $value = Prado::getPathOfNamespace($value, self::EXT_XSL_FILE);
77
-	  if($value === null) {
77
+	  if ($value === null) {
78 78
 	throw new TInvalidDataValueException('xmltransform_transformpath_invalid', $value);
79 79
 	  }
80 80
 	}
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
    * @throws TInvalidDataValueException
108 108
    */
109 109
   public function setDocumentPath($value) {
110
-	if(!is_file($value)) {
110
+	if (!is_file($value)) {
111 111
 	  $value = Prado::getPathOfNamespace($value, self::EXT_XML_FILE);
112
-	  if($value === null) {
112
+	  if ($value === null) {
113 113
 	throw new TInvalidDataValueException('xmltransform_documentpath_invalid', $value);
114 114
 	  }
115 115
 	}
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
    * @return TAttributeCollection the list of custom parameters
136 136
    */
137 137
   public function getParameters() {
138
-	if($params = $this->getViewState('Parameters', null)) {
138
+	if ($params = $this->getViewState('Parameters', null)) {
139 139
 	  return $params;
140 140
 	} else {
141 141
 	  $params = new TAttributeCollection();
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
   }
146 146
 
147 147
   private function getTransformXmlDocument() {
148
-	if(($content = $this->getTransformContent()) !== '') {
148
+	if (($content = $this->getTransformContent()) !== '') {
149 149
 	  $document = new DOMDocument();
150 150
 	  $document->loadXML($content);
151 151
 	  return $document;
152
-	} elseif(($path = $this->getTransformPath()) !== '') {
152
+	} elseif (($path = $this->getTransformPath()) !== '') {
153 153
 	  $document = new DOMDocument();
154 154
 	  $document->load($path);
155 155
 	  return $document;
@@ -159,11 +159,11 @@  discard block
 block discarded – undo
159 159
   }
160 160
 
161 161
   private function getSourceXmlDocument() {
162
-	if(($content = $this->getDocumentContent()) !== '') {
162
+	if (($content = $this->getDocumentContent()) !== '') {
163 163
 	  $document = new DOMDocument();
164 164
 	  $document->loadXML($content);
165 165
 	  return $document;
166
-	} elseif(($path = $this->getDocumentPath()) !== '') {
166
+	} elseif (($path = $this->getDocumentPath()) !== '') {
167 167
 	  $document = new DOMDocument();
168 168
 	  $document->load($path);
169 169
 	  return $document;
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
    * @param THtmlWriter The writer used for the rendering purpose
178 178
    */
179 179
   public function render($writer) {
180
-	if(($document = $this->getSourceXmlDocument()) === null) {
180
+	if (($document = $this->getSourceXmlDocument()) === null) {
181 181
 	  $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
182 182
 	  parent::render($htmlWriter);
183 183
 	  $document = new DOMDocument();
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
 	// Check for parameters
193 193
 	$parameters = $this->getParameters();
194
-	foreach($parameters as $name => $value) {
194
+	foreach ($parameters as $name => $value) {
195 195
 	  $xslt->setParameter('', $name, $value);
196 196
 	}
197 197
 	$output = $xslt->transformToXML($document);
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TListControlValidator.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 */
85 85
 	public function setMinSelection($value)
86 86
 	{
87
-		if(($value = TPropertyValue::ensureInteger($value)) < 0)
87
+		if (($value = TPropertyValue::ensureInteger($value)) < 0)
88 88
 			$value = -1;
89 89
 		$this->setViewState('MinSelection', $value, -1);
90 90
 	}
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function setMaxSelection($value)
104 104
 	{
105
-		if(($value = TPropertyValue::ensureInteger($value)) < 0)
105
+		if (($value = TPropertyValue::ensureInteger($value)) < 0)
106 106
 			$value = -1;
107 107
 		$this->setViewState('MaxSelection', $value, -1);
108 108
 	}
@@ -141,22 +141,22 @@  discard block
 block discarded – undo
141 141
 		$required = $this->getRequiredValues();
142 142
 
143 143
 		//if required, check the values
144
-		if(!empty($required))
144
+		if (!empty($required))
145 145
 		{
146
-			if($count < count($required))
146
+			if ($count < count($required))
147 147
 				return false;
148
-			foreach($required as $require)
148
+			foreach ($required as $require)
149 149
 				$exists = $exists && in_array($require, $values);
150 150
 		}
151 151
 
152 152
 		$min = $this->getMinSelection();
153 153
 		$max = $this->getMaxSelection();
154 154
 
155
-		if($min !== -1 && $max !== -1)
155
+		if ($min !== -1 && $max !== -1)
156 156
 			return $exists && $count >= $min && $count <= $max;
157
-		elseif($min === -1 && $max !== -1)
157
+		elseif ($min === -1 && $max !== -1)
158 158
 			return $exists && $count <= $max;
159
-		elseif($min !== -1 && $max === -1)
159
+		elseif ($min !== -1 && $max === -1)
160 160
 			return $exists && $count >= $min;
161 161
 		else
162 162
 			return $exists;
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 		$values = [];
172 172
 
173 173
 		//get the data
174
-		foreach($control->getItems() as $item)
174
+		foreach ($control->getItems() as $item)
175 175
 		{
176
-			if($item->getSelected())
176
+			if ($item->getSelected())
177 177
 				$values[] = $item->getValue();
178 178
 		}
179 179
 		return $values;
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 	{
187 187
 		$required = [];
188 188
 		$string = $this->getRequiredSelections();
189
-		if(!empty($string))
189
+		if (!empty($string))
190 190
 			$required = preg_split('/,\s*/', $string);
191 191
 		return $required;
192 192
 	}
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 		$options = parent::getClientScriptOptions();
201 201
 		$control = $this->getValidationTarget();
202 202
 
203
-		if(!$control instanceof TListControl)
203
+		if (!$control instanceof TListControl)
204 204
 		{
205 205
 			throw new TConfigurationException(
206 206
 				'listcontrolvalidator_invalid_control',
@@ -209,12 +209,12 @@  discard block
 block discarded – undo
209 209
 
210 210
 		$min = $this->getMinSelection();
211 211
 		$max = $this->getMaxSelection();
212
-		if($min !== -1)
212
+		if ($min !== -1)
213 213
 			$options['Min'] = $min;
214
-		if($max !== -1)
214
+		if ($max !== -1)
215 215
 			$options['Max'] = $max;
216 216
 		$required = $this->getRequiredSelections();
217
-		if(strlen($required) > 0)
217
+		if (strlen($required) > 0)
218 218
 			$options['Required'] = $required;
219 219
 		$options['TotalItems'] = $control->getItemCount();
220 220
 
Please login to merge, or discard this patch.
Braces   +36 added lines, -26 removed lines patch added patch discarded remove patch
@@ -84,8 +84,9 @@  discard block
 block discarded – undo
84 84
 	 */
85 85
 	public function setMinSelection($value)
86 86
 	{
87
-		if(($value = TPropertyValue::ensureInteger($value)) < 0)
88
-			$value = -1;
87
+		if(($value = TPropertyValue::ensureInteger($value)) < 0) {
88
+					$value = -1;
89
+		}
89 90
 		$this->setViewState('MinSelection', $value, -1);
90 91
 	}
91 92
 
@@ -102,8 +103,9 @@  discard block
 block discarded – undo
102 103
 	 */
103 104
 	public function setMaxSelection($value)
104 105
 	{
105
-		if(($value = TPropertyValue::ensureInteger($value)) < 0)
106
-			$value = -1;
106
+		if(($value = TPropertyValue::ensureInteger($value)) < 0) {
107
+					$value = -1;
108
+		}
107 109
 		$this->setViewState('MaxSelection', $value, -1);
108 110
 	}
109 111
 
@@ -143,23 +145,26 @@  discard block
 block discarded – undo
143 145
 		//if required, check the values
144 146
 		if(!empty($required))
145 147
 		{
146
-			if($count < count($required))
147
-				return false;
148
-			foreach($required as $require)
149
-				$exists = $exists && in_array($require, $values);
148
+			if($count < count($required)) {
149
+							return false;
150
+			}
151
+			foreach($required as $require) {
152
+							$exists = $exists && in_array($require, $values);
153
+			}
150 154
 		}
151 155
 
152 156
 		$min = $this->getMinSelection();
153 157
 		$max = $this->getMaxSelection();
154 158
 
155
-		if($min !== -1 && $max !== -1)
156
-			return $exists && $count >= $min && $count <= $max;
157
-		elseif($min === -1 && $max !== -1)
158
-			return $exists && $count <= $max;
159
-		elseif($min !== -1 && $max === -1)
160
-			return $exists && $count >= $min;
161
-		else
162
-			return $exists;
159
+		if($min !== -1 && $max !== -1) {
160
+					return $exists && $count >= $min && $count <= $max;
161
+		} elseif($min === -1 && $max !== -1) {
162
+					return $exists && $count <= $max;
163
+		} elseif($min !== -1 && $max === -1) {
164
+					return $exists && $count >= $min;
165
+		} else {
166
+					return $exists;
167
+		}
163 168
 	}
164 169
 
165 170
 	/**
@@ -173,8 +178,9 @@  discard block
 block discarded – undo
173 178
 		//get the data
174 179
 		foreach($control->getItems() as $item)
175 180
 		{
176
-			if($item->getSelected())
177
-				$values[] = $item->getValue();
181
+			if($item->getSelected()) {
182
+							$values[] = $item->getValue();
183
+			}
178 184
 		}
179 185
 		return $values;
180 186
 	}
@@ -186,8 +192,9 @@  discard block
 block discarded – undo
186 192
 	{
187 193
 		$required = [];
188 194
 		$string = $this->getRequiredSelections();
189
-		if(!empty($string))
190
-			$required = preg_split('/,\s*/', $string);
195
+		if(!empty($string)) {
196
+					$required = preg_split('/,\s*/', $string);
197
+		}
191 198
 		return $required;
192 199
 	}
193 200
 
@@ -209,13 +216,16 @@  discard block
 block discarded – undo
209 216
 
210 217
 		$min = $this->getMinSelection();
211 218
 		$max = $this->getMaxSelection();
212
-		if($min !== -1)
213
-			$options['Min'] = $min;
214
-		if($max !== -1)
215
-			$options['Max'] = $max;
219
+		if($min !== -1) {
220
+					$options['Min'] = $min;
221
+		}
222
+		if($max !== -1) {
223
+					$options['Max'] = $max;
224
+		}
216 225
 		$required = $this->getRequiredSelections();
217
-		if(strlen($required) > 0)
218
-			$options['Required'] = $required;
226
+		if(strlen($required) > 0) {
227
+					$options['Required'] = $required;
228
+		}
219 229
 		$options['TotalItems'] = $control->getItemCount();
220 230
 
221 231
 		return $options;
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTabPanel.php 2 patches
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function addParsedObject($object)
85 85
 	{
86
-		if($object instanceof TTabView)
86
+		if ($object instanceof TTabView)
87 87
 			$this->getControls()->add($object);
88 88
 	}
89 89
 
@@ -137,32 +137,32 @@  discard block
 block discarded – undo
137 137
 	{
138 138
 		$activeView = null;
139 139
 		$views = $this->getViews();
140
-		if(($id = $this->getActiveViewID()) !== '')
140
+		if (($id = $this->getActiveViewID()) !== '')
141 141
 		{
142
-			if(($index = $views->findIndexByID($id)) >= 0)
142
+			if (($index = $views->findIndexByID($id)) >= 0)
143 143
 				$activeView = $views->itemAt($index);
144 144
 			else
145 145
 				throw new TInvalidDataValueException('tabpanel_activeviewid_invalid', $id);
146 146
 		}
147
-		elseif(($index = $this->getActiveViewIndex()) >= 0)
147
+		elseif (($index = $this->getActiveViewIndex()) >= 0)
148 148
 		{
149
-			if($index < $views->getCount())
149
+			if ($index < $views->getCount())
150 150
 				$activeView = $views->itemAt($index);
151 151
 			else
152 152
 				throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid', $index);
153 153
 		}
154 154
 		else
155 155
 		{
156
-			foreach($views as $index => $view)
156
+			foreach ($views as $index => $view)
157 157
 			{
158
-				if($view->getActive())
158
+				if ($view->getActive())
159 159
 				{
160 160
 					$activeView = $view;
161 161
 					break;
162 162
 				}
163 163
 			}
164 164
 		}
165
-		if($activeView !== null)
165
+		if ($activeView !== null)
166 166
 			$this->activateView($activeView);
167 167
 		return $activeView;
168 168
 	}
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 */
174 174
 	public function setActiveView($view)
175 175
 	{
176
-		if($this->getViews()->indexOf($view) >= 0)
176
+		if ($this->getViews()->indexOf($view) >= 0)
177 177
 			$this->activateView($view);
178 178
 		else
179 179
 			throw new TInvalidOperationException('tabpanel_view_inexistent');
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	public function getCssClass()
219 219
 	{
220 220
 		$cssClass = parent::getCssClass();
221
-		return $cssClass === ''?'tab-panel':$cssClass;
221
+		return $cssClass === '' ? 'tab-panel' : $cssClass;
222 222
 	}
223 223
 
224 224
 	/**
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 	 */
243 243
 	public function getViewStyle()
244 244
 	{
245
-		if(($style = $this->getViewState('ViewStyle', null)) === null)
245
+		if (($style = $this->getViewState('ViewStyle', null)) === null)
246 246
 		{
247 247
 			$style = new TStyle;
248 248
 			$style->setCssClass('tab-view');
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 	 */
273 273
 	public function getTabStyle()
274 274
 	{
275
-		if(($style = $this->getViewState('TabStyle', null)) === null)
275
+		if (($style = $this->getViewState('TabStyle', null)) === null)
276 276
 		{
277 277
 			$style = new TStyle;
278 278
 			$style->setCssClass('tab-normal');
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 	 */
303 303
 	public function getActiveTabStyle()
304 304
 	{
305
-		if(($style = $this->getViewState('ActiveTabStyle', null)) === null)
305
+		if (($style = $this->getViewState('ActiveTabStyle', null)) === null)
306 306
 		{
307 307
 			$style = new TStyle;
308 308
 			$style->setCssClass('tab-active');
@@ -320,9 +320,9 @@  discard block
 block discarded – undo
320 320
 	{
321 321
 		$this->setActiveViewIndex(-1);
322 322
 		$this->setActiveViewID('');
323
-		foreach($this->getViews() as $index => $v)
323
+		foreach ($this->getViews() as $index => $v)
324 324
 		{
325
-			if($view === $v)
325
+			if ($view === $v)
326 326
 			{
327 327
 				$this->setActiveViewIndex($index);
328 328
 				$this->setActiveViewID($view->getID(false));
@@ -342,11 +342,11 @@  discard block
 block discarded – undo
342 342
 	 */
343 343
 	public function loadPostData($key, $values)
344 344
 	{
345
-		if(($index = $values[$this->getClientID() . '_1']) !== null)
345
+		if (($index = $values[$this->getClientID().'_1']) !== null)
346 346
 		{
347
-			$index = (int)$index;
347
+			$index = (int) $index;
348 348
 			$currentIndex = $this->getActiveViewIndex();
349
-			if($currentIndex !== $index)
349
+			if ($currentIndex !== $index)
350 350
 			{
351 351
 				$this->setActiveViewID(''); // clear up view ID
352 352
 				$this->setActiveViewIndex($index);
@@ -397,12 +397,12 @@  discard block
 block discarded – undo
397 397
 	public function onPreRender($param)
398 398
 	{
399 399
 		parent::onPreRender($param);
400
-		$this->getActiveView();  // determine the active view
400
+		$this->getActiveView(); // determine the active view
401 401
 		$this->registerStyleSheet();
402 402
 
403 403
 		$page = $this->getPage();
404 404
 		$page->registerRequiresPostData($this);
405
-		$page->registerRequiresPostData($this->getClientID() . "_1");
405
+		$page->registerRequiresPostData($this->getClientID()."_1");
406 406
 	}
407 407
 
408 408
 	/**
@@ -414,15 +414,15 @@  discard block
 block discarded – undo
414 414
 	{
415 415
 		$url = $this->getCssUrl();
416 416
 
417
-		if($url === '') {
417
+		if ($url === '') {
418 418
 			return;
419 419
 		}
420 420
 
421
-		if($url === 'default') {
422
-			$url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'tabpanel.css');
421
+		if ($url === 'default') {
422
+			$url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'tabpanel.css');
423 423
 		}
424 424
 
425
-		if($url !== '') {
425
+		if ($url !== '') {
426 426
 			$this->getPage()->getClientScript()->registerStyleSheetFile($url, $url);
427 427
 		}
428 428
 	}
@@ -441,9 +441,9 @@  discard block
 block discarded – undo
441 441
 		$cs->registerEndScript("prado:$id", $code);
442 442
 		// ensure an item is always active and visible
443 443
 		$index = $this->getActiveViewIndex();
444
-		if(!$this->getViews()->itemAt($index)->Visible)
444
+		if (!$this->getViews()->itemAt($index)->Visible)
445 445
 			$index = 0;
446
-		$cs->registerHiddenField($id . '_1', $index);
446
+		$cs->registerHiddenField($id.'_1', $index);
447 447
 	}
448 448
 
449 449
 	/**
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
 		$options['NormalCssClass'] = $this->getTabCssClass();
467 467
 		$viewIDs = [];
468 468
 		$viewVis = [];
469
-		foreach($this->getViews() as $view)
469
+		foreach ($this->getViews() as $view)
470 470
 		{
471 471
 			$viewIDs[] = $view->getClientID();
472 472
 			$viewVis[] = $view->getVisible();
@@ -508,17 +508,17 @@  discard block
 block discarded – undo
508 508
 	public function renderContents($writer)
509 509
 	{
510 510
 		$views = $this->getViews();
511
-		if($views->getCount() > 0)
511
+		if ($views->getCount() > 0)
512 512
 		{
513 513
 			$writer->writeLine();
514 514
 			// render tab bar
515
-			foreach($views as $view)
515
+			foreach ($views as $view)
516 516
 			{
517 517
 				$view->renderTab($writer);
518 518
 				$writer->writeLine();
519 519
 			}
520 520
 			// render tab views
521
-			foreach($views as $view)
521
+			foreach ($views as $view)
522 522
 			{
523 523
 				$view->renderControl($writer);
524 524
 				$writer->writeLine();
Please login to merge, or discard this patch.
Braces   +28 added lines, -24 removed lines patch added patch discarded remove patch
@@ -83,8 +83,9 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function addParsedObject($object)
85 85
 	{
86
-		if($object instanceof TTabView)
87
-			$this->getControls()->add($object);
86
+		if($object instanceof TTabView) {
87
+					$this->getControls()->add($object);
88
+		}
88 89
 	}
89 90
 
90 91
 	/**
@@ -139,19 +140,19 @@  discard block
 block discarded – undo
139 140
 		$views = $this->getViews();
140 141
 		if(($id = $this->getActiveViewID()) !== '')
141 142
 		{
142
-			if(($index = $views->findIndexByID($id)) >= 0)
143
-				$activeView = $views->itemAt($index);
144
-			else
145
-				throw new TInvalidDataValueException('tabpanel_activeviewid_invalid', $id);
146
-		}
147
-		elseif(($index = $this->getActiveViewIndex()) >= 0)
143
+			if(($index = $views->findIndexByID($id)) >= 0) {
144
+							$activeView = $views->itemAt($index);
145
+			} else {
146
+							throw new TInvalidDataValueException('tabpanel_activeviewid_invalid', $id);
147
+			}
148
+		} elseif(($index = $this->getActiveViewIndex()) >= 0)
148 149
 		{
149
-			if($index < $views->getCount())
150
-				$activeView = $views->itemAt($index);
151
-			else
152
-				throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid', $index);
153
-		}
154
-		else
150
+			if($index < $views->getCount()) {
151
+							$activeView = $views->itemAt($index);
152
+			} else {
153
+							throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid', $index);
154
+			}
155
+		} else
155 156
 		{
156 157
 			foreach($views as $index => $view)
157 158
 			{
@@ -162,8 +163,9 @@  discard block
 block discarded – undo
162 163
 				}
163 164
 			}
164 165
 		}
165
-		if($activeView !== null)
166
-			$this->activateView($activeView);
166
+		if($activeView !== null) {
167
+					$this->activateView($activeView);
168
+		}
167 169
 		return $activeView;
168 170
 	}
169 171
 
@@ -173,10 +175,11 @@  discard block
 block discarded – undo
173 175
 	 */
174 176
 	public function setActiveView($view)
175 177
 	{
176
-		if($this->getViews()->indexOf($view) >= 0)
177
-			$this->activateView($view);
178
-		else
179
-			throw new TInvalidOperationException('tabpanel_view_inexistent');
178
+		if($this->getViews()->indexOf($view) >= 0) {
179
+					$this->activateView($view);
180
+		} else {
181
+					throw new TInvalidOperationException('tabpanel_view_inexistent');
182
+		}
180 183
 	}
181 184
 
182 185
 	/**
@@ -327,9 +330,9 @@  discard block
 block discarded – undo
327 330
 				$this->setActiveViewIndex($index);
328 331
 				$this->setActiveViewID($view->getID(false));
329 332
 				$view->setActive(true);
333
+			} else {
334
+							$v->setActive(false);
330 335
 			}
331
-			else
332
-				$v->setActive(false);
333 336
 		}
334 337
 	}
335 338
 
@@ -441,8 +444,9 @@  discard block
 block discarded – undo
441 444
 		$cs->registerEndScript("prado:$id", $code);
442 445
 		// ensure an item is always active and visible
443 446
 		$index = $this->getActiveViewIndex();
444
-		if(!$this->getViews()->itemAt($index)->Visible)
445
-			$index = 0;
447
+		if(!$this->getViews()->itemAt($index)->Visible) {
448
+					$index = 0;
449
+		}
446 450
 		$cs->registerHiddenField($id . '_1', $index);
447 451
 	}
448 452
 
Please login to merge, or discard this patch.