Completed
Push — prado-3.3 ( f4da81...5dd4b5 )
by Fabio
09:03
created
framework/Web/UI/WebControls/TRangeValidator.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 */
66 66
 	public function getMinValue()
67 67
 	{
68
-		return $this->getViewState('MinValue','');
68
+		return $this->getViewState('MinValue', '');
69 69
 	}
70 70
 
71 71
 	/**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public function setMinValue($value)
76 76
 	{
77
-		$this->setViewState('MinValue',TPropertyValue::ensureString($value),'');
77
+		$this->setViewState('MinValue', TPropertyValue::ensureString($value), '');
78 78
 	}
79 79
 
80 80
 	/**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	public function getMaxValue()
84 84
 	{
85
-		return $this->getViewState('MaxValue','');
85
+		return $this->getViewState('MaxValue', '');
86 86
 	}
87 87
 
88 88
 	/**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function setMaxValue($value)
93 93
 	{
94
-		$this->setViewState('MaxValue',TPropertyValue::ensureString($value),'');
94
+		$this->setViewState('MaxValue', TPropertyValue::ensureString($value), '');
95 95
 	}
96 96
 
97 97
 	/**
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 */
100 100
 	public function setStrictComparison($value)
101 101
 	{
102
-		$this->setViewState('StrictComparison', TPropertyValue::ensureBoolean($value),false);
102
+		$this->setViewState('StrictComparison', TPropertyValue::ensureBoolean($value), false);
103 103
 	}
104 104
 
105 105
 	/**
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 */
117 117
 	public function getDataType()
118 118
 	{
119
-		return $this->getViewState('DataType',TRangeValidationDataType::String);
119
+		return $this->getViewState('DataType', TRangeValidationDataType::String);
120 120
 	}
121 121
 
122 122
 	/**
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 */
126 126
 	public function setDataType($value)
127 127
 	{
128
-		$this->setViewState('DataType',TPropertyValue::ensureEnum($value,'TRangeValidationDataType'),TRangeValidationDataType::String);
128
+		$this->setViewState('DataType', TPropertyValue::ensureEnum($value, 'TRangeValidationDataType'), TRangeValidationDataType::String);
129 129
 	}
130 130
 
131 131
 	/**
@@ -198,16 +198,16 @@  discard block
 block discarded – undo
198 198
 		$minValue=$this->getMinValue();
199 199
 		$maxValue=$this->getMaxValue();
200 200
 
201
-		$valid=preg_match('/^[-+]?[0-9]+$/',trim($value));
201
+		$valid=preg_match('/^[-+]?[0-9]+$/', trim($value));
202 202
 		$value=intval($value);
203 203
 		if($minValue!=='')
204 204
 			$valid=$valid && $this->isGreaterThan($value, intval($minValue));
205 205
 		if($maxValue!=='')
206
-			$valid=$valid && $this->isLessThan($value,intval($maxValue));
206
+			$valid=$valid && $this->isLessThan($value, intval($maxValue));
207 207
 		return $valid;
208 208
 	}
209 209
 
210
-	protected function isLessThan($left,$right)
210
+	protected function isLessThan($left, $right)
211 211
 	{
212 212
 		return $this->getStrictComparison() ? $left < $right : $left <= $right;
213 213
 	}
@@ -227,12 +227,12 @@  discard block
 block discarded – undo
227 227
 		$minValue=$this->getMinValue();
228 228
 		$maxValue=$this->getMaxValue();
229 229
 
230
-		$valid=preg_match('/^[-+]?([0-9]*\.)?[0-9]+([eE][-+]?[0-9]+)?$/',trim($value));
230
+		$valid=preg_match('/^[-+]?([0-9]*\.)?[0-9]+([eE][-+]?[0-9]+)?$/', trim($value));
231 231
 		$value=floatval($value);
232 232
 		if($minValue!=='')
233
-			$valid=$valid && $this->isGreaterThan($value,floatval($minValue));
233
+			$valid=$valid && $this->isGreaterThan($value, floatval($minValue));
234 234
 		if($maxValue!=='')
235
-			$valid=$valid && $this->isLessThan($value,floatval($maxValue));
235
+			$valid=$valid && $this->isLessThan($value, floatval($maxValue));
236 236
 		return $valid;
237 237
 	}
238 238
 
@@ -249,24 +249,24 @@  discard block
 block discarded – undo
249 249
 
250 250
 		$valid=true;
251 251
 
252
-		$dateFormat = $this->getDateFormat();
252
+		$dateFormat=$this->getDateFormat();
253 253
 		if($dateFormat!=='')
254 254
 		{
255 255
 			$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $dateFormat);
256
-			$value = $formatter->parse($value);
256
+			$value=$formatter->parse($value);
257 257
 			if($minValue!=='')
258
-				$valid=$valid && $this->isGreaterThan($value,$formatter->parse($minValue));
258
+				$valid=$valid && $this->isGreaterThan($value, $formatter->parse($minValue));
259 259
 			if($maxValue!=='')
260
-				$valid=$valid && $this->isLessThan($value,$formatter->parse($maxValue));
260
+				$valid=$valid && $this->isLessThan($value, $formatter->parse($maxValue));
261 261
 			return $valid;
262 262
 		}
263 263
 		else
264 264
 		{
265 265
 			$value=strtotime($value);
266 266
 			if($minValue!=='')
267
-				$valid=$valid && $this->isGreaterThan($value,strtotime($minValue));
267
+				$valid=$valid && $this->isGreaterThan($value, strtotime($minValue));
268 268
 			if($maxValue!=='')
269
-				$valid=$valid && $this->isLessThan($value,strtotime($maxValue));
269
+				$valid=$valid && $this->isLessThan($value, strtotime($maxValue));
270 270
 			return $valid;
271 271
 		}
272 272
 	}
@@ -284,9 +284,9 @@  discard block
 block discarded – undo
284 284
 
285 285
 		$valid=true;
286 286
 		if($minValue!=='')
287
-			$valid=$valid && $this->isGreaterThan(strcmp($value,$minValue),0);
287
+			$valid=$valid && $this->isGreaterThan(strcmp($value, $minValue), 0);
288 288
 		if($maxValue!=='')
289
-			$valid=$valid && $this->isLessThan(strcmp($value,$maxValue),0);
289
+			$valid=$valid && $this->isLessThan(strcmp($value, $maxValue), 0);
290 290
 		return $valid;
291 291
 	}
292 292
 
@@ -300,20 +300,20 @@  discard block
 block discarded – undo
300 300
 		$maxValue=$this->getMaxValue();
301 301
 
302 302
 		$valid=true;
303
-		$charset = $this->getCharset();
303
+		$charset=$this->getCharset();
304 304
 		if($charset==='')
305 305
 		{
306
-			$app= $this->getApplication()->getGlobalization();
307
-			$charset = $app ? $app->getCharset() : null;
306
+			$app=$this->getApplication()->getGlobalization();
307
+			$charset=$app ? $app->getCharset() : null;
308 308
 			if(!$charset)
309
-				$charset = 'UTF-8';
309
+				$charset='UTF-8';
310 310
 		}
311 311
 
312
-		$length = iconv_strlen($value, $charset);
312
+		$length=iconv_strlen($value, $charset);
313 313
 		if($minValue!=='')
314
-			$valid = $valid && $this->isGreaterThan($length,intval($minValue));
314
+			$valid=$valid && $this->isGreaterThan($length, intval($minValue));
315 315
 		if($maxValue!=='')
316
-			$valid = $valid && $this->isLessThan($length,intval($maxValue));
316
+			$valid=$valid && $this->isLessThan($length, intval($maxValue));
317 317
 		return $valid;
318 318
 	}
319 319
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TColorPicker.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
  */
38 38
 class TColorPicker extends TTextBox
39 39
 {
40
-	const SCRIPT_PATH = 'prado/colorpicker';
40
+	const SCRIPT_PATH='prado/colorpicker';
41 41
 
42 42
 	private $_clientSide;
43 43
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public function getShowColorPicker()
48 48
 	{
49
-		return $this->getViewState('ShowColorPicker',true);
49
+		return $this->getViewState('ShowColorPicker', true);
50 50
 	}
51 51
 
52 52
 	/**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function setShowColorPicker($value)
57 57
 	{
58
-		$this->setViewState('ShowColorPicker',TPropertyValue::ensureBoolean($value),true);
58
+		$this->setViewState('ShowColorPicker', TPropertyValue::ensureBoolean($value), true);
59 59
 	}
60 60
 
61 61
 	/**
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	public function getClientSide()
129 129
 	{
130 130
 		if($this->_clientSide===null)
131
-			$this->_clientSide = $this->createClientSide();
131
+			$this->_clientSide=$this->createClientSide();
132 132
 		return $this->_clientSide;
133 133
 	}
134 134
 
@@ -146,18 +146,18 @@  discard block
 block discarded – undo
146 146
 	 */
147 147
 	protected function getPostBackOptions()
148 148
 	{
149
-		$options = parent::getPostBackOptions();
150
-		$options['ClassName'] = $this->getCssClass();
151
-		$options['ShowColorPicker'] = $this->getShowColorPicker();
149
+		$options=parent::getPostBackOptions();
150
+		$options['ClassName']=$this->getCssClass();
151
+		$options['ShowColorPicker']=$this->getShowColorPicker();
152 152
 		if($options['ShowColorPicker'])
153 153
 		{
154
-			$mode = $this->getMode();
155
-			if($mode == TColorPickerMode::Full) $options['Mode'] = $mode;
156
-			else if($mode == TColorPickerMode::Simple) $options['Palette'] = 'Tiny';
157
-			$options['OKButtonText'] = $this->getOKButtonText();
158
-			$options['CancelButtonText'] = $this->getCancelButtonText();
154
+			$mode=$this->getMode();
155
+			if($mode==TColorPickerMode::Full) $options['Mode']=$mode;
156
+			else if($mode==TColorPickerMode::Simple) $options['Palette']='Tiny';
157
+			$options['OKButtonText']=$this->getOKButtonText();
158
+			$options['CancelButtonText']=$this->getCancelButtonText();
159 159
 		}
160
-		$options = array_merge($options,$this->getClientSide()->getOptions()->toArray());
160
+		$options=array_merge($options, $this->getClientSide()->getOptions()->toArray());
161 161
 		return $options;
162 162
 	}
163 163
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 */
168 168
 	protected function getAssetUrl($file='')
169 169
 	{
170
-		$base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl();
170
+		$base=$this->getPage()->getClientScript()->getPradoScriptAssetUrl();
171 171
 		return $base.'/'.self::SCRIPT_PATH.'/'.$file;
172 172
 	}
173 173
 
@@ -185,15 +185,15 @@  discard block
 block discarded – undo
185 185
 	 */
186 186
 	protected function publishColorPickerAssets()
187 187
 	{
188
-		$cs = $this->getPage()->getClientScript();
189
-		$key = "prado:".get_class($this);
190
-		$imgs['button.gif'] = $this->getAssetUrl('button.gif');
191
-		$imgs['background.png'] = $this->getAssetUrl('background.png');
192
-		$options = TJavaScript::encode($imgs);
193
-		$code = "Prado.WebUI.TColorPicker.UIImages = {$options};";
188
+		$cs=$this->getPage()->getClientScript();
189
+		$key="prado:".get_class($this);
190
+		$imgs['button.gif']=$this->getAssetUrl('button.gif');
191
+		$imgs['background.png']=$this->getAssetUrl('background.png');
192
+		$options=TJavaScript::encode($imgs);
193
+		$code="Prado.WebUI.TColorPicker.UIImages = {$options};";
194 194
 		$cs->registerEndScript($key, $code);
195 195
 		$cs->registerPradoScript("colorpicker");
196
-		$url = $this->getAssetUrl($this->getColorPickerStyle().'.css');
196
+		$url=$this->getAssetUrl($this->getColorPickerStyle().'.css');
197 197
 		if(!$cs->isStyleSheetFileRegistered($url))
198 198
 			$cs->registerStyleSheetFile($url, $url);
199 199
 	}
@@ -208,13 +208,13 @@  discard block
 block discarded – undo
208 208
 	{
209 209
 		parent::renderEndTag($writer);
210 210
 
211
-		$color = $this->getText();
211
+		$color=$this->getText();
212 212
 		$writer->addAttribute('class', 'TColorPicker_button');
213 213
 		$writer->renderBeginTag('span');
214 214
 
215 215
 		$writer->addAttribute('id', $this->getClientID().'_button');
216 216
 		$writer->addAttribute('src', $this->getAssetUrl('button.gif'));
217
-		if($color !== '')
217
+		if($color!=='')
218 218
 			$writer->addAttribute('style', "background-color:{$color};");
219 219
 		$writer->addAttribute('width', '20');
220 220
 		$writer->addAttribute('height', '20');
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTableHeaderCell.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 	{
43 43
 		parent::addAttributesToRender($writer);
44 44
 		if(($scope=$this->getScope())!==TTableHeaderScope::NotSet)
45
-			$writer->addAttribute('scope',$scope===TTableHeaderScope::Row?'row':'col');
45
+			$writer->addAttribute('scope', $scope===TTableHeaderScope::Row ? 'row' : 'col');
46 46
 		if(($text=$this->getAbbreviatedText())!=='')
47
-			$writer->addAttribute('abbr',$text);
47
+			$writer->addAttribute('abbr', $text);
48 48
 		if(($text=$this->getCategoryText())!=='')
49
-			$writer->addAttribute('axis',$text);
49
+			$writer->addAttribute('axis', $text);
50 50
 	}
51 51
 
52 52
 	/**
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 */
55 55
 	public function getScope()
56 56
 	{
57
-		return $this->getViewState('Scope',TTableHeaderScope::NotSet);
57
+		return $this->getViewState('Scope', TTableHeaderScope::NotSet);
58 58
 	}
59 59
 
60 60
 	/**
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function setScope($value)
64 64
 	{
65
-		$this->setViewState('Scope',TPropertyValue::ensureEnum($value,'TTableHeaderScope'),TTableHeaderScope::NotSet);
65
+		$this->setViewState('Scope', TPropertyValue::ensureEnum($value, 'TTableHeaderScope'), TTableHeaderScope::NotSet);
66 66
 	}
67 67
 
68 68
 	/**
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public function getAbbreviatedText()
72 72
 	{
73
-		return $this->getViewState('AbbreviatedText','');
73
+		return $this->getViewState('AbbreviatedText', '');
74 74
 	}
75 75
 
76 76
 	/**
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public function setAbbreviatedText($value)
80 80
 	{
81
-		$this->setViewState('AbbreviatedText',$value,'');
81
+		$this->setViewState('AbbreviatedText', $value, '');
82 82
 	}
83 83
 
84 84
 	/**
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public function getCategoryText()
88 88
 	{
89
-		return $this->getViewState('CategoryText','');
89
+		return $this->getViewState('CategoryText', '');
90 90
 	}
91 91
 
92 92
 	/**
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function setCategoryText($value)
96 96
 	{
97
-		$this->setViewState('CategoryText',$value,'');
97
+		$this->setViewState('CategoryText', $value, '');
98 98
 	}
99 99
 }
100 100
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TRepeatInfo.php 1 patch
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 * @param integer zero-based index of the current rendering item.
43 43
 	 * @return TStyle CSS style used for rendering items (including header, footer and separators)
44 44
 	 */
45
-	public function generateItemStyle($itemType,$index);
45
+	public function generateItemStyle($itemType, $index);
46 46
 	/**
47 47
 	 * Renders an item.
48 48
 	 * @param THtmlWriter writer for the rendering purpose
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 * @param string item type
51 51
 	 * @param integer zero-based index of the item being rendered
52 52
 	 */
53
-	public function renderItem($writer,$repeatInfo,$itemType,$index);
53
+	public function renderItem($writer, $repeatInfo, $itemType, $index);
54 54
 }
55 55
 
56 56
 /**
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	 */
124 124
 	public function setCaptionAlign($value)
125 125
 	{
126
-		$this->_captionAlign=TPropertyValue::ensureEnum($value,'TTableCaptionAlign');
126
+		$this->_captionAlign=TPropertyValue::ensureEnum($value, 'TTableCaptionAlign');
127 127
 	}
128 128
 
129 129
 	/**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 */
140 140
 	public function setRepeatColumns($value)
141 141
 	{
142
-		if(($value=TPropertyValue::ensureInteger($value))<0)
142
+		if(($value=TPropertyValue::ensureInteger($value)) < 0)
143 143
 			throw new TInvalidDataValueException('repeatinfo_repeatcolumns_invalid');
144 144
 		$this->_repeatColumns=$value;
145 145
 	}
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	public function setRepeatDirection($value)
159 159
 	{
160
-		$this->_repeatDirection=TPropertyValue::ensureEnum($value,'TRepeatDirection');
160
+		$this->_repeatDirection=TPropertyValue::ensureEnum($value, 'TRepeatDirection');
161 161
 	}
162 162
 
163 163
 	/**
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 */
174 174
 	public function setRepeatLayout($value)
175 175
 	{
176
-		$this->_repeatLayout=TPropertyValue::ensureEnum($value,'TRepeatLayout');
176
+		$this->_repeatLayout=TPropertyValue::ensureEnum($value, 'TRepeatLayout');
177 177
 	}
178 178
 
179 179
 	/**
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 		}
195 195
 		else if($this->_repeatLayout===TRepeatLayout::Raw)
196 196
 		{
197
-			$this->renderRawContents($writer,$user);
197
+			$this->renderRawContents($writer, $user);
198 198
 			return;
199 199
 		}
200 200
 		else
@@ -207,9 +207,9 @@  discard block
 block discarded – undo
207 207
 		$writer->writeLine();
208 208
 
209 209
 		if($this->_repeatDirection===TRepeatDirection::Vertical)
210
-			$this->renderVerticalContents($writer,$user);
210
+			$this->renderVerticalContents($writer, $user);
211 211
 		else
212
-			$this->renderHorizontalContents($writer,$user);
212
+			$this->renderHorizontalContents($writer, $user);
213 213
 
214 214
 		$control->renderEndTag($writer);
215 215
 	}
@@ -219,22 +219,22 @@  discard block
 block discarded – undo
219 219
 	 * @param THtmlWriter writer for the rendering purpose
220 220
 	 * @param IRepeatInfoUser repeat information user
221 221
 	 */
222
-	protected function renderRawContents($writer,$user)
222
+	protected function renderRawContents($writer, $user)
223 223
 	{
224 224
 		if($user->getHasHeader())
225
-			$user->renderItem($writer,$this,'Header',-1);
225
+			$user->renderItem($writer, $this, 'Header', -1);
226 226
 
227 227
 		// render items
228 228
 		$hasSeparators=$user->getHasSeparators();
229 229
 		$itemCount=$user->getItemCount();
230
-		for($i=0;$i<$itemCount;++$i)
230
+		for($i=0; $i < $itemCount; ++$i)
231 231
 		{
232
-			$user->renderItem($writer,$this,'Item',$i);
233
-			if($hasSeparators && $i!=$itemCount-1)
234
-				$user->renderItem($writer,$this,'Separator',$i);
232
+			$user->renderItem($writer, $this, 'Item', $i);
233
+			if($hasSeparators && $i!=$itemCount - 1)
234
+				$user->renderItem($writer, $this, 'Separator', $i);
235 235
 		}
236 236
 		if($user->getHasFooter())
237
-			$user->renderItem($writer,$this,'Footer',-1);
237
+			$user->renderItem($writer, $this, 'Footer', -1);
238 238
 	}
239 239
 
240 240
 	/**
@@ -242,52 +242,52 @@  discard block
 block discarded – undo
242 242
 	 * @param THtmlWriter writer for the rendering purpose
243 243
 	 * @param IRepeatInfoUser repeat information user
244 244
 	 */
245
-	protected function renderHorizontalContents($writer,$user)
245
+	protected function renderHorizontalContents($writer, $user)
246 246
 	{
247 247
 		$tableLayout=($this->_repeatLayout===TRepeatLayout::Table);
248 248
 		$hasSeparators=$user->getHasSeparators();
249 249
 		$itemCount=$user->getItemCount();
250
-		$columns=$this->_repeatColumns===0?$itemCount:$this->_repeatColumns;
251
-		$totalColumns=$hasSeparators?$columns+$columns:$columns;
252
-		$needBreak=$columns<$itemCount;
250
+		$columns=$this->_repeatColumns===0 ? $itemCount : $this->_repeatColumns;
251
+		$totalColumns=$hasSeparators ? $columns + $columns : $columns;
252
+		$needBreak=$columns < $itemCount;
253 253
 
254 254
 		if($user->getHasHeader())
255
-			$this->renderHeader($writer,$user,$tableLayout,$totalColumns,$needBreak);
255
+			$this->renderHeader($writer, $user, $tableLayout, $totalColumns, $needBreak);
256 256
 
257 257
 		// render items
258 258
 		if($tableLayout)
259 259
 		{
260 260
 			$writer->renderBeginTag('tbody');
261 261
 			$column=0;
262
-			for($i=0;$i<$itemCount;++$i)
262
+			for($i=0; $i < $itemCount; ++$i)
263 263
 			{
264 264
 				if($column==0)
265 265
 					$writer->renderBeginTag('tr');
266
-				if(($style=$user->generateItemStyle('Item',$i))!==null)
266
+				if(($style=$user->generateItemStyle('Item', $i))!==null)
267 267
 					$style->addAttributesToRender($writer);
268 268
 				$writer->renderBeginTag('td');
269
-				$user->renderItem($writer,$this,'Item',$i);
269
+				$user->renderItem($writer, $this, 'Item', $i);
270 270
 				$writer->renderEndTag();
271 271
 				$writer->writeLine();
272
-				if($hasSeparators && $i!=$itemCount-1)
272
+				if($hasSeparators && $i!=$itemCount - 1)
273 273
 				{
274
-					if(($style=$user->generateItemStyle('Separator',$i))!==null)
274
+					if(($style=$user->generateItemStyle('Separator', $i))!==null)
275 275
 						$style->addAttributesToRender($writer);
276 276
 					$writer->renderBeginTag('td');
277
-					$user->renderItem($writer,$this,'Separator',$i);
277
+					$user->renderItem($writer, $this, 'Separator', $i);
278 278
 					$writer->renderEndTag();
279 279
 					$writer->writeLine();
280 280
 				}
281 281
 				$column++;
282
-				if($i==$itemCount-1)
282
+				if($i==$itemCount - 1)
283 283
 				{
284
-					$restColumns=$columns-$column;
284
+					$restColumns=$columns - $column;
285 285
 					if($hasSeparators)
286
-						$restColumns=$restColumns?$restColumns+$restColumns+1:1;
287
-					for($j=0;$j<$restColumns;++$j)
286
+						$restColumns=$restColumns ? $restColumns + $restColumns + 1 : 1;
287
+					for($j=0; $j < $restColumns; ++$j)
288 288
 						$writer->write("<td></td>\n");
289 289
 				}
290
-				if($column==$columns || $i==$itemCount-1)
290
+				if($column==$columns || $i==$itemCount - 1)
291 291
 				{
292 292
 					$writer->renderEndTag();
293 293
 					$writer->writeLine();
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
 		else
300 300
 		{
301 301
 			$column=0;
302
-			for($i=0;$i<$itemCount;++$i)
302
+			for($i=0; $i < $itemCount; ++$i)
303 303
 			{
304
-				$user->renderItem($writer,$this,'Item',$i);
305
-				if($hasSeparators && $i!=$itemCount-1)
306
-					$user->renderItem($writer,$this,'Separator',$i);
304
+				$user->renderItem($writer, $this, 'Item', $i);
305
+				if($hasSeparators && $i!=$itemCount - 1)
306
+					$user->renderItem($writer, $this, 'Separator', $i);
307 307
 				$column++;
308
-				if($column==$columns || $i==$itemCount-1)
308
+				if($column==$columns || $i==$itemCount - 1)
309 309
 				{
310 310
 					if($needBreak)
311 311
 						$writer->writeBreak();
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		}
317 317
 
318 318
 		if($user->getHasFooter())
319
-			$this->renderFooter($writer,$user,$tableLayout,$totalColumns,$needBreak);
319
+			$this->renderFooter($writer, $user, $tableLayout, $totalColumns, $needBreak);
320 320
 	}
321 321
 
322 322
 	/**
@@ -324,12 +324,12 @@  discard block
 block discarded – undo
324 324
 	 * @param THtmlWriter writer for the rendering purpose
325 325
 	 * @param IRepeatInfoUser repeat information user
326 326
 	 */
327
-	protected function renderVerticalContents($writer,$user)
327
+	protected function renderVerticalContents($writer, $user)
328 328
 	{
329 329
 		$tableLayout=($this->_repeatLayout===TRepeatLayout::Table);
330 330
 		$hasSeparators=$user->getHasSeparators();
331 331
 		$itemCount=$user->getItemCount();
332
-		if($this->_repeatColumns<=1)
332
+		if($this->_repeatColumns <= 1)
333 333
 		{
334 334
 			$rows=$itemCount;
335 335
 			$columns=1;
@@ -338,69 +338,69 @@  discard block
 block discarded – undo
338 338
 		else
339 339
 		{
340 340
 			$columns=$this->_repeatColumns;
341
-			$rows=(int)(($itemCount+$columns-1)/$columns);
342
-			if($rows==0 && $itemCount>0)
341
+			$rows=(int) (($itemCount + $columns - 1) / $columns);
342
+			if($rows==0 && $itemCount > 0)
343 343
 				$rows=1;
344
-			if(($lastColumns=$itemCount%$columns)==0)
344
+			if(($lastColumns=$itemCount % $columns)==0)
345 345
 				$lastColumns=$columns;
346 346
 		}
347
-		$totalColumns=$hasSeparators?$columns+$columns:$columns;
347
+		$totalColumns=$hasSeparators ? $columns + $columns : $columns;
348 348
 
349 349
 		if($user->getHasHeader())
350
-			$this->renderHeader($writer,$user,$tableLayout,$totalColumns,false);
350
+			$this->renderHeader($writer, $user, $tableLayout, $totalColumns, false);
351 351
 
352 352
 		if($tableLayout)
353 353
 		{
354 354
 			$writer->renderBeginTag('tbody');
355 355
 			$renderedItems=0;
356
-			for($row=0;$row<$rows;++$row)
356
+			for($row=0; $row < $rows; ++$row)
357 357
 			{
358 358
 				$index=$row;
359 359
 				$writer->renderBeginTag('tr');
360
-				for($col=0;$col<$columns;++$col)
360
+				for($col=0; $col < $columns; ++$col)
361 361
 				{
362
-					if($renderedItems>=$itemCount)
362
+					if($renderedItems >= $itemCount)
363 363
 						break;
364
-					if($col>0)
364
+					if($col > 0)
365 365
 					{
366 366
 						$index+=$rows;
367
-						if($col-1>=$lastColumns)
367
+						if($col - 1 >= $lastColumns)
368 368
 							$index--;
369 369
 					}
370
-					if($index>=$itemCount)
370
+					if($index >= $itemCount)
371 371
 						continue;
372 372
 					$renderedItems++;
373
-					if(($style=$user->generateItemStyle('Item',$index))!==null)
373
+					if(($style=$user->generateItemStyle('Item', $index))!==null)
374 374
 						$style->addAttributesToRender($writer);
375 375
 					$writer->renderBeginTag('td');
376
-					$user->renderItem($writer,$this,'Item',$index);
376
+					$user->renderItem($writer, $this, 'Item', $index);
377 377
 					$writer->renderEndTag();
378 378
 					$writer->writeLine();
379 379
 					if(!$hasSeparators)
380 380
 						continue;
381
-					if($renderedItems<$itemCount-1)
381
+					if($renderedItems < $itemCount - 1)
382 382
 					{
383 383
 						if($columns==1)
384 384
 						{
385 385
 							$writer->renderEndTag();
386 386
 							$writer->renderBeginTag('tr');
387 387
 						}
388
-						if(($style=$user->generateItemStyle('Separator',$index))!==null)
388
+						if(($style=$user->generateItemStyle('Separator', $index))!==null)
389 389
 							$style->addAttributesToRender($writer);
390 390
 						$writer->renderBeginTag('td');
391
-						$user->renderItem($writer,$this,'Separator',$index);
391
+						$user->renderItem($writer, $this, 'Separator', $index);
392 392
 						$writer->renderEndTag();
393 393
 						$writer->writeLine();
394 394
 					}
395
-					else if($columns>1)
395
+					else if($columns > 1)
396 396
 						$writer->write("<td></td>\n");
397 397
 				}
398
-				if($row==$rows-1)
398
+				if($row==$rows - 1)
399 399
 				{
400
-					$restColumns=$columns-$lastColumns;
400
+					$restColumns=$columns - $lastColumns;
401 401
 					if($hasSeparators)
402 402
 						$restColumns+=$restColumns;
403
-					for($col=0;$col<$restColumns;++$col)
403
+					for($col=0; $col < $restColumns; ++$col)
404 404
 						$writer->write("<td></td>\n");
405 405
 				}
406 406
 				$writer->renderEndTag();
@@ -411,41 +411,41 @@  discard block
 block discarded – undo
411 411
 		else
412 412
 		{
413 413
 			$renderedItems=0;
414
-			for($row=0;$row<$rows;++$row)
414
+			for($row=0; $row < $rows; ++$row)
415 415
 			{
416 416
 				$index=$row;
417
-				for($col=0;$col<$columns;++$col)
417
+				for($col=0; $col < $columns; ++$col)
418 418
 				{
419
-					if($renderedItems>=$itemCount)
419
+					if($renderedItems >= $itemCount)
420 420
 						break;
421
-					if($col>0)
421
+					if($col > 0)
422 422
 					{
423 423
 						$index+=$rows;
424
-						if($col-1>=$lastColumns)
424
+						if($col - 1 >= $lastColumns)
425 425
 							$index--;
426 426
 					}
427
-					if($index>=$itemCount)
427
+					if($index >= $itemCount)
428 428
 						continue;
429 429
 					$renderedItems++;
430
-					$user->renderItem($writer,$this,'Item',$index);
430
+					$user->renderItem($writer, $this, 'Item', $index);
431 431
 					$writer->writeLine();
432 432
 					if(!$hasSeparators)
433 433
 						continue;
434
-					if($renderedItems<$itemCount-1)
434
+					if($renderedItems < $itemCount - 1)
435 435
 					{
436 436
 						if($columns==1)
437 437
 							$writer->writeBreak();
438
-						$user->renderItem($writer,$this,'Separator',$index);
438
+						$user->renderItem($writer, $this, 'Separator', $index);
439 439
 					}
440 440
 					$writer->writeLine();
441 441
 				}
442
-				if($row<$rows-1 || $user->getHasFooter())
442
+				if($row < $rows - 1 || $user->getHasFooter())
443 443
 					$writer->writeBreak();
444 444
 			}
445 445
 		}
446 446
 
447 447
 		if($user->getHasFooter())
448
-			$this->renderFooter($writer,$user,$tableLayout,$totalColumns,false);
448
+			$this->renderFooter($writer, $user, $tableLayout, $totalColumns, false);
449 449
 
450 450
 	}
451 451
 
@@ -457,26 +457,26 @@  discard block
 block discarded – undo
457 457
 	 * @param integer number of columns to be rendered
458 458
 	 * @param boolean if a line break is needed at the end
459 459
 	 */
460
-	protected function renderHeader($writer,$user,$tableLayout,$columns,$needBreak)
460
+	protected function renderHeader($writer, $user, $tableLayout, $columns, $needBreak)
461 461
 	{
462 462
 		if($tableLayout)
463 463
 		{
464 464
 			$writer->renderBeginTag('thead');
465 465
 			$writer->renderBeginTag('tr');
466
-			if($columns>1)
467
-				$writer->addAttribute('colspan',"$columns");
468
-			$writer->addAttribute('scope','col');
469
-			if(($style=$user->generateItemStyle('Header',-1))!==null)
466
+			if($columns > 1)
467
+				$writer->addAttribute('colspan', "$columns");
468
+			$writer->addAttribute('scope', 'col');
469
+			if(($style=$user->generateItemStyle('Header', -1))!==null)
470 470
 				$style->addAttributesToRender($writer);
471 471
 			$writer->renderBeginTag('th');
472
-			$user->renderItem($writer,$this,'Header',-1);
472
+			$user->renderItem($writer, $this, 'Header', -1);
473 473
 			$writer->renderEndTag();
474 474
 			$writer->renderEndTag();
475 475
 			$writer->renderEndTag();
476 476
 		}
477 477
 		else
478 478
 		{
479
-			$user->renderItem($writer,$this,'Header',-1);
479
+			$user->renderItem($writer, $this, 'Header', -1);
480 480
 			if($needBreak)
481 481
 				$writer->writeBreak();
482 482
 		}
@@ -490,24 +490,24 @@  discard block
 block discarded – undo
490 490
 	 * @param boolean whether to render using table layout
491 491
 	 * @param integer number of columns to be rendered
492 492
 	 */
493
-	protected function renderFooter($writer,$user,$tableLayout,$columns)
493
+	protected function renderFooter($writer, $user, $tableLayout, $columns)
494 494
 	{
495 495
 		if($tableLayout)
496 496
 		{
497 497
 			$writer->renderBeginTag('tfoot');
498 498
 			$writer->renderBeginTag('tr');
499
-			if($columns>1)
500
-				$writer->addAttribute('colspan',"$columns");
501
-			if(($style=$user->generateItemStyle('Footer',-1))!==null)
499
+			if($columns > 1)
500
+				$writer->addAttribute('colspan', "$columns");
501
+			if(($style=$user->generateItemStyle('Footer', -1))!==null)
502 502
 				$style->addAttributesToRender($writer);
503 503
 			$writer->renderBeginTag('td');
504
-			$user->renderItem($writer,$this,'Footer',-1);
504
+			$user->renderItem($writer, $this, 'Footer', -1);
505 505
 			$writer->renderEndTag();
506 506
 			$writer->renderEndTag();
507 507
 			$writer->renderEndTag();
508 508
 		}
509 509
 		else
510
-			$user->renderItem($writer,$this,'Footer',-1);
510
+			$user->renderItem($writer, $this, 'Footer', -1);
511 511
 		$writer->writeLine();
512 512
 	}
513 513
 }
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDataTypeValidator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	public function getDataType()
51 51
 	{
52
-		return $this->getViewState('DataType','String');
52
+		return $this->getViewState('DataType', 'String');
53 53
 	}
54 54
 
55 55
 	/**
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 */
59 59
 	public function setDataType($value)
60 60
 	{
61
-		$this->setViewState('DataType',TPropertyValue::ensureEnum($value,'TValidationDataType'),TValidationDataType::String);
61
+		$this->setViewState('DataType', TPropertyValue::ensureEnum($value, 'TValidationDataType'), TValidationDataType::String);
62 62
 	}
63 63
 
64 64
 	/**
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
 		switch($this->getDataType())
93 93
 		{
94 94
 			case TValidationDataType::Integer:
95
-				return preg_match('/^[-+]?[0-9]+$/',trim($value));
95
+				return preg_match('/^[-+]?[0-9]+$/', trim($value));
96 96
 			case TValidationDataType::Float:
97
-				return preg_match('/^[-+]?([0-9]*\.)?[0-9]+([eE][-+]?[0-9]+)?$/',trim($value));
97
+				return preg_match('/^[-+]?([0-9]*\.)?[0-9]+([eE][-+]?[0-9]+)?$/', trim($value));
98 98
 			case TValidationDataType::Date:
99
-				$dateFormat = $this->getDateFormat();
99
+				$dateFormat=$this->getDateFormat();
100 100
 				if(strlen($dateFormat))
101 101
 				{
102
-					$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$dateFormat);
102
+					$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $dateFormat);
103 103
 					return $formatter->isValidDate($value);
104 104
 				}
105 105
 				else
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	protected function getClientScriptOptions()
116 116
 	{
117
-		$options = parent::getClientScriptOptions();
117
+		$options=parent::getClientScriptOptions();
118 118
 		$options['DataType']=$this->getDataType();
119 119
 		if(($dateFormat=$this->getDateFormat())!=='')
120 120
 			$options['DateFormat']=$dateFormat;
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTabPanel.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -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
 	/**
@@ -132,17 +132,17 @@  discard block
 block discarded – undo
132 132
 		$views=$this->getViews();
133 133
 		if(($id=$this->getActiveViewID())!=='')
134 134
 		{
135
-			if(($index=$views->findIndexByID($id))>=0)
135
+			if(($index=$views->findIndexByID($id)) >= 0)
136 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())
142
+			if($index < $views->getCount())
143 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
 		{
@@ -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
     /**
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     public function getCssClass()
212 212
     {
213 213
     	$cssClass=parent::getCssClass();
214
-    	return $cssClass===''?'tab-panel':$cssClass;
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 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 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 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
 	}
@@ -333,11 +333,11 @@  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 338
 		if(($index=$values[$this->getClientID().'_1'])!==null)
339 339
 		{
340
-			$index=(int)$index;
340
+			$index=(int) $index;
341 341
 			$currentIndex=$this->getActiveViewIndex();
342 342
 			if($currentIndex!==$index)
343 343
 			{
@@ -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,7 +390,7 @@  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 396
 		$page=$this->getPage();
@@ -405,17 +405,17 @@  discard block
 block discarded – undo
405 405
 	 */
406 406
 	protected function registerStyleSheet()
407 407
 	{
408
-		$url = $this->getCssUrl();
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
 	}
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 		$code="new $className($options);";
434 434
 		$cs->registerEndScript("prado:$id", $code);
435 435
 		// ensure an item is always active and visible
436
-		$index = $this->getActiveViewIndex();
436
+		$index=$this->getActiveViewIndex();
437 437
 		if(!$this->getViews()->itemAt($index)->Visible)
438 438
 			$index=0;
439 439
 		$cs->registerHiddenField($id.'_1', $index);
@@ -454,19 +454,19 @@  discard block
 block discarded – undo
454 454
 	 */
455 455
 	protected function getClientOptions()
456 456
 	{
457
-		$options['ID'] = $this->getClientID();
458
-		$options['ActiveCssClass'] = $this->getActiveTabCssClass();
459
-		$options['NormalCssClass'] = $this->getTabCssClass();
460
-		$viewIDs = array();
461
-		$viewVis = array();
457
+		$options['ID']=$this->getClientID();
458
+		$options['ActiveCssClass']=$this->getActiveTabCssClass();
459
+		$options['NormalCssClass']=$this->getTabCssClass();
460
+		$viewIDs=array();
461
+		$viewVis=array();
462 462
 		foreach($this->getViews() as $view)
463 463
 		{
464
-			$viewIDs[] = $view->getClientID();
465
-			$viewVis[] = $view->getVisible();
464
+			$viewIDs[]=$view->getClientID();
465
+			$viewVis[]=$view->getVisible();
466 466
 		}
467
-		$options['Views'] = $viewIDs;
468
-		$options['ViewsVis'] = $viewVis;
469
-		$options['AutoSwitch'] = $this->getAutoSwitch();
467
+		$options['Views']=$viewIDs;
468
+		$options['ViewsVis']=$viewVis;
469
+		$options['AutoSwitch']=$this->getAutoSwitch();
470 470
 
471 471
 		return $options;
472 472
 	}
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 	public function renderContents($writer)
502 502
 	{
503 503
 		$views=$this->getViews();
504
-		if($views->getCount()>0)
504
+		if($views->getCount() > 0)
505 505
 		{
506 506
 			$writer->writeLine();
507 507
 			// render tab bar
@@ -560,13 +560,13 @@  discard block
 block discarded – undo
560 560
 	protected function addAttributesToRender($writer)
561 561
 	{
562 562
 		if(!$this->getActive() && $this->getPage()->getClientSupportsJavaScript())
563
-			$this->getStyle()->setStyleField('display','none');
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
 	/**
@@ -657,9 +657,9 @@  discard block
 block discarded – undo
657 657
 	{
658 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());
@@ -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 708
 		if($item instanceof TTabView)
709
-			parent::insertAt($index,$item);
709
+			parent::insertAt($index, $item);
710 710
 		else
711 711
 			throw new TInvalidDataTypeException('tabviewcollection_tabview_required');
712 712
 	}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TWebControlDecorator.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 * @var boolean tells if the decoration uses state in its templates.  If there are no templates
66 66
 	 * in the instance of the decoration this variable is unused.
67 67
 	 */
68
-	private $_usestate = false;
68
+	private $_usestate=false;
69 69
 
70 70
 	/**
71 71
 	 * @var TWebControl the control to decorate
@@ -86,19 +86,19 @@  discard block
 block discarded – undo
86 86
 	/**
87 87
 	 * @var string the text that goes before the open tag
88 88
 	 */
89
-	private $_pretagtext = '';
89
+	private $_pretagtext='';
90 90
 	/**
91 91
 	 * @var string the text that goes after the open tag
92 92
 	 */
93
-	private $_precontentstext = '';
93
+	private $_precontentstext='';
94 94
 	/**
95 95
 	 * @var string the text that goes before the close tag
96 96
 	 */
97
-	private $_postcontentstext = '';
97
+	private $_postcontentstext='';
98 98
 	/**
99 99
 	 * @var string the text that goes after the close tag
100 100
 	 */
101
-	private $_posttagtext = '';
101
+	private $_posttagtext='';
102 102
 
103 103
 
104 104
 
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 	 * @param TWebControl The control that is to be decorated.
126 126
 	 * @param boolean whether decoration is just around the inner content
127 127
 	 */
128
-	public function __construct($control, $onlyinternal = false) {
129
-		$this->_control = $control;
130
-		$this->_internalonly = $onlyinternal;
128
+	public function __construct($control, $onlyinternal=false) {
129
+		$this->_control=$control;
130
+		$this->_internalonly=$onlyinternal;
131 131
 	}
132 132
 
133 133
 	/**
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 */
145 145
 	public function setUseState($value)
146 146
 	{
147
-		$this->_usestate = TPropertyValue::ensureBoolean($value);
147
+		$this->_usestate=TPropertyValue::ensureBoolean($value);
148 148
 	}
149 149
 
150 150
 	/**
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	 */
160 160
 	public function setPreTagText($value) {
161 161
 		if(!$this->_internalonly && !$this->_control->getIsSkinApplied())
162
-			$this->_pretagtext = TPropertyValue::ensureString($value);
162
+			$this->_pretagtext=TPropertyValue::ensureString($value);
163 163
 	}
164 164
 
165 165
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 	 */
176 176
 	public function setPreContentsText($value) {
177 177
 		if(!$this->_control->getIsSkinApplied())
178
-			$this->_precontentstext = TPropertyValue::ensureString($value);
178
+			$this->_precontentstext=TPropertyValue::ensureString($value);
179 179
 	}
180 180
 
181 181
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	 */
192 192
 	public function setPostContentsText($value) {
193 193
 		if(!$this->_control->getIsSkinApplied())
194
-			$this->_postcontentstext = TPropertyValue::ensureString($value);
194
+			$this->_postcontentstext=TPropertyValue::ensureString($value);
195 195
 	}
196 196
 
197 197
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 */
208 208
 	public function setPostTagText($value) {
209 209
 		if(!$this->_internalonly && !$this->_control->getIsSkinApplied())
210
-			$this->_posttagtext = TPropertyValue::ensureString($value);
210
+			$this->_posttagtext=TPropertyValue::ensureString($value);
211 211
 	}
212 212
 
213 213
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 	 */
224 224
 	public function setPreTagTemplate($value) {
225 225
 		if(!$this->_internalonly && !$this->_control->getIsSkinApplied())
226
-			$this->_pretagtemplate = $value;
226
+			$this->_pretagtemplate=$value;
227 227
 	}
228 228
 
229 229
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	 */
240 240
 	public function setPreContentsTemplate($value) {
241 241
 		if(!$this->_control->getIsSkinApplied())
242
-			$this->_precontentstemplate = $value;
242
+			$this->_precontentstemplate=$value;
243 243
 	}
244 244
 
245 245
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	 */
256 256
 	public function setPostContentsTemplate($value) {
257 257
 		if(!$this->_control->getIsSkinApplied())
258
-			$this->_postcontentstemplate = $value;
258
+			$this->_postcontentstemplate=$value;
259 259
 	}
260 260
 
261 261
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 	 */
272 272
 	public function setPostTagTemplate($value) {
273 273
 		if(!$this->_internalonly && !$this->_control->getIsSkinApplied())
274
-			$this->_posttagtemplate = $value;
274
+			$this->_posttagtemplate=$value;
275 275
 	}
276 276
 
277 277
 	/**
@@ -280,15 +280,15 @@  discard block
 block discarded – undo
280 280
 	 * This call attaches the ensureTemplateDecoration to the TPage onSaveStateComplete so
281 281
 	 * these controls don't have page states.  This is as close to not influencing the page as possible.
282 282
 	 */
283
-	public function instantiate($outercontrol = null) {
283
+	public function instantiate($outercontrol=null) {
284 284
 		if($this->getPreTagTemplate() || $this->getPreContentsTemplate() ||
285 285
 			$this->getPostContentsTemplate() || $this->getPostTagTemplate()) {
286 286
 
287
-			$this->_outercontrol = $outercontrol;
287
+			$this->_outercontrol=$outercontrol;
288 288
 			if($this->getUseState())
289 289
 				$this->ensureTemplateDecoration();
290 290
 			else
291
-				$this->_control->getPage()->onSaveStateComplete[] = array($this, 'ensureTemplateDecoration');
291
+				$this->_control->getPage()->onSaveStateComplete[]=array($this, 'ensureTemplateDecoration');
292 292
 		}
293 293
 	}
294 294
 
@@ -303,26 +303,26 @@  discard block
 block discarded – undo
303 303
 	 */
304 304
 	public function ensureTemplateDecoration($sender=null, $param=null) {
305 305
 
306
-		$control = $this->_control;
307
-		$outercontrol = $this->_outercontrol;
308
-		if($outercontrol === null)
309
-			$outercontrol = $control;
306
+		$control=$this->_control;
307
+		$outercontrol=$this->_outercontrol;
308
+		if($outercontrol===null)
309
+			$outercontrol=$control;
310 310
 
311 311
 		if($this->_addedTemplateDecoration)
312 312
 			return $this->_addedTemplateDecoration;
313 313
 
314
-		$this->_addedTemplateDecoration = true;
314
+		$this->_addedTemplateDecoration=true;
315 315
 
316 316
 		if($this->getPreContentsTemplate())
317 317
 		{
318
-			$precontents = Prado::createComponent('TCompositeControl');
318
+			$precontents=Prado::createComponent('TCompositeControl');
319 319
 			$this->getPreContentsTemplate()->instantiateIn($precontents);
320 320
 			$control->getControls()->insertAt(0, $precontents);
321 321
 		}
322 322
 
323 323
 		if($this->getPostContentsTemplate())
324 324
 		{
325
-			$postcontents = Prado::createComponent('TCompositeControl');
325
+			$postcontents=Prado::createComponent('TCompositeControl');
326 326
 			$this->getPostContentsTemplate()->instantiateIn($postcontents);
327 327
 			$control->getControls()->add($postcontents);
328 328
 		}
@@ -333,14 +333,14 @@  discard block
 block discarded – undo
333 333
 
334 334
 		if($this->getPreTagTemplate())
335 335
 		{
336
-			$pretag = Prado::createComponent('TCompositeControl');
336
+			$pretag=Prado::createComponent('TCompositeControl');
337 337
 			$this->getPreTagTemplate()->instantiateIn($pretag);
338 338
 			$outercontrol->getParent()->getControls()->insertBefore($outercontrol, $pretag);
339 339
 		}
340 340
 
341 341
 		if($this->getPostTagTemplate())
342 342
 		{
343
-			$posttag = Prado::createComponent('TCompositeControl');
343
+			$posttag=Prado::createComponent('TCompositeControl');
344 344
 			$this->getPostTagTemplate()->instantiateIn($posttag);
345 345
 			$outercontrol->getParent()->getControls()->insertAfter($outercontrol, $posttag);
346 346
 		}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TRepeaterItemRenderer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@
 block discarded – undo
34 34
 	 * @param TEventParameter event parameter
35 35
 	 * @return boolean whether the event bubbling should stop here.
36 36
 	 */
37
-	public function bubbleEvent($sender,$param)
37
+	public function bubbleEvent($sender, $param)
38 38
 	{
39 39
 		if($param instanceof TCommandEventParameter)
40 40
 		{
41
-			$this->raiseBubbleEvent($this,new TRepeaterCommandEventParameter($this,$sender,$param));
41
+			$this->raiseBubbleEvent($this, new TRepeaterCommandEventParameter($this, $sender, $param));
42 42
 			return true;
43 43
 		}
44 44
 		else
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TPager.php 1 patch
Spacing   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public function getControlToPaginate()
82 82
 	{
83
-		return $this->getViewState('ControlToPaginate','');
83
+		return $this->getViewState('ControlToPaginate', '');
84 84
 	}
85 85
 
86 86
 	/**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function setControlToPaginate($value)
93 93
 	{
94
-		$this->setViewState('ControlToPaginate',$value,'');
94
+		$this->setViewState('ControlToPaginate', $value, '');
95 95
 	}
96 96
 
97 97
 	/**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	public function getButtonCssClass()
102 102
 	{
103
-		return $this->getViewState('ButtonCssClass','');
103
+		return $this->getViewState('ButtonCssClass', '');
104 104
 	}
105 105
 
106 106
 	/**
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	public function setButtonCssClass($value)
111 111
 	{
112
-		$this->setViewState('ButtonCssClass',TPropertyValue::ensureString($value,''),'');
112
+		$this->setViewState('ButtonCssClass', TPropertyValue::ensureString($value, ''), '');
113 113
 	}
114 114
 
115 115
 	/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	public function getMode()
119 119
 	{
120
-		return $this->getViewState('Mode',TPagerMode::NextPrev);
120
+		return $this->getViewState('Mode', TPagerMode::NextPrev);
121 121
 	}
122 122
 
123 123
 	/**
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 */
126 126
 	public function setMode($value)
127 127
 	{
128
-		$this->setViewState('Mode',TPropertyValue::ensureEnum($value,'TPagerMode'),TPagerMode::NextPrev);
128
+		$this->setViewState('Mode', TPropertyValue::ensureEnum($value, 'TPagerMode'), TPagerMode::NextPrev);
129 129
 	}
130 130
 
131 131
 	/**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 */
134 134
 	public function getButtonType()
135 135
 	{
136
-		return $this->getViewState('ButtonType',TPagerButtonType::LinkButton);
136
+		return $this->getViewState('ButtonType', TPagerButtonType::LinkButton);
137 137
 	}
138 138
 
139 139
 	/**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 */
142 142
 	public function setButtonType($value)
143 143
 	{
144
-		$this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'TPagerButtonType'),TPagerButtonType::LinkButton);
144
+		$this->setViewState('ButtonType', TPropertyValue::ensureEnum($value, 'TPagerButtonType'), TPagerButtonType::LinkButton);
145 145
 	}
146 146
 
147 147
 	/**
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	 */
150 150
 	public function getNextPageText()
151 151
 	{
152
-		return $this->getViewState('NextPageText','>');
152
+		return $this->getViewState('NextPageText', '>');
153 153
 	}
154 154
 
155 155
 	/**
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	public function setNextPageText($value)
159 159
 	{
160
-		$this->setViewState('NextPageText',$value,'>');
160
+		$this->setViewState('NextPageText', $value, '>');
161 161
 	}
162 162
 
163 163
 	/**
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	 */
166 166
 	public function getPrevPageText()
167 167
 	{
168
-		return $this->getViewState('PrevPageText','<');
168
+		return $this->getViewState('PrevPageText', '<');
169 169
 	}
170 170
 
171 171
 	/**
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 */
174 174
 	public function setPrevPageText($value)
175 175
 	{
176
-		$this->setViewState('PrevPageText',$value,'<');
176
+		$this->setViewState('PrevPageText', $value, '<');
177 177
 	}
178 178
 
179 179
 	/**
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	 */
182 182
 	public function getFirstPageText()
183 183
 	{
184
-		return $this->getViewState('FirstPageText','<<');
184
+		return $this->getViewState('FirstPageText', '<<');
185 185
 	}
186 186
 
187 187
 	/**
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	 */
190 190
 	public function setFirstPageText($value)
191 191
 	{
192
-		$this->setViewState('FirstPageText',$value,'<<');
192
+		$this->setViewState('FirstPageText', $value, '<<');
193 193
 	}
194 194
 
195 195
 	/**
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 */
198 198
 	public function getLastPageText()
199 199
 	{
200
-		return $this->getViewState('LastPageText','>>');
200
+		return $this->getViewState('LastPageText', '>>');
201 201
 	}
202 202
 
203 203
 	/**
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 */
206 206
 	public function setLastPageText($value)
207 207
 	{
208
-		$this->setViewState('LastPageText',$value,'>>');
208
+		$this->setViewState('LastPageText', $value, '>>');
209 209
 	}
210 210
 
211 211
 	/**
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	 */
215 215
 	public function getFirstPageImageUrl()
216 216
 	{
217
-		return $this->getViewState('FirstPageImageUrl','');
217
+		return $this->getViewState('FirstPageImageUrl', '');
218 218
 	}
219 219
 
220 220
 	/**
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 	 */
224 224
 	public function setFirstPageImageUrl($value)
225 225
 	{
226
-		$this->setViewState('FirstPageImageUrl',$value);
226
+		$this->setViewState('FirstPageImageUrl', $value);
227 227
 	}
228 228
 
229 229
 	/**
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 	 */
233 233
 	public function getLastPageImageUrl()
234 234
 	{
235
-		return $this->getViewState('LastPageImageUrl','');
235
+		return $this->getViewState('LastPageImageUrl', '');
236 236
 	}
237 237
 
238 238
 	/**
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 	 */
242 242
 	public function setLastPageImageUrl($value)
243 243
 	{
244
-		$this->setViewState('LastPageImageUrl',$value);
244
+		$this->setViewState('LastPageImageUrl', $value);
245 245
 	}
246 246
 
247 247
 	/**
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 	 */
251 251
 	public function getNextPageImageUrl()
252 252
 	{
253
-		return $this->getViewState('NextPageImageUrl','');
253
+		return $this->getViewState('NextPageImageUrl', '');
254 254
 	}
255 255
 
256 256
 	/**
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	 */
260 260
 	public function setNextPageImageUrl($value)
261 261
 	{
262
-		$this->setViewState('NextPageImageUrl',$value);
262
+		$this->setViewState('NextPageImageUrl', $value);
263 263
 	}
264 264
 
265 265
 	/**
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	 */
269 269
 	public function getPrevPageImageUrl()
270 270
 	{
271
-		return $this->getViewState('PrevPageImageUrl','');
271
+		return $this->getViewState('PrevPageImageUrl', '');
272 272
 	}
273 273
 
274 274
 	/**
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 	 */
278 278
 	public function setPrevPageImageUrl($value)
279 279
 	{
280
-		$this->setViewState('PrevPageImageUrl',$value);
280
+		$this->setViewState('PrevPageImageUrl', $value);
281 281
 	}
282 282
 
283 283
 	/**
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 	 */
288 288
 	public function getNumericPageImageUrl()
289 289
 	{
290
-		return $this->getViewState('NumericPageImageUrl','');
290
+		return $this->getViewState('NumericPageImageUrl', '');
291 291
 	}
292 292
 
293 293
 	/**
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 	 */
302 302
 	public function setNumericPageImageUrl($value)
303 303
 	{
304
-		$this->setViewState('NumericPageImageUrl',$value);
304
+		$this->setViewState('NumericPageImageUrl', $value);
305 305
 	}
306 306
 
307 307
 	/**
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 	 */
310 310
 	public function getPageButtonCount()
311 311
 	{
312
-		return $this->getViewState('PageButtonCount',10);
312
+		return $this->getViewState('PageButtonCount', 10);
313 313
 	}
314 314
 
315 315
 	/**
@@ -318,9 +318,9 @@  discard block
 block discarded – undo
318 318
 	 */
319 319
 	public function setPageButtonCount($value)
320 320
 	{
321
-		if(($value=TPropertyValue::ensureInteger($value))<1)
321
+		if(($value=TPropertyValue::ensureInteger($value)) < 1)
322 322
 			throw new TInvalidDataValueException('pager_pagebuttoncount_invalid');
323
-		$this->setViewState('PageButtonCount',$value,10);
323
+		$this->setViewState('PageButtonCount', $value, 10);
324 324
 	}
325 325
 
326 326
 	/**
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	 */
329 329
 	public function getCurrentPageIndex()
330 330
 	{
331
-		return $this->getViewState('CurrentPageIndex',0);
331
+		return $this->getViewState('CurrentPageIndex', 0);
332 332
 	}
333 333
 
334 334
 	/**
@@ -337,9 +337,9 @@  discard block
 block discarded – undo
337 337
 	 */
338 338
 	protected function setCurrentPageIndex($value)
339 339
 	{
340
-		if(($value=TPropertyValue::ensureInteger($value))<0)
340
+		if(($value=TPropertyValue::ensureInteger($value)) < 0)
341 341
 			throw new TInvalidDataValueException('pager_currentpageindex_invalid');
342
-		$this->setViewState('CurrentPageIndex',$value,0);
342
+		$this->setViewState('CurrentPageIndex', $value, 0);
343 343
 	}
344 344
 
345 345
 	/**
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 	 */
348 348
 	public function getPageCount()
349 349
 	{
350
-		return $this->getViewState('PageCount',0);
350
+		return $this->getViewState('PageCount', 0);
351 351
 	}
352 352
 
353 353
 	/**
@@ -356,9 +356,9 @@  discard block
 block discarded – undo
356 356
 	 */
357 357
 	protected function setPageCount($value)
358 358
 	{
359
-		if(($value=TPropertyValue::ensureInteger($value))<0)
359
+		if(($value=TPropertyValue::ensureInteger($value)) < 0)
360 360
 			throw new TInvalidDataValueException('pager_pagecount_invalid');
361
-		$this->setViewState('PageCount',$value,0);
361
+		$this->setViewState('PageCount', $value, 0);
362 362
 	}
363 363
 
364 364
 	/**
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 	 */
375 375
 	public function getIsLastPage()
376 376
 	{
377
-		return $this->getCurrentPageIndex()===$this->getPageCount()-1;
377
+		return $this->getCurrentPageIndex()===$this->getPageCount() - 1;
378 378
 	}
379 379
 
380 380
 	/**
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 
390 390
 		$controlID=$this->getControlToPaginate();
391 391
 		if(($targetControl=$this->getNamingContainer()->findControl($controlID))===null || !($targetControl instanceof TDataBoundControl))
392
-			throw new TConfigurationException('pager_controltopaginate_invalid',$controlID);
392
+			throw new TConfigurationException('pager_controltopaginate_invalid', $controlID);
393 393
 
394 394
 		if($targetControl->getAllowPaging())
395 395
 		{
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 	 */
412 412
 	public function render($writer)
413 413
 	{
414
-		if($this->_pageCount>1)
414
+		if($this->_pageCount > 1)
415 415
 			parent::render($writer);
416 416
 	}
417 417
 
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 	 * @param string CommandParameter corresponding to the OnCommand event of the button
449 449
 	 * @return mixed the button instance
450 450
 	 */
451
-	protected function createPagerButton($buttonType,$enabled,$text,$commandName,$commandParameter)
451
+	protected function createPagerButton($buttonType, $enabled, $text, $commandName, $commandParameter)
452 452
 	{
453 453
 		if($buttonType===TPagerButtonType::LinkButton)
454 454
 		{
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 			if($buttonType===TPagerButtonType::ImageButton)
468 468
 			{
469 469
 				$button=new TImageButton;
470
-				$button->setImageUrl($this->getPageImageUrl($text,$commandName));
470
+				$button->setImageUrl($this->getPageImageUrl($text, $commandName));
471 471
 			}
472 472
 			else
473 473
 				$button=new TButton;
@@ -487,13 +487,13 @@  discard block
 block discarded – undo
487 487
 	 * @param string the command name associated with the image button
488 488
 	 * @since 3.1.1
489 489
 	 */
490
-	protected function getPageImageUrl($text,$commandName)
490
+	protected function getPageImageUrl($text, $commandName)
491 491
 	{
492 492
 		switch($commandName)
493 493
 		{
494 494
 			case self::CMD_PAGE:
495 495
 				$url=$this->getNumericPageImageUrl();
496
-				return str_replace('{0}',$text,$url);
496
+				return str_replace('{0}', $text, $url);
497 497
 			case self::CMD_PAGE_NEXT:
498 498
 				return $this->getNextPageImageUrl();
499 499
 			case self::CMD_PAGE_PREV:
@@ -518,44 +518,44 @@  discard block
 block discarded – undo
518 518
 		{
519 519
 			if(($text=$this->getFirstPageText())!=='')
520 520
 			{
521
-				$label=$this->createPagerButton($buttonType,false,$text,self::CMD_PAGE_FIRST,'');
521
+				$label=$this->createPagerButton($buttonType, false, $text, self::CMD_PAGE_FIRST, '');
522 522
 				$controls->add($label);
523 523
 				$controls->add("\n");
524 524
 			}
525
-			$label=$this->createPagerButton($buttonType,false,$this->getPrevPageText(),self::CMD_PAGE_PREV,'');
525
+			$label=$this->createPagerButton($buttonType, false, $this->getPrevPageText(), self::CMD_PAGE_PREV, '');
526 526
 			$controls->add($label);
527 527
 		}
528 528
 		else
529 529
 		{
530 530
 			if(($text=$this->getFirstPageText())!=='')
531 531
 			{
532
-				$button=$this->createPagerButton($buttonType,true,$text,self::CMD_PAGE_FIRST,'');
532
+				$button=$this->createPagerButton($buttonType, true, $text, self::CMD_PAGE_FIRST, '');
533 533
 				$controls->add($button);
534 534
 				$controls->add("\n");
535 535
 			}
536
-			$button=$this->createPagerButton($buttonType,true,$this->getPrevPageText(),self::CMD_PAGE_PREV,'');
536
+			$button=$this->createPagerButton($buttonType, true, $this->getPrevPageText(), self::CMD_PAGE_PREV, '');
537 537
 			$controls->add($button);
538 538
 		}
539 539
 		$controls->add("\n");
540 540
 		if($this->getIsLastPage())
541 541
 		{
542
-			$label=$this->createPagerButton($buttonType,false,$this->getNextPageText(),self::CMD_PAGE_NEXT,'');
542
+			$label=$this->createPagerButton($buttonType, false, $this->getNextPageText(), self::CMD_PAGE_NEXT, '');
543 543
 			$controls->add($label);
544 544
 			if(($text=$this->getLastPageText())!=='')
545 545
 			{
546 546
 				$controls->add("\n");
547
-				$label=$this->createPagerButton($buttonType,false,$text,self::CMD_PAGE_LAST,'');
547
+				$label=$this->createPagerButton($buttonType, false, $text, self::CMD_PAGE_LAST, '');
548 548
 				$controls->add($label);
549 549
 			}
550 550
 		}
551 551
 		else
552 552
 		{
553
-			$button=$this->createPagerButton($buttonType,true,$this->getNextPageText(),self::CMD_PAGE_NEXT,'');
553
+			$button=$this->createPagerButton($buttonType, true, $this->getNextPageText(), self::CMD_PAGE_NEXT, '');
554 554
 			$controls->add($button);
555 555
 			if(($text=$this->getLastPageText())!=='')
556 556
 			{
557 557
 				$controls->add("\n");
558
-				$button=$this->createPagerButton($buttonType,true,$text,self::CMD_PAGE_LAST,'');
558
+				$button=$this->createPagerButton($buttonType, true, $text, self::CMD_PAGE_LAST, '');
559 559
 				$controls->add($button);
560 560
 			}
561 561
 		}
@@ -569,63 +569,63 @@  discard block
 block discarded – undo
569 569
 		$buttonType=$this->getButtonType();
570 570
 		$controls=$this->getControls();
571 571
 		$pageCount=$this->getPageCount();
572
-		$pageIndex=$this->getCurrentPageIndex()+1;
572
+		$pageIndex=$this->getCurrentPageIndex() + 1;
573 573
 		$maxButtonCount=$this->getPageButtonCount();
574
-		$buttonCount=$maxButtonCount>$pageCount?$pageCount:$maxButtonCount;
574
+		$buttonCount=$maxButtonCount > $pageCount ? $pageCount : $maxButtonCount;
575 575
 		$startPageIndex=1;
576 576
 		$endPageIndex=$buttonCount;
577
-		if($pageIndex>$endPageIndex)
577
+		if($pageIndex > $endPageIndex)
578 578
 		{
579
-			$startPageIndex=((int)(($pageIndex-1)/$maxButtonCount))*$maxButtonCount+1;
580
-			if(($endPageIndex=$startPageIndex+$maxButtonCount-1)>$pageCount)
579
+			$startPageIndex=((int) (($pageIndex - 1) / $maxButtonCount)) * $maxButtonCount + 1;
580
+			if(($endPageIndex=$startPageIndex + $maxButtonCount - 1) > $pageCount)
581 581
 				$endPageIndex=$pageCount;
582
-			if($endPageIndex-$startPageIndex+1<$maxButtonCount)
582
+			if($endPageIndex - $startPageIndex + 1 < $maxButtonCount)
583 583
 			{
584
-				if(($startPageIndex=$endPageIndex-$maxButtonCount+1)<1)
584
+				if(($startPageIndex=$endPageIndex - $maxButtonCount + 1) < 1)
585 585
 					$startPageIndex=1;
586 586
 			}
587 587
 		}
588 588
 
589
-		if($startPageIndex>1)
589
+		if($startPageIndex > 1)
590 590
 		{
591 591
 			if(($text=$this->getFirstPageText())!=='')
592 592
 			{
593
-				$button=$this->createPagerButton($buttonType,true,$text,self::CMD_PAGE_FIRST,'');
593
+				$button=$this->createPagerButton($buttonType, true, $text, self::CMD_PAGE_FIRST, '');
594 594
 				$controls->add($button);
595 595
 				$controls->add("\n");
596 596
 			}
597
-			$prevPageIndex=$startPageIndex-1;
598
-			$button=$this->createPagerButton($buttonType,true,$this->getPrevPageText(),self::CMD_PAGE,"$prevPageIndex");
597
+			$prevPageIndex=$startPageIndex - 1;
598
+			$button=$this->createPagerButton($buttonType, true, $this->getPrevPageText(), self::CMD_PAGE, "$prevPageIndex");
599 599
 			$controls->add($button);
600 600
 			$controls->add("\n");
601 601
 		}
602 602
 
603
-		for($i=$startPageIndex;$i<=$endPageIndex;++$i)
603
+		for($i=$startPageIndex; $i <= $endPageIndex; ++$i)
604 604
 		{
605 605
 			if($i===$pageIndex)
606 606
 			{
607
-				$label=$this->createPagerButton($buttonType,false,"$i",self::CMD_PAGE,'');
607
+				$label=$this->createPagerButton($buttonType, false, "$i", self::CMD_PAGE, '');
608 608
 				$controls->add($label);
609 609
 			}
610 610
 			else
611 611
 			{
612
-				$button=$this->createPagerButton($buttonType,true,"$i",self::CMD_PAGE,"$i");
612
+				$button=$this->createPagerButton($buttonType, true, "$i", self::CMD_PAGE, "$i");
613 613
 				$controls->add($button);
614 614
 			}
615
-			if($i<$endPageIndex)
615
+			if($i < $endPageIndex)
616 616
 				$controls->add("\n");
617 617
 		}
618 618
 
619
-		if($pageCount>$endPageIndex)
619
+		if($pageCount > $endPageIndex)
620 620
 		{
621 621
 			$controls->add("\n");
622
-			$nextPageIndex=$endPageIndex+1;
623
-			$button=$this->createPagerButton($buttonType,true,$this->getNextPageText(),self::CMD_PAGE,"$nextPageIndex");
622
+			$nextPageIndex=$endPageIndex + 1;
623
+			$button=$this->createPagerButton($buttonType, true, $this->getNextPageText(), self::CMD_PAGE, "$nextPageIndex");
624 624
 			$controls->add($button);
625 625
 			if(($text=$this->getLastPageText())!=='')
626 626
 			{
627 627
 				$controls->add("\n");
628
-				$button=$this->createPagerButton($buttonType,true,$text,self::CMD_PAGE_LAST,'');
628
+				$button=$this->createPagerButton($buttonType, true, $text, self::CMD_PAGE_LAST, '');
629 629
 				$controls->add($button);
630 630
 			}
631 631
 		}
@@ -638,11 +638,11 @@  discard block
 block discarded – undo
638 638
 	{
639 639
 		$list=new TDropDownList;
640 640
 		$this->getControls()->add($list);
641
-		$list->setDataSource(range(1,$this->getPageCount()));
641
+		$list->setDataSource(range(1, $this->getPageCount()));
642 642
 		$list->dataBind();
643 643
 		$list->setSelectedIndex($this->getCurrentPageIndex());
644 644
 		$list->setAutoPostBack(true);
645
-		$list->attachEventHandler('OnSelectedIndexChanged',array($this,'listIndexChanged'));
645
+		$list->attachEventHandler('OnSelectedIndexChanged', array($this, 'listIndexChanged'));
646 646
 	}
647 647
 
648 648
 	/**
@@ -651,10 +651,10 @@  discard block
 block discarded – undo
651 651
 	 * @param TDropDownList the dropdown list control raising the event
652 652
 	 * @param TEventParameter event parameter
653 653
 	 */
654
-	public function listIndexChanged($sender,$param)
654
+	public function listIndexChanged($sender, $param)
655 655
 	{
656 656
 		$pageIndex=$sender->getSelectedIndex();
657
-		$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender,$pageIndex));
657
+		$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex));
658 658
 	}
659 659
 
660 660
 	/**
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 	 */
664 664
 	public function onPageIndexChanged($param)
665 665
 	{
666
-		$this->raiseEvent('OnPageIndexChanged',$this,$param);
666
+		$this->raiseEvent('OnPageIndexChanged', $this, $param);
667 667
 	}
668 668
 
669 669
 	/**
@@ -674,37 +674,37 @@  discard block
 block discarded – undo
674 674
 	 * @param TEventParameter event parameter
675 675
 	 * @return boolean whether the event bubbling should stop here.
676 676
 	 */
677
-	public function bubbleEvent($sender,$param)
677
+	public function bubbleEvent($sender, $param)
678 678
 	{
679 679
 		if($param instanceof TCommandEventParameter)
680 680
 		{
681 681
 			$command=$param->getCommandName();
682
-			if(strcasecmp($command,self::CMD_PAGE)===0)
682
+			if(strcasecmp($command, self::CMD_PAGE)===0)
683 683
 			{
684
-				$pageIndex=TPropertyValue::ensureInteger($param->getCommandParameter())-1;
685
-				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender,$pageIndex));
684
+				$pageIndex=TPropertyValue::ensureInteger($param->getCommandParameter()) - 1;
685
+				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex));
686 686
 				return true;
687 687
 			}
688
-			else if(strcasecmp($command,self::CMD_PAGE_NEXT)===0)
688
+			else if(strcasecmp($command, self::CMD_PAGE_NEXT)===0)
689 689
 			{
690
-				$pageIndex=$this->getCurrentPageIndex()+1;
691
-				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender,$pageIndex));
690
+				$pageIndex=$this->getCurrentPageIndex() + 1;
691
+				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex));
692 692
 				return true;
693 693
 			}
694
-			else if(strcasecmp($command,self::CMD_PAGE_PREV)===0)
694
+			else if(strcasecmp($command, self::CMD_PAGE_PREV)===0)
695 695
 			{
696
-				$pageIndex=$this->getCurrentPageIndex()-1;
697
-				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender,$pageIndex));
696
+				$pageIndex=$this->getCurrentPageIndex() - 1;
697
+				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex));
698 698
 				return true;
699 699
 			}
700
-			else if(strcasecmp($command,self::CMD_PAGE_FIRST)===0)
700
+			else if(strcasecmp($command, self::CMD_PAGE_FIRST)===0)
701 701
 			{
702
-				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender,0));
702
+				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, 0));
703 703
 				return true;
704 704
 			}
705
-			else if(strcasecmp($command,self::CMD_PAGE_LAST)===0)
705
+			else if(strcasecmp($command, self::CMD_PAGE_LAST)===0)
706 706
 			{
707
-				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender,$this->getPageCount()-1));
707
+				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $this->getPageCount() - 1));
708 708
 				return true;
709 709
 			}
710 710
 			return false;
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 	 * @param TControl the control originally raises the <b>OnCommand</b> event.
745 745
 	 * @param integer new page index
746 746
 	 */
747
-	public function __construct($source,$newPageIndex)
747
+	public function __construct($source, $newPageIndex)
748 748
 	{
749 749
 		$this->_source=$source;
750 750
 		$this->_newIndex=$newPageIndex;
Please login to merge, or discard this patch.