Completed
Push — prado-3.3 ( e90646...0b76d5 )
by Fabio
23:37 queued 03:01
created
framework/Web/UI/WebControls/TCompareValidator.php 4 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -186,6 +186,8 @@
 block discarded – undo
186 186
 	 * Parse the pair of values into the appropriate value type.
187 187
 	 * @param string value one
188 188
 	 * @param string second value
189
+	 * @param string $value1
190
+	 * @param string $value2
189 191
 	 * @return array appropriate type of the value pair, array($value1, $value2);
190 192
 	 */
191 193
 	protected function getComparisonValues($value1, $value2)
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	public function getDataType()
61 61
 	{
62
-		return $this->getViewState('DataType',TValidationDataType::String);
62
+		return $this->getViewState('DataType', TValidationDataType::String);
63 63
 	}
64 64
 
65 65
 	/**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	public function setDataType($value)
71 71
 	{
72
-		$this->setViewState('DataType',TPropertyValue::ensureEnum($value,'TValidationDataType'),TValidationDataType::String);
72
+		$this->setViewState('DataType', TPropertyValue::ensureEnum($value, 'TValidationDataType'), TValidationDataType::String);
73 73
 	}
74 74
 
75 75
 	/**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 */
78 78
 	public function getControlToCompare()
79 79
 	{
80
-		return $this->getViewState('ControlToCompare','');
80
+		return $this->getViewState('ControlToCompare', '');
81 81
 	}
82 82
 
83 83
 	/**
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public function setControlToCompare($value)
88 88
 	{
89
-		$this->setViewState('ControlToCompare',$value,'');
89
+		$this->setViewState('ControlToCompare', $value, '');
90 90
 	}
91 91
 
92 92
 	/**
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function getValueToCompare()
96 96
 	{
97
-		return $this->getViewState('ValueToCompare','');
97
+		return $this->getViewState('ValueToCompare', '');
98 98
 	}
99 99
 
100 100
 	/**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	public function setValueToCompare($value)
105 105
 	{
106
-		$this->setViewState('ValueToCompare',$value,'');
106
+		$this->setViewState('ValueToCompare', $value, '');
107 107
 	}
108 108
 
109 109
 	/**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public function getOperator()
113 113
 	{
114
-		return $this->getViewState('Operator',TValidationCompareOperator::Equal);
114
+		return $this->getViewState('Operator', TValidationCompareOperator::Equal);
115 115
 	}
116 116
 
117 117
 	/**
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	public function setOperator($value)
122 122
 	{
123
-		$this->setViewState('Operator',TPropertyValue::ensureEnum($value,'TValidationCompareOperator'),TValidationCompareOperator::Equal);
123
+		$this->setViewState('Operator', TPropertyValue::ensureEnum($value, 'TValidationCompareOperator'), TValidationCompareOperator::Equal);
124 124
 	}
125 125
 
126 126
 	/**
@@ -149,21 +149,21 @@  discard block
 block discarded – undo
149 149
 	 */
150 150
 	public function evaluateIsValid()
151 151
 	{
152
-		if(($value=$this->getValidationValue($this->getValidationTarget()))==='')
152
+		if (($value = $this->getValidationValue($this->getValidationTarget())) === '')
153 153
 			return true;
154 154
 
155
-		if(($controlToCompare=$this->getControlToCompare())!=='')
155
+		if (($controlToCompare = $this->getControlToCompare()) !== '')
156 156
 		{
157
-			if(($control2=$this->findControl($controlToCompare))===null)
157
+			if (($control2 = $this->findControl($controlToCompare)) === null)
158 158
 				throw new TInvalidDataValueException('comparevalidator_controltocompare_invalid');
159
-			if(($value2=$this->getValidationValue($control2))==='')
159
+			if (($value2 = $this->getValidationValue($control2)) === '')
160 160
 				return false;
161 161
 		}
162 162
 		else
163
-			$value2=$this->getValueToCompare();
163
+			$value2 = $this->getValueToCompare();
164 164
 
165 165
 		$values = $this->getComparisonValues($value, $value2);
166
-		switch($this->getOperator())
166
+		switch ($this->getOperator())
167 167
 		{
168 168
 			case TValidationCompareOperator::Equal:
169 169
 				return $values[0] == $values[1];
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	 */
191 191
 	protected function getComparisonValues($value1, $value2)
192 192
 	{
193
-		switch($this->getDataType())
193
+		switch ($this->getDataType())
194 194
 		{
195 195
 			case TValidationDataType::Integer:
196 196
 				return array(intval($value1), intval($value2));
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 				return array(floatval($value1), floatval($value2));
199 199
 			case TValidationDataType::Date:
200 200
 				$dateFormat = $this->getDateFormat();
201
-				if($dateFormat!=='')
201
+				if ($dateFormat !== '')
202 202
 				{
203 203
 					$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', $dateFormat);
204 204
 					return array($formatter->parse($value1), $formatter->parse($value2));
@@ -216,18 +216,18 @@  discard block
 block discarded – undo
216 216
 	protected function getClientScriptOptions()
217 217
 	{
218 218
 		$options = parent::getClientScriptOptions();
219
-		if(($name=$this->getControlToCompare())!=='')
219
+		if (($name = $this->getControlToCompare()) !== '')
220 220
 		{
221
-			if(($control=$this->findControl($name))!==null)
222
-				$options['ControlToCompare']=$control->getClientID();
221
+			if (($control = $this->findControl($name)) !== null)
222
+				$options['ControlToCompare'] = $control->getClientID();
223 223
 		}
224
-		if(($value=$this->getValueToCompare())!=='')
225
-			$options['ValueToCompare']=$value;
226
-		if(($operator=$this->getOperator())!==TValidationCompareOperator::Equal)
227
-			$options['Operator']=$operator;
228
-		$options['DataType']=$this->getDataType();
229
-		if(($dateFormat=$this->getDateFormat())!=='')
230
-			$options['DateFormat']=$dateFormat;
224
+		if (($value = $this->getValueToCompare()) !== '')
225
+			$options['ValueToCompare'] = $value;
226
+		if (($operator = $this->getOperator()) !== TValidationCompareOperator::Equal)
227
+			$options['Operator'] = $operator;
228
+		$options['DataType'] = $this->getDataType();
229
+		if (($dateFormat = $this->getDateFormat()) !== '')
230
+			$options['DateFormat'] = $dateFormat;
231 231
 		return $options;
232 232
 	}
233 233
 }
@@ -252,11 +252,11 @@  discard block
 block discarded – undo
252 252
  */
253 253
 class TValidationCompareOperator extends TEnumerable
254 254
 {
255
-	const Equal='Equal';
256
-	const NotEqual='NotEqual';
257
-	const GreaterThan='GreaterThan';
258
-	const GreaterThanEqual='GreaterThanEqual';
259
-	const LessThan='LessThan';
260
-	const LessThanEqual='LessThanEqual';
255
+	const Equal = 'Equal';
256
+	const NotEqual = 'NotEqual';
257
+	const GreaterThan = 'GreaterThan';
258
+	const GreaterThanEqual = 'GreaterThanEqual';
259
+	const LessThan = 'LessThan';
260
+	const LessThanEqual = 'LessThanEqual';
261 261
 }
262 262
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -158,8 +158,7 @@  discard block
 block discarded – undo
158 158
 				throw new TInvalidDataValueException('comparevalidator_controltocompare_invalid');
159 159
 			if(($value2=$this->getValidationValue($control2))==='')
160 160
 				return false;
161
-		}
162
-		else
161
+		} else
163 162
 			$value2=$this->getValueToCompare();
164 163
 
165 164
 		$values = $this->getComparisonValues($value, $value2);
@@ -202,8 +201,7 @@  discard block
 block discarded – undo
202 201
 				{
203 202
 					$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', $dateFormat);
204 203
 					return array($formatter->parse($value1), $formatter->parse($value2));
205
-				}
206
-				else
204
+				} else
207 205
 					return array(strtotime($value1), strtotime($value2));
208 206
 		}
209 207
 		return array($value1, $value2);
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,9 +62,9 @@
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	/**
65
-     * Sets the date format for a date validation
66
-     * @param string the date format value
67
-     */
65
+	 * Sets the date format for a date validation
66
+	 * @param string the date format value
67
+	 */
68 68
 	public function setDateFormat($value)
69 69
 	{
70 70
 		$this->setViewState('DateFormat', $value, '');
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDataBoundControl.php 3 patches
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -151,6 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
 	/**
153 153
 	 * @param boolean if databind has been invoked in this page request
154
+	 * @param boolean $value
154 155
 	 */
155 156
 	protected function setIsDataBound($value)
156 157
 	{
@@ -211,6 +212,7 @@  discard block
 block discarded – undo
211 212
 
212 213
 	/**
213 214
 	 * @param integer the zero-based index of the current page
215
+	 * @param integer $value
214 216
 	 * @throws TInvalidDataValueException if the value is less than 0
215 217
 	 */
216 218
 	public function setCurrentPageIndex($value)
@@ -273,6 +275,7 @@  discard block
 block discarded – undo
273 275
 	 * If true and the control has been prerendered while it uses the data source
274 276
 	 * specified by {@link setDataSourceID}, a databind call will be called by this method.
275 277
 	 * @param boolean whether a databind call is required.
278
+	 * @param boolean $value
276 279
 	 */
277 280
 	protected function setRequiresDataBinding($value)
278 281
 	{
@@ -405,6 +408,9 @@  discard block
 block discarded – undo
405 408
 		return $this->_currentDataSource;
406 409
 	}
407 410
 
411
+	/**
412
+	 * @param Traversable $data
413
+	 */
408 414
 	abstract protected function performDataBinding($data);
409 415
 
410 416
 	/**
@@ -566,6 +572,7 @@  discard block
 block discarded – undo
566 572
 	 * Sets the zero-based index for the item.
567 573
 	 * If the item is not in the item collection (e.g. it is a header item), -1 should be used.
568 574
 	 * @param integer zero-based index of the item.
575
+	 * @return void
569 576
 	 */
570 577
 	public function setItemIndex($value);
571 578
 
@@ -576,6 +583,7 @@  discard block
 block discarded – undo
576 583
 
577 584
 	/**
578 585
 	 * @param TListItemType the item type.
586
+	 * @return void
579 587
 	 */
580 588
 	public function setItemType($value);
581 589
 }
Please login to merge, or discard this patch.
Spacing   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -43,18 +43,18 @@  discard block
 block discarded – undo
43 43
  */
44 44
 abstract class TDataBoundControl extends TWebControl
45 45
 {
46
-	private $_initialized=false;
47
-	private $_dataSource=null;
48
-	private $_requiresBindToNull=false;
49
-	private $_requiresDataBinding=false;
50
-	private $_prerendered=false;
51
-	private $_currentView=null;
52
-	private $_currentDataSource=null;
53
-	private $_currentViewValid=false;
54
-	private $_currentDataSourceValid=false;
55
-	private $_currentViewIsFromDataSourceID=false;
56
-	private $_parameters=null;
57
-	private $_isDataBound=false;
46
+	private $_initialized = false;
47
+	private $_dataSource = null;
48
+	private $_requiresBindToNull = false;
49
+	private $_requiresDataBinding = false;
50
+	private $_prerendered = false;
51
+	private $_currentView = null;
52
+	private $_currentDataSource = null;
53
+	private $_currentViewValid = false;
54
+	private $_currentDataSourceValid = false;
55
+	private $_currentViewIsFromDataSourceID = false;
56
+	private $_parameters = null;
57
+	private $_isDataBound = false;
58 58
 
59 59
 	/**
60 60
 	 * @return Traversable data source object, defaults to null.
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public function setDataSource($value)
75 75
 	{
76
-		$this->_dataSource=$this->validateDataSource($value);
76
+		$this->_dataSource = $this->validateDataSource($value);
77 77
 		$this->onDataSourceChanged();
78 78
 	}
79 79
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	public function getDataSourceID()
84 84
 	{
85
-		return $this->getViewState('DataSourceID','');
85
+		return $this->getViewState('DataSourceID', '');
86 86
 	}
87 87
 
88 88
 	/**
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function setDataSourceID($value)
93 93
 	{
94
-		$dsid=$this->getViewState('DataSourceID','');
95
-		if($dsid!=='' && $value==='')
96
-			$this->_requiresBindToNull=true;
97
-		$this->setViewState('DataSourceID',$value,'');
94
+		$dsid = $this->getViewState('DataSourceID', '');
95
+		if ($dsid !== '' && $value === '')
96
+			$this->_requiresBindToNull = true;
97
+		$this->setViewState('DataSourceID', $value, '');
98 98
 		$this->onDataSourceChanged();
99 99
 	}
100 100
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	protected function getUsingDataSourceID()
107 107
 	{
108
-		return $this->getDataSourceID()!=='';
108
+		return $this->getDataSourceID() !== '';
109 109
 	}
110 110
 
111 111
 	/**
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	public function onDataSourceChanged()
116 116
 	{
117
-		$this->_currentViewValid=false;
118
-		$this->_currentDataSourceValid=false;
119
-		if($this->getInitialized())
117
+		$this->_currentViewValid = false;
118
+		$this->_currentDataSourceValid = false;
119
+		if ($this->getInitialized())
120 120
 			$this->setRequiresDataBinding(true);
121 121
 	}
122 122
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	protected function setInitialized($value)
140 140
 	{
141
-		$this->_initialized=TPropertyValue::ensureBoolean($value);
141
+		$this->_initialized = TPropertyValue::ensureBoolean($value);
142 142
 	}
143 143
 
144 144
 	/**
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	 */
155 155
 	protected function setIsDataBound($value)
156 156
 	{
157
-		$this->_isDataBound=$value;
157
+		$this->_isDataBound = $value;
158 158
 	}
159 159
 
160 160
 	/**
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 	 */
171 171
 	public function getAllowPaging()
172 172
 	{
173
-		return $this->getViewState('AllowPaging',false);
173
+		return $this->getViewState('AllowPaging', false);
174 174
 	}
175 175
 
176 176
 	/**
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 	 */
179 179
 	public function setAllowPaging($value)
180 180
 	{
181
-		$this->setViewState('AllowPaging',TPropertyValue::ensureBoolean($value),false);
181
+		$this->setViewState('AllowPaging', TPropertyValue::ensureBoolean($value), false);
182 182
 	}
183 183
 
184 184
 	/**
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 	 */
187 187
 	public function getAllowCustomPaging()
188 188
 	{
189
-		return $this->getViewState('AllowCustomPaging',false);
189
+		return $this->getViewState('AllowCustomPaging', false);
190 190
 	}
191 191
 
192 192
 	/**
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	 */
199 199
 	public function setAllowCustomPaging($value)
200 200
 	{
201
-		$this->setViewState('AllowCustomPaging',TPropertyValue::ensureBoolean($value),false);
201
+		$this->setViewState('AllowCustomPaging', TPropertyValue::ensureBoolean($value), false);
202 202
 	}
203 203
 
204 204
 	/**
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	 */
207 207
 	public function getCurrentPageIndex()
208 208
 	{
209
-		return $this->getViewState('CurrentPageIndex',0);
209
+		return $this->getViewState('CurrentPageIndex', 0);
210 210
 	}
211 211
 
212 212
 	/**
@@ -215,9 +215,9 @@  discard block
 block discarded – undo
215 215
 	 */
216 216
 	public function setCurrentPageIndex($value)
217 217
 	{
218
-		if(($value=TPropertyValue::ensureInteger($value))<0)
219
-			$value=0;
220
-		$this->setViewState('CurrentPageIndex',$value,0);
218
+		if (($value = TPropertyValue::ensureInteger($value)) < 0)
219
+			$value = 0;
220
+		$this->setViewState('CurrentPageIndex', $value, 0);
221 221
 	}
222 222
 
223 223
 	/**
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 */
226 226
 	public function getPageSize()
227 227
 	{
228
-		return $this->getViewState('PageSize',10);
228
+		return $this->getViewState('PageSize', 10);
229 229
 	}
230 230
 
231 231
 	/**
@@ -234,9 +234,9 @@  discard block
 block discarded – undo
234 234
 	 */
235 235
 	public function setPageSize($value)
236 236
 	{
237
-		if(($value=TPropertyValue::ensureInteger($value))<1)
238
-			throw new TInvalidDataValueException('databoundcontrol_pagesize_invalid',get_class($this));
239
-		$this->setViewState('PageSize',TPropertyValue::ensureInteger($value),10);
237
+		if (($value = TPropertyValue::ensureInteger($value)) < 1)
238
+			throw new TInvalidDataValueException('databoundcontrol_pagesize_invalid', get_class($this));
239
+		$this->setViewState('PageSize', TPropertyValue::ensureInteger($value), 10);
240 240
 	}
241 241
 
242 242
 	/**
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 	 */
245 245
 	public function getPageCount()
246 246
 	{
247
-		return $this->getViewState('PageCount',1);
247
+		return $this->getViewState('PageCount', 1);
248 248
 	}
249 249
 
250 250
 	/**
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 	 */
254 254
 	public function getVirtualItemCount()
255 255
 	{
256
-		return $this->getViewState('VirtualItemCount',0);
256
+		return $this->getViewState('VirtualItemCount', 0);
257 257
 	}
258 258
 
259 259
 	/**
@@ -263,9 +263,9 @@  discard block
 block discarded – undo
263 263
 	 */
264 264
 	public function setVirtualItemCount($value)
265 265
 	{
266
-		if(($value=TPropertyValue::ensureInteger($value))<0)
267
-			throw new TInvalidDataValueException('databoundcontrol_virtualitemcount_invalid',get_class($this));
268
-		$this->setViewState('VirtualItemCount',$value,0);
266
+		if (($value = TPropertyValue::ensureInteger($value)) < 0)
267
+			throw new TInvalidDataValueException('databoundcontrol_virtualitemcount_invalid', get_class($this));
268
+		$this->setViewState('VirtualItemCount', $value, 0);
269 269
 	}
270 270
 
271 271
 	/**
@@ -276,14 +276,14 @@  discard block
 block discarded – undo
276 276
 	 */
277 277
 	protected function setRequiresDataBinding($value)
278 278
 	{
279
-		$value=TPropertyValue::ensureBoolean($value);
280
-		if($value && $this->_prerendered)
279
+		$value = TPropertyValue::ensureBoolean($value);
280
+		if ($value && $this->_prerendered)
281 281
 		{
282
-			$this->_requiresDataBinding=true;
282
+			$this->_requiresDataBinding = true;
283 283
 			$this->ensureDataBound();
284 284
 		}
285 285
 		else
286
-			$this->_requiresDataBinding=$value;
286
+			$this->_requiresDataBinding = $value;
287 287
 	}
288 288
 
289 289
 	/**
@@ -294,10 +294,10 @@  discard block
 block discarded – undo
294 294
 	 */
295 295
 	protected function ensureDataBound()
296 296
 	{
297
-		if($this->_requiresDataBinding && ($this->getUsingDataSourceID() || $this->_requiresBindToNull))
297
+		if ($this->_requiresDataBinding && ($this->getUsingDataSourceID() || $this->_requiresBindToNull))
298 298
 		{
299 299
 			$this->dataBind();
300
-			$this->_requiresBindToNull=false;
300
+			$this->_requiresBindToNull = false;
301 301
 		}
302 302
 	}
303 303
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	 */
307 307
 	protected function createPagedDataSource()
308 308
 	{
309
-		$ds=new TPagedDataSource;
309
+		$ds = new TPagedDataSource;
310 310
 		$ds->setCurrentPageIndex($this->getCurrentPageIndex());
311 311
 		$ds->setPageSize($this->getPageSize());
312 312
 		$ds->setAllowPaging($this->getAllowPaging());
@@ -327,21 +327,21 @@  discard block
 block discarded – undo
327 327
 		$this->dataBindProperties();
328 328
 		$this->onDataBinding(null);
329 329
 
330
-		if(($view=$this->getDataSourceView())!==null)
331
-			$data=$view->select($this->getSelectParameters());
330
+		if (($view = $this->getDataSourceView()) !== null)
331
+			$data = $view->select($this->getSelectParameters());
332 332
 		else
333
-			$data=null;
333
+			$data = null;
334 334
 
335
-		if($data instanceof Traversable)
335
+		if ($data instanceof Traversable)
336 336
 		{
337
-			if($this->getAllowPaging())
337
+			if ($this->getAllowPaging())
338 338
 			{
339
-				$ds=$this->createPagedDataSource();
339
+				$ds = $this->createPagedDataSource();
340 340
 				$ds->setDataSource($data);
341
-				$this->setViewState('PageCount',$ds->getPageCount());
342
-				if($ds->getCurrentPageIndex()>=$ds->getPageCount())
341
+				$this->setViewState('PageCount', $ds->getPageCount());
342
+				if ($ds->getCurrentPageIndex() >= $ds->getPageCount())
343 343
 				{
344
-					$ds->setCurrentPageIndex($ds->getPageCount()-1);
344
+					$ds->setCurrentPageIndex($ds->getPageCount() - 1);
345 345
 					$this->setCurrentPageIndex($ds->getCurrentPageIndex());
346 346
 				}
347 347
 				$this->performDataBinding($ds);
@@ -356,51 +356,51 @@  discard block
 block discarded – undo
356 356
 		$this->onDataBound(null);
357 357
 	}
358 358
 
359
-	public function dataSourceViewChanged($sender,$param)
359
+	public function dataSourceViewChanged($sender, $param)
360 360
 	{
361
-		if(!$this->_ignoreDataSourceViewChanged)
361
+		if (!$this->_ignoreDataSourceViewChanged)
362 362
 			$this->setRequiresDataBinding(true);
363 363
 	}
364 364
 
365 365
 	protected function getDataSourceView()
366 366
 	{
367
-		if(!$this->_currentViewValid)
367
+		if (!$this->_currentViewValid)
368 368
 		{
369
-			if($this->_currentView && $this->_currentViewIsFromDataSourceID)
370
-				$this->_currentView->detachEventHandler('DataSourceViewChanged',array($this,'dataSourceViewChanged'));
371
-			if(($dataSource=$this->determineDataSource())!==null)
369
+			if ($this->_currentView && $this->_currentViewIsFromDataSourceID)
370
+				$this->_currentView->detachEventHandler('DataSourceViewChanged', array($this, 'dataSourceViewChanged'));
371
+			if (($dataSource = $this->determineDataSource()) !== null)
372 372
 			{
373
-				if(($view=$dataSource->getView($this->getDataMember()))===null)
374
-					throw new TInvalidDataValueException('databoundcontrol_datamember_invalid',$this->getDataMember());
375
-				if($this->_currentViewIsFromDataSourceID=$this->getUsingDataSourceID())
376
-					$view->attachEventHandler('OnDataSourceViewChanged',array($this,'dataSourceViewChanged'));
377
-				$this->_currentView=$view;
373
+				if (($view = $dataSource->getView($this->getDataMember())) === null)
374
+					throw new TInvalidDataValueException('databoundcontrol_datamember_invalid', $this->getDataMember());
375
+				if ($this->_currentViewIsFromDataSourceID = $this->getUsingDataSourceID())
376
+					$view->attachEventHandler('OnDataSourceViewChanged', array($this, 'dataSourceViewChanged'));
377
+				$this->_currentView = $view;
378 378
 			}
379 379
 			else
380
-				$this->_currentView=null;
381
-			$this->_currentViewValid=true;
380
+				$this->_currentView = null;
381
+			$this->_currentViewValid = true;
382 382
 		}
383 383
 		return $this->_currentView;
384 384
 	}
385 385
 
386 386
 	protected function determineDataSource()
387 387
 	{
388
-		if(!$this->_currentDataSourceValid)
388
+		if (!$this->_currentDataSourceValid)
389 389
 		{
390
-			if(($dsid=$this->getDataSourceID())!=='')
390
+			if (($dsid = $this->getDataSourceID()) !== '')
391 391
 			{
392
-				if(($dataSource=$this->getNamingContainer()->findControl($dsid))===null)
393
-					throw new TInvalidDataValueException('databoundcontrol_datasourceid_inexistent',$dsid);
394
-				else if(!($dataSource instanceof IDataSource))
395
-					throw new TInvalidDataValueException('databoundcontrol_datasourceid_invalid',$dsid);
392
+				if (($dataSource = $this->getNamingContainer()->findControl($dsid)) === null)
393
+					throw new TInvalidDataValueException('databoundcontrol_datasourceid_inexistent', $dsid);
394
+				else if (!($dataSource instanceof IDataSource))
395
+					throw new TInvalidDataValueException('databoundcontrol_datasourceid_invalid', $dsid);
396 396
 				else
397
-					$this->_currentDataSource=$dataSource;
397
+					$this->_currentDataSource = $dataSource;
398 398
 			}
399
-			else if(($dataSource=$this->getDataSource())!==null)
400
-				$this->_currentDataSource=new TReadOnlyDataSource($dataSource,$this->getDataMember());
399
+			else if (($dataSource = $this->getDataSource()) !== null)
400
+				$this->_currentDataSource = new TReadOnlyDataSource($dataSource, $this->getDataMember());
401 401
 			else
402
-				$this->_currentDataSource=null;
403
-			$this->_currentDataSourceValid=true;
402
+				$this->_currentDataSource = null;
403
+			$this->_currentDataSourceValid = true;
404 404
 		}
405 405
 		return $this->_currentDataSource;
406 406
 	}
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 	 */
415 415
 	public function onDataBound($param)
416 416
 	{
417
-		$this->raiseEvent('OnDataBound',$this,$param);
417
+		$this->raiseEvent('OnDataBound', $this, $param);
418 418
 	}
419 419
 
420 420
 	/**
@@ -427,8 +427,8 @@  discard block
 block discarded – undo
427 427
 	public function onInit($param)
428 428
 	{
429 429
 		parent::onInit($param);
430
-		$page=$this->getPage();
431
-		$page->attachEventHandler('OnPreLoad',array($this,'pagePreLoad'));
430
+		$page = $this->getPage();
431
+		$page->attachEventHandler('OnPreLoad', array($this, 'pagePreLoad'));
432 432
 	}
433 433
 
434 434
 	/**
@@ -437,11 +437,11 @@  discard block
 block discarded – undo
437 437
 	 * @param mixed event sender
438 438
 	 * @param TEventParameter event parameter
439 439
 	 */
440
-	public function pagePreLoad($sender,$param)
440
+	public function pagePreLoad($sender, $param)
441 441
 	{
442
-		$this->_initialized=true;
443
-		$isPostBack=$this->getPage()->getIsPostBack();
444
-		if(!$isPostBack || ($isPostBack && (!$this->getEnableViewState(true) || !$this->getIsDataBound())))
442
+		$this->_initialized = true;
443
+		$isPostBack = $this->getPage()->getIsPostBack();
444
+		if (!$isPostBack || ($isPostBack && (!$this->getEnableViewState(true) || !$this->getIsDataBound())))
445 445
 			$this->setRequiresDataBinding(true);
446 446
 	}
447 447
 
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	 */
453 453
 	public function onPreRender($param)
454 454
 	{
455
-		$this->_prerendered=true;
455
+		$this->_prerendered = true;
456 456
 		$this->ensureDataBound();
457 457
 		parent::onPreRender($param);
458 458
 	}
@@ -466,44 +466,44 @@  discard block
 block discarded – undo
466 466
 	 */
467 467
 	protected function validateDataSource($value)
468 468
 	{
469
-		if(is_string($value))
469
+		if (is_string($value))
470 470
 		{
471
-			$list=new TList;
472
-			foreach(TPropertyValue::ensureArray($value) as $key=>$value)
471
+			$list = new TList;
472
+			foreach (TPropertyValue::ensureArray($value) as $key=>$value)
473 473
 			{
474
-				if(is_array($value))
474
+				if (is_array($value))
475 475
 					$list->add($value);
476 476
 				else
477
-					$list->add(array($value,is_string($key)?$key:$value));
477
+					$list->add(array($value, is_string($key) ? $key : $value));
478 478
 			}
479 479
 			return $list;
480 480
 		}
481
-		else if(is_array($value))
481
+		else if (is_array($value))
482 482
 			return new TMap($value);
483
-		else if($value instanceof TDbDataReader) {
483
+		else if ($value instanceof TDbDataReader) {
484 484
 			// read array from TDbDataReader since it's forward-only stream and can only be traversed once
485 485
 			return $value->readAll();
486 486
 		}
487
-		else if(($value instanceof Traversable) || $value===null)
487
+		else if (($value instanceof Traversable) || $value === null)
488 488
 			return $value;
489 489
 		else
490
-			throw new TInvalidDataTypeException('databoundcontrol_datasource_invalid',get_class($this));
490
+			throw new TInvalidDataTypeException('databoundcontrol_datasource_invalid', get_class($this));
491 491
 	}
492 492
 
493 493
 	public function getDataMember()
494 494
 	{
495
-		return $this->getViewState('DataMember','');
495
+		return $this->getViewState('DataMember', '');
496 496
 	}
497 497
 
498 498
 	public function setDataMember($value)
499 499
 	{
500
-		$this->setViewState('DataMember',$value,'');
500
+		$this->setViewState('DataMember', $value, '');
501 501
 	}
502 502
 
503 503
 	public function getSelectParameters()
504 504
 	{
505
-		if(!$this->_parameters)
506
-			$this->_parameters=new TDataSourceSelectParameters;
505
+		if (!$this->_parameters)
506
+			$this->_parameters = new TDataSourceSelectParameters;
507 507
 		return $this->_parameters;
508 508
 	}
509 509
 }
@@ -530,14 +530,14 @@  discard block
 block discarded – undo
530 530
  */
531 531
 class TListItemType extends TEnumerable
532 532
 {
533
-	const Header='Header';
534
-	const Footer='Footer';
535
-	const Item='Item';
536
-	const Separator='Separator';
537
-	const AlternatingItem='AlternatingItem';
538
-	const EditItem='EditItem';
539
-	const SelectedItem='SelectedItem';
540
-	const Pager='Pager';
533
+	const Header = 'Header';
534
+	const Footer = 'Footer';
535
+	const Item = 'Item';
536
+	const Separator = 'Separator';
537
+	const AlternatingItem = 'AlternatingItem';
538
+	const EditItem = 'EditItem';
539
+	const SelectedItem = 'SelectedItem';
540
+	const Pager = 'Pager';
541 541
 }
542 542
 
543 543
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -281,8 +281,7 @@  discard block
 block discarded – undo
281 281
 		{
282 282
 			$this->_requiresDataBinding=true;
283 283
 			$this->ensureDataBound();
284
-		}
285
-		else
284
+		} else
286 285
 			$this->_requiresDataBinding=$value;
287 286
 	}
288 287
 
@@ -345,8 +344,7 @@  discard block
 block discarded – undo
345 344
 					$this->setCurrentPageIndex($ds->getCurrentPageIndex());
346 345
 				}
347 346
 				$this->performDataBinding($ds);
348
-			}
349
-			else
347
+			} else
350 348
 			{
351 349
 				$this->clearViewState('PageCount');
352 350
 				$this->performDataBinding($data);
@@ -375,8 +373,7 @@  discard block
 block discarded – undo
375 373
 				if($this->_currentViewIsFromDataSourceID=$this->getUsingDataSourceID())
376 374
 					$view->attachEventHandler('OnDataSourceViewChanged',array($this,'dataSourceViewChanged'));
377 375
 				$this->_currentView=$view;
378
-			}
379
-			else
376
+			} else
380 377
 				$this->_currentView=null;
381 378
 			$this->_currentViewValid=true;
382 379
 		}
@@ -395,8 +392,7 @@  discard block
 block discarded – undo
395 392
 					throw new TInvalidDataValueException('databoundcontrol_datasourceid_invalid',$dsid);
396 393
 				else
397 394
 					$this->_currentDataSource=$dataSource;
398
-			}
399
-			else if(($dataSource=$this->getDataSource())!==null)
395
+			} else if(($dataSource=$this->getDataSource())!==null)
400 396
 				$this->_currentDataSource=new TReadOnlyDataSource($dataSource,$this->getDataMember());
401 397
 			else
402 398
 				$this->_currentDataSource=null;
@@ -477,14 +473,12 @@  discard block
 block discarded – undo
477 473
 					$list->add(array($value,is_string($key)?$key:$value));
478 474
 			}
479 475
 			return $list;
480
-		}
481
-		else if(is_array($value))
476
+		} else if(is_array($value))
482 477
 			return new TMap($value);
483 478
 		else if($value instanceof TDbDataReader) {
484 479
 			// read array from TDbDataReader since it's forward-only stream and can only be traversed once
485 480
 			return $value->readAll();
486
-		}
487
-		else if(($value instanceof Traversable) || $value===null)
481
+		} else if(($value instanceof Traversable) || $value===null)
488 482
 			return $value;
489 483
 		else
490 484
 			throw new TInvalidDataTypeException('databoundcontrol_datasource_invalid',get_class($this));
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDataGrid.php 3 patches
Doc Comments   +24 added lines, -1 removed lines patch added patch discarded remove patch
@@ -534,6 +534,7 @@  discard block
 block discarded – undo
534 534
 	 * If the item to be selected is already in edit mode, it will remain in edit mode.
535 535
 	 * If the index is less than 0, any existing selection will be cleared up.
536 536
 	 * @param integer the selected item index
537
+	 * @param integer $value
537 538
 	 */
538 539
 	public function setSelectedItemIndex($value)
539 540
 	{
@@ -762,6 +763,7 @@  discard block
 block discarded – undo
762 763
 	 * This method is invoked when a button control raises <b>OnCommand</b> event
763 764
 	 * with <b>cancel</b> command name.
764 765
 	 * @param TDataGridCommandEventParameter event parameter
766
+	 * @param TDataGridCommandEventParameter $param
765 767
 	 */
766 768
 	public function onCancelCommand($param)
767 769
 	{
@@ -773,6 +775,7 @@  discard block
 block discarded – undo
773 775
 	 * This method is invoked when a button control raises <b>OnCommand</b> event
774 776
 	 * with <b>delete</b> command name.
775 777
 	 * @param TDataGridCommandEventParameter event parameter
778
+	 * @param TDataGridCommandEventParameter $param
776 779
 	 */
777 780
 	public function onDeleteCommand($param)
778 781
 	{
@@ -784,6 +787,7 @@  discard block
 block discarded – undo
784 787
 	 * This method is invoked when a button control raises <b>OnCommand</b> event
785 788
 	 * with <b>edit</b> command name.
786 789
 	 * @param TDataGridCommandEventParameter event parameter
790
+	 * @param TDataGridCommandEventParameter $param
787 791
 	 */
788 792
 	public function onEditCommand($param)
789 793
 	{
@@ -794,6 +798,7 @@  discard block
 block discarded – undo
794 798
 	 * Raises <b>OnItemCommand</b> event.
795 799
 	 * This method is invoked when a button control raises <b>OnCommand</b> event.
796 800
 	 * @param TDataGridCommandEventParameter event parameter
801
+	 * @param TDataGridCommandEventParameter $param
797 802
 	 */
798 803
 	public function onItemCommand($param)
799 804
 	{
@@ -805,6 +810,7 @@  discard block
 block discarded – undo
805 810
 	 * This method is invoked when a button control raises <b>OnCommand</b> event
806 811
 	 * with <b>sort</b> command name.
807 812
 	 * @param TDataGridSortCommandEventParameter event parameter
813
+	 * @param TDataGridSortCommandEventParameter $param
808 814
 	 */
809 815
 	public function onSortCommand($param)
810 816
 	{
@@ -816,6 +822,7 @@  discard block
 block discarded – undo
816 822
 	 * This method is invoked when a button control raises <b>OnCommand</b> event
817 823
 	 * with <b>update</b> command name.
818 824
 	 * @param TDataGridCommandEventParameter event parameter
825
+	 * @param TDataGridCommandEventParameter $param
819 826
 	 */
820 827
 	public function onUpdateCommand($param)
821 828
 	{
@@ -827,6 +834,7 @@  discard block
 block discarded – undo
827 834
 	 * This method is invoked right after a datagrid item is created and before
828 835
 	 * added to page hierarchy.
829 836
 	 * @param TDataGridItemEventParameter event parameter
837
+	 * @param TDataGridItemEventParameter $param
830 838
 	 */
831 839
 	public function onItemCreated($param)
832 840
 	{
@@ -838,6 +846,7 @@  discard block
 block discarded – undo
838 846
 	 * This method is invoked right after a datagrid pager is created and before
839 847
 	 * added to page hierarchy.
840 848
 	 * @param TDataGridPagerEventParameter event parameter
849
+	 * @param TDataGridPagerEventParameter $param
841 850
 	 */
842 851
 	public function onPagerCreated($param)
843 852
 	{
@@ -849,6 +858,7 @@  discard block
 block discarded – undo
849 858
 	 * This method is invoked for each datagrid item after it performs
850 859
 	 * databinding.
851 860
 	 * @param TDataGridItemEventParameter event parameter
861
+	 * @param TDataGridItemEventParameter $param
852 862
 	 */
853 863
 	public function onItemDataBound($param)
854 864
 	{
@@ -859,6 +869,7 @@  discard block
 block discarded – undo
859 869
 	 * Raises <b>OnPageIndexChanged</b> event.
860 870
 	 * This method is invoked when current page is changed.
861 871
 	 * @param TDataGridPageChangedEventParameter event parameter
872
+	 * @param TDataGridPageChangedEventParameter $param
862 873
 	 */
863 874
 	public function onPageIndexChanged($param)
864 875
 	{
@@ -1155,6 +1166,11 @@  discard block
 block discarded – undo
1155 1166
 		return new TDataGridItem($itemIndex,$dataSourceIndex,$itemType);
1156 1167
 	}
1157 1168
 
1169
+	/**
1170
+	 * @param integer $itemIndex
1171
+	 * @param boolean $dataBind
1172
+	 * @param TList $columns
1173
+	 */
1158 1174
 	private function createItemInternal($itemIndex,$dataSourceIndex,$itemType,$dataBind,$dataItem,$columns)
1159 1175
 	{
1160 1176
 		$item=$this->createItem($itemIndex,$dataSourceIndex,$itemType);
@@ -1180,6 +1196,7 @@  discard block
 block discarded – undo
1180 1196
 	 * Initializes a datagrid item and cells inside it
1181 1197
 	 * @param TDataGrid datagrid item to be initialized
1182 1198
 	 * @param TDataGridColumnCollection datagrid columns to be used to initialize the cells in the item
1199
+	 * @param TDataGridItem $item
1183 1200
 	 */
1184 1201
 	protected function initializeItem($item,$columns)
1185 1202
 	{
@@ -1212,6 +1229,7 @@  discard block
 block discarded – undo
1212 1229
 	/**
1213 1230
 	 * Builds the pager content based on pager style.
1214 1231
 	 * @param TDataGridPager the container for the pager
1232
+	 * @param TDataGridPager $pager
1215 1233
 	 */
1216 1234
 	protected function buildPager($pager)
1217 1235
 	{
@@ -1237,6 +1255,9 @@  discard block
 block discarded – undo
1237 1255
 	 * @param string caption of the button
1238 1256
 	 * @param string CommandName corresponding to the OnCommand event of the button
1239 1257
 	 * @param string CommandParameter corresponding to the OnCommand event of the button
1258
+	 * @param TDataGridPagerButtonType $buttonType
1259
+	 * @param boolean $enabled
1260
+	 * @param string $commandName
1240 1261
 	 * @return mixed the button instance
1241 1262
 	 */
1242 1263
 	protected function createPagerButton($pager,$buttonType,$enabled,$text,$commandName,$commandParameter)
@@ -1881,6 +1902,7 @@  discard block
 block discarded – undo
1881 1902
 	 * Constructor.
1882 1903
 	 * @param TControl the control originally raises the <b>OnCommand</b> event.
1883 1904
 	 * @param integer new page index
1905
+	 * @param integer $newPageIndex
1884 1906
 	 */
1885 1907
 	public function __construct($source,$newPageIndex)
1886 1908
 	{
@@ -1957,7 +1979,7 @@  discard block
 block discarded – undo
1957 1979
 	}
1958 1980
 
1959 1981
 	/**
1960
-	 * @return TListItemType item type.
1982
+	 * @return string item type.
1961 1983
 	 */
1962 1984
 	public function getItemType()
1963 1985
 	{
@@ -2062,6 +2084,7 @@  discard block
 block discarded – undo
2062 2084
 	/**
2063 2085
 	 * Constructor.
2064 2086
 	 * @param TDataGrid datagrid object
2087
+	 * @param TDataGrid $dataGrid
2065 2088
 	 */
2066 2089
 	public function __construct($dataGrid)
2067 2090
 	{
Please login to merge, or discard this patch.
Braces   +39 added lines, -58 removed lines patch added patch discarded remove patch
@@ -711,33 +711,27 @@  discard block
 block discarded – undo
711 711
 				$this->setSelectedItemIndex($param->getItem()->getItemIndex());
712 712
 				$this->onSelectedIndexChanged($param);
713 713
 				return true;
714
-			}
715
-			else if(strcasecmp($command,self::CMD_EDIT)===0)
714
+			} else if(strcasecmp($command,self::CMD_EDIT)===0)
716 715
 			{
717 716
 				$this->onEditCommand($param);
718 717
 				return true;
719
-			}
720
-			else if(strcasecmp($command,self::CMD_DELETE)===0)
718
+			} else if(strcasecmp($command,self::CMD_DELETE)===0)
721 719
 			{
722 720
 				$this->onDeleteCommand($param);
723 721
 				return true;
724
-			}
725
-			else if(strcasecmp($command,self::CMD_UPDATE)===0)
722
+			} else if(strcasecmp($command,self::CMD_UPDATE)===0)
726 723
 			{
727 724
 				$this->onUpdateCommand($param);
728 725
 				return true;
729
-			}
730
-			else if(strcasecmp($command,self::CMD_CANCEL)===0)
726
+			} else if(strcasecmp($command,self::CMD_CANCEL)===0)
731 727
 			{
732 728
 				$this->onCancelCommand($param);
733 729
 				return true;
734
-			}
735
-			else if(strcasecmp($command,self::CMD_SORT)===0)
730
+			} else if(strcasecmp($command,self::CMD_SORT)===0)
736 731
 			{
737 732
 				$this->onSortCommand(new TDataGridSortCommandEventParameter($sender,$param));
738 733
 				return true;
739
-			}
740
-			else if(strcasecmp($command,self::CMD_PAGE)===0)
734
+			} else if(strcasecmp($command,self::CMD_PAGE)===0)
741 735
 			{
742 736
 				$p=$param->getCommandParameter();
743 737
 				if(strcasecmp($p,self::CMD_PAGE_NEXT)===0)
@@ -881,20 +875,20 @@  discard block
 block discarded – undo
881 875
 		if($this->_autoColumns)
882 876
 		{
883 877
 			$state=array();
884
-			foreach($this->_autoColumns as $column)
885
-				$state[]=$column->saveState();
878
+			foreach($this->_autoColumns as $column) {
879
+							$state[]=$column->saveState();
880
+			}
886 881
 			$this->setViewState('AutoColumns',$state,array());
887
-		}
888
-		else
882
+		} else
889 883
 			$this->clearViewState('AutoColumns');
890 884
 		if($this->_columns)
891 885
 		{
892 886
 			$state=array();
893
-			foreach($this->_columns as $column)
894
-				$state[]=$column->saveState();
887
+			foreach($this->_columns as $column) {
888
+							$state[]=$column->saveState();
889
+			}
895 890
 			$this->setViewState('Columns',$state,array());
896
-		}
897
-		else
891
+		} else
898 892
 			$this->clearViewState('Columns');
899 893
 	}
900 894
 
@@ -919,8 +913,7 @@  discard block
 block discarded – undo
919 913
 					$column->loadState($st);
920 914
 					$this->_autoColumns->add($column);
921 915
 				}
922
-			}
923
-			else
916
+			} else
924 917
 				$this->_autoColumns=null;
925 918
 			$state=$this->getViewState('Columns',array());
926 919
 			if($this->_columns && $this->_columns->getCount()===count($state))
@@ -970,8 +963,9 @@  discard block
 block discarded – undo
970 963
 
971 964
 		if($columns->getCount())
972 965
 		{
973
-			foreach($columns as $column)
974
-				$column->initialize();
966
+			foreach($columns as $column) {
967
+							$column->initialize();
968
+			}
975 969
 			$selectedIndex=$this->getSelectedItemIndex();
976 970
 			$editIndex=$this->getEditItemIndex();
977 971
 			for($index=0;$index<$itemCount;++$index)
@@ -1026,8 +1020,7 @@  discard block
 block discarded – undo
1026 1020
 			$columns=new TList($this->getColumns());
1027 1021
 			$autoColumns=$this->createAutoColumns($data);
1028 1022
 			$columns->mergeWith($autoColumns);
1029
-		}
1030
-		else
1023
+		} else
1031 1024
 			$columns=$this->getColumns();
1032 1025
 		$this->_allColumns=$columns;
1033 1026
 
@@ -1039,8 +1032,9 @@  discard block
 block discarded – undo
1039 1032
 		$this->setViewState('DataSourceIndex',$dsIndex,0);
1040 1033
 		if($columns->getCount())
1041 1034
 		{
1042
-			foreach($columns as $column)
1043
-				$column->initialize();
1035
+			foreach($columns as $column) {
1036
+							$column->initialize();
1037
+			}
1044 1038
 
1045 1039
 			$selectedIndex=$this->getSelectedItemIndex();
1046 1040
 			$editIndex=$this->getEditItemIndex();
@@ -1117,8 +1111,7 @@  discard block
 block discarded – undo
1117 1111
 					{
1118 1112
 						$prevCell=$cell;
1119 1113
 						$prevCellText=$cellText;
1120
-					}
1121
-					else
1114
+					} else
1122 1115
 					{
1123 1116
 						if(($rowSpan=$prevCell->getRowSpan())===0)
1124 1117
 							$rowSpan=1;
@@ -1167,8 +1160,7 @@  discard block
 block discarded – undo
1167 1160
 			$this->getControls()->add($item);
1168 1161
 			$item->dataBind();
1169 1162
 			$this->onItemDataBound($param);
1170
-		}
1171
-		else
1163
+		} else
1172 1164
 		{
1173 1165
 			$this->onItemCreated($param);
1174 1166
 			$this->getControls()->add($item);
@@ -1251,8 +1243,7 @@  discard block
 block discarded – undo
1251 1243
 				$button->setText($text);
1252 1244
 				return $button;
1253 1245
 			}
1254
-		}
1255
-		else
1246
+		} else
1256 1247
 		{
1257 1248
 			$button=new TButton;
1258 1249
 			if(!$enabled)
@@ -1286,8 +1277,7 @@  discard block
 block discarded – undo
1286 1277
 
1287 1278
 			$label=$this->createPagerButton($pager,$buttonType,false,$style->getPrevPageText(),'','');
1288 1279
 			$controls->add($label);
1289
-		}
1290
-		else
1280
+		} else
1291 1281
 		{
1292 1282
 			if(($text=$style->getFirstPageText())!=='')
1293 1283
 			{
@@ -1310,8 +1300,7 @@  discard block
 block discarded – undo
1310 1300
 				$label=$this->createPagerButton($pager,$buttonType,false,$text,'','');
1311 1301
 				$controls->add($label);
1312 1302
 			}
1313
-		}
1314
-		else
1303
+		} else
1315 1304
 		{
1316 1305
 			$button=$this->createPagerButton($pager,$buttonType,true,$style->getNextPageText(),self::CMD_PAGE,self::CMD_PAGE_NEXT);
1317 1306
 			$controls->add($button);
@@ -1371,8 +1360,7 @@  discard block
 block discarded – undo
1371 1360
 			{
1372 1361
 				$label=$this->createPagerButton($pager,$buttonType,false,"$i",'','');
1373 1362
 				$controls->add($label);
1374
-			}
1375
-			else
1363
+			} else
1376 1364
 			{
1377 1365
 				$button=$this->createPagerButton($pager,$buttonType,true,"$i",self::CMD_PAGE,"$i");
1378 1366
 				$controls->add($button);
@@ -1418,8 +1406,7 @@  discard block
 block discarded – undo
1418 1406
 					$column->setDataField($key);
1419 1407
 					$column->setSortExpression($key);
1420 1408
 					$autoColumns->add($column);
1421
-				}
1422
-				else
1409
+				} else
1423 1410
 				{
1424 1411
 					$column->setHeaderText(TListItemType::Item);
1425 1412
 					$column->setDataField($key);
@@ -1510,8 +1497,7 @@  discard block
 block discarded – undo
1510 1497
 					{
1511 1498
 						if($itemStyle)
1512 1499
 							$item->getStyle()->mergeWith($itemStyle);
1513
-					}
1514
-					else
1500
+					} else
1515 1501
 					{
1516 1502
 						if($alternatingItemStyle)
1517 1503
 							$item->getStyle()->mergeWith($alternatingItemStyle);
@@ -1524,8 +1510,7 @@  discard block
 block discarded – undo
1524 1510
 					{
1525 1511
 						if($itemStyle)
1526 1512
 							$item->getStyle()->mergeWith($itemStyle);
1527
-					}
1528
-					else
1513
+					} else
1529 1514
 					{
1530 1515
 						if($alternatingItemStyle)
1531 1516
 							$item->getStyle()->mergeWith($alternatingItemStyle);
@@ -1539,8 +1524,7 @@  discard block
 block discarded – undo
1539 1524
 						{
1540 1525
 							if($pagerStyle->getPosition()===TDataGridPagerPosition::Bottom || !$pagerStyle->getVisible())
1541 1526
 								$item->setVisible(false);
1542
-						}
1543
-						else
1527
+						} else
1544 1528
 						{
1545 1529
 							if($pagerStyle->getPosition()===TDataGridPagerPosition::Top || !$pagerStyle->getVisible())
1546 1530
 								$item->setVisible(false);
@@ -1612,8 +1596,7 @@  discard block
 block discarded – undo
1612 1596
 				$control->renderBeginTag($writer);
1613 1597
 				$this->renderContents($writer);
1614 1598
 				$control->renderEndTag($writer);
1615
-			}
1616
-			else if($this->getViewState('ItemCount',0)>0)
1599
+			} else if($this->getViewState('ItemCount',0)>0)
1617 1600
 			{
1618 1601
 				$this->applyItemStyles();
1619 1602
 				if($this->_topPager)
@@ -1651,8 +1634,9 @@  discard block
 block discarded – undo
1651 1634
 		if($style=$this->getViewState('TableBodyStyle',null))
1652 1635
 			$style->addAttributesToRender($writer);
1653 1636
 		$writer->renderBeginTag('tbody');
1654
-		foreach($this->getItems() as $item)
1655
-			$item->renderControl($writer);
1637
+		foreach($this->getItems() as $item) {
1638
+					$item->renderControl($writer);
1639
+		}
1656 1640
 		$writer->renderEndTag();
1657 1641
 
1658 1642
 		if($this->_footer && $this->_footer->getVisible())
@@ -2039,8 +2023,7 @@  discard block
 block discarded – undo
2039 2023
 		{
2040 2024
 			$this->raiseBubbleEvent($this,new TDataGridCommandEventParameter($this,$sender,$param));
2041 2025
 			return true;
2042
-		}
2043
-		else
2026
+		} else
2044 2027
 			return false;
2045 2028
 	}
2046 2029
 }
@@ -2081,8 +2064,7 @@  discard block
 block discarded – undo
2081 2064
 		{
2082 2065
 			$this->raiseBubbleEvent($this,new TDataGridCommandEventParameter($this,$sender,$param));
2083 2066
 			return true;
2084
-		}
2085
-		else
2067
+		} else
2086 2068
 			return false;
2087 2069
 	}
2088 2070
 
@@ -2178,8 +2160,7 @@  discard block
 block discarded – undo
2178 2160
 		{
2179 2161
 			$item->setOwner($this->_o);
2180 2162
 			parent::insertAt($index,$item);
2181
-		}
2182
-		else
2163
+		} else
2183 2164
 			throw new TInvalidDataTypeException('datagridcolumncollection_datagridcolumn_required');
2184 2165
 	}
2185 2166
 }
Please login to merge, or discard this patch.
Spacing   +466 added lines, -466 removed lines patch added patch discarded remove patch
@@ -153,68 +153,68 @@  discard block
 block discarded – undo
153 153
 	 * datagrid item types
154 154
 	 * @deprecated deprecated since version 3.0.4. Use TListItemType constants instead.
155 155
 	 */
156
-	const IT_HEADER='Header';
157
-	const IT_FOOTER='Footer';
158
-	const IT_ITEM='Item';
159
-	const IT_SEPARATOR='Separator';
160
-	const IT_ALTERNATINGITEM='AlternatingItem';
161
-	const IT_EDITITEM='EditItem';
162
-	const IT_SELECTEDITEM='SelectedItem';
163
-	const IT_PAGER='Pager';
156
+	const IT_HEADER = 'Header';
157
+	const IT_FOOTER = 'Footer';
158
+	const IT_ITEM = 'Item';
159
+	const IT_SEPARATOR = 'Separator';
160
+	const IT_ALTERNATINGITEM = 'AlternatingItem';
161
+	const IT_EDITITEM = 'EditItem';
162
+	const IT_SELECTEDITEM = 'SelectedItem';
163
+	const IT_PAGER = 'Pager';
164 164
 
165 165
 	/**
166 166
 	 * Command name that TDataGrid understands.
167 167
 	 */
168
-	const CMD_SELECT='Select';
169
-	const CMD_EDIT='Edit';
170
-	const CMD_UPDATE='Update';
171
-	const CMD_DELETE='Delete';
172
-	const CMD_CANCEL='Cancel';
173
-	const CMD_SORT='Sort';
174
-	const CMD_PAGE='Page';
175
-	const CMD_PAGE_NEXT='Next';
176
-	const CMD_PAGE_PREV='Previous';
177
-	const CMD_PAGE_FIRST='First';
178
-	const CMD_PAGE_LAST='Last';
168
+	const CMD_SELECT = 'Select';
169
+	const CMD_EDIT = 'Edit';
170
+	const CMD_UPDATE = 'Update';
171
+	const CMD_DELETE = 'Delete';
172
+	const CMD_CANCEL = 'Cancel';
173
+	const CMD_SORT = 'Sort';
174
+	const CMD_PAGE = 'Page';
175
+	const CMD_PAGE_NEXT = 'Next';
176
+	const CMD_PAGE_PREV = 'Previous';
177
+	const CMD_PAGE_FIRST = 'First';
178
+	const CMD_PAGE_LAST = 'Last';
179 179
 
180 180
 	/**
181 181
 	 * @var TDataGridColumnCollection manually created column collection
182 182
 	 */
183
-	private $_columns=null;
183
+	private $_columns = null;
184 184
 	/**
185 185
 	 * @var TDataGridColumnCollection automatically created column collection
186 186
 	 */
187
-	private $_autoColumns=null;
187
+	private $_autoColumns = null;
188 188
 	/**
189 189
 	 * @var TList all columns including both manually and automatically created columns
190 190
 	 */
191
-	private $_allColumns=null;
191
+	private $_allColumns = null;
192 192
 	/**
193 193
 	 * @var TDataGridItemCollection datagrid item collection
194 194
 	 */
195
-	private $_items=null;
195
+	private $_items = null;
196 196
 	/**
197 197
 	 * @var TDataGridItem header item
198 198
 	 */
199
-	private $_header=null;
199
+	private $_header = null;
200 200
 	/**
201 201
 	 * @var TDataGridItem footer item
202 202
 	 */
203
-	private $_footer=null;
203
+	private $_footer = null;
204 204
 	/**
205 205
 	 * @var TPagedDataSource paged data source object
206 206
 	 */
207
-	private $_pagedDataSource=null;
208
-	private $_topPager=null;
209
-	private $_bottomPager=null;
207
+	private $_pagedDataSource = null;
208
+	private $_topPager = null;
209
+	private $_bottomPager = null;
210 210
 	/**
211 211
 	 * @var ITemplate template used when empty data is bounded
212 212
 	 */
213
-	private $_emptyTemplate=null;
213
+	private $_emptyTemplate = null;
214 214
 	/**
215 215
 	 * @var boolean whether empty template is effective
216 216
 	 */
217
-	private $_useEmptyTemplate=false;
217
+	private $_useEmptyTemplate = false;
218 218
 
219 219
 	/**
220 220
 	 * @return string tag name (table) of the datagrid
@@ -239,10 +239,10 @@  discard block
 block discarded – undo
239 239
 	 */
240 240
 	public function addParsedObject($object)
241 241
 	{
242
-		if($object instanceof TDataGridColumn)
242
+		if ($object instanceof TDataGridColumn)
243 243
 			$this->getColumns()->add($object);
244 244
 		else
245
-			parent::addParsedObject($object);  // this is needed by EmptyTemplate
245
+			parent::addParsedObject($object); // this is needed by EmptyTemplate
246 246
 	}
247 247
 
248 248
 	/**
@@ -250,8 +250,8 @@  discard block
 block discarded – undo
250 250
 	 */
251 251
 	public function getColumns()
252 252
 	{
253
-		if(!$this->_columns)
254
-			$this->_columns=new TDataGridColumnCollection($this);
253
+		if (!$this->_columns)
254
+			$this->_columns = new TDataGridColumnCollection($this);
255 255
 		return $this->_columns;
256 256
 	}
257 257
 
@@ -260,8 +260,8 @@  discard block
 block discarded – undo
260 260
 	 */
261 261
 	public function getAutoColumns()
262 262
 	{
263
-		if(!$this->_autoColumns)
264
-			$this->_autoColumns=new TDataGridColumnCollection($this);
263
+		if (!$this->_autoColumns)
264
+			$this->_autoColumns = new TDataGridColumnCollection($this);
265 265
 		return $this->_autoColumns;
266 266
 	}
267 267
 
@@ -270,8 +270,8 @@  discard block
 block discarded – undo
270 270
 	 */
271 271
 	public function getItems()
272 272
 	{
273
-		if(!$this->_items)
274
-			$this->_items=new TDataGridItemCollection;
273
+		if (!$this->_items)
274
+			$this->_items = new TDataGridItemCollection;
275 275
 		return $this->_items;
276 276
 	}
277 277
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	 */
281 281
 	public function getItemCount()
282 282
 	{
283
-		return $this->_items?$this->_items->getCount():0;
283
+		return $this->_items ? $this->_items->getCount() : 0;
284 284
 	}
285 285
 
286 286
 	/**
@@ -314,10 +314,10 @@  discard block
 block discarded – undo
314 314
 	 */
315 315
 	public function getItemStyle()
316 316
 	{
317
-		if(($style=$this->getViewState('ItemStyle',null))===null)
317
+		if (($style = $this->getViewState('ItemStyle', null)) === null)
318 318
 		{
319
-			$style=new TTableItemStyle;
320
-			$this->setViewState('ItemStyle',$style,null);
319
+			$style = new TTableItemStyle;
320
+			$this->setViewState('ItemStyle', $style, null);
321 321
 		}
322 322
 		return $style;
323 323
 	}
@@ -327,10 +327,10 @@  discard block
 block discarded – undo
327 327
 	 */
328 328
 	public function getAlternatingItemStyle()
329 329
 	{
330
-		if(($style=$this->getViewState('AlternatingItemStyle',null))===null)
330
+		if (($style = $this->getViewState('AlternatingItemStyle', null)) === null)
331 331
 		{
332
-			$style=new TTableItemStyle;
333
-			$this->setViewState('AlternatingItemStyle',$style,null);
332
+			$style = new TTableItemStyle;
333
+			$this->setViewState('AlternatingItemStyle', $style, null);
334 334
 		}
335 335
 		return $style;
336 336
 	}
@@ -340,10 +340,10 @@  discard block
 block discarded – undo
340 340
 	 */
341 341
 	public function getSelectedItemStyle()
342 342
 	{
343
-		if(($style=$this->getViewState('SelectedItemStyle',null))===null)
343
+		if (($style = $this->getViewState('SelectedItemStyle', null)) === null)
344 344
 		{
345
-			$style=new TTableItemStyle;
346
-			$this->setViewState('SelectedItemStyle',$style,null);
345
+			$style = new TTableItemStyle;
346
+			$this->setViewState('SelectedItemStyle', $style, null);
347 347
 		}
348 348
 		return $style;
349 349
 	}
@@ -353,10 +353,10 @@  discard block
 block discarded – undo
353 353
 	 */
354 354
 	public function getEditItemStyle()
355 355
 	{
356
-		if(($style=$this->getViewState('EditItemStyle',null))===null)
356
+		if (($style = $this->getViewState('EditItemStyle', null)) === null)
357 357
 		{
358
-			$style=new TTableItemStyle;
359
-			$this->setViewState('EditItemStyle',$style,null);
358
+			$style = new TTableItemStyle;
359
+			$this->setViewState('EditItemStyle', $style, null);
360 360
 		}
361 361
 		return $style;
362 362
 	}
@@ -366,10 +366,10 @@  discard block
 block discarded – undo
366 366
 	 */
367 367
 	public function getHeaderStyle()
368 368
 	{
369
-		if(($style=$this->getViewState('HeaderStyle',null))===null)
369
+		if (($style = $this->getViewState('HeaderStyle', null)) === null)
370 370
 		{
371
-			$style=new TTableItemStyle;
372
-			$this->setViewState('HeaderStyle',$style,null);
371
+			$style = new TTableItemStyle;
372
+			$this->setViewState('HeaderStyle', $style, null);
373 373
 		}
374 374
 		return $style;
375 375
 	}
@@ -379,10 +379,10 @@  discard block
 block discarded – undo
379 379
 	 */
380 380
 	public function getFooterStyle()
381 381
 	{
382
-		if(($style=$this->getViewState('FooterStyle',null))===null)
382
+		if (($style = $this->getViewState('FooterStyle', null)) === null)
383 383
 		{
384
-			$style=new TTableItemStyle;
385
-			$this->setViewState('FooterStyle',$style,null);
384
+			$style = new TTableItemStyle;
385
+			$this->setViewState('FooterStyle', $style, null);
386 386
 		}
387 387
 		return $style;
388 388
 	}
@@ -392,10 +392,10 @@  discard block
 block discarded – undo
392 392
 	 */
393 393
 	public function getPagerStyle()
394 394
 	{
395
-		if(($style=$this->getViewState('PagerStyle',null))===null)
395
+		if (($style = $this->getViewState('PagerStyle', null)) === null)
396 396
 		{
397
-			$style=new TDataGridPagerStyle;
398
-			$this->setViewState('PagerStyle',$style,null);
397
+			$style = new TDataGridPagerStyle;
398
+			$this->setViewState('PagerStyle', $style, null);
399 399
 		}
400 400
 		return $style;
401 401
 	}
@@ -406,10 +406,10 @@  discard block
 block discarded – undo
406 406
 	 */
407 407
 	public function getTableHeadStyle()
408 408
 	{
409
-		if(($style=$this->getViewState('TableHeadStyle',null))===null)
409
+		if (($style = $this->getViewState('TableHeadStyle', null)) === null)
410 410
 		{
411
-			$style=new TStyle;
412
-			$this->setViewState('TableHeadStyle',$style,null);
411
+			$style = new TStyle;
412
+			$this->setViewState('TableHeadStyle', $style, null);
413 413
 		}
414 414
 		return $style;
415 415
 	}
@@ -420,10 +420,10 @@  discard block
 block discarded – undo
420 420
 	 */
421 421
 	public function getTableBodyStyle()
422 422
 	{
423
-		if(($style=$this->getViewState('TableBodyStyle',null))===null)
423
+		if (($style = $this->getViewState('TableBodyStyle', null)) === null)
424 424
 		{
425
-			$style=new TStyle;
426
-			$this->setViewState('TableBodyStyle',$style,null);
425
+			$style = new TStyle;
426
+			$this->setViewState('TableBodyStyle', $style, null);
427 427
 		}
428 428
 		return $style;
429 429
 	}
@@ -434,10 +434,10 @@  discard block
 block discarded – undo
434 434
 	 */
435 435
 	public function getTableFootStyle()
436 436
 	{
437
-		if(($style=$this->getViewState('TableFootStyle',null))===null)
437
+		if (($style = $this->getViewState('TableFootStyle', null)) === null)
438 438
 		{
439
-			$style=new TStyle;
440
-			$this->setViewState('TableFootStyle',$style,null);
439
+			$style = new TStyle;
440
+			$this->setViewState('TableFootStyle', $style, null);
441 441
 		}
442 442
 		return $style;
443 443
 	}
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 	 */
448 448
 	public function getCaption()
449 449
 	{
450
-		return $this->getViewState('Caption','');
450
+		return $this->getViewState('Caption', '');
451 451
 	}
452 452
 
453 453
 	/**
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 	 */
456 456
 	public function setCaption($value)
457 457
 	{
458
-		$this->setViewState('Caption',$value,'');
458
+		$this->setViewState('Caption', $value, '');
459 459
 	}
460 460
 
461 461
 	/**
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 	 */
464 464
 	public function getCaptionAlign()
465 465
 	{
466
-		return $this->getViewState('CaptionAlign',TTableCaptionAlign::NotSet);
466
+		return $this->getViewState('CaptionAlign', TTableCaptionAlign::NotSet);
467 467
 	}
468 468
 
469 469
 	/**
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 	 */
472 472
 	public function setCaptionAlign($value)
473 473
 	{
474
-		$this->setViewState('CaptionAlign',TPropertyValue::ensureEnum($value,'TTableCaptionAlign'),TTableCaptionAlign::NotSet);
474
+		$this->setViewState('CaptionAlign', TPropertyValue::ensureEnum($value, 'TTableCaptionAlign'), TTableCaptionAlign::NotSet);
475 475
 	}
476 476
 
477 477
 	/**
@@ -511,9 +511,9 @@  discard block
 block discarded – undo
511 511
 	 */
512 512
 	public function getSelectedItem()
513 513
 	{
514
-		$index=$this->getSelectedItemIndex();
515
-		$items=$this->getItems();
516
-		if($index>=0 && $index<$items->getCount())
514
+		$index = $this->getSelectedItemIndex();
515
+		$items = $this->getItems();
516
+		if ($index >= 0 && $index < $items->getCount())
517 517
 			return $items->itemAt($index);
518 518
 		else
519 519
 			return null;
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 	 */
526 526
 	public function getSelectedItemIndex()
527 527
 	{
528
-		return $this->getViewState('SelectedItemIndex',-1);
528
+		return $this->getViewState('SelectedItemIndex', -1);
529 529
 	}
530 530
 
531 531
 	/**
@@ -537,23 +537,23 @@  discard block
 block discarded – undo
537 537
 	 */
538 538
 	public function setSelectedItemIndex($value)
539 539
 	{
540
-		if(($value=TPropertyValue::ensureInteger($value))<0)
541
-			$value=-1;
542
-		if(($current=$this->getSelectedItemIndex())!==$value)
540
+		if (($value = TPropertyValue::ensureInteger($value)) < 0)
541
+			$value = -1;
542
+		if (($current = $this->getSelectedItemIndex()) !== $value)
543 543
 		{
544
-			$this->setViewState('SelectedItemIndex',$value,-1);
545
-			$items=$this->getItems();
546
-			$itemCount=$items->getCount();
547
-			if($current>=0 && $current<$itemCount)
544
+			$this->setViewState('SelectedItemIndex', $value, -1);
545
+			$items = $this->getItems();
546
+			$itemCount = $items->getCount();
547
+			if ($current >= 0 && $current < $itemCount)
548 548
 			{
549
-				$item=$items->itemAt($current);
550
-				if($item->getItemType()!==TListItemType::EditItem)
551
-					$item->setItemType($current%2?TListItemType::AlternatingItem:TListItemType::Item);
549
+				$item = $items->itemAt($current);
550
+				if ($item->getItemType() !== TListItemType::EditItem)
551
+					$item->setItemType($current % 2 ?TListItemType::AlternatingItem : TListItemType::Item);
552 552
 			}
553
-			if($value>=0 && $value<$itemCount)
553
+			if ($value >= 0 && $value < $itemCount)
554 554
 			{
555
-				$item=$items->itemAt($value);
556
-				if($item->getItemType()!==TListItemType::EditItem)
555
+				$item = $items->itemAt($value);
556
+				if ($item->getItemType() !== TListItemType::EditItem)
557 557
 					$item->setItemType(TListItemType::SelectedItem);
558 558
 			}
559 559
 		}
@@ -564,9 +564,9 @@  discard block
 block discarded – undo
564 564
 	 */
565 565
 	public function getEditItem()
566 566
 	{
567
-		$index=$this->getEditItemIndex();
568
-		$items=$this->getItems();
569
-		if($index>=0 && $index<$items->getCount())
567
+		$index = $this->getEditItemIndex();
568
+		$items = $this->getItems();
569
+		if ($index >= 0 && $index < $items->getCount())
570 570
 			return $items->itemAt($index);
571 571
 		else
572 572
 			return null;
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 	 */
579 579
 	public function getEditItemIndex()
580 580
 	{
581
-		return $this->getViewState('EditItemIndex',-1);
581
+		return $this->getViewState('EditItemIndex', -1);
582 582
 	}
583 583
 
584 584
 	/**
@@ -589,16 +589,16 @@  discard block
 block discarded – undo
589 589
 	 */
590 590
 	public function setEditItemIndex($value)
591 591
 	{
592
-		if(($value=TPropertyValue::ensureInteger($value))<0)
593
-			$value=-1;
594
-		if(($current=$this->getEditItemIndex())!==$value)
592
+		if (($value = TPropertyValue::ensureInteger($value)) < 0)
593
+			$value = -1;
594
+		if (($current = $this->getEditItemIndex()) !== $value)
595 595
 		{
596
-			$this->setViewState('EditItemIndex',$value,-1);
597
-			$items=$this->getItems();
598
-			$itemCount=$items->getCount();
599
-			if($current>=0 && $current<$itemCount)
600
-				$items->itemAt($current)->setItemType($current%2?TListItemType::AlternatingItem:TListItemType::Item);
601
-			if($value>=0 && $value<$itemCount)
596
+			$this->setViewState('EditItemIndex', $value, -1);
597
+			$items = $this->getItems();
598
+			$itemCount = $items->getCount();
599
+			if ($current >= 0 && $current < $itemCount)
600
+				$items->itemAt($current)->setItemType($current % 2 ?TListItemType::AlternatingItem : TListItemType::Item);
601
+			if ($value >= 0 && $value < $itemCount)
602 602
 				$items->itemAt($value)->setItemType(TListItemType::EditItem);
603 603
 		}
604 604
 	}
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 	 */
609 609
 	public function getAllowSorting()
610 610
 	{
611
-		return $this->getViewState('AllowSorting',false);
611
+		return $this->getViewState('AllowSorting', false);
612 612
 	}
613 613
 
614 614
 	/**
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 	 */
617 617
 	public function setAllowSorting($value)
618 618
 	{
619
-		$this->setViewState('AllowSorting',TPropertyValue::ensureBoolean($value),false);
619
+		$this->setViewState('AllowSorting', TPropertyValue::ensureBoolean($value), false);
620 620
 	}
621 621
 
622 622
 	/**
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 	 */
625 625
 	public function getAutoGenerateColumns()
626 626
 	{
627
-		return $this->getViewState('AutoGenerateColumns',true);
627
+		return $this->getViewState('AutoGenerateColumns', true);
628 628
 	}
629 629
 
630 630
 	/**
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 	 */
633 633
 	public function setAutoGenerateColumns($value)
634 634
 	{
635
-		$this->setViewState('AutoGenerateColumns',TPropertyValue::ensureBoolean($value),true);
635
+		$this->setViewState('AutoGenerateColumns', TPropertyValue::ensureBoolean($value), true);
636 636
 	}
637 637
 
638 638
 	/**
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 	 */
641 641
 	public function getShowHeader()
642 642
 	{
643
-		return $this->getViewState('ShowHeader',true);
643
+		return $this->getViewState('ShowHeader', true);
644 644
 	}
645 645
 
646 646
 	/**
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 	 */
649 649
 	public function setShowHeader($value)
650 650
 	{
651
-		$this->setViewState('ShowHeader',TPropertyValue::ensureBoolean($value),true);
651
+		$this->setViewState('ShowHeader', TPropertyValue::ensureBoolean($value), true);
652 652
 	}
653 653
 
654 654
 	/**
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 	 */
657 657
 	public function getShowFooter()
658 658
 	{
659
-		return $this->getViewState('ShowFooter',false);
659
+		return $this->getViewState('ShowFooter', false);
660 660
 	}
661 661
 
662 662
 	/**
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 	 */
665 665
 	public function setShowFooter($value)
666 666
 	{
667
-		$this->setViewState('ShowFooter',TPropertyValue::ensureBoolean($value),false);
667
+		$this->setViewState('ShowFooter', TPropertyValue::ensureBoolean($value), false);
668 668
 	}
669 669
 
670 670
 	/**
@@ -681,10 +681,10 @@  discard block
 block discarded – undo
681 681
 	 */
682 682
 	public function setEmptyTemplate($value)
683 683
 	{
684
-		if($value instanceof ITemplate || $value===null)
685
-			$this->_emptyTemplate=$value;
684
+		if ($value instanceof ITemplate || $value === null)
685
+			$this->_emptyTemplate = $value;
686 686
 		else
687
-			throw new TInvalidDataTypeException('datagrid_template_required','EmptyTemplate');
687
+			throw new TInvalidDataTypeException('datagrid_template_required', 'EmptyTemplate');
688 688
 	}
689 689
 
690 690
 	/**
@@ -700,57 +700,57 @@  discard block
 block discarded – undo
700 700
 	 * @param TEventParameter event parameter
701 701
 	 * @return boolean whether the event bubbling should stop here.
702 702
 	 */
703
-	public function bubbleEvent($sender,$param)
703
+	public function bubbleEvent($sender, $param)
704 704
 	{
705
-		if($param instanceof TDataGridCommandEventParameter)
705
+		if ($param instanceof TDataGridCommandEventParameter)
706 706
 		{
707 707
 			$this->onItemCommand($param);
708
-			$command=$param->getCommandName();
709
-			if(strcasecmp($command,self::CMD_SELECT)===0)
708
+			$command = $param->getCommandName();
709
+			if (strcasecmp($command, self::CMD_SELECT) === 0)
710 710
 			{
711 711
 				$this->setSelectedItemIndex($param->getItem()->getItemIndex());
712 712
 				$this->onSelectedIndexChanged($param);
713 713
 				return true;
714 714
 			}
715
-			else if(strcasecmp($command,self::CMD_EDIT)===0)
715
+			else if (strcasecmp($command, self::CMD_EDIT) === 0)
716 716
 			{
717 717
 				$this->onEditCommand($param);
718 718
 				return true;
719 719
 			}
720
-			else if(strcasecmp($command,self::CMD_DELETE)===0)
720
+			else if (strcasecmp($command, self::CMD_DELETE) === 0)
721 721
 			{
722 722
 				$this->onDeleteCommand($param);
723 723
 				return true;
724 724
 			}
725
-			else if(strcasecmp($command,self::CMD_UPDATE)===0)
725
+			else if (strcasecmp($command, self::CMD_UPDATE) === 0)
726 726
 			{
727 727
 				$this->onUpdateCommand($param);
728 728
 				return true;
729 729
 			}
730
-			else if(strcasecmp($command,self::CMD_CANCEL)===0)
730
+			else if (strcasecmp($command, self::CMD_CANCEL) === 0)
731 731
 			{
732 732
 				$this->onCancelCommand($param);
733 733
 				return true;
734 734
 			}
735
-			else if(strcasecmp($command,self::CMD_SORT)===0)
735
+			else if (strcasecmp($command, self::CMD_SORT) === 0)
736 736
 			{
737
-				$this->onSortCommand(new TDataGridSortCommandEventParameter($sender,$param));
737
+				$this->onSortCommand(new TDataGridSortCommandEventParameter($sender, $param));
738 738
 				return true;
739 739
 			}
740
-			else if(strcasecmp($command,self::CMD_PAGE)===0)
740
+			else if (strcasecmp($command, self::CMD_PAGE) === 0)
741 741
 			{
742
-				$p=$param->getCommandParameter();
743
-				if(strcasecmp($p,self::CMD_PAGE_NEXT)===0)
744
-					$pageIndex=$this->getCurrentPageIndex()+1;
745
-				else if(strcasecmp($p,self::CMD_PAGE_PREV)===0)
746
-					$pageIndex=$this->getCurrentPageIndex()-1;
747
-				else if(strcasecmp($p,self::CMD_PAGE_FIRST)===0)
748
-					$pageIndex=0;
749
-				else if(strcasecmp($p,self::CMD_PAGE_LAST)===0)
750
-					$pageIndex=$this->getPageCount()-1;
742
+				$p = $param->getCommandParameter();
743
+				if (strcasecmp($p, self::CMD_PAGE_NEXT) === 0)
744
+					$pageIndex = $this->getCurrentPageIndex() + 1;
745
+				else if (strcasecmp($p, self::CMD_PAGE_PREV) === 0)
746
+					$pageIndex = $this->getCurrentPageIndex() - 1;
747
+				else if (strcasecmp($p, self::CMD_PAGE_FIRST) === 0)
748
+					$pageIndex = 0;
749
+				else if (strcasecmp($p, self::CMD_PAGE_LAST) === 0)
750
+					$pageIndex = $this->getPageCount() - 1;
751 751
 				else
752
-					$pageIndex=TPropertyValue::ensureInteger($p)-1;
753
-				$this->onPageIndexChanged(new TDataGridPageChangedEventParameter($sender,$pageIndex));
752
+					$pageIndex = TPropertyValue::ensureInteger($p) - 1;
753
+				$this->onPageIndexChanged(new TDataGridPageChangedEventParameter($sender, $pageIndex));
754 754
 				return true;
755 755
 			}
756 756
 		}
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 	 */
766 766
 	public function onCancelCommand($param)
767 767
 	{
768
-		$this->raiseEvent('OnCancelCommand',$this,$param);
768
+		$this->raiseEvent('OnCancelCommand', $this, $param);
769 769
 	}
770 770
 
771 771
 	/**
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
 	 */
777 777
 	public function onDeleteCommand($param)
778 778
 	{
779
-		$this->raiseEvent('OnDeleteCommand',$this,$param);
779
+		$this->raiseEvent('OnDeleteCommand', $this, $param);
780 780
 	}
781 781
 
782 782
 	/**
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 	 */
788 788
 	public function onEditCommand($param)
789 789
 	{
790
-		$this->raiseEvent('OnEditCommand',$this,$param);
790
+		$this->raiseEvent('OnEditCommand', $this, $param);
791 791
 	}
792 792
 
793 793
 	/**
@@ -797,7 +797,7 @@  discard block
 block discarded – undo
797 797
 	 */
798 798
 	public function onItemCommand($param)
799 799
 	{
800
-		$this->raiseEvent('OnItemCommand',$this,$param);
800
+		$this->raiseEvent('OnItemCommand', $this, $param);
801 801
 	}
802 802
 
803 803
 	/**
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 	 */
809 809
 	public function onSortCommand($param)
810 810
 	{
811
-		$this->raiseEvent('OnSortCommand',$this,$param);
811
+		$this->raiseEvent('OnSortCommand', $this, $param);
812 812
 	}
813 813
 
814 814
 	/**
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
 	 */
820 820
 	public function onUpdateCommand($param)
821 821
 	{
822
-		$this->raiseEvent('OnUpdateCommand',$this,$param);
822
+		$this->raiseEvent('OnUpdateCommand', $this, $param);
823 823
 	}
824 824
 
825 825
 	/**
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
 	 */
831 831
 	public function onItemCreated($param)
832 832
 	{
833
-		$this->raiseEvent('OnItemCreated',$this,$param);
833
+		$this->raiseEvent('OnItemCreated', $this, $param);
834 834
 	}
835 835
 
836 836
 	/**
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
 	 */
842 842
 	public function onPagerCreated($param)
843 843
 	{
844
-		$this->raiseEvent('OnPagerCreated',$this,$param);
844
+		$this->raiseEvent('OnPagerCreated', $this, $param);
845 845
 	}
846 846
 
847 847
 	/**
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
 	 */
853 853
 	public function onItemDataBound($param)
854 854
 	{
855
-		$this->raiseEvent('OnItemDataBound',$this,$param);
855
+		$this->raiseEvent('OnItemDataBound', $this, $param);
856 856
 	}
857 857
 
858 858
 	/**
@@ -862,7 +862,7 @@  discard block
 block discarded – undo
862 862
 	 */
863 863
 	public function onPageIndexChanged($param)
864 864
 	{
865
-		$this->raiseEvent('OnPageIndexChanged',$this,$param);
865
+		$this->raiseEvent('OnPageIndexChanged', $this, $param);
866 866
 	}
867 867
 
868 868
 	/**
@@ -872,27 +872,27 @@  discard block
 block discarded – undo
872 872
 	public function saveState()
873 873
 	{
874 874
 		parent::saveState();
875
-		if(!$this->getEnableViewState(true))
875
+		if (!$this->getEnableViewState(true))
876 876
 			return;
877
-		if($this->_items)
878
-			$this->setViewState('ItemCount',$this->_items->getCount(),0);
877
+		if ($this->_items)
878
+			$this->setViewState('ItemCount', $this->_items->getCount(), 0);
879 879
 		else
880 880
 			$this->clearViewState('ItemCount');
881
-		if($this->_autoColumns)
881
+		if ($this->_autoColumns)
882 882
 		{
883
-			$state=array();
884
-			foreach($this->_autoColumns as $column)
885
-				$state[]=$column->saveState();
886
-			$this->setViewState('AutoColumns',$state,array());
883
+			$state = array();
884
+			foreach ($this->_autoColumns as $column)
885
+				$state[] = $column->saveState();
886
+			$this->setViewState('AutoColumns', $state, array());
887 887
 		}
888 888
 		else
889 889
 			$this->clearViewState('AutoColumns');
890
-		if($this->_columns)
890
+		if ($this->_columns)
891 891
 		{
892
-			$state=array();
893
-			foreach($this->_columns as $column)
894
-				$state[]=$column->saveState();
895
-			$this->setViewState('Columns',$state,array());
892
+			$state = array();
893
+			foreach ($this->_columns as $column)
894
+				$state[] = $column->saveState();
895
+			$this->setViewState('Columns', $state, array());
896 896
 		}
897 897
 		else
898 898
 			$this->clearViewState('Columns');
@@ -905,28 +905,28 @@  discard block
 block discarded – undo
905 905
 	public function loadState()
906 906
 	{
907 907
 		parent::loadState();
908
-		if(!$this->getEnableViewState(true))
908
+		if (!$this->getEnableViewState(true))
909 909
 			return;
910
-		if(!$this->getIsDataBound())
910
+		if (!$this->getIsDataBound())
911 911
 		{
912
-			$state=$this->getViewState('AutoColumns',array());
913
-			if(!empty($state))
912
+			$state = $this->getViewState('AutoColumns', array());
913
+			if (!empty($state))
914 914
 			{
915
-				$this->_autoColumns=new TDataGridColumnCollection($this);
916
-				foreach($state as $st)
915
+				$this->_autoColumns = new TDataGridColumnCollection($this);
916
+				foreach ($state as $st)
917 917
 				{
918
-					$column=new $this->AutoGenerateColumnName;
918
+					$column = new $this->AutoGenerateColumnName;
919 919
 					$column->loadState($st);
920 920
 					$this->_autoColumns->add($column);
921 921
 				}
922 922
 			}
923 923
 			else
924
-				$this->_autoColumns=null;
925
-			$state=$this->getViewState('Columns',array());
926
-			if($this->_columns && $this->_columns->getCount()===count($state))
924
+				$this->_autoColumns = null;
925
+			$state = $this->getViewState('Columns', array());
926
+			if ($this->_columns && $this->_columns->getCount() === count($state))
927 927
 			{
928
-				$i=0;
929
-				foreach($this->_columns as $column)
928
+				$i = 0;
929
+				foreach ($this->_columns as $column)
930 930
 				{
931 931
 					$column->loadState($state[$i]);
932 932
 					$i++;
@@ -943,11 +943,11 @@  discard block
 block discarded – undo
943 943
 	{
944 944
 		$this->getControls()->clear();
945 945
 		$this->getItems()->clear();
946
-		$this->_header=null;
947
-		$this->_footer=null;
948
-		$this->_topPager=null;
949
-		$this->_bottomPager=null;
950
-		$this->_useEmptyTemplate=false;
946
+		$this->_header = null;
947
+		$this->_footer = null;
948
+		$this->_topPager = null;
949
+		$this->_bottomPager = null;
950
+		$this->_useEmptyTemplate = false;
951 951
 	}
952 952
 
953 953
 	/**
@@ -957,52 +957,52 @@  discard block
 block discarded – undo
957 957
 	{
958 958
 		$this->reset();
959 959
 
960
-		$allowPaging=$this->getAllowPaging();
960
+		$allowPaging = $this->getAllowPaging();
961 961
 
962
-		$itemCount=$this->getViewState('ItemCount',0);
963
-		$dsIndex=$this->getViewState('DataSourceIndex',0);
962
+		$itemCount = $this->getViewState('ItemCount', 0);
963
+		$dsIndex = $this->getViewState('DataSourceIndex', 0);
964 964
 
965
-		$columns=new TList($this->getColumns());
965
+		$columns = new TList($this->getColumns());
966 966
 		$columns->mergeWith($this->_autoColumns);
967
-		$this->_allColumns=$columns;
967
+		$this->_allColumns = $columns;
968 968
 
969
-		$items=$this->getItems();
969
+		$items = $this->getItems();
970 970
 
971
-		if($columns->getCount())
971
+		if ($columns->getCount())
972 972
 		{
973
-			foreach($columns as $column)
973
+			foreach ($columns as $column)
974 974
 				$column->initialize();
975
-			$selectedIndex=$this->getSelectedItemIndex();
976
-			$editIndex=$this->getEditItemIndex();
977
-			for($index=0;$index<$itemCount;++$index)
975
+			$selectedIndex = $this->getSelectedItemIndex();
976
+			$editIndex = $this->getEditItemIndex();
977
+			for ($index = 0; $index < $itemCount; ++$index)
978 978
 			{
979
-				if($index===0)
979
+				if ($index === 0)
980 980
 				{
981
-					if($allowPaging)
982
-						$this->_topPager=$this->createPager();
983
-					$this->_header=$this->createItemInternal(-1,-1,TListItemType::Header,false,null,$columns);
981
+					if ($allowPaging)
982
+						$this->_topPager = $this->createPager();
983
+					$this->_header = $this->createItemInternal(-1, -1, TListItemType::Header, false, null, $columns);
984 984
 				}
985
-				if($index===$editIndex)
986
-					$itemType=TListItemType::EditItem;
987
-				else if($index===$selectedIndex)
988
-					$itemType=TListItemType::SelectedItem;
989
-				else if($index % 2)
990
-					$itemType=TListItemType::AlternatingItem;
985
+				if ($index === $editIndex)
986
+					$itemType = TListItemType::EditItem;
987
+				else if ($index === $selectedIndex)
988
+					$itemType = TListItemType::SelectedItem;
989
+				else if ($index % 2)
990
+					$itemType = TListItemType::AlternatingItem;
991 991
 				else
992
-					$itemType=TListItemType::Item;
993
-				$items->add($this->createItemInternal($index,$dsIndex,$itemType,false,null,$columns));
992
+					$itemType = TListItemType::Item;
993
+				$items->add($this->createItemInternal($index, $dsIndex, $itemType, false, null, $columns));
994 994
 				$dsIndex++;
995 995
 			}
996
-			if($index>0)
996
+			if ($index > 0)
997 997
 			{
998
-				$this->_footer=$this->createItemInternal(-1,-1,TListItemType::Footer,false,null,$columns);
999
-				if($allowPaging)
1000
-					$this->_bottomPager=$this->createPager();
998
+				$this->_footer = $this->createItemInternal(-1, -1, TListItemType::Footer, false, null, $columns);
999
+				if ($allowPaging)
1000
+					$this->_bottomPager = $this->createPager();
1001 1001
 			}
1002 1002
 		}
1003
-		if(!$dsIndex && $this->_emptyTemplate!==null)
1003
+		if (!$dsIndex && $this->_emptyTemplate !== null)
1004 1004
 		{
1005
-			$this->_useEmptyTemplate=true;
1005
+			$this->_useEmptyTemplate = true;
1006 1006
 			$this->_emptyTemplate->instantiateIn($this);
1007 1007
 		}
1008 1008
 	}
@@ -1016,69 +1016,69 @@  discard block
 block discarded – undo
1016 1016
 	protected function performDataBinding($data)
1017 1017
 	{
1018 1018
 		$this->reset();
1019
-		$keys=$this->getDataKeys();
1019
+		$keys = $this->getDataKeys();
1020 1020
 		$keys->clear();
1021
-		$keyField=$this->getDataKeyField();
1021
+		$keyField = $this->getDataKeyField();
1022 1022
 
1023 1023
 		// get all columns
1024
-		if($this->getAutoGenerateColumns())
1024
+		if ($this->getAutoGenerateColumns())
1025 1025
 		{
1026
-			$columns=new TList($this->getColumns());
1027
-			$autoColumns=$this->createAutoColumns($data);
1026
+			$columns = new TList($this->getColumns());
1027
+			$autoColumns = $this->createAutoColumns($data);
1028 1028
 			$columns->mergeWith($autoColumns);
1029 1029
 		}
1030 1030
 		else
1031
-			$columns=$this->getColumns();
1032
-		$this->_allColumns=$columns;
1031
+			$columns = $this->getColumns();
1032
+		$this->_allColumns = $columns;
1033 1033
 
1034
-		$items=$this->getItems();
1034
+		$items = $this->getItems();
1035 1035
 
1036
-		$index=0;
1037
-		$allowPaging=$this->getAllowPaging() && ($data instanceof TPagedDataSource);
1038
-		$dsIndex=$allowPaging?$data->getFirstIndexInPage():0;
1039
-		$this->setViewState('DataSourceIndex',$dsIndex,0);
1040
-		if($columns->getCount())
1036
+		$index = 0;
1037
+		$allowPaging = $this->getAllowPaging() && ($data instanceof TPagedDataSource);
1038
+		$dsIndex = $allowPaging ? $data->getFirstIndexInPage() : 0;
1039
+		$this->setViewState('DataSourceIndex', $dsIndex, 0);
1040
+		if ($columns->getCount())
1041 1041
 		{
1042
-			foreach($columns as $column)
1042
+			foreach ($columns as $column)
1043 1043
 				$column->initialize();
1044 1044
 
1045
-			$selectedIndex=$this->getSelectedItemIndex();
1046
-			$editIndex=$this->getEditItemIndex();
1047
-			foreach($data as $key=>$row)
1045
+			$selectedIndex = $this->getSelectedItemIndex();
1046
+			$editIndex = $this->getEditItemIndex();
1047
+			foreach ($data as $key=>$row)
1048 1048
 			{
1049
-				if($keyField!=='')
1050
-					$keys->add($this->getDataFieldValue($row,$keyField));
1049
+				if ($keyField !== '')
1050
+					$keys->add($this->getDataFieldValue($row, $keyField));
1051 1051
 				else
1052 1052
 					$keys->add($key);
1053
-				if($index===0)
1053
+				if ($index === 0)
1054 1054
 				{
1055
-					if($allowPaging)
1056
-						$this->_topPager=$this->createPager();
1057
-					$this->_header=$this->createItemInternal(-1,-1,TListItemType::Header,true,null,$columns);
1055
+					if ($allowPaging)
1056
+						$this->_topPager = $this->createPager();
1057
+					$this->_header = $this->createItemInternal(-1, -1, TListItemType::Header, true, null, $columns);
1058 1058
 				}
1059
-				if($index===$editIndex)
1060
-					$itemType=TListItemType::EditItem;
1061
-				else if($index===$selectedIndex)
1062
-					$itemType=TListItemType::SelectedItem;
1063
-				else if($index % 2)
1064
-					$itemType=TListItemType::AlternatingItem;
1059
+				if ($index === $editIndex)
1060
+					$itemType = TListItemType::EditItem;
1061
+				else if ($index === $selectedIndex)
1062
+					$itemType = TListItemType::SelectedItem;
1063
+				else if ($index % 2)
1064
+					$itemType = TListItemType::AlternatingItem;
1065 1065
 				else
1066
-					$itemType=TListItemType::Item;
1067
-				$items->add($this->createItemInternal($index,$dsIndex,$itemType,true,$row,$columns));
1066
+					$itemType = TListItemType::Item;
1067
+				$items->add($this->createItemInternal($index, $dsIndex, $itemType, true, $row, $columns));
1068 1068
 				$index++;
1069 1069
 				$dsIndex++;
1070 1070
 			}
1071
-			if($index>0)
1071
+			if ($index > 0)
1072 1072
 			{
1073
-				$this->_footer=$this->createItemInternal(-1,-1,TListItemType::Footer,true,null,$columns);
1074
-				if($allowPaging)
1075
-					$this->_bottomPager=$this->createPager();
1073
+				$this->_footer = $this->createItemInternal(-1, -1, TListItemType::Footer, true, null, $columns);
1074
+				if ($allowPaging)
1075
+					$this->_bottomPager = $this->createPager();
1076 1076
 			}
1077 1077
 		}
1078
-		$this->setViewState('ItemCount',$index,0);
1079
-		if(!$dsIndex && $this->_emptyTemplate!==null)
1078
+		$this->setViewState('ItemCount', $index, 0);
1079
+		if (!$dsIndex && $this->_emptyTemplate !== null)
1080 1080
 		{
1081
-			$this->_useEmptyTemplate=true;
1081
+			$this->_useEmptyTemplate = true;
1082 1082
 			$this->_emptyTemplate->instantiateIn($this);
1083 1083
 			$this->dataBindChildren();
1084 1084
 		}
@@ -1090,39 +1090,39 @@  discard block
 block discarded – undo
1090 1090
 	 */
1091 1091
 	private function groupCells()
1092 1092
 	{
1093
-		if(($columns=$this->_allColumns)===null)
1093
+		if (($columns = $this->_allColumns) === null)
1094 1094
 			return;
1095
-		$items=$this->getItems();
1096
-		foreach($columns as $id=>$column)
1095
+		$items = $this->getItems();
1096
+		foreach ($columns as $id=>$column)
1097 1097
 		{
1098
-			if(!$column->getEnableCellGrouping())
1098
+			if (!$column->getEnableCellGrouping())
1099 1099
 				continue;
1100
-			$prevCell=null;
1101
-			$prevCellText=null;
1102
-			foreach($items as $item)
1100
+			$prevCell = null;
1101
+			$prevCellText = null;
1102
+			foreach ($items as $item)
1103 1103
 			{
1104
-				$itemType=$item->getItemType();
1105
-				$cell=$item->getCells()->itemAt($id);
1106
-				if(!$cell->getVisible())
1104
+				$itemType = $item->getItemType();
1105
+				$cell = $item->getCells()->itemAt($id);
1106
+				if (!$cell->getVisible())
1107 1107
 					continue;
1108
-				if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem)
1108
+				if ($itemType === TListItemType::Item || $itemType === TListItemType::AlternatingItem || $itemType === TListItemType::SelectedItem)
1109 1109
 				{
1110
-					if(($cellText=$this->getCellText($cell))==='')
1110
+					if (($cellText = $this->getCellText($cell)) === '')
1111 1111
 					{
1112
-						$prevCell=null;
1113
-						$prevCellText=null;
1112
+						$prevCell = null;
1113
+						$prevCellText = null;
1114 1114
 						continue;
1115 1115
 					}
1116
-					if($prevCell===null || $prevCellText!==$cellText)
1116
+					if ($prevCell === null || $prevCellText !== $cellText)
1117 1117
 					{
1118
-						$prevCell=$cell;
1119
-						$prevCellText=$cellText;
1118
+						$prevCell = $cell;
1119
+						$prevCellText = $cellText;
1120 1120
 					}
1121 1121
 					else
1122 1122
 					{
1123
-						if(($rowSpan=$prevCell->getRowSpan())===0)
1124
-							$rowSpan=1;
1125
-						$prevCell->setRowSpan($rowSpan+1);
1123
+						if (($rowSpan = $prevCell->getRowSpan()) === 0)
1124
+							$rowSpan = 1;
1125
+						$prevCell->setRowSpan($rowSpan + 1);
1126 1126
 						$cell->setVisible(false);
1127 1127
 					}
1128 1128
 				}
@@ -1132,12 +1132,12 @@  discard block
 block discarded – undo
1132 1132
 
1133 1133
 	private function getCellText($cell)
1134 1134
 	{
1135
-		if(($data=$cell->getText())==='' && $cell->getHasControls())
1135
+		if (($data = $cell->getText()) === '' && $cell->getHasControls())
1136 1136
 		{
1137
-			$controls=$cell->getControls();
1138
-			foreach($controls as $control)
1137
+			$controls = $cell->getControls();
1138
+			foreach ($controls as $control)
1139 1139
 			{
1140
-				if($control instanceof IDataRenderer)
1140
+				if ($control instanceof IDataRenderer)
1141 1141
 					return $control->getData();
1142 1142
 			}
1143 1143
 		}
@@ -1150,17 +1150,17 @@  discard block
 block discarded – undo
1150 1150
 	 * @param TListItemType item type
1151 1151
 	 * @return TDataGridItem created data list item
1152 1152
 	 */
1153
-	protected function createItem($itemIndex,$dataSourceIndex,$itemType)
1153
+	protected function createItem($itemIndex, $dataSourceIndex, $itemType)
1154 1154
 	{
1155
-		return new TDataGridItem($itemIndex,$dataSourceIndex,$itemType);
1155
+		return new TDataGridItem($itemIndex, $dataSourceIndex, $itemType);
1156 1156
 	}
1157 1157
 
1158
-	private function createItemInternal($itemIndex,$dataSourceIndex,$itemType,$dataBind,$dataItem,$columns)
1158
+	private function createItemInternal($itemIndex, $dataSourceIndex, $itemType, $dataBind, $dataItem, $columns)
1159 1159
 	{
1160
-		$item=$this->createItem($itemIndex,$dataSourceIndex,$itemType);
1161
-		$this->initializeItem($item,$columns);
1162
-		$param=new TDataGridItemEventParameter($item);
1163
-		if($dataBind)
1160
+		$item = $this->createItem($itemIndex, $dataSourceIndex, $itemType);
1161
+		$this->initializeItem($item, $columns);
1162
+		$param = new TDataGridItemEventParameter($item);
1163
+		if ($dataBind)
1164 1164
 		{
1165 1165
 			$item->setData($dataItem);
1166 1166
 			$this->onItemCreated($param);
@@ -1181,28 +1181,28 @@  discard block
 block discarded – undo
1181 1181
 	 * @param TDataGrid datagrid item to be initialized
1182 1182
 	 * @param TDataGridColumnCollection datagrid columns to be used to initialize the cells in the item
1183 1183
 	 */
1184
-	protected function initializeItem($item,$columns)
1184
+	protected function initializeItem($item, $columns)
1185 1185
 	{
1186
-		$cells=$item->getCells();
1187
-		$itemType=$item->getItemType();
1188
-		$index=0;
1189
-		foreach($columns as $column)
1186
+		$cells = $item->getCells();
1187
+		$itemType = $item->getItemType();
1188
+		$index = 0;
1189
+		foreach ($columns as $column)
1190 1190
 		{
1191
-			if($itemType===TListItemType::Header)
1192
-				$cell=new TTableHeaderCell;
1191
+			if ($itemType === TListItemType::Header)
1192
+				$cell = new TTableHeaderCell;
1193 1193
 			else
1194
-				$cell=new TTableCell;
1195
-			if(($id=$column->getID())!=='')
1196
-				$item->registerObject($id,$cell);
1194
+				$cell = new TTableCell;
1195
+			if (($id = $column->getID()) !== '')
1196
+				$item->registerObject($id, $cell);
1197 1197
 			$cells->add($cell);
1198
-			$column->initializeCell($cell,$index,$itemType);
1198
+			$column->initializeCell($cell, $index, $itemType);
1199 1199
 			$index++;
1200 1200
 		}
1201 1201
 	}
1202 1202
 
1203 1203
 	protected function createPager()
1204 1204
 	{
1205
-		$pager=new TDataGridPager($this);
1205
+		$pager = new TDataGridPager($this);
1206 1206
 		$this->buildPager($pager);
1207 1207
 		$this->onPagerCreated(new TDataGridPagerEventParameter($pager));
1208 1208
 		$this->getControls()->add($pager);
@@ -1215,7 +1215,7 @@  discard block
 block discarded – undo
1215 1215
 	 */
1216 1216
 	protected function buildPager($pager)
1217 1217
 	{
1218
-		switch($this->getPagerStyle()->getMode())
1218
+		switch ($this->getPagerStyle()->getMode())
1219 1219
 		{
1220 1220
 			case TDataGridPagerMode::NextPrev:
1221 1221
 				$this->buildNextPrevPager($pager);
@@ -1239,23 +1239,23 @@  discard block
 block discarded – undo
1239 1239
 	 * @param string CommandParameter corresponding to the OnCommand event of the button
1240 1240
 	 * @return mixed the button instance
1241 1241
 	 */
1242
-	protected function createPagerButton($pager,$buttonType,$enabled,$text,$commandName,$commandParameter)
1242
+	protected function createPagerButton($pager, $buttonType, $enabled, $text, $commandName, $commandParameter)
1243 1243
 	{
1244
-		if($buttonType===TDataGridPagerButtonType::LinkButton)
1244
+		if ($buttonType === TDataGridPagerButtonType::LinkButton)
1245 1245
 		{
1246
-			if($enabled)
1247
-				$button=new TLinkButton;
1246
+			if ($enabled)
1247
+				$button = new TLinkButton;
1248 1248
 			else
1249 1249
 			{
1250
-				$button=new TLabel;
1250
+				$button = new TLabel;
1251 1251
 				$button->setText($text);
1252 1252
 				return $button;
1253 1253
 			}
1254 1254
 		}
1255 1255
 		else
1256 1256
 		{
1257
-			$button=new TButton;
1258
-			if(!$enabled)
1257
+			$button = new TButton;
1258
+			if (!$enabled)
1259 1259
 				$button->setEnabled(false);
1260 1260
 		}
1261 1261
 		$button->setText($text);
@@ -1271,54 +1271,54 @@  discard block
 block discarded – undo
1271 1271
 	 */
1272 1272
 	protected function buildNextPrevPager($pager)
1273 1273
 	{
1274
-		$style=$this->getPagerStyle();
1275
-		$buttonType=$style->getButtonType();
1276
-		$controls=$pager->getControls();
1277
-		$currentPageIndex=$this->getCurrentPageIndex();
1278
-		if($currentPageIndex===0)
1274
+		$style = $this->getPagerStyle();
1275
+		$buttonType = $style->getButtonType();
1276
+		$controls = $pager->getControls();
1277
+		$currentPageIndex = $this->getCurrentPageIndex();
1278
+		if ($currentPageIndex === 0)
1279 1279
 		{
1280
-			if(($text=$style->getFirstPageText())!=='')
1280
+			if (($text = $style->getFirstPageText()) !== '')
1281 1281
 			{
1282
-				$label=$this->createPagerButton($pager,$buttonType,false,$text,'','');
1282
+				$label = $this->createPagerButton($pager, $buttonType, false, $text, '', '');
1283 1283
 				$controls->add($label);
1284 1284
 				$controls->add("\n");
1285 1285
 			}
1286 1286
 
1287
-			$label=$this->createPagerButton($pager,$buttonType,false,$style->getPrevPageText(),'','');
1287
+			$label = $this->createPagerButton($pager, $buttonType, false, $style->getPrevPageText(), '', '');
1288 1288
 			$controls->add($label);
1289 1289
 		}
1290 1290
 		else
1291 1291
 		{
1292
-			if(($text=$style->getFirstPageText())!=='')
1292
+			if (($text = $style->getFirstPageText()) !== '')
1293 1293
 			{
1294
-				$button=$this->createPagerButton($pager,$buttonType,true,$text,self::CMD_PAGE,self::CMD_PAGE_FIRST);
1294
+				$button = $this->createPagerButton($pager, $buttonType, true, $text, self::CMD_PAGE, self::CMD_PAGE_FIRST);
1295 1295
 				$controls->add($button);
1296 1296
 				$controls->add("\n");
1297 1297
 			}
1298 1298
 
1299
-			$button=$this->createPagerButton($pager,$buttonType,true,$style->getPrevPageText(),self::CMD_PAGE,self::CMD_PAGE_PREV);
1299
+			$button = $this->createPagerButton($pager, $buttonType, true, $style->getPrevPageText(), self::CMD_PAGE, self::CMD_PAGE_PREV);
1300 1300
 			$controls->add($button);
1301 1301
 		}
1302 1302
 		$controls->add("\n");
1303
-		if($currentPageIndex===$this->getPageCount()-1)
1303
+		if ($currentPageIndex === $this->getPageCount() - 1)
1304 1304
 		{
1305
-			$label=$this->createPagerButton($pager,$buttonType,false,$style->getNextPageText(),'','');
1305
+			$label = $this->createPagerButton($pager, $buttonType, false, $style->getNextPageText(), '', '');
1306 1306
 			$controls->add($label);
1307
-			if(($text=$style->getLastPageText())!=='')
1307
+			if (($text = $style->getLastPageText()) !== '')
1308 1308
 			{
1309 1309
 				$controls->add("\n");
1310
-				$label=$this->createPagerButton($pager,$buttonType,false,$text,'','');
1310
+				$label = $this->createPagerButton($pager, $buttonType, false, $text, '', '');
1311 1311
 				$controls->add($label);
1312 1312
 			}
1313 1313
 		}
1314 1314
 		else
1315 1315
 		{
1316
-			$button=$this->createPagerButton($pager,$buttonType,true,$style->getNextPageText(),self::CMD_PAGE,self::CMD_PAGE_NEXT);
1316
+			$button = $this->createPagerButton($pager, $buttonType, true, $style->getNextPageText(), self::CMD_PAGE, self::CMD_PAGE_NEXT);
1317 1317
 			$controls->add($button);
1318
-			if(($text=$style->getLastPageText())!=='')
1318
+			if (($text = $style->getLastPageText()) !== '')
1319 1319
 			{
1320 1320
 				$controls->add("\n");
1321
-				$button=$this->createPagerButton($pager,$buttonType,true,$text,self::CMD_PAGE,self::CMD_PAGE_LAST);
1321
+				$button = $this->createPagerButton($pager, $buttonType, true, $text, self::CMD_PAGE, self::CMD_PAGE_LAST);
1322 1322
 				$controls->add($button);
1323 1323
 			}
1324 1324
 		}
@@ -1330,67 +1330,67 @@  discard block
 block discarded – undo
1330 1330
 	 */
1331 1331
 	protected function buildNumericPager($pager)
1332 1332
 	{
1333
-		$style=$this->getPagerStyle();
1334
-		$buttonType=$style->getButtonType();
1335
-		$controls=$pager->getControls();
1336
-		$pageCount=$this->getPageCount();
1337
-		$pageIndex=$this->getCurrentPageIndex()+1;
1338
-		$maxButtonCount=$style->getPageButtonCount();
1339
-		$buttonCount=$maxButtonCount>$pageCount?$pageCount:$maxButtonCount;
1340
-		$startPageIndex=1;
1341
-		$endPageIndex=$buttonCount;
1342
-		if($pageIndex>$endPageIndex)
1333
+		$style = $this->getPagerStyle();
1334
+		$buttonType = $style->getButtonType();
1335
+		$controls = $pager->getControls();
1336
+		$pageCount = $this->getPageCount();
1337
+		$pageIndex = $this->getCurrentPageIndex() + 1;
1338
+		$maxButtonCount = $style->getPageButtonCount();
1339
+		$buttonCount = $maxButtonCount > $pageCount ? $pageCount : $maxButtonCount;
1340
+		$startPageIndex = 1;
1341
+		$endPageIndex = $buttonCount;
1342
+		if ($pageIndex > $endPageIndex)
1343 1343
 		{
1344
-			$startPageIndex=((int)(($pageIndex-1)/$maxButtonCount))*$maxButtonCount+1;
1345
-			if(($endPageIndex=$startPageIndex+$maxButtonCount-1)>$pageCount)
1346
-				$endPageIndex=$pageCount;
1347
-			if($endPageIndex-$startPageIndex+1<$maxButtonCount)
1344
+			$startPageIndex = ((int) (($pageIndex - 1) / $maxButtonCount)) * $maxButtonCount + 1;
1345
+			if (($endPageIndex = $startPageIndex + $maxButtonCount - 1) > $pageCount)
1346
+				$endPageIndex = $pageCount;
1347
+			if ($endPageIndex - $startPageIndex + 1 < $maxButtonCount)
1348 1348
 			{
1349
-				if(($startPageIndex=$endPageIndex-$maxButtonCount+1)<1)
1350
-					$startPageIndex=1;
1349
+				if (($startPageIndex = $endPageIndex - $maxButtonCount + 1) < 1)
1350
+					$startPageIndex = 1;
1351 1351
 			}
1352 1352
 		}
1353 1353
 
1354
-		if($startPageIndex>1)
1354
+		if ($startPageIndex > 1)
1355 1355
 		{
1356
-			if(($text=$style->getFirstPageText())!=='')
1356
+			if (($text = $style->getFirstPageText()) !== '')
1357 1357
 			{
1358
-				$button=$this->createPagerButton($pager,$buttonType,true,$text,self::CMD_PAGE,self::CMD_PAGE_FIRST);
1358
+				$button = $this->createPagerButton($pager, $buttonType, true, $text, self::CMD_PAGE, self::CMD_PAGE_FIRST);
1359 1359
 				$controls->add($button);
1360 1360
 				$controls->add("\n");
1361 1361
 			}
1362
-			$prevPageIndex=$startPageIndex-1;
1363
-			$button=$this->createPagerButton($pager,$buttonType,true,$style->getPrevPageText(),self::CMD_PAGE,"$prevPageIndex");
1362
+			$prevPageIndex = $startPageIndex - 1;
1363
+			$button = $this->createPagerButton($pager, $buttonType, true, $style->getPrevPageText(), self::CMD_PAGE, "$prevPageIndex");
1364 1364
 			$controls->add($button);
1365 1365
 			$controls->add("\n");
1366 1366
 		}
1367 1367
 
1368
-		for($i=$startPageIndex;$i<=$endPageIndex;++$i)
1368
+		for ($i = $startPageIndex; $i <= $endPageIndex; ++$i)
1369 1369
 		{
1370
-			if($i===$pageIndex)
1370
+			if ($i === $pageIndex)
1371 1371
 			{
1372
-				$label=$this->createPagerButton($pager,$buttonType,false,"$i",'','');
1372
+				$label = $this->createPagerButton($pager, $buttonType, false, "$i", '', '');
1373 1373
 				$controls->add($label);
1374 1374
 			}
1375 1375
 			else
1376 1376
 			{
1377
-				$button=$this->createPagerButton($pager,$buttonType,true,"$i",self::CMD_PAGE,"$i");
1377
+				$button = $this->createPagerButton($pager, $buttonType, true, "$i", self::CMD_PAGE, "$i");
1378 1378
 				$controls->add($button);
1379 1379
 			}
1380
-			if($i<$endPageIndex)
1380
+			if ($i < $endPageIndex)
1381 1381
 				$controls->add("\n");
1382 1382
 		}
1383 1383
 
1384
-		if($pageCount>$endPageIndex)
1384
+		if ($pageCount > $endPageIndex)
1385 1385
 		{
1386 1386
 			$controls->add("\n");
1387
-			$nextPageIndex=$endPageIndex+1;
1388
-			$button=$this->createPagerButton($pager,$buttonType,true,$style->getNextPageText(),self::CMD_PAGE,"$nextPageIndex");
1387
+			$nextPageIndex = $endPageIndex + 1;
1388
+			$button = $this->createPagerButton($pager, $buttonType, true, $style->getNextPageText(), self::CMD_PAGE, "$nextPageIndex");
1389 1389
 			$controls->add($button);
1390
-			if(($text=$style->getLastPageText())!=='')
1390
+			if (($text = $style->getLastPageText()) !== '')
1391 1391
 			{
1392 1392
 				$controls->add("\n");
1393
-				$button=$this->createPagerButton($pager,$buttonType,true,$text,self::CMD_PAGE,self::CMD_PAGE_LAST);
1393
+				$button = $this->createPagerButton($pager, $buttonType, true, $text, self::CMD_PAGE, self::CMD_PAGE_LAST);
1394 1394
 				$controls->add($button);
1395 1395
 			}
1396 1396
 		}
@@ -1403,16 +1403,16 @@  discard block
 block discarded – undo
1403 1403
 	 */
1404 1404
 	protected function createAutoColumns($dataSource)
1405 1405
 	{
1406
-		if(!$dataSource)
1406
+		if (!$dataSource)
1407 1407
 			return null;
1408
-		$autoColumns=$this->getAutoColumns();
1408
+		$autoColumns = $this->getAutoColumns();
1409 1409
 		$autoColumns->clear();
1410
-		foreach($dataSource as $row)
1410
+		foreach ($dataSource as $row)
1411 1411
 		{
1412
-			foreach($row as $key=>$value)
1412
+			foreach ($row as $key=>$value)
1413 1413
 			{
1414
-				$column=new $this->AutoGenerateColumnName;
1415
-				if(is_string($key))
1414
+				$column = new $this->AutoGenerateColumnName;
1415
+				if (is_string($key))
1416 1416
 				{
1417 1417
 					$column->setHeaderText($key);
1418 1418
 					$column->setDataField($key);
@@ -1445,104 +1445,104 @@  discard block
 block discarded – undo
1445 1445
 	 */
1446 1446
 	protected function applyItemStyles()
1447 1447
 	{
1448
-		$itemStyle=$this->getViewState('ItemStyle',null);
1448
+		$itemStyle = $this->getViewState('ItemStyle', null);
1449 1449
 
1450
-		$alternatingItemStyle=$this->getViewState('AlternatingItemStyle',null);
1451
-		if($itemStyle!==null)
1450
+		$alternatingItemStyle = $this->getViewState('AlternatingItemStyle', null);
1451
+		if ($itemStyle !== null)
1452 1452
 		{
1453
-			if($alternatingItemStyle===null)
1454
-				$alternatingItemStyle=$itemStyle;
1453
+			if ($alternatingItemStyle === null)
1454
+				$alternatingItemStyle = $itemStyle;
1455 1455
 			else
1456 1456
 				$alternatingItemStyle->mergeWith($itemStyle);
1457 1457
 		}
1458 1458
 
1459
-		$selectedItemStyle=$this->getViewState('SelectedItemStyle',null);
1459
+		$selectedItemStyle = $this->getViewState('SelectedItemStyle', null);
1460 1460
 
1461
-		$editItemStyle=$this->getViewState('EditItemStyle',null);
1462
-		if($selectedItemStyle!==null)
1461
+		$editItemStyle = $this->getViewState('EditItemStyle', null);
1462
+		if ($selectedItemStyle !== null)
1463 1463
 		{
1464
-			if($editItemStyle===null)
1465
-				$editItemStyle=$selectedItemStyle;
1464
+			if ($editItemStyle === null)
1465
+				$editItemStyle = $selectedItemStyle;
1466 1466
 			else
1467 1467
 				$editItemStyle->mergeWith($selectedItemStyle);
1468 1468
 		}
1469 1469
 
1470
-		$headerStyle=$this->getViewState('HeaderStyle',null);
1471
-		$footerStyle=$this->getViewState('FooterStyle',null);
1472
-		$pagerStyle=$this->getViewState('PagerStyle',null);
1473
-		$separatorStyle=$this->getViewState('SeparatorStyle',null);
1470
+		$headerStyle = $this->getViewState('HeaderStyle', null);
1471
+		$footerStyle = $this->getViewState('FooterStyle', null);
1472
+		$pagerStyle = $this->getViewState('PagerStyle', null);
1473
+		$separatorStyle = $this->getViewState('SeparatorStyle', null);
1474 1474
 
1475
-		foreach($this->getControls() as $index=>$item)
1475
+		foreach ($this->getControls() as $index=>$item)
1476 1476
 		{
1477
-			if(!($item instanceof TDataGridItem) && !($item instanceof TDataGridPager))
1477
+			if (!($item instanceof TDataGridItem) && !($item instanceof TDataGridPager))
1478 1478
 				continue;
1479
-			$itemType=$item->getItemType();
1480
-			switch($itemType)
1479
+			$itemType = $item->getItemType();
1480
+			switch ($itemType)
1481 1481
 			{
1482 1482
 				case TListItemType::Header:
1483
-					if($headerStyle)
1483
+					if ($headerStyle)
1484 1484
 						$item->getStyle()->mergeWith($headerStyle);
1485
-					if(!$this->getShowHeader())
1485
+					if (!$this->getShowHeader())
1486 1486
 						$item->setVisible(false);
1487 1487
 					break;
1488 1488
 				case TListItemType::Footer:
1489
-					if($footerStyle)
1489
+					if ($footerStyle)
1490 1490
 						$item->getStyle()->mergeWith($footerStyle);
1491
-					if(!$this->getShowFooter())
1491
+					if (!$this->getShowFooter())
1492 1492
 						$item->setVisible(false);
1493 1493
 					break;
1494 1494
 				case TListItemType::Separator:
1495
-					if($separatorStyle)
1495
+					if ($separatorStyle)
1496 1496
 						$item->getStyle()->mergeWith($separatorStyle);
1497 1497
 					break;
1498 1498
 				case TListItemType::Item:
1499
-					if($itemStyle)
1499
+					if ($itemStyle)
1500 1500
 						$item->getStyle()->mergeWith($itemStyle);
1501 1501
 					break;
1502 1502
 				case TListItemType::AlternatingItem:
1503
-					if($alternatingItemStyle)
1503
+					if ($alternatingItemStyle)
1504 1504
 						$item->getStyle()->mergeWith($alternatingItemStyle);
1505 1505
 					break;
1506 1506
 				case TListItemType::SelectedItem:
1507
-					if($selectedItemStyle)
1507
+					if ($selectedItemStyle)
1508 1508
 						$item->getStyle()->mergeWith($selectedItemStyle);
1509
-					if($index % 2==1)
1509
+					if ($index % 2 == 1)
1510 1510
 					{
1511
-						if($itemStyle)
1511
+						if ($itemStyle)
1512 1512
 							$item->getStyle()->mergeWith($itemStyle);
1513 1513
 					}
1514 1514
 					else
1515 1515
 					{
1516
-						if($alternatingItemStyle)
1516
+						if ($alternatingItemStyle)
1517 1517
 							$item->getStyle()->mergeWith($alternatingItemStyle);
1518 1518
 					}
1519 1519
 					break;
1520 1520
 				case TListItemType::EditItem:
1521
-					if($editItemStyle)
1521
+					if ($editItemStyle)
1522 1522
 						$item->getStyle()->mergeWith($editItemStyle);
1523
-					if($index % 2==1)
1523
+					if ($index % 2 == 1)
1524 1524
 					{
1525
-						if($itemStyle)
1525
+						if ($itemStyle)
1526 1526
 							$item->getStyle()->mergeWith($itemStyle);
1527 1527
 					}
1528 1528
 					else
1529 1529
 					{
1530
-						if($alternatingItemStyle)
1530
+						if ($alternatingItemStyle)
1531 1531
 							$item->getStyle()->mergeWith($alternatingItemStyle);
1532 1532
 					}
1533 1533
 					break;
1534 1534
 				case TListItemType::Pager:
1535
-					if($pagerStyle)
1535
+					if ($pagerStyle)
1536 1536
 					{
1537 1537
 						$item->getStyle()->mergeWith($pagerStyle);
1538
-						if($index===0)
1538
+						if ($index === 0)
1539 1539
 						{
1540
-							if($pagerStyle->getPosition()===TDataGridPagerPosition::Bottom || !$pagerStyle->getVisible())
1540
+							if ($pagerStyle->getPosition() === TDataGridPagerPosition::Bottom || !$pagerStyle->getVisible())
1541 1541
 								$item->setVisible(false);
1542 1542
 						}
1543 1543
 						else
1544 1544
 						{
1545
-							if($pagerStyle->getPosition()===TDataGridPagerPosition::Top || !$pagerStyle->getVisible())
1545
+							if ($pagerStyle->getPosition() === TDataGridPagerPosition::Top || !$pagerStyle->getVisible())
1546 1546
 								$item->setVisible(false);
1547 1547
 						}
1548 1548
 					}
@@ -1550,25 +1550,25 @@  discard block
 block discarded – undo
1550 1550
 				default:
1551 1551
 					break;
1552 1552
 			}
1553
-			if($this->_columns && $itemType!==TListItemType::Pager)
1553
+			if ($this->_columns && $itemType !== TListItemType::Pager)
1554 1554
 			{
1555
-				$n=$this->_columns->getCount();
1556
-				$cells=$item->getCells();
1557
-				for($i=0;$i<$n;++$i)
1555
+				$n = $this->_columns->getCount();
1556
+				$cells = $item->getCells();
1557
+				for ($i = 0; $i < $n; ++$i)
1558 1558
 				{
1559
-					$cell=$cells->itemAt($i);
1560
-					$column=$this->_columns->itemAt($i);
1561
-					if(!$column->getVisible())
1559
+					$cell = $cells->itemAt($i);
1560
+					$column = $this->_columns->itemAt($i);
1561
+					if (!$column->getVisible())
1562 1562
 						$cell->setVisible(false);
1563 1563
 					else
1564 1564
 					{
1565
-						if($itemType===TListItemType::Header)
1566
-							$style=$column->getHeaderStyle(false);
1567
-						else if($itemType===TListItemType::Footer)
1568
-							$style=$column->getFooterStyle(false);
1565
+						if ($itemType === TListItemType::Header)
1566
+							$style = $column->getHeaderStyle(false);
1567
+						else if ($itemType === TListItemType::Footer)
1568
+							$style = $column->getFooterStyle(false);
1569 1569
 						else
1570
-							$style=$column->getItemStyle(false);
1571
-						if($style!==null)
1570
+							$style = $column->getItemStyle(false);
1571
+						if ($style !== null)
1572 1572
 							$cell->getStyle()->mergeWith($style);
1573 1573
 					}
1574 1574
 				}
@@ -1583,10 +1583,10 @@  discard block
 block discarded – undo
1583 1583
 	public function renderBeginTag($writer)
1584 1584
 	{
1585 1585
 		parent::renderBeginTag($writer);
1586
-		if(($caption=$this->getCaption())!=='')
1586
+		if (($caption = $this->getCaption()) !== '')
1587 1587
 		{
1588
-			if(($align=$this->getCaptionAlign())!==TTableCaptionAlign::NotSet)
1589
-				$writer->addAttribute('align',strtolower($align));
1588
+			if (($align = $this->getCaptionAlign()) !== TTableCaptionAlign::NotSet)
1589
+				$writer->addAttribute('align', strtolower($align));
1590 1590
 			$writer->renderBeginTag('caption');
1591 1591
 			$writer->write($caption);
1592 1592
 			$writer->renderEndTag();
@@ -1599,30 +1599,30 @@  discard block
 block discarded – undo
1599 1599
 	 */
1600 1600
 	public function render($writer)
1601 1601
 	{
1602
-		if($this->getHasControls())
1602
+		if ($this->getHasControls())
1603 1603
 		{
1604 1604
 			$this->groupCells();
1605
-			if($this->_useEmptyTemplate)
1605
+			if ($this->_useEmptyTemplate)
1606 1606
 			{
1607
-				$control=new TWebControl;
1607
+				$control = new TWebControl;
1608 1608
 				$control->setID($this->getClientID());
1609 1609
 				$control->copyBaseAttributes($this);
1610
-				if($this->getHasStyle())
1610
+				if ($this->getHasStyle())
1611 1611
 					$control->getStyle()->copyFrom($this->getStyle());
1612 1612
 				$control->renderBeginTag($writer);
1613 1613
 				$this->renderContents($writer);
1614 1614
 				$control->renderEndTag($writer);
1615 1615
 			}
1616
-			else if($this->getViewState('ItemCount',0)>0)
1616
+			else if ($this->getViewState('ItemCount', 0) > 0)
1617 1617
 			{
1618 1618
 				$this->applyItemStyles();
1619
-				if($this->_topPager)
1619
+				if ($this->_topPager)
1620 1620
 				{
1621 1621
 					$this->_topPager->renderControl($writer);
1622 1622
 					$writer->writeLine();
1623 1623
 				}
1624 1624
 				$this->renderTable($writer);
1625
-				if($this->_bottomPager)
1625
+				if ($this->_bottomPager)
1626 1626
 				{
1627 1627
 					$writer->writeLine();
1628 1628
 					$this->_bottomPager->renderControl($writer);
@@ -1638,27 +1638,27 @@  discard block
 block discarded – undo
1638 1638
 	protected function renderTable($writer)
1639 1639
 	{
1640 1640
 		$this->renderBeginTag($writer);
1641
-		if($this->_header && $this->_header->getVisible())
1641
+		if ($this->_header && $this->_header->getVisible())
1642 1642
 		{
1643 1643
 			$writer->writeLine();
1644
-			if($style=$this->getViewState('TableHeadStyle',null))
1644
+			if ($style = $this->getViewState('TableHeadStyle', null))
1645 1645
 				$style->addAttributesToRender($writer);
1646 1646
 			$writer->renderBeginTag('thead');
1647 1647
 			$this->_header->render($writer);
1648 1648
 			$writer->renderEndTag();
1649 1649
 		}
1650 1650
 		$writer->writeLine();
1651
-		if($style=$this->getViewState('TableBodyStyle',null))
1651
+		if ($style = $this->getViewState('TableBodyStyle', null))
1652 1652
 			$style->addAttributesToRender($writer);
1653 1653
 		$writer->renderBeginTag('tbody');
1654
-		foreach($this->getItems() as $item)
1654
+		foreach ($this->getItems() as $item)
1655 1655
 			$item->renderControl($writer);
1656 1656
 		$writer->renderEndTag();
1657 1657
 
1658
-		if($this->_footer && $this->_footer->getVisible())
1658
+		if ($this->_footer && $this->_footer->getVisible())
1659 1659
 		{
1660 1660
 			$writer->writeLine();
1661
-			if($style=$this->getViewState('TableFootStyle',null))
1661
+			if ($style = $this->getViewState('TableFootStyle', null))
1662 1662
 				$style->addAttributesToRender($writer);
1663 1663
 			$writer->renderBeginTag('tfoot');
1664 1664
 			$this->_footer->render($writer);
@@ -1687,7 +1687,7 @@  discard block
 block discarded – undo
1687 1687
 	 * The TDataGridItem control responsible for the event.
1688 1688
 	 * @var TDataGridItem
1689 1689
 	 */
1690
-	private $_item=null;
1690
+	private $_item = null;
1691 1691
 
1692 1692
 	/**
1693 1693
 	 * Constructor.
@@ -1695,7 +1695,7 @@  discard block
 block discarded – undo
1695 1695
 	 */
1696 1696
 	public function __construct(TDataGridItem $item)
1697 1697
 	{
1698
-		$this->_item=$item;
1698
+		$this->_item = $item;
1699 1699
 	}
1700 1700
 
1701 1701
 	/**
@@ -1724,7 +1724,7 @@  discard block
 block discarded – undo
1724 1724
 	 * The TDataGridPager control responsible for the event.
1725 1725
 	 * @var TDataGridPager
1726 1726
 	 */
1727
-	protected $_pager=null;
1727
+	protected $_pager = null;
1728 1728
 
1729 1729
 	/**
1730 1730
 	 * Constructor.
@@ -1732,7 +1732,7 @@  discard block
 block discarded – undo
1732 1732
 	 */
1733 1733
 	public function __construct(TDataGridPager $pager)
1734 1734
 	{
1735
-		$this->_pager=$pager;
1735
+		$this->_pager = $pager;
1736 1736
 	}
1737 1737
 
1738 1738
 	/**
@@ -1763,11 +1763,11 @@  discard block
 block discarded – undo
1763 1763
 	/**
1764 1764
 	 * @var TDataGridItem the TDataGridItem control responsible for the event.
1765 1765
 	 */
1766
-	private $_item=null;
1766
+	private $_item = null;
1767 1767
 	/**
1768 1768
 	 * @var TControl the control originally raises the <b>Command</b> event.
1769 1769
 	 */
1770
-	private $_source=null;
1770
+	private $_source = null;
1771 1771
 
1772 1772
 	/**
1773 1773
 	 * Constructor.
@@ -1775,11 +1775,11 @@  discard block
 block discarded – undo
1775 1775
 	 * @param TControl original event sender
1776 1776
 	 * @param TCommandEventParameter original event parameter
1777 1777
 	 */
1778
-	public function __construct($item,$source,TCommandEventParameter $param)
1778
+	public function __construct($item, $source, TCommandEventParameter $param)
1779 1779
 	{
1780
-		$this->_item=$item;
1781
-		$this->_source=$source;
1782
-		parent::__construct($param->getCommandName(),$param->getCommandParameter());
1780
+		$this->_item = $item;
1781
+		$this->_source = $source;
1782
+		parent::__construct($param->getCommandName(), $param->getCommandParameter());
1783 1783
 	}
1784 1784
 
1785 1785
 	/**
@@ -1818,21 +1818,21 @@  discard block
 block discarded – undo
1818 1818
 	/**
1819 1819
 	 * @var string sort expression
1820 1820
 	 */
1821
-	private $_sortExpression='';
1821
+	private $_sortExpression = '';
1822 1822
 	/**
1823 1823
 	 * @var TControl original event sender
1824 1824
 	 */
1825
-	private $_source=null;
1825
+	private $_source = null;
1826 1826
 
1827 1827
 	/**
1828 1828
 	 * Constructor.
1829 1829
 	 * @param TControl the control originally raises the <b>OnCommand</b> event.
1830 1830
 	 * @param TDataGridCommandEventParameter command event parameter
1831 1831
 	 */
1832
-	public function __construct($source,TDataGridCommandEventParameter $param)
1832
+	public function __construct($source, TDataGridCommandEventParameter $param)
1833 1833
 	{
1834
-		$this->_source=$source;
1835
-		$this->_sortExpression=$param->getCommandParameter();
1834
+		$this->_source = $source;
1835
+		$this->_sortExpression = $param->getCommandParameter();
1836 1836
 	}
1837 1837
 
1838 1838
 	/**
@@ -1875,17 +1875,17 @@  discard block
 block discarded – undo
1875 1875
 	/**
1876 1876
 	 * @var TControl original event sender
1877 1877
 	 */
1878
-	private $_source=null;
1878
+	private $_source = null;
1879 1879
 
1880 1880
 	/**
1881 1881
 	 * Constructor.
1882 1882
 	 * @param TControl the control originally raises the <b>OnCommand</b> event.
1883 1883
 	 * @param integer new page index
1884 1884
 	 */
1885
-	public function __construct($source,$newPageIndex)
1885
+	public function __construct($source, $newPageIndex)
1886 1886
 	{
1887
-		$this->_source=$source;
1888
-		$this->_newIndex=$newPageIndex;
1887
+		$this->_source = $source;
1888
+		$this->_newIndex = $newPageIndex;
1889 1889
 	}
1890 1890
 
1891 1891
 	/**
@@ -1924,35 +1924,35 @@  discard block
 block discarded – undo
1924 1924
 	/**
1925 1925
 	 * @var integer index of the data item in the Items collection of datagrid
1926 1926
 	 */
1927
-	private $_itemIndex='';
1927
+	private $_itemIndex = '';
1928 1928
 	/**
1929 1929
 	 * @var integer index of the item from the bound data source
1930 1930
 	 */
1931
-	private $_dataSourceIndex=0;
1931
+	private $_dataSourceIndex = 0;
1932 1932
 	/**
1933 1933
 	 * type of the TDataGridItem
1934 1934
 	 * @var string
1935 1935
 	 */
1936
-	private $_itemType='';
1936
+	private $_itemType = '';
1937 1937
 	/**
1938 1938
 	 * value of the data item
1939 1939
 	 * @var mixed
1940 1940
 	 */
1941
-	private $_data=null;
1941
+	private $_data = null;
1942 1942
 
1943 1943
 	/**
1944 1944
 	 * Constructor.
1945 1945
 	 * @param integer zero-based index of the item in the item collection of datagrid
1946 1946
 	 * @param TListItemType item type
1947 1947
 	 */
1948
-	public function __construct($itemIndex,$dataSourceIndex,$itemType)
1948
+	public function __construct($itemIndex, $dataSourceIndex, $itemType)
1949 1949
 	{
1950
-		$this->_itemIndex=$itemIndex;
1951
-		$this->_dataSourceIndex=$dataSourceIndex;
1950
+		$this->_itemIndex = $itemIndex;
1951
+		$this->_dataSourceIndex = $dataSourceIndex;
1952 1952
 		$this->setItemType($itemType);
1953
-		if($itemType===TListItemType::Header)
1953
+		if ($itemType === TListItemType::Header)
1954 1954
 			$this->setTableSection(TTableRowSection::Header);
1955
-		else if($itemType===TListItemType::Footer)
1955
+		else if ($itemType === TListItemType::Footer)
1956 1956
 			$this->setTableSection(TTableRowSection::Footer);
1957 1957
 	}
1958 1958
 
@@ -1969,7 +1969,7 @@  discard block
 block discarded – undo
1969 1969
 	 */
1970 1970
 	public function setItemType($value)
1971 1971
 	{
1972
-		$this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType');
1972
+		$this->_itemType = TPropertyValue::ensureEnum($value, 'TListItemType');
1973 1973
 	}
1974 1974
 
1975 1975
 	/**
@@ -2003,7 +2003,7 @@  discard block
 block discarded – undo
2003 2003
 	 */
2004 2004
 	public function setData($value)
2005 2005
 	{
2006
-		$this->_data=$value;
2006
+		$this->_data = $value;
2007 2007
 	}
2008 2008
 
2009 2009
 	/**
@@ -2033,11 +2033,11 @@  discard block
 block discarded – undo
2033 2033
 	 * @param TEventParameter event parameter
2034 2034
 	 * @return boolean whether the event bubbling should stop here.
2035 2035
 	 */
2036
-	public function bubbleEvent($sender,$param)
2036
+	public function bubbleEvent($sender, $param)
2037 2037
 	{
2038
-		if($param instanceof TCommandEventParameter)
2038
+		if ($param instanceof TCommandEventParameter)
2039 2039
 		{
2040
-			$this->raiseBubbleEvent($this,new TDataGridCommandEventParameter($this,$sender,$param));
2040
+			$this->raiseBubbleEvent($this, new TDataGridCommandEventParameter($this, $sender, $param));
2041 2041
 			return true;
2042 2042
 		}
2043 2043
 		else
@@ -2065,7 +2065,7 @@  discard block
 block discarded – undo
2065 2065
 	 */
2066 2066
 	public function __construct($dataGrid)
2067 2067
 	{
2068
-		$this->_dataGrid=$dataGrid;
2068
+		$this->_dataGrid = $dataGrid;
2069 2069
 	}
2070 2070
 
2071 2071
 	/**
@@ -2075,11 +2075,11 @@  discard block
 block discarded – undo
2075 2075
 	 * @param TEventParameter event parameter
2076 2076
 	 * @return boolean whether the event bubbling should stop here.
2077 2077
 	 */
2078
-	public function bubbleEvent($sender,$param)
2078
+	public function bubbleEvent($sender, $param)
2079 2079
 	{
2080
-		if($param instanceof TCommandEventParameter)
2080
+		if ($param instanceof TCommandEventParameter)
2081 2081
 		{
2082
-			$this->raiseBubbleEvent($this,new TDataGridCommandEventParameter($this,$sender,$param));
2082
+			$this->raiseBubbleEvent($this, new TDataGridCommandEventParameter($this, $sender, $param));
2083 2083
 			return true;
2084 2084
 		}
2085 2085
 		else
@@ -2122,10 +2122,10 @@  discard block
 block discarded – undo
2122 2122
 	 * @param mixed new item
2123 2123
 	 * @throws TInvalidDataTypeException if the item to be inserted is not a TDataGridItem.
2124 2124
 	 */
2125
-	public function insertAt($index,$item)
2125
+	public function insertAt($index, $item)
2126 2126
 	{
2127
-		if($item instanceof TDataGridItem)
2128
-			parent::insertAt($index,$item);
2127
+		if ($item instanceof TDataGridItem)
2128
+			parent::insertAt($index, $item);
2129 2129
 		else
2130 2130
 			throw new TInvalidDataTypeException('datagriditemcollection_datagriditem_required');
2131 2131
 	}
@@ -2154,7 +2154,7 @@  discard block
 block discarded – undo
2154 2154
 	 */
2155 2155
 	public function __construct(TDataGrid $owner)
2156 2156
 	{
2157
-		$this->_o=$owner;
2157
+		$this->_o = $owner;
2158 2158
 	}
2159 2159
 
2160 2160
 	/**
@@ -2172,12 +2172,12 @@  discard block
 block discarded – undo
2172 2172
 	 * @param mixed new item
2173 2173
 	 * @throws TInvalidDataTypeException if the item to be inserted is not a TDataGridColumn.
2174 2174
 	 */
2175
-	public function insertAt($index,$item)
2175
+	public function insertAt($index, $item)
2176 2176
 	{
2177
-		if($item instanceof TDataGridColumn)
2177
+		if ($item instanceof TDataGridColumn)
2178 2178
 		{
2179 2179
 			$item->setOwner($this->_o);
2180
-			parent::insertAt($index,$item);
2180
+			parent::insertAt($index, $item);
2181 2181
 		}
2182 2182
 		else
2183 2183
 			throw new TInvalidDataTypeException('datagridcolumncollection_datagridcolumn_required');
@@ -2198,8 +2198,8 @@  discard block
 block discarded – undo
2198 2198
  */
2199 2199
 class TDataGridPagerMode extends TEnumerable
2200 2200
 {
2201
-	const NextPrev='NextPrev';
2202
-	const Numeric='Numeric';
2201
+	const NextPrev = 'NextPrev';
2202
+	const Numeric = 'Numeric';
2203 2203
 }
2204 2204
 
2205 2205
 
@@ -2217,8 +2217,8 @@  discard block
 block discarded – undo
2217 2217
  */
2218 2218
 class TDataGridPagerButtonType extends TEnumerable
2219 2219
 {
2220
-	const LinkButton='LinkButton';
2221
-	const PushButton='PushButton';
2220
+	const LinkButton = 'LinkButton';
2221
+	const PushButton = 'PushButton';
2222 2222
 }
2223 2223
 
2224 2224
 
@@ -2237,8 +2237,8 @@  discard block
 block discarded – undo
2237 2237
  */
2238 2238
 class TDataGridPagerPosition extends TEnumerable
2239 2239
 {
2240
-	const Bottom='Bottom';
2241
-	const Top='Top';
2242
-	const TopAndBottom='TopAndBottom';
2240
+	const Bottom = 'Bottom';
2241
+	const Top = 'Top';
2242
+	const TopAndBottom = 'TopAndBottom';
2243 2243
 }
2244 2244
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDataGridColumn.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -281,6 +281,7 @@  discard block
 block discarded – undo
281 281
 	 *
282 282
 	 * @param string the name of the viewstate value to be returned
283 283
 	 * @param mixed the default value. If $key is not found in viewstate, $defaultValue will be returned
284
+	 * @param string $key
284 285
 	 * @return mixed the viewstate value corresponding to $key
285 286
 	 */
286 287
 	protected function getViewState($key,$defaultValue=null)
@@ -295,6 +296,7 @@  discard block
 block discarded – undo
295 296
 	 * @param string the name of the viewstate value
296 297
 	 * @param mixed the viewstate value to be set
297 298
 	 * @param mixed default value. If $value===$defaultValue, the item will be cleared from the viewstate.
299
+	 * @param string $key
298 300
 	 */
299 301
 	protected function setViewState($key,$value,$defaultValue=null)
300 302
 	{
@@ -356,6 +358,7 @@  discard block
 block discarded – undo
356 358
 	 * If the data is a component, the field is used as the name of a property.
357 359
 	 * @param mixed data containing the field of value
358 360
 	 * @param string the data field
361
+	 * @param string $field
359 362
 	 * @return mixed data value at the specified field
360 363
 	 * @throws TInvalidDataValueException if the data or the field is invalid.
361 364
 	 */
@@ -515,6 +518,7 @@  discard block
 block discarded – undo
515 518
 	 * as the first and second parameters in {@link sprintf}.
516 519
 	 * @param string format string
517 520
 	 * @param mixed the data to be formatted
521
+	 * @param string $formatString
518 522
 	 * @return string the formatted result
519 523
 	 */
520 524
 	protected function formatDataValue($formatString,$value)
Please login to merge, or discard this patch.
Spacing   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
  */
63 63
 abstract class TDataGridColumn extends TApplicationComponent
64 64
 {
65
-	private $_id='';
66
-	private $_owner=null;
67
-	private $_viewState=array();
65
+	private $_id = '';
66
+	private $_owner = null;
67
+	private $_viewState = array();
68 68
 
69 69
 	/**
70 70
 	 * @return string the ID of the column.
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function setID($value)
85 85
 	{
86
-		if(!preg_match(TControl::ID_FORMAT,$value))
87
-			throw new TInvalidDataValueException('datagridcolumn_id_invalid',get_class($this),$value);
88
-		$this->_id=$value;
86
+		if (!preg_match(TControl::ID_FORMAT, $value))
87
+			throw new TInvalidDataValueException('datagridcolumn_id_invalid', get_class($this), $value);
88
+		$this->_id = $value;
89 89
 	}
90 90
 
91 91
 	/**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 */
94 94
 	public function getHeaderText()
95 95
 	{
96
-		return $this->getViewState('HeaderText','');
96
+		return $this->getViewState('HeaderText', '');
97 97
 	}
98 98
 
99 99
 	/**
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 */
102 102
 	public function setHeaderText($value)
103 103
 	{
104
-		$this->setViewState('HeaderText',$value,'');
104
+		$this->setViewState('HeaderText', $value, '');
105 105
 	}
106 106
 
107 107
 	/**
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	public function getHeaderImageUrl()
111 111
 	{
112
-		return $this->getViewState('HeaderImageUrl','');
112
+		return $this->getViewState('HeaderImageUrl', '');
113 113
 	}
114 114
 
115 115
 	/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	public function setHeaderImageUrl($value)
119 119
 	{
120
-		$this->setViewState('HeaderImageUrl',$value,'');
120
+		$this->setViewState('HeaderImageUrl', $value, '');
121 121
 	}
122 122
 
123 123
 	/**
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 */
127 127
 	public function getHeaderRenderer()
128 128
 	{
129
-		return $this->getViewState('HeaderRenderer','');
129
+		return $this->getViewState('HeaderRenderer', '');
130 130
 	}
131 131
 
132 132
 	/**
@@ -141,19 +141,19 @@  discard block
 block discarded – undo
141 141
 	 */
142 142
 	public function setHeaderRenderer($value)
143 143
 	{
144
-		$this->setViewState('HeaderRenderer',$value,'');
144
+		$this->setViewState('HeaderRenderer', $value, '');
145 145
 	}
146 146
 
147 147
 	/**
148 148
 	 * @param boolean whether to create a style if previously not existing
149 149
 	 * @return TTableItemStyle the style for header
150 150
 	 */
151
-	public function getHeaderStyle($createStyle=true)
151
+	public function getHeaderStyle($createStyle = true)
152 152
 	{
153
-		if(($style=$this->getViewState('HeaderStyle',null))===null && $createStyle)
153
+		if (($style = $this->getViewState('HeaderStyle', null)) === null && $createStyle)
154 154
 		{
155
-			$style=new TTableItemStyle;
156
-			$this->setViewState('HeaderStyle',$style,null);
155
+			$style = new TTableItemStyle;
156
+			$this->setViewState('HeaderStyle', $style, null);
157 157
 		}
158 158
 		return $style;
159 159
 	}
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 */
164 164
 	public function getFooterText()
165 165
 	{
166
-		return $this->getViewState('FooterText','');
166
+		return $this->getViewState('FooterText', '');
167 167
 	}
168 168
 
169 169
 	/**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	public function setFooterText($value)
173 173
 	{
174
-		$this->setViewState('FooterText',$value,'');
174
+		$this->setViewState('FooterText', $value, '');
175 175
 	}
176 176
 
177 177
 	/**
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	 */
181 181
 	public function getFooterRenderer()
182 182
 	{
183
-		return $this->getViewState('FooterRenderer','');
183
+		return $this->getViewState('FooterRenderer', '');
184 184
 	}
185 185
 
186 186
 	/**
@@ -195,19 +195,19 @@  discard block
 block discarded – undo
195 195
 	 */
196 196
 	public function setFooterRenderer($value)
197 197
 	{
198
-		$this->setViewState('FooterRenderer',$value,'');
198
+		$this->setViewState('FooterRenderer', $value, '');
199 199
 	}
200 200
 
201 201
 	/**
202 202
 	 * @param boolean whether to create a style if previously not existing
203 203
 	 * @return TTableItemStyle the style for footer
204 204
 	 */
205
-	public function getFooterStyle($createStyle=true)
205
+	public function getFooterStyle($createStyle = true)
206 206
 	{
207
-		if(($style=$this->getViewState('FooterStyle',null))===null && $createStyle)
207
+		if (($style = $this->getViewState('FooterStyle', null)) === null && $createStyle)
208 208
 		{
209
-			$style=new TTableItemStyle;
210
-			$this->setViewState('FooterStyle',$style,null);
209
+			$style = new TTableItemStyle;
210
+			$this->setViewState('FooterStyle', $style, null);
211 211
 		}
212 212
 		return $style;
213 213
 	}
@@ -216,12 +216,12 @@  discard block
 block discarded – undo
216 216
 	 * @param boolean whether to create a style if previously not existing
217 217
 	 * @return TTableItemStyle the style for item
218 218
 	 */
219
-	public function getItemStyle($createStyle=true)
219
+	public function getItemStyle($createStyle = true)
220 220
 	{
221
-		if(($style=$this->getViewState('ItemStyle',null))===null && $createStyle)
221
+		if (($style = $this->getViewState('ItemStyle', null)) === null && $createStyle)
222 222
 		{
223
-			$style=new TTableItemStyle;
224
-			$this->setViewState('ItemStyle',$style,null);
223
+			$style = new TTableItemStyle;
224
+			$this->setViewState('ItemStyle', $style, null);
225 225
 		}
226 226
 		return $style;
227 227
 	}
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 	 */
232 232
 	public function getSortExpression()
233 233
 	{
234
-		return $this->getViewState('SortExpression','');
234
+		return $this->getViewState('SortExpression', '');
235 235
 	}
236 236
 
237 237
 	/**
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	 */
240 240
 	public function setSortExpression($value)
241 241
 	{
242
-		$this->setViewState('SortExpression',$value,'');
242
+		$this->setViewState('SortExpression', $value, '');
243 243
 	}
244 244
 
245 245
 	/**
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	 */
249 249
 	public function getEnableCellGrouping()
250 250
 	{
251
-		return $this->getViewState('EnableCellGrouping',false);
251
+		return $this->getViewState('EnableCellGrouping', false);
252 252
 	}
253 253
 
254 254
 	/**
@@ -257,15 +257,15 @@  discard block
 block discarded – undo
257 257
 	 */
258 258
 	public function setEnableCellGrouping($value)
259 259
 	{
260
-		$this->setViewState('EnableCellGrouping',TPropertyValue::ensureBoolean($value),false);
260
+		$this->setViewState('EnableCellGrouping', TPropertyValue::ensureBoolean($value), false);
261 261
 	}
262 262
 
263 263
 	/**
264 264
 	 * @return boolean whether the column is visible. Defaults to true.
265 265
 	 */
266
-	public function getVisible($checkParents=true)
266
+	public function getVisible($checkParents = true)
267 267
 	{
268
-		return $this->getViewState('Visible',true);
268
+		return $this->getViewState('Visible', true);
269 269
 	}
270 270
 
271 271
 	/**
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 	 */
274 274
 	public function setVisible($value)
275 275
 	{
276
-		$this->setViewState('Visible',TPropertyValue::ensureBoolean($value),true);
276
+		$this->setViewState('Visible', TPropertyValue::ensureBoolean($value), true);
277 277
 	}
278 278
 
279 279
 	/**
@@ -283,9 +283,9 @@  discard block
 block discarded – undo
283 283
 	 * @param mixed the default value. If $key is not found in viewstate, $defaultValue will be returned
284 284
 	 * @return mixed the viewstate value corresponding to $key
285 285
 	 */
286
-	protected function getViewState($key,$defaultValue=null)
286
+	protected function getViewState($key, $defaultValue = null)
287 287
 	{
288
-		return isset($this->_viewState[$key])?$this->_viewState[$key]:$defaultValue;
288
+		return isset($this->_viewState[$key]) ? $this->_viewState[$key] : $defaultValue;
289 289
 	}
290 290
 
291 291
 	/**
@@ -296,12 +296,12 @@  discard block
 block discarded – undo
296 296
 	 * @param mixed the viewstate value to be set
297 297
 	 * @param mixed default value. If $value===$defaultValue, the item will be cleared from the viewstate.
298 298
 	 */
299
-	protected function setViewState($key,$value,$defaultValue=null)
299
+	protected function setViewState($key, $value, $defaultValue = null)
300 300
 	{
301
-		if($value===$defaultValue)
301
+		if ($value === $defaultValue)
302 302
 			unset($this->_viewState[$key]);
303 303
 		else
304
-			$this->_viewState[$key]=$value;
304
+			$this->_viewState[$key] = $value;
305 305
 	}
306 306
 
307 307
 	/**
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 	 */
311 311
 	public function loadState($state)
312 312
 	{
313
-		$this->_viewState=$state;
313
+		$this->_viewState = $state;
314 314
 	}
315 315
 
316 316
 	/**
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 	 */
336 336
 	public function setOwner(TDataGrid $value)
337 337
 	{
338
-		$this->_owner=$value;
338
+		$this->_owner = $value;
339 339
 	}
340 340
 
341 341
 	/**
@@ -359,9 +359,9 @@  discard block
 block discarded – undo
359 359
 	 * @return mixed data value at the specified field
360 360
 	 * @throws TInvalidDataValueException if the data or the field is invalid.
361 361
 	 */
362
-	protected function getDataFieldValue($data,$field)
362
+	protected function getDataFieldValue($data, $field)
363 363
 	{
364
-		return TDataFieldAccessor::getDataFieldValue($data,$field);
364
+		return TDataFieldAccessor::getDataFieldValue($data, $field);
365 365
 	}
366 366
 
367 367
 
@@ -376,12 +376,12 @@  discard block
 block discarded – undo
376 376
 	 * @param integer the index to the Columns property that the cell resides in.
377 377
 	 * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)
378 378
 	 */
379
-	public function initializeCell($cell,$columnIndex,$itemType)
379
+	public function initializeCell($cell, $columnIndex, $itemType)
380 380
 	{
381
-		if($itemType===TListItemType::Header)
382
-			$this->initializeHeaderCell($cell,$columnIndex);
383
-		else if($itemType===TListItemType::Footer)
384
-			$this->initializeFooterCell($cell,$columnIndex);
381
+		if ($itemType === TListItemType::Header)
382
+			$this->initializeHeaderCell($cell, $columnIndex);
383
+		else if ($itemType === TListItemType::Footer)
384
+			$this->initializeFooterCell($cell, $columnIndex);
385 385
 	}
386 386
 
387 387
 	/**
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 	 */
393 393
 	public function getAllowSorting()
394 394
 	{
395
-		return $this->getSortExpression()!=='' && (!$this->_owner || $this->_owner->getAllowSorting());
395
+		return $this->getSortExpression() !== '' && (!$this->_owner || $this->_owner->getAllowSorting());
396 396
 	}
397 397
 
398 398
 	/**
@@ -409,42 +409,42 @@  discard block
 block discarded – undo
409 409
 	 * @param TTableCell the cell to be initialized
410 410
 	 * @param integer the index to the Columns property that the cell resides in.
411 411
 	 */
412
-	protected function initializeHeaderCell($cell,$columnIndex)
412
+	protected function initializeHeaderCell($cell, $columnIndex)
413 413
 	{
414
-		$text=$this->getHeaderText();
414
+		$text = $this->getHeaderText();
415 415
 
416
-		if(($classPath=$this->getHeaderRenderer())!=='')
416
+		if (($classPath = $this->getHeaderRenderer()) !== '')
417 417
 		{
418
-			$control=Prado::createComponent($classPath);
418
+			$control = Prado::createComponent($classPath);
419 419
 			$cell->getControls()->add($control);
420
-			if($control instanceof IDataRenderer)
420
+			if ($control instanceof IDataRenderer)
421 421
 			{
422
-				if($control instanceof IItemDataRenderer)
422
+				if ($control instanceof IItemDataRenderer)
423 423
 				{
424
-					$item=$cell->getParent();
424
+					$item = $cell->getParent();
425 425
 					$control->setItemIndex($item->getItemIndex());
426 426
 					$control->setItemType($item->getItemType());
427 427
 				}
428 428
 				$control->setData($text);
429 429
 			}
430 430
 		}
431
-		else if($this->getAllowSorting())
431
+		else if ($this->getAllowSorting())
432 432
 		{
433
-			$sortExpression=$this->getSortExpression();
434
-			if(($url=$this->getHeaderImageUrl())!=='')
433
+			$sortExpression = $this->getSortExpression();
434
+			if (($url = $this->getHeaderImageUrl()) !== '')
435 435
 			{
436
-				$button=Prado::createComponent('System.Web.UI.WebControls.TImageButton');
436
+				$button = Prado::createComponent('System.Web.UI.WebControls.TImageButton');
437 437
 				$button->setImageUrl($url);
438 438
 				$button->setCommandName(TDataGrid::CMD_SORT);
439 439
 				$button->setCommandParameter($sortExpression);
440
-				if($text!=='')
440
+				if ($text !== '')
441 441
 					$button->setAlternateText($text);
442 442
 				$button->setCausesValidation(false);
443 443
 				$cell->getControls()->add($button);
444 444
 			}
445
-			else if($text!=='')
445
+			else if ($text !== '')
446 446
 			{
447
-				$button=Prado::createComponent('System.Web.UI.WebControls.TLinkButton');
447
+				$button = Prado::createComponent('System.Web.UI.WebControls.TLinkButton');
448 448
 				$button->setText($text);
449 449
 				$button->setCommandName(TDataGrid::CMD_SORT);
450 450
 				$button->setCommandParameter($sortExpression);
@@ -456,15 +456,15 @@  discard block
 block discarded – undo
456 456
 		}
457 457
 		else
458 458
 		{
459
-			if(($url=$this->getHeaderImageUrl())!=='')
459
+			if (($url = $this->getHeaderImageUrl()) !== '')
460 460
 			{
461
-				$image=Prado::createComponent('System.Web.UI.WebControls.TImage');
461
+				$image = Prado::createComponent('System.Web.UI.WebControls.TImage');
462 462
 				$image->setImageUrl($url);
463
-				if($text!=='')
463
+				if ($text !== '')
464 464
 					$image->setAlternateText($text);
465 465
 				$cell->getControls()->add($image);
466 466
 			}
467
-			else if($text!=='')
467
+			else if ($text !== '')
468 468
 				$cell->setText($text);
469 469
 			else
470 470
 				$cell->setText('&nbsp;');
@@ -481,25 +481,25 @@  discard block
 block discarded – undo
481 481
 	 * @param TTableCell the cell to be initialized
482 482
 	 * @param integer the index to the Columns property that the cell resides in.
483 483
 	 */
484
-	protected function initializeFooterCell($cell,$columnIndex)
484
+	protected function initializeFooterCell($cell, $columnIndex)
485 485
 	{
486
-		$text=$this->getFooterText();
487
-		if(($classPath=$this->getFooterRenderer())!=='')
486
+		$text = $this->getFooterText();
487
+		if (($classPath = $this->getFooterRenderer()) !== '')
488 488
 		{
489
-			$control=Prado::createComponent($classPath);
489
+			$control = Prado::createComponent($classPath);
490 490
 			$cell->getControls()->add($control);
491
-			if($control instanceof IDataRenderer)
491
+			if ($control instanceof IDataRenderer)
492 492
 			{
493
-				if($control instanceof IItemDataRenderer)
493
+				if ($control instanceof IItemDataRenderer)
494 494
 				{
495
-					$item=$cell->getParent();
495
+					$item = $cell->getParent();
496 496
 					$control->setItemIndex($item->getItemIndex());
497 497
 					$control->setItemType($item->getItemType());
498 498
 				}
499 499
 				$control->setData($text);
500 500
 			}
501 501
 		}
502
-		else if($text!=='')
502
+		else if ($text !== '')
503 503
 			$cell->setText($text);
504 504
 		else
505 505
 			$cell->setText('&nbsp;');
@@ -517,26 +517,26 @@  discard block
 block discarded – undo
517 517
 	 * @param mixed the data to be formatted
518 518
 	 * @return string the formatted result
519 519
 	 */
520
-	protected function formatDataValue($formatString,$value)
520
+	protected function formatDataValue($formatString, $value)
521 521
 	{
522
-		if($formatString==='')
522
+		if ($formatString === '')
523 523
 			return TPropertyValue::ensureString($value);
524
-		else if($formatString[0]==='#')
524
+		else if ($formatString[0] === '#')
525 525
 		{
526
-			$expression=strtr(substr($formatString,1),array('{0}'=>'$value'));
526
+			$expression = strtr(substr($formatString, 1), array('{0}'=>'$value'));
527 527
 			try
528 528
 			{
529
-				if(eval("\$result=$expression;")===false)
529
+				if (eval("\$result=$expression;") === false)
530 530
 					throw new Exception('');
531 531
 				return $result;
532 532
 			}
533
-			catch(Exception $e)
533
+			catch (Exception $e)
534 534
 			{
535
-				throw new TInvalidDataValueException('datagridcolumn_expression_invalid',get_class($this),$expression,$e->getMessage());
535
+				throw new TInvalidDataValueException('datagridcolumn_expression_invalid', get_class($this), $expression, $e->getMessage());
536 536
 			}
537 537
 		}
538 538
 		else
539
-			return sprintf($formatString,$value);
539
+			return sprintf($formatString, $value);
540 540
 	}
541 541
 }
542 542
 
@@ -557,8 +557,8 @@  discard block
 block discarded – undo
557 557
  */
558 558
 class TButtonColumnType extends TEnumerable
559 559
 {
560
-	const LinkButton='LinkButton';
561
-	const PushButton='PushButton';
562
-	const ImageButton='ImageButton';
560
+	const LinkButton = 'LinkButton';
561
+	const PushButton = 'PushButton';
562
+	const ImageButton = 'ImageButton';
563 563
 }
564 564
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -427,8 +427,7 @@  discard block
 block discarded – undo
427 427
 				}
428 428
 				$control->setData($text);
429 429
 			}
430
-		}
431
-		else if($this->getAllowSorting())
430
+		} else if($this->getAllowSorting())
432 431
 		{
433 432
 			$sortExpression=$this->getSortExpression();
434 433
 			if(($url=$this->getHeaderImageUrl())!=='')
@@ -441,8 +440,7 @@  discard block
 block discarded – undo
441 440
 					$button->setAlternateText($text);
442 441
 				$button->setCausesValidation(false);
443 442
 				$cell->getControls()->add($button);
444
-			}
445
-			else if($text!=='')
443
+			} else if($text!=='')
446 444
 			{
447 445
 				$button=Prado::createComponent('System.Web.UI.WebControls.TLinkButton');
448 446
 				$button->setText($text);
@@ -450,11 +448,9 @@  discard block
 block discarded – undo
450 448
 				$button->setCommandParameter($sortExpression);
451 449
 				$button->setCausesValidation(false);
452 450
 				$cell->getControls()->add($button);
453
-			}
454
-			else
451
+			} else
455 452
 				$cell->setText('&nbsp;');
456
-		}
457
-		else
453
+		} else
458 454
 		{
459 455
 			if(($url=$this->getHeaderImageUrl())!=='')
460 456
 			{
@@ -463,8 +459,7 @@  discard block
 block discarded – undo
463 459
 				if($text!=='')
464 460
 					$image->setAlternateText($text);
465 461
 				$cell->getControls()->add($image);
466
-			}
467
-			else if($text!=='')
462
+			} else if($text!=='')
468 463
 				$cell->setText($text);
469 464
 			else
470 465
 				$cell->setText('&nbsp;');
@@ -498,8 +493,7 @@  discard block
 block discarded – undo
498 493
 				}
499 494
 				$control->setData($text);
500 495
 			}
501
-		}
502
-		else if($text!=='')
496
+		} else if($text!=='')
503 497
 			$cell->setText($text);
504 498
 		else
505 499
 			$cell->setText('&nbsp;');
@@ -529,13 +523,11 @@  discard block
 block discarded – undo
529 523
 				if(eval("\$result=$expression;")===false)
530 524
 					throw new Exception('');
531 525
 				return $result;
532
-			}
533
-			catch(Exception $e)
526
+			} catch(Exception $e)
534 527
 			{
535 528
 				throw new TInvalidDataValueException('datagridcolumn_expression_invalid',get_class($this),$expression,$e->getMessage());
536 529
 			}
537
-		}
538
-		else
530
+		} else
539 531
 			return sprintf($formatString,$value);
540 532
 	}
541 533
 }
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDataList.php 3 patches
Doc Comments   +11 added lines patch added patch discarded remove patch
@@ -404,6 +404,7 @@  discard block
 block discarded – undo
404 404
 
405 405
 	/**
406 406
 	 * @param ITemplate the template for item
407
+	 * @param TWizardSideBarListItemTemplate $value
407 408
 	 * @throws TInvalidDataTypeException if the input is not an {@link ITemplate} or not null.
408 409
 	 */
409 410
 	public function setItemTemplate($value)
@@ -959,6 +960,7 @@  discard block
 block discarded – undo
959 960
 	 * If you override this method, be sure to call parent's implementation
960 961
 	 * so that event handlers have chance to respond to the event.
961 962
 	 * @param TDataListItemEventParameter event parameter
963
+	 * @param TDataListItemEventParameter $param
962 964
 	 */
963 965
 	public function onItemCreated($param)
964 966
 	{
@@ -973,6 +975,7 @@  discard block
 block discarded – undo
973 975
 	 * If you override this method, be sure to call parent's implementation
974 976
 	 * so that event handlers have chance to respond to the event.
975 977
 	 * @param TDataListItemEventParameter event parameter
978
+	 * @param TDataListItemEventParameter $param
976 979
 	 */
977 980
 	public function onItemDataBound($param)
978 981
 	{
@@ -984,6 +987,7 @@  discard block
 block discarded – undo
984 987
 	 * This method is invoked when a child control of the data list
985 988
 	 * raises an <b>OnCommand</b> event.
986 989
 	 * @param TDataListCommandEventParameter event parameter
990
+	 * @param TDataListCommandEventParameter $param
987 991
 	 */
988 992
 	public function onItemCommand($param)
989 993
 	{
@@ -995,6 +999,7 @@  discard block
 block discarded – undo
995 999
 	 * This method is invoked when a child control of the data list
996 1000
 	 * raises an <b>OnCommand</b> event and the command name is 'edit' (case-insensitive).
997 1001
 	 * @param TDataListCommandEventParameter event parameter
1002
+	 * @param TDataListCommandEventParameter $param
998 1003
 	 */
999 1004
 	public function onEditCommand($param)
1000 1005
 	{
@@ -1006,6 +1011,7 @@  discard block
 block discarded – undo
1006 1011
 	 * This method is invoked when a child control of the data list
1007 1012
 	 * raises an <b>OnCommand</b> event and the command name is 'delete' (case-insensitive).
1008 1013
 	 * @param TDataListCommandEventParameter event parameter
1014
+	 * @param TDataListCommandEventParameter $param
1009 1015
 	 */
1010 1016
 	public function onDeleteCommand($param)
1011 1017
 	{
@@ -1017,6 +1023,7 @@  discard block
 block discarded – undo
1017 1023
 	 * This method is invoked when a child control of the data list
1018 1024
 	 * raises an <b>OnCommand</b> event and the command name is 'update' (case-insensitive).
1019 1025
 	 * @param TDataListCommandEventParameter event parameter
1026
+	 * @param TDataListCommandEventParameter $param
1020 1027
 	 */
1021 1028
 	public function onUpdateCommand($param)
1022 1029
 	{
@@ -1028,6 +1035,7 @@  discard block
 block discarded – undo
1028 1035
 	 * This method is invoked when a child control of the data list
1029 1036
 	 * raises an <b>OnCommand</b> event and the command name is 'cancel' (case-insensitive).
1030 1037
 	 * @param TDataListCommandEventParameter event parameter
1038
+	 * @param TDataListCommandEventParameter $param
1031 1039
 	 */
1032 1040
 	public function onCancelCommand($param)
1033 1041
 	{
@@ -1131,6 +1139,7 @@  discard block
 block discarded – undo
1131 1139
 	 * This method invokes {@link createItem} to create a new datalist item.
1132 1140
 	 * @param integer zero-based item index.
1133 1141
 	 * @param TListItemType item type
1142
+	 * @param integer $itemIndex
1134 1143
 	 * @return TControl the created item, null if item is not created
1135 1144
 	 */
1136 1145
 	private function createItemInternal($itemIndex,$itemType)
@@ -1152,6 +1161,7 @@  discard block
 block discarded – undo
1152 1161
 	 * @param integer zero-based item index.
1153 1162
 	 * @param TListItemType item type
1154 1163
 	 * @param mixed data to be associated with the item
1164
+	 * @param integer $itemIndex
1155 1165
 	 * @return TControl the created item, null if item is not created
1156 1166
 	 */
1157 1167
 	private function createItemWithDataInternal($itemIndex,$itemType,$dataItem)
@@ -1511,6 +1521,7 @@  discard block
 block discarded – undo
1511 1521
 	/**
1512 1522
 	 * Constructor.
1513 1523
 	 * @param TControl DataList item related with the corresponding event
1524
+	 * @param TControl $item
1514 1525
 	 */
1515 1526
 	public function __construct($item)
1516 1527
 	{
Please login to merge, or discard this patch.
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -924,23 +924,19 @@  discard block
 block discarded – undo
924 924
 					$this->setSelectedItemIndex($item->getItemIndex());
925 925
 				$this->onSelectedIndexChanged($param);
926 926
 				return true;
927
-			}
928
-			else if(strcasecmp($command,self::CMD_EDIT)===0)
927
+			} else if(strcasecmp($command,self::CMD_EDIT)===0)
929 928
 			{
930 929
 				$this->onEditCommand($param);
931 930
 				return true;
932
-			}
933
-			else if(strcasecmp($command,self::CMD_DELETE)===0)
931
+			} else if(strcasecmp($command,self::CMD_DELETE)===0)
934 932
 			{
935 933
 				$this->onDeleteCommand($param);
936 934
 				return true;
937
-			}
938
-			else if(strcasecmp($command,self::CMD_UPDATE)===0)
935
+			} else if(strcasecmp($command,self::CMD_UPDATE)===0)
939 936
 			{
940 937
 				$this->onUpdateCommand($param);
941 938
 				return true;
942
-			}
943
-			else if(strcasecmp($command,self::CMD_CANCEL)===0)
939
+			} else if(strcasecmp($command,self::CMD_CANCEL)===0)
944 940
 			{
945 941
 				$this->onCancelCommand($param);
946 942
 				return true;
@@ -1078,8 +1074,7 @@  discard block
 block discarded – undo
1078 1074
 			$style=$item->getStyle();
1079 1075
 			$item->clearStyle();
1080 1076
 			return $style;
1081
-		}
1082
-		else
1077
+		} else
1083 1078
 			return null;
1084 1079
 	}
1085 1080
 
@@ -1141,8 +1136,7 @@  discard block
 block discarded – undo
1141 1136
 			$this->onItemCreated($param);
1142 1137
 			$this->getControls()->add($item);
1143 1138
 			return $item;
1144
-		}
1145
-		else
1139
+		} else
1146 1140
 			return null;
1147 1141
 	}
1148 1142
 
@@ -1166,8 +1160,7 @@  discard block
 block discarded – undo
1166 1160
 			$item->dataBind();
1167 1161
 			$this->onItemDataBound($param);
1168 1162
 			return $item;
1169
-		}
1170
-		else
1163
+		} else
1171 1164
 			return null;
1172 1165
 	}
1173 1166
 
@@ -1187,8 +1180,7 @@  discard block
 block discarded – undo
1187 1180
 				return array($this->getItemRenderer(),$this->_itemTemplate);
1188 1181
 			else
1189 1182
 				return $this->getAlternatingItemDisplay();
1190
-		}
1191
-		else
1183
+		} else
1192 1184
 			return array($classPath,$this->_selectedItemTemplate);
1193 1185
 	}
1194 1186
 
@@ -1248,15 +1240,13 @@  discard block
 block discarded – undo
1248 1240
 				$item->setItemIndex($itemIndex);
1249 1241
 				$item->setItemType($itemType);
1250 1242
 			}
1251
-		}
1252
-		else if($template!==null)
1243
+		} else if($template!==null)
1253 1244
 		{
1254 1245
 			$item=new TDataListItem;
1255 1246
 			$item->setItemIndex($itemIndex);
1256 1247
 			$item->setItemType($itemType);
1257 1248
 			$template->instantiateIn($item);
1258
-		}
1259
-		else
1249
+		} else
1260 1250
 			$item=null;
1261 1251
 
1262 1252
 		return $item;
@@ -1415,8 +1405,7 @@  discard block
 block discarded – undo
1415 1405
 				$items->add($this->createItemInternal($i,$itemType));
1416 1406
 			}
1417 1407
 			$this->_footer=$this->createItemInternal(-1,TListItemType::Footer);
1418
-		}
1419
-		else
1408
+		} else
1420 1409
 			$this->createEmptyContent();
1421 1410
 		$this->clearChildState();
1422 1411
 	}
@@ -1481,8 +1470,7 @@  discard block
 block discarded – undo
1481 1470
 				$this->applyItemStyles();
1482 1471
 				$repeatInfo=$this->getRepeatInfo();
1483 1472
 				$repeatInfo->renderRepeater($writer,$this);
1484
-			}
1485
-			else if($this->_emptyTemplate!==null || $this->getEmptyRenderer()!=='')
1473
+			} else if($this->_emptyTemplate!==null || $this->getEmptyRenderer()!=='')
1486 1474
 				parent::render($writer);
1487 1475
 		}
1488 1476
 	}
@@ -1725,8 +1713,7 @@  discard block
 block discarded – undo
1725 1713
 		{
1726 1714
 			$this->raiseBubbleEvent($this,new TDataListCommandEventParameter($this,$sender,$param));
1727 1715
 			return true;
1728
-		}
1729
-		else
1716
+		} else
1730 1717
 			return false;
1731 1718
 	}
1732 1719
 }
Please login to merge, or discard this patch.
Spacing   +289 added lines, -289 removed lines patch added patch discarded remove patch
@@ -153,43 +153,43 @@  discard block
 block discarded – undo
153 153
 	/**
154 154
 	 * Command name that TDataList understands. They are case-insensitive.
155 155
 	 */
156
-	const CMD_SELECT='Select';
157
-	const CMD_EDIT='Edit';
158
-	const CMD_UPDATE='Update';
159
-	const CMD_DELETE='Delete';
160
-	const CMD_CANCEL='Cancel';
156
+	const CMD_SELECT = 'Select';
157
+	const CMD_EDIT = 'Edit';
158
+	const CMD_UPDATE = 'Update';
159
+	const CMD_DELETE = 'Delete';
160
+	const CMD_CANCEL = 'Cancel';
161 161
 
162 162
 	/**
163 163
 	 * @var TDataListItemCollection item list
164 164
 	 */
165
-	private $_items=null;
165
+	private $_items = null;
166 166
 	/**
167 167
 	 * @var Itemplate various item templates
168 168
 	 */
169
-	private $_itemTemplate=null;
170
-	private $_emptyTemplate=null;
171
-	private $_alternatingItemTemplate=null;
172
-	private $_selectedItemTemplate=null;
173
-	private $_editItemTemplate=null;
174
-	private $_headerTemplate=null;
175
-	private $_footerTemplate=null;
176
-	private $_separatorTemplate=null;
169
+	private $_itemTemplate = null;
170
+	private $_emptyTemplate = null;
171
+	private $_alternatingItemTemplate = null;
172
+	private $_selectedItemTemplate = null;
173
+	private $_editItemTemplate = null;
174
+	private $_headerTemplate = null;
175
+	private $_footerTemplate = null;
176
+	private $_separatorTemplate = null;
177 177
 	/**
178 178
 	 * @var TControl header item
179 179
 	 */
180
-	private $_header=null;
180
+	private $_header = null;
181 181
 	/**
182 182
 	 * @var TControl footer item
183 183
 	 */
184
-	private $_footer=null;
184
+	private $_footer = null;
185 185
 
186 186
 	/**
187 187
 	 * @return TDataListItemCollection item list
188 188
 	 */
189 189
 	public function getItems()
190 190
 	{
191
-		if(!$this->_items)
192
-			$this->_items=new TDataListItemCollection;
191
+		if (!$this->_items)
192
+			$this->_items = new TDataListItemCollection;
193 193
 		return $this->_items;
194 194
 	}
195 195
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	 */
199 199
 	public function getItemCount()
200 200
 	{
201
-		return $this->_items?$this->_items->getCount():0;
201
+		return $this->_items ? $this->_items->getCount() : 0;
202 202
 	}
203 203
 
204 204
 	/**
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 */
208 208
 	public function getItemRenderer()
209 209
 	{
210
-		return $this->getViewState('ItemRenderer','');
210
+		return $this->getViewState('ItemRenderer', '');
211 211
 	}
212 212
 
213 213
 	/**
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	 */
223 223
 	public function setItemRenderer($value)
224 224
 	{
225
-		$this->setViewState('ItemRenderer',$value,'');
225
+		$this->setViewState('ItemRenderer', $value, '');
226 226
 	}
227 227
 
228 228
 	/**
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 	 */
232 232
 	public function getAlternatingItemRenderer()
233 233
 	{
234
-		return $this->getViewState('AlternatingItemRenderer','');
234
+		return $this->getViewState('AlternatingItemRenderer', '');
235 235
 	}
236 236
 
237 237
 	/**
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	 */
247 247
 	public function setAlternatingItemRenderer($value)
248 248
 	{
249
-		$this->setViewState('AlternatingItemRenderer',$value,'');
249
+		$this->setViewState('AlternatingItemRenderer', $value, '');
250 250
 	}
251 251
 
252 252
 	/**
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	 */
256 256
 	public function getEditItemRenderer()
257 257
 	{
258
-		return $this->getViewState('EditItemRenderer','');
258
+		return $this->getViewState('EditItemRenderer', '');
259 259
 	}
260 260
 
261 261
 	/**
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	 */
271 271
 	public function setEditItemRenderer($value)
272 272
 	{
273
-		$this->setViewState('EditItemRenderer',$value,'');
273
+		$this->setViewState('EditItemRenderer', $value, '');
274 274
 	}
275 275
 
276 276
 	/**
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	 */
280 280
 	public function getSelectedItemRenderer()
281 281
 	{
282
-		return $this->getViewState('SelectedItemRenderer','');
282
+		return $this->getViewState('SelectedItemRenderer', '');
283 283
 	}
284 284
 
285 285
 	/**
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 	 */
295 295
 	public function setSelectedItemRenderer($value)
296 296
 	{
297
-		$this->setViewState('SelectedItemRenderer',$value,'');
297
+		$this->setViewState('SelectedItemRenderer', $value, '');
298 298
 	}
299 299
 
300 300
 	/**
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 	 */
304 304
 	public function getSeparatorRenderer()
305 305
 	{
306
-		return $this->getViewState('SeparatorRenderer','');
306
+		return $this->getViewState('SeparatorRenderer', '');
307 307
 	}
308 308
 
309 309
 	/**
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	 */
319 319
 	public function setSeparatorRenderer($value)
320 320
 	{
321
-		$this->setViewState('SeparatorRenderer',$value,'');
321
+		$this->setViewState('SeparatorRenderer', $value, '');
322 322
 	}
323 323
 
324 324
 	/**
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 	 */
328 328
 	public function getHeaderRenderer()
329 329
 	{
330
-		return $this->getViewState('HeaderRenderer','');
330
+		return $this->getViewState('HeaderRenderer', '');
331 331
 	}
332 332
 
333 333
 	/**
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 	 */
343 343
 	public function setHeaderRenderer($value)
344 344
 	{
345
-		$this->setViewState('HeaderRenderer',$value,'');
345
+		$this->setViewState('HeaderRenderer', $value, '');
346 346
 	}
347 347
 
348 348
 	/**
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 	 */
352 352
 	public function getFooterRenderer()
353 353
 	{
354
-		return $this->getViewState('FooterRenderer','');
354
+		return $this->getViewState('FooterRenderer', '');
355 355
 	}
356 356
 
357 357
 	/**
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 	 */
367 367
 	public function setFooterRenderer($value)
368 368
 	{
369
-		$this->setViewState('FooterRenderer',$value,'');
369
+		$this->setViewState('FooterRenderer', $value, '');
370 370
 	}
371 371
 
372 372
 	/**
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 	 */
376 376
 	public function getEmptyRenderer()
377 377
 	{
378
-		return $this->getViewState('EmptyRenderer','');
378
+		return $this->getViewState('EmptyRenderer', '');
379 379
 	}
380 380
 
381 381
 	/**
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 	 */
392 392
 	public function setEmptyRenderer($value)
393 393
 	{
394
-		$this->setViewState('EmptyRenderer',$value,'');
394
+		$this->setViewState('EmptyRenderer', $value, '');
395 395
 	}
396 396
 
397 397
 	/**
@@ -408,10 +408,10 @@  discard block
 block discarded – undo
408 408
 	 */
409 409
 	public function setItemTemplate($value)
410 410
 	{
411
-		if($value instanceof ITemplate || $value===null)
412
-			$this->_itemTemplate=$value;
411
+		if ($value instanceof ITemplate || $value === null)
412
+			$this->_itemTemplate = $value;
413 413
 		else
414
-			throw new TInvalidDataTypeException('datalist_template_required','ItemTemplate');
414
+			throw new TInvalidDataTypeException('datalist_template_required', 'ItemTemplate');
415 415
 	}
416 416
 
417 417
 	/**
@@ -419,10 +419,10 @@  discard block
 block discarded – undo
419 419
 	 */
420 420
 	public function getItemStyle()
421 421
 	{
422
-		if(($style=$this->getViewState('ItemStyle',null))===null)
422
+		if (($style = $this->getViewState('ItemStyle', null)) === null)
423 423
 		{
424
-			$style=new TTableItemStyle;
425
-			$this->setViewState('ItemStyle',$style,null);
424
+			$style = new TTableItemStyle;
425
+			$this->setViewState('ItemStyle', $style, null);
426 426
 		}
427 427
 		return $style;
428 428
 	}
@@ -441,10 +441,10 @@  discard block
 block discarded – undo
441 441
 	 */
442 442
 	public function setAlternatingItemTemplate($value)
443 443
 	{
444
-		if($value instanceof ITemplate || $value===null)
445
-			$this->_alternatingItemTemplate=$value;
444
+		if ($value instanceof ITemplate || $value === null)
445
+			$this->_alternatingItemTemplate = $value;
446 446
 		else
447
-			throw new TInvalidDataTypeException('datalist_template_required','AlternatingItemType');
447
+			throw new TInvalidDataTypeException('datalist_template_required', 'AlternatingItemType');
448 448
 	}
449 449
 
450 450
 	/**
@@ -452,10 +452,10 @@  discard block
 block discarded – undo
452 452
 	 */
453 453
 	public function getAlternatingItemStyle()
454 454
 	{
455
-		if(($style=$this->getViewState('AlternatingItemStyle',null))===null)
455
+		if (($style = $this->getViewState('AlternatingItemStyle', null)) === null)
456 456
 		{
457
-			$style=new TTableItemStyle;
458
-			$this->setViewState('AlternatingItemStyle',$style,null);
457
+			$style = new TTableItemStyle;
458
+			$this->setViewState('AlternatingItemStyle', $style, null);
459 459
 		}
460 460
 		return $style;
461 461
 	}
@@ -474,10 +474,10 @@  discard block
 block discarded – undo
474 474
 	 */
475 475
 	public function setSelectedItemTemplate($value)
476 476
 	{
477
-		if($value instanceof ITemplate || $value===null)
478
-			$this->_selectedItemTemplate=$value;
477
+		if ($value instanceof ITemplate || $value === null)
478
+			$this->_selectedItemTemplate = $value;
479 479
 		else
480
-			throw new TInvalidDataTypeException('datalist_template_required','SelectedItemTemplate');
480
+			throw new TInvalidDataTypeException('datalist_template_required', 'SelectedItemTemplate');
481 481
 	}
482 482
 
483 483
 	/**
@@ -485,10 +485,10 @@  discard block
 block discarded – undo
485 485
 	 */
486 486
 	public function getSelectedItemStyle()
487 487
 	{
488
-		if(($style=$this->getViewState('SelectedItemStyle',null))===null)
488
+		if (($style = $this->getViewState('SelectedItemStyle', null)) === null)
489 489
 		{
490
-			$style=new TTableItemStyle;
491
-			$this->setViewState('SelectedItemStyle',$style,null);
490
+			$style = new TTableItemStyle;
491
+			$this->setViewState('SelectedItemStyle', $style, null);
492 492
 		}
493 493
 		return $style;
494 494
 	}
@@ -507,10 +507,10 @@  discard block
 block discarded – undo
507 507
 	 */
508 508
 	public function setEditItemTemplate($value)
509 509
 	{
510
-		if($value instanceof ITemplate || $value===null)
511
-			$this->_editItemTemplate=$value;
510
+		if ($value instanceof ITemplate || $value === null)
511
+			$this->_editItemTemplate = $value;
512 512
 		else
513
-			throw new TInvalidDataTypeException('datalist_template_required','EditItemTemplate');
513
+			throw new TInvalidDataTypeException('datalist_template_required', 'EditItemTemplate');
514 514
 	}
515 515
 
516 516
 	/**
@@ -518,10 +518,10 @@  discard block
 block discarded – undo
518 518
 	 */
519 519
 	public function getEditItemStyle()
520 520
 	{
521
-		if(($style=$this->getViewState('EditItemStyle',null))===null)
521
+		if (($style = $this->getViewState('EditItemStyle', null)) === null)
522 522
 		{
523
-			$style=new TTableItemStyle;
524
-			$this->setViewState('EditItemStyle',$style,null);
523
+			$style = new TTableItemStyle;
524
+			$this->setViewState('EditItemStyle', $style, null);
525 525
 		}
526 526
 		return $style;
527 527
 	}
@@ -540,10 +540,10 @@  discard block
 block discarded – undo
540 540
 	 */
541 541
 	public function setHeaderTemplate($value)
542 542
 	{
543
-		if($value instanceof ITemplate || $value===null)
544
-			$this->_headerTemplate=$value;
543
+		if ($value instanceof ITemplate || $value === null)
544
+			$this->_headerTemplate = $value;
545 545
 		else
546
-			throw new TInvalidDataTypeException('datalist_template_required','HeaderTemplate');
546
+			throw new TInvalidDataTypeException('datalist_template_required', 'HeaderTemplate');
547 547
 	}
548 548
 
549 549
 	/**
@@ -551,10 +551,10 @@  discard block
 block discarded – undo
551 551
 	 */
552 552
 	public function getHeaderStyle()
553 553
 	{
554
-		if(($style=$this->getViewState('HeaderStyle',null))===null)
554
+		if (($style = $this->getViewState('HeaderStyle', null)) === null)
555 555
 		{
556
-			$style=new TTableItemStyle;
557
-			$this->setViewState('HeaderStyle',$style,null);
556
+			$style = new TTableItemStyle;
557
+			$this->setViewState('HeaderStyle', $style, null);
558 558
 		}
559 559
 		return $style;
560 560
 	}
@@ -581,10 +581,10 @@  discard block
 block discarded – undo
581 581
 	 */
582 582
 	public function setFooterTemplate($value)
583 583
 	{
584
-		if($value instanceof ITemplate || $value===null)
585
-			$this->_footerTemplate=$value;
584
+		if ($value instanceof ITemplate || $value === null)
585
+			$this->_footerTemplate = $value;
586 586
 		else
587
-			throw new TInvalidDataTypeException('datalist_template_required','FooterTemplate');
587
+			throw new TInvalidDataTypeException('datalist_template_required', 'FooterTemplate');
588 588
 	}
589 589
 
590 590
 	/**
@@ -592,10 +592,10 @@  discard block
 block discarded – undo
592 592
 	 */
593 593
 	public function getFooterStyle()
594 594
 	{
595
-		if(($style=$this->getViewState('FooterStyle',null))===null)
595
+		if (($style = $this->getViewState('FooterStyle', null)) === null)
596 596
 		{
597
-			$style=new TTableItemStyle;
598
-			$this->setViewState('FooterStyle',$style,null);
597
+			$style = new TTableItemStyle;
598
+			$this->setViewState('FooterStyle', $style, null);
599 599
 		}
600 600
 		return $style;
601 601
 	}
@@ -622,10 +622,10 @@  discard block
 block discarded – undo
622 622
 	 */
623 623
 	public function setEmptyTemplate($value)
624 624
 	{
625
-		if($value instanceof ITemplate || $value===null)
626
-			$this->_emptyTemplate=$value;
625
+		if ($value instanceof ITemplate || $value === null)
626
+			$this->_emptyTemplate = $value;
627 627
 		else
628
-			throw new TInvalidDataTypeException('datalist_template_required','EmptyTemplate');
628
+			throw new TInvalidDataTypeException('datalist_template_required', 'EmptyTemplate');
629 629
 	}
630 630
 
631 631
 	/**
@@ -642,10 +642,10 @@  discard block
 block discarded – undo
642 642
 	 */
643 643
 	public function setSeparatorTemplate($value)
644 644
 	{
645
-		if($value instanceof ITemplate || $value===null)
646
-			$this->_separatorTemplate=$value;
645
+		if ($value instanceof ITemplate || $value === null)
646
+			$this->_separatorTemplate = $value;
647 647
 		else
648
-			throw new TInvalidDataTypeException('datalist_template_required','SeparatorTemplate');
648
+			throw new TInvalidDataTypeException('datalist_template_required', 'SeparatorTemplate');
649 649
 	}
650 650
 
651 651
 	/**
@@ -653,10 +653,10 @@  discard block
 block discarded – undo
653 653
 	 */
654 654
 	public function getSeparatorStyle()
655 655
 	{
656
-		if(($style=$this->getViewState('SeparatorStyle',null))===null)
656
+		if (($style = $this->getViewState('SeparatorStyle', null)) === null)
657 657
 		{
658
-			$style=new TTableItemStyle;
659
-			$this->setViewState('SeparatorStyle',$style,null);
658
+			$style = new TTableItemStyle;
659
+			$this->setViewState('SeparatorStyle', $style, null);
660 660
 		}
661 661
 		return $style;
662 662
 	}
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 	 */
668 668
 	public function getSelectedItemIndex()
669 669
 	{
670
-		return $this->getViewState('SelectedItemIndex',-1);
670
+		return $this->getViewState('SelectedItemIndex', -1);
671 671
 	}
672 672
 
673 673
 	/**
@@ -679,23 +679,23 @@  discard block
 block discarded – undo
679 679
 	 */
680 680
 	public function setSelectedItemIndex($value)
681 681
 	{
682
-		if(($value=TPropertyValue::ensureInteger($value))<0)
683
-			$value=-1;
684
-		if(($current=$this->getSelectedItemIndex())!==$value)
682
+		if (($value = TPropertyValue::ensureInteger($value)) < 0)
683
+			$value = -1;
684
+		if (($current = $this->getSelectedItemIndex()) !== $value)
685 685
 		{
686
-			$this->setViewState('SelectedItemIndex',$value,-1);
687
-			$items=$this->getItems();
688
-			$itemCount=$items->getCount();
689
-			if($current>=0 && $current<$itemCount)
686
+			$this->setViewState('SelectedItemIndex', $value, -1);
687
+			$items = $this->getItems();
688
+			$itemCount = $items->getCount();
689
+			if ($current >= 0 && $current < $itemCount)
690 690
 			{
691
-				$item=$items->itemAt($current);
692
-				if(($item instanceof IItemDataRenderer) && $item->getItemType()!==TListItemType::EditItem)
693
-					$item->setItemType($current%2?TListItemType::AlternatingItem : TListItemType::Item);
691
+				$item = $items->itemAt($current);
692
+				if (($item instanceof IItemDataRenderer) && $item->getItemType() !== TListItemType::EditItem)
693
+					$item->setItemType($current % 2 ?TListItemType::AlternatingItem : TListItemType::Item);
694 694
 			}
695
-			if($value>=0 && $value<$itemCount)
695
+			if ($value >= 0 && $value < $itemCount)
696 696
 			{
697
-				$item=$items->itemAt($value);
698
-				if(($item instanceof IItemDataRenderer) && $item->getItemType()!==TListItemType::EditItem)
697
+				$item = $items->itemAt($value);
698
+				if (($item instanceof IItemDataRenderer) && $item->getItemType() !== TListItemType::EditItem)
699 699
 					$item->setItemType(TListItemType::SelectedItem);
700 700
 			}
701 701
 		}
@@ -706,9 +706,9 @@  discard block
 block discarded – undo
706 706
 	 */
707 707
 	public function getSelectedItem()
708 708
 	{
709
-		$index=$this->getSelectedItemIndex();
710
-		$items=$this->getItems();
711
-		if($index>=0 && $index<$items->getCount())
709
+		$index = $this->getSelectedItemIndex();
710
+		$items = $this->getItems();
711
+		if ($index >= 0 && $index < $items->getCount())
712 712
 			return $items->itemAt($index);
713 713
 		else
714 714
 			return null;
@@ -720,11 +720,11 @@  discard block
 block discarded – undo
720 720
 	 */
721 721
 	public function getSelectedDataKey()
722 722
 	{
723
-		if($this->getDataKeyField()==='')
723
+		if ($this->getDataKeyField() === '')
724 724
 			throw new TInvalidOperationException('datalist_datakeyfield_required');
725
-		$index=$this->getSelectedItemIndex();
726
-		$dataKeys=$this->getDataKeys();
727
-		if($index>=0 && $index<$dataKeys->getCount())
725
+		$index = $this->getSelectedItemIndex();
726
+		$dataKeys = $this->getDataKeys();
727
+		if ($index >= 0 && $index < $dataKeys->getCount())
728 728
 			return $dataKeys->itemAt($index);
729 729
 		else
730 730
 			return null;
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
 	 */
737 737
 	public function getEditItemIndex()
738 738
 	{
739
-		return $this->getViewState('EditItemIndex',-1);
739
+		return $this->getViewState('EditItemIndex', -1);
740 740
 	}
741 741
 
742 742
 	/**
@@ -747,16 +747,16 @@  discard block
 block discarded – undo
747 747
 	 */
748 748
 	public function setEditItemIndex($value)
749 749
 	{
750
-		if(($value=TPropertyValue::ensureInteger($value))<0)
751
-			$value=-1;
752
-		if(($current=$this->getEditItemIndex())!==$value)
750
+		if (($value = TPropertyValue::ensureInteger($value)) < 0)
751
+			$value = -1;
752
+		if (($current = $this->getEditItemIndex()) !== $value)
753 753
 		{
754
-			$this->setViewState('EditItemIndex',$value,-1);
755
-			$items=$this->getItems();
756
-			$itemCount=$items->getCount();
757
-			if($current>=0 && $current<$itemCount)
758
-				$items->itemAt($current)->setItemType($current%2?TListItemType::AlternatingItem : TListItemType::Item);
759
-			if($value>=0 && $value<$itemCount)
754
+			$this->setViewState('EditItemIndex', $value, -1);
755
+			$items = $this->getItems();
756
+			$itemCount = $items->getCount();
757
+			if ($current >= 0 && $current < $itemCount)
758
+				$items->itemAt($current)->setItemType($current % 2 ?TListItemType::AlternatingItem : TListItemType::Item);
759
+			if ($value >= 0 && $value < $itemCount)
760 760
 				$items->itemAt($value)->setItemType(TListItemType::EditItem);
761 761
 		}
762 762
 	}
@@ -766,9 +766,9 @@  discard block
 block discarded – undo
766 766
 	 */
767 767
 	public function getEditItem()
768 768
 	{
769
-		$index=$this->getEditItemIndex();
770
-		$items=$this->getItems();
771
-		if($index>=0 && $index<$items->getCount())
769
+		$index = $this->getEditItemIndex();
770
+		$items = $this->getItems();
771
+		if ($index >= 0 && $index < $items->getCount())
772 772
 			return $items->itemAt($index);
773 773
 		else
774 774
 			return null;
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
 	 */
780 780
 	public function getShowHeader()
781 781
 	{
782
-		return $this->getViewState('ShowHeader',true);
782
+		return $this->getViewState('ShowHeader', true);
783 783
 	}
784 784
 
785 785
 	/**
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 	 */
788 788
 	public function setShowHeader($value)
789 789
 	{
790
-		$this->setViewState('ShowHeader',TPropertyValue::ensureBoolean($value),true);
790
+		$this->setViewState('ShowHeader', TPropertyValue::ensureBoolean($value), true);
791 791
 	}
792 792
 
793 793
 	/**
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
 	 */
796 796
 	public function getShowFooter()
797 797
 	{
798
-		return $this->getViewState('ShowFooter',true);
798
+		return $this->getViewState('ShowFooter', true);
799 799
 	}
800 800
 
801 801
 	/**
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
 	 */
804 804
 	public function setShowFooter($value)
805 805
 	{
806
-		$this->setViewState('ShowFooter',TPropertyValue::ensureBoolean($value),true);
806
+		$this->setViewState('ShowFooter', TPropertyValue::ensureBoolean($value), true);
807 807
 	}
808 808
 
809 809
 	/**
@@ -811,10 +811,10 @@  discard block
 block discarded – undo
811 811
 	 */
812 812
 	protected function getRepeatInfo()
813 813
 	{
814
-		if(($repeatInfo=$this->getViewState('RepeatInfo',null))===null)
814
+		if (($repeatInfo = $this->getViewState('RepeatInfo', null)) === null)
815 815
 		{
816
-			$repeatInfo=new TRepeatInfo;
817
-			$this->setViewState('RepeatInfo',$repeatInfo,null);
816
+			$repeatInfo = new TRepeatInfo;
817
+			$this->setViewState('RepeatInfo', $repeatInfo, null);
818 818
 		}
819 819
 		return $repeatInfo;
820 820
 	}
@@ -912,35 +912,35 @@  discard block
 block discarded – undo
912 912
 	 * @param TEventParameter event parameter
913 913
 	 * @return boolean whether the event bubbling should stop here.
914 914
 	 */
915
-	public function bubbleEvent($sender,$param)
915
+	public function bubbleEvent($sender, $param)
916 916
 	{
917
-		if($param instanceof TDataListCommandEventParameter)
917
+		if ($param instanceof TDataListCommandEventParameter)
918 918
 		{
919 919
 			$this->onItemCommand($param);
920
-			$command=$param->getCommandName();
921
-			if(strcasecmp($command,self::CMD_SELECT)===0)
920
+			$command = $param->getCommandName();
921
+			if (strcasecmp($command, self::CMD_SELECT) === 0)
922 922
 			{
923
-				if(($item=$param->getItem()) instanceof IItemDataRenderer)
923
+				if (($item = $param->getItem()) instanceof IItemDataRenderer)
924 924
 					$this->setSelectedItemIndex($item->getItemIndex());
925 925
 				$this->onSelectedIndexChanged($param);
926 926
 				return true;
927 927
 			}
928
-			else if(strcasecmp($command,self::CMD_EDIT)===0)
928
+			else if (strcasecmp($command, self::CMD_EDIT) === 0)
929 929
 			{
930 930
 				$this->onEditCommand($param);
931 931
 				return true;
932 932
 			}
933
-			else if(strcasecmp($command,self::CMD_DELETE)===0)
933
+			else if (strcasecmp($command, self::CMD_DELETE) === 0)
934 934
 			{
935 935
 				$this->onDeleteCommand($param);
936 936
 				return true;
937 937
 			}
938
-			else if(strcasecmp($command,self::CMD_UPDATE)===0)
938
+			else if (strcasecmp($command, self::CMD_UPDATE) === 0)
939 939
 			{
940 940
 				$this->onUpdateCommand($param);
941 941
 				return true;
942 942
 			}
943
-			else if(strcasecmp($command,self::CMD_CANCEL)===0)
943
+			else if (strcasecmp($command, self::CMD_CANCEL) === 0)
944 944
 			{
945 945
 				$this->onCancelCommand($param);
946 946
 				return true;
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
 	 */
963 963
 	public function onItemCreated($param)
964 964
 	{
965
-		$this->raiseEvent('OnItemCreated',$this,$param);
965
+		$this->raiseEvent('OnItemCreated', $this, $param);
966 966
 	}
967 967
 
968 968
 	/**
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 	 */
977 977
 	public function onItemDataBound($param)
978 978
 	{
979
-		$this->raiseEvent('OnItemDataBound',$this,$param);
979
+		$this->raiseEvent('OnItemDataBound', $this, $param);
980 980
 	}
981 981
 
982 982
 	/**
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
 	 */
988 988
 	public function onItemCommand($param)
989 989
 	{
990
-		$this->raiseEvent('OnItemCommand',$this,$param);
990
+		$this->raiseEvent('OnItemCommand', $this, $param);
991 991
 	}
992 992
 
993 993
 	/**
@@ -998,7 +998,7 @@  discard block
 block discarded – undo
998 998
 	 */
999 999
 	public function onEditCommand($param)
1000 1000
 	{
1001
-		$this->raiseEvent('OnEditCommand',$this,$param);
1001
+		$this->raiseEvent('OnEditCommand', $this, $param);
1002 1002
 	}
1003 1003
 
1004 1004
 	/**
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
 	 */
1010 1010
 	public function onDeleteCommand($param)
1011 1011
 	{
1012
-		$this->raiseEvent('OnDeleteCommand',$this,$param);
1012
+		$this->raiseEvent('OnDeleteCommand', $this, $param);
1013 1013
 	}
1014 1014
 
1015 1015
 	/**
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 	 */
1021 1021
 	public function onUpdateCommand($param)
1022 1022
 	{
1023
-		$this->raiseEvent('OnUpdateCommand',$this,$param);
1023
+		$this->raiseEvent('OnUpdateCommand', $this, $param);
1024 1024
 	}
1025 1025
 
1026 1026
 	/**
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 	 */
1032 1032
 	public function onCancelCommand($param)
1033 1033
 	{
1034
-		$this->raiseEvent('OnCancelCommand',$this,$param);
1034
+		$this->raiseEvent('OnCancelCommand', $this, $param);
1035 1035
 	}
1036 1036
 
1037 1037
 	/**
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
 	 */
1042 1042
 	public function getHasHeader()
1043 1043
 	{
1044
-		return ($this->getShowHeader() && ($this->_headerTemplate!==null || $this->getHeaderRenderer()!==''));
1044
+		return ($this->getShowHeader() && ($this->_headerTemplate !== null || $this->getHeaderRenderer() !== ''));
1045 1045
 	}
1046 1046
 
1047 1047
 	/**
@@ -1051,7 +1051,7 @@  discard block
 block discarded – undo
1051 1051
 	 */
1052 1052
 	public function getHasFooter()
1053 1053
 	{
1054
-		return ($this->getShowFooter() && ($this->_footerTemplate!==null || $this->getFooterRenderer()!==''));
1054
+		return ($this->getShowFooter() && ($this->_footerTemplate !== null || $this->getFooterRenderer() !== ''));
1055 1055
 	}
1056 1056
 
1057 1057
 	/**
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
 	 */
1062 1062
 	public function getHasSeparators()
1063 1063
 	{
1064
-		return $this->_separatorTemplate!==null || $this->getSeparatorRenderer()!=='';
1064
+		return $this->_separatorTemplate !== null || $this->getSeparatorRenderer() !== '';
1065 1065
 	}
1066 1066
 
1067 1067
 	/**
@@ -1071,11 +1071,11 @@  discard block
 block discarded – undo
1071 1071
 	 * @param integer index of the item being rendered
1072 1072
 	 * @return TStyle item style
1073 1073
 	 */
1074
-	public function generateItemStyle($itemType,$index)
1074
+	public function generateItemStyle($itemType, $index)
1075 1075
 	{
1076
-		if(($item=$this->getItem($itemType,$index))!==null && ($item instanceof IStyleable) && $item->getHasStyle())
1076
+		if (($item = $this->getItem($itemType, $index)) !== null && ($item instanceof IStyleable) && $item->getHasStyle())
1077 1077
 		{
1078
-			$style=$item->getStyle();
1078
+			$style = $item->getStyle();
1079 1079
 			$item->clearStyle();
1080 1080
 			return $style;
1081 1081
 		}
@@ -1091,10 +1091,10 @@  discard block
 block discarded – undo
1091 1091
 	 * @param string item type (Header,Footer,Item,AlternatingItem,SelectedItem,EditItem,Separator,Pager)
1092 1092
 	 * @param integer zero-based index of the item in the item list
1093 1093
 	 */
1094
-	public function renderItem($writer,$repeatInfo,$itemType,$index)
1094
+	public function renderItem($writer, $repeatInfo, $itemType, $index)
1095 1095
 	{
1096
-		$item=$this->getItem($itemType,$index);
1097
-		if($repeatInfo->getRepeatLayout()===TRepeatLayout::Raw && get_class($item)==='TDataListItem')
1096
+		$item = $this->getItem($itemType, $index);
1097
+		if ($repeatInfo->getRepeatLayout() === TRepeatLayout::Raw && get_class($item) === 'TDataListItem')
1098 1098
 			$item->setTagName('div');
1099 1099
 		$item->renderControl($writer);
1100 1100
 	}
@@ -1104,9 +1104,9 @@  discard block
 block discarded – undo
1104 1104
 	 * @param integer item index
1105 1105
 	 * @return TControl data list item with the specified item type and index
1106 1106
 	 */
1107
-	private function getItem($itemType,$index)
1107
+	private function getItem($itemType, $index)
1108 1108
 	{
1109
-		switch($itemType)
1109
+		switch ($itemType)
1110 1110
 		{
1111 1111
 			case TListItemType::Item:
1112 1112
 			case TListItemType::AlternatingItem:
@@ -1116,10 +1116,10 @@  discard block
 block discarded – undo
1116 1116
 			case TListItemType::Header:
1117 1117
 				return $this->getControls()->itemAt(0);
1118 1118
 			case TListItemType::Footer:
1119
-				return $this->getControls()->itemAt($this->getControls()->getCount()-1);
1119
+				return $this->getControls()->itemAt($this->getControls()->getCount() - 1);
1120 1120
 			case TListItemType::Separator:
1121
-				$i=$index+$index+1;
1122
-				if($this->_headerTemplate!==null || $this->getHeaderRenderer()!=='')
1121
+				$i = $index + $index + 1;
1122
+				if ($this->_headerTemplate !== null || $this->getHeaderRenderer() !== '')
1123 1123
 					$i++;
1124 1124
 				return $this->getControls()->itemAt($i);
1125 1125
 		}
@@ -1133,11 +1133,11 @@  discard block
 block discarded – undo
1133 1133
 	 * @param TListItemType item type
1134 1134
 	 * @return TControl the created item, null if item is not created
1135 1135
 	 */
1136
-	private function createItemInternal($itemIndex,$itemType)
1136
+	private function createItemInternal($itemIndex, $itemType)
1137 1137
 	{
1138
-		if(($item=$this->createItem($itemIndex,$itemType))!==null)
1138
+		if (($item = $this->createItem($itemIndex, $itemType)) !== null)
1139 1139
 		{
1140
-			$param=new TDataListItemEventParameter($item);
1140
+			$param = new TDataListItemEventParameter($item);
1141 1141
 			$this->onItemCreated($param);
1142 1142
 			$this->getControls()->add($item);
1143 1143
 			return $item;
@@ -1154,12 +1154,12 @@  discard block
 block discarded – undo
1154 1154
 	 * @param mixed data to be associated with the item
1155 1155
 	 * @return TControl the created item, null if item is not created
1156 1156
 	 */
1157
-	private function createItemWithDataInternal($itemIndex,$itemType,$dataItem)
1157
+	private function createItemWithDataInternal($itemIndex, $itemType, $dataItem)
1158 1158
 	{
1159
-		if(($item=$this->createItem($itemIndex,$itemType))!==null)
1159
+		if (($item = $this->createItem($itemIndex, $itemType)) !== null)
1160 1160
 		{
1161
-			$param=new TDataListItemEventParameter($item);
1162
-			if($item instanceof IDataRenderer)
1161
+			$param = new TDataListItemEventParameter($item);
1162
+			if ($item instanceof IDataRenderer)
1163 1163
 				$item->setData($dataItem);
1164 1164
 			$this->onItemCreated($param);
1165 1165
 			$this->getControls()->add($item);
@@ -1173,31 +1173,31 @@  discard block
 block discarded – undo
1173 1173
 
1174 1174
 	private function getAlternatingItemDisplay()
1175 1175
 	{
1176
-		if(($classPath=$this->getAlternatingItemRenderer())==='' && $this->_alternatingItemTemplate===null)
1177
-			return array($this->getItemRenderer(),$this->_itemTemplate);
1176
+		if (($classPath = $this->getAlternatingItemRenderer()) === '' && $this->_alternatingItemTemplate === null)
1177
+			return array($this->getItemRenderer(), $this->_itemTemplate);
1178 1178
 		else
1179
-			return array($classPath,$this->_alternatingItemTemplate);
1179
+			return array($classPath, $this->_alternatingItemTemplate);
1180 1180
 	}
1181 1181
 
1182 1182
 	private function getSelectedItemDisplay($itemIndex)
1183 1183
 	{
1184
-		if(($classPath=$this->getSelectedItemRenderer())==='' && $this->_selectedItemTemplate===null)
1184
+		if (($classPath = $this->getSelectedItemRenderer()) === '' && $this->_selectedItemTemplate === null)
1185 1185
 		{
1186
-			if($itemIndex%2===0)
1187
-				return array($this->getItemRenderer(),$this->_itemTemplate);
1186
+			if ($itemIndex % 2 === 0)
1187
+				return array($this->getItemRenderer(), $this->_itemTemplate);
1188 1188
 			else
1189 1189
 				return $this->getAlternatingItemDisplay();
1190 1190
 		}
1191 1191
 		else
1192
-			return array($classPath,$this->_selectedItemTemplate);
1192
+			return array($classPath, $this->_selectedItemTemplate);
1193 1193
 	}
1194 1194
 
1195 1195
 	private function getEditItemDisplay($itemIndex)
1196 1196
 	{
1197
-		if(($classPath=$this->getEditItemRenderer())==='' && $this->_editItemTemplate===null)
1197
+		if (($classPath = $this->getEditItemRenderer()) === '' && $this->_editItemTemplate === null)
1198 1198
 			return $this->getSelectedItemDisplay($itemIndex);
1199 1199
 		else
1200
-			return array($classPath,$this->_editItemTemplate);
1200
+			return array($classPath, $this->_editItemTemplate);
1201 1201
 	}
1202 1202
 
1203 1203
 	/**
@@ -1206,58 +1206,58 @@  discard block
 block discarded – undo
1206 1206
 	 * @param TListItemType item type
1207 1207
 	 * @return TControl created datalist item
1208 1208
 	 */
1209
-	protected function createItem($itemIndex,$itemType)
1209
+	protected function createItem($itemIndex, $itemType)
1210 1210
 	{
1211
-		$template=null;
1212
-		$classPath=null;
1213
-		switch($itemType)
1211
+		$template = null;
1212
+		$classPath = null;
1213
+		switch ($itemType)
1214 1214
 		{
1215 1215
 			case TListItemType::Item :
1216
-				$classPath=$this->getItemRenderer();
1217
-				$template=$this->_itemTemplate;
1216
+				$classPath = $this->getItemRenderer();
1217
+				$template = $this->_itemTemplate;
1218 1218
 				break;
1219 1219
 			case TListItemType::AlternatingItem :
1220
-				list($classPath,$template)=$this->getAlternatingItemDisplay();
1220
+				list($classPath, $template) = $this->getAlternatingItemDisplay();
1221 1221
 				break;
1222 1222
 			case TListItemType::SelectedItem:
1223
-				list($classPath,$template)=$this->getSelectedItemDisplay($itemIndex);
1223
+				list($classPath, $template) = $this->getSelectedItemDisplay($itemIndex);
1224 1224
 				break;
1225 1225
 			case TListItemType::EditItem:
1226
-				list($classPath,$template)=$this->getEditItemDisplay($itemIndex);
1226
+				list($classPath, $template) = $this->getEditItemDisplay($itemIndex);
1227 1227
 				break;
1228 1228
 			case TListItemType::Header :
1229
-				$classPath=$this->getHeaderRenderer();
1230
-				$template=$this->_headerTemplate;
1229
+				$classPath = $this->getHeaderRenderer();
1230
+				$template = $this->_headerTemplate;
1231 1231
 				break;
1232 1232
 			case TListItemType::Footer :
1233
-				$classPath=$this->getFooterRenderer();
1234
-				$template=$this->_footerTemplate;
1233
+				$classPath = $this->getFooterRenderer();
1234
+				$template = $this->_footerTemplate;
1235 1235
 				break;
1236 1236
 			case TListItemType::Separator :
1237
-				$classPath=$this->getSeparatorRenderer();
1238
-				$template=$this->_separatorTemplate;
1237
+				$classPath = $this->getSeparatorRenderer();
1238
+				$template = $this->_separatorTemplate;
1239 1239
 				break;
1240 1240
 			default:
1241
-				throw new TInvalidDataValueException('datalist_itemtype_unknown',$itemType);
1241
+				throw new TInvalidDataValueException('datalist_itemtype_unknown', $itemType);
1242 1242
 		}
1243
-		if($classPath!=='')
1243
+		if ($classPath !== '')
1244 1244
 		{
1245
-			$item=Prado::createComponent($classPath);
1246
-			if($item instanceof IItemDataRenderer)
1245
+			$item = Prado::createComponent($classPath);
1246
+			if ($item instanceof IItemDataRenderer)
1247 1247
 			{
1248 1248
 				$item->setItemIndex($itemIndex);
1249 1249
 				$item->setItemType($itemType);
1250 1250
 			}
1251 1251
 		}
1252
-		else if($template!==null)
1252
+		else if ($template !== null)
1253 1253
 		{
1254
-			$item=new TDataListItem;
1254
+			$item = new TDataListItem;
1255 1255
 			$item->setItemIndex($itemIndex);
1256 1256
 			$item->setItemType($itemType);
1257 1257
 			$template->instantiateIn($item);
1258 1258
 		}
1259 1259
 		else
1260
-			$item=null;
1260
+			$item = null;
1261 1261
 
1262 1262
 		return $item;
1263 1263
 	}
@@ -1267,9 +1267,9 @@  discard block
 block discarded – undo
1267 1267
 	 */
1268 1268
 	protected function createEmptyContent()
1269 1269
 	{
1270
-		if(($classPath=$this->getEmptyRenderer())!=='')
1270
+		if (($classPath = $this->getEmptyRenderer()) !== '')
1271 1271
 			$this->getControls()->add(Prado::createComponent($classPath));
1272
-		else if($this->_emptyTemplate!==null)
1272
+		else if ($this->_emptyTemplate !== null)
1273 1273
 			$this->_emptyTemplate->instantiateIn($this);
1274 1274
 	}
1275 1275
 
@@ -1286,68 +1286,68 @@  discard block
 block discarded – undo
1286 1286
 	 */
1287 1287
 	protected function applyItemStyles()
1288 1288
 	{
1289
-		$itemStyle=$this->getViewState('ItemStyle',null);
1289
+		$itemStyle = $this->getViewState('ItemStyle', null);
1290 1290
 
1291
-		$alternatingItemStyle=$this->getViewState('AlternatingItemStyle',null);
1292
-		if($itemStyle!==null)
1291
+		$alternatingItemStyle = $this->getViewState('AlternatingItemStyle', null);
1292
+		if ($itemStyle !== null)
1293 1293
 		{
1294
-			if($alternatingItemStyle===null)
1295
-				$alternatingItemStyle=$itemStyle;
1294
+			if ($alternatingItemStyle === null)
1295
+				$alternatingItemStyle = $itemStyle;
1296 1296
 			else
1297 1297
 				$alternatingItemStyle->mergeWith($itemStyle);
1298 1298
 		}
1299 1299
 
1300
-		$selectedItemStyle=$this->getViewState('SelectedItemStyle',null);
1300
+		$selectedItemStyle = $this->getViewState('SelectedItemStyle', null);
1301 1301
 
1302
-		$editItemStyle=$this->getViewState('EditItemStyle',null);
1303
-		if($selectedItemStyle!==null)
1302
+		$editItemStyle = $this->getViewState('EditItemStyle', null);
1303
+		if ($selectedItemStyle !== null)
1304 1304
 		{
1305
-			if($editItemStyle===null)
1306
-				$editItemStyle=$selectedItemStyle;
1305
+			if ($editItemStyle === null)
1306
+				$editItemStyle = $selectedItemStyle;
1307 1307
 			else
1308 1308
 				$editItemStyle->mergeWith($selectedItemStyle);
1309 1309
 		}
1310 1310
 
1311 1311
 		// apply header style if any
1312
-		if($this->_header!==null && $this->_header instanceof IStyleable)
1312
+		if ($this->_header !== null && $this->_header instanceof IStyleable)
1313 1313
 		{
1314
-			if($headerStyle=$this->getViewState('HeaderStyle',null))
1314
+			if ($headerStyle = $this->getViewState('HeaderStyle', null))
1315 1315
 				$this->_header->getStyle()->mergeWith($headerStyle);
1316 1316
 		}
1317 1317
 
1318 1318
 		// apply footer style if any
1319
-		if($this->_footer!==null && $this->_footer instanceof IStyleable)
1319
+		if ($this->_footer !== null && $this->_footer instanceof IStyleable)
1320 1320
 		{
1321
-			if($footerStyle=$this->getViewState('FooterStyle',null))
1321
+			if ($footerStyle = $this->getViewState('FooterStyle', null))
1322 1322
 				$this->_footer->getStyle()->mergeWith($footerStyle);
1323 1323
 		}
1324 1324
 
1325
-		$selectedIndex=$this->getSelectedItemIndex();
1326
-		$editIndex=$this->getEditItemIndex();
1325
+		$selectedIndex = $this->getSelectedItemIndex();
1326
+		$editIndex = $this->getEditItemIndex();
1327 1327
 
1328 1328
 		// apply item styles if any
1329
-		foreach($this->getItems() as $index=>$item)
1329
+		foreach ($this->getItems() as $index=>$item)
1330 1330
 		{
1331
-			if($index===$editIndex)
1332
-				$style=$editItemStyle;
1333
-			else if($index===$selectedIndex)
1334
-				$style=$selectedItemStyle;
1335
-			else if($index%2===0)
1336
-				$style=$itemStyle;
1331
+			if ($index === $editIndex)
1332
+				$style = $editItemStyle;
1333
+			else if ($index === $selectedIndex)
1334
+				$style = $selectedItemStyle;
1335
+			else if ($index % 2 === 0)
1336
+				$style = $itemStyle;
1337 1337
 			else
1338
-				$style=$alternatingItemStyle;
1339
-			if($style && $item instanceof IStyleable)
1338
+				$style = $alternatingItemStyle;
1339
+			if ($style && $item instanceof IStyleable)
1340 1340
 				$item->getStyle()->mergeWith($style);
1341 1341
 		}
1342 1342
 
1343 1343
 		// apply separator style if any
1344
-		if(($separatorStyle=$this->getViewState('SeparatorStyle',null))!==null && $this->getHasSeparators())
1344
+		if (($separatorStyle = $this->getViewState('SeparatorStyle', null)) !== null && $this->getHasSeparators())
1345 1345
 		{
1346
-			$controls=$this->getControls();
1347
-			$count=$controls->getCount();
1348
-			for($i=$this->_header?2:1;$i<$count;$i+=2)
1346
+			$controls = $this->getControls();
1347
+			$count = $controls->getCount();
1348
+			for ($i = $this->_header ? 2 : 1; $i < $count; $i += 2)
1349 1349
 			{
1350
-				if(($separator=$controls->itemAt($i)) instanceof IStyleable)
1350
+				if (($separator = $controls->itemAt($i)) instanceof IStyleable)
1351 1351
 					$separator->getStyle()->mergeWith($separatorStyle);
1352 1352
 			}
1353 1353
 		}
@@ -1360,8 +1360,8 @@  discard block
 block discarded – undo
1360 1360
 	public function saveState()
1361 1361
 	{
1362 1362
 		parent::saveState();
1363
-		if($this->_items)
1364
-			$this->setViewState('ItemCount',$this->_items->getCount(),0);
1363
+		if ($this->_items)
1364
+			$this->setViewState('ItemCount', $this->_items->getCount(), 0);
1365 1365
 		else
1366 1366
 			$this->clearViewState('ItemCount');
1367 1367
 	}
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
 	public function loadState()
1374 1374
 	{
1375 1375
 		parent::loadState();
1376
-		if(!$this->getIsDataBound())
1376
+		if (!$this->getIsDataBound())
1377 1377
 			$this->restoreItemsFromViewState();
1378 1378
 		$this->clearViewState('ItemCount');
1379 1379
 	}
@@ -1385,8 +1385,8 @@  discard block
 block discarded – undo
1385 1385
 	{
1386 1386
 		$this->getControls()->clear();
1387 1387
 		$this->getItems()->clear();
1388
-		$this->_header=null;
1389
-		$this->_footer=null;
1388
+		$this->_header = null;
1389
+		$this->_footer = null;
1390 1390
 	}
1391 1391
 
1392 1392
 	/**
@@ -1395,26 +1395,26 @@  discard block
 block discarded – undo
1395 1395
 	protected function restoreItemsFromViewState()
1396 1396
 	{
1397 1397
 		$this->reset();
1398
-		if(($itemCount=$this->getViewState('ItemCount',0))>0)
1398
+		if (($itemCount = $this->getViewState('ItemCount', 0)) > 0)
1399 1399
 		{
1400
-			$items=$this->getItems();
1401
-			$selectedIndex=$this->getSelectedItemIndex();
1402
-			$editIndex=$this->getEditItemIndex();
1403
-			$hasSeparator=$this->_separatorTemplate!==null || $this->getSeparatorRenderer()!=='';
1404
-			$this->_header=$this->createItemInternal(-1,TListItemType::Header);
1405
-			for($i=0;$i<$itemCount;++$i)
1400
+			$items = $this->getItems();
1401
+			$selectedIndex = $this->getSelectedItemIndex();
1402
+			$editIndex = $this->getEditItemIndex();
1403
+			$hasSeparator = $this->_separatorTemplate !== null || $this->getSeparatorRenderer() !== '';
1404
+			$this->_header = $this->createItemInternal(-1, TListItemType::Header);
1405
+			for ($i = 0; $i < $itemCount; ++$i)
1406 1406
 			{
1407
-				if($hasSeparator && $i>0)
1408
-					$this->createItemInternal($i-1,TListItemType::Separator);
1409
-				if($i===$editIndex)
1410
-					$itemType=TListItemType::EditItem;
1411
-				else if($i===$selectedIndex)
1412
-					$itemType=TListItemType::SelectedItem;
1407
+				if ($hasSeparator && $i > 0)
1408
+					$this->createItemInternal($i - 1, TListItemType::Separator);
1409
+				if ($i === $editIndex)
1410
+					$itemType = TListItemType::EditItem;
1411
+				else if ($i === $selectedIndex)
1412
+					$itemType = TListItemType::SelectedItem;
1413 1413
 				else
1414
-					$itemType=$i%2?TListItemType::AlternatingItem : TListItemType::Item;
1415
-				$items->add($this->createItemInternal($i,$itemType));
1414
+					$itemType = $i % 2 ?TListItemType::AlternatingItem : TListItemType::Item;
1415
+				$items->add($this->createItemInternal($i, $itemType));
1416 1416
 			}
1417
-			$this->_footer=$this->createItemInternal(-1,TListItemType::Footer);
1417
+			$this->_footer = $this->createItemInternal(-1, TListItemType::Footer);
1418 1418
 		}
1419 1419
 		else
1420 1420
 			$this->createEmptyContent();
@@ -1430,41 +1430,41 @@  discard block
 block discarded – undo
1430 1430
 	protected function performDataBinding($data)
1431 1431
 	{
1432 1432
 		$this->reset();
1433
-		$keys=$this->getDataKeys();
1433
+		$keys = $this->getDataKeys();
1434 1434
 		$keys->clear();
1435
-		$keyField=$this->getDataKeyField();
1436
-		$itemIndex=0;
1437
-		$items=$this->getItems();
1438
-		$hasSeparator=$this->_separatorTemplate!==null || $this->getSeparatorRenderer()!=='';
1439
-		$selectedIndex=$this->getSelectedItemIndex();
1440
-		$editIndex=$this->getEditItemIndex();
1441
-		foreach($data as $key=>$dataItem)
1435
+		$keyField = $this->getDataKeyField();
1436
+		$itemIndex = 0;
1437
+		$items = $this->getItems();
1438
+		$hasSeparator = $this->_separatorTemplate !== null || $this->getSeparatorRenderer() !== '';
1439
+		$selectedIndex = $this->getSelectedItemIndex();
1440
+		$editIndex = $this->getEditItemIndex();
1441
+		foreach ($data as $key=>$dataItem)
1442 1442
 		{
1443
-			if($keyField!=='')
1444
-				$keys->add($this->getDataFieldValue($dataItem,$keyField));
1443
+			if ($keyField !== '')
1444
+				$keys->add($this->getDataFieldValue($dataItem, $keyField));
1445 1445
 			else
1446 1446
 				$keys->add($key);
1447
-			if($itemIndex===0)
1448
-				$this->_header=$this->createItemWithDataInternal(-1,TListItemType::Header,null);
1449
-			if($hasSeparator && $itemIndex>0)
1450
-				$this->createItemWithDataInternal($itemIndex-1,TListItemType::Separator,null);
1451
-			if($itemIndex===$editIndex)
1452
-				$itemType=TListItemType::EditItem;
1453
-			else if($itemIndex===$selectedIndex)
1454
-				$itemType=TListItemType::SelectedItem;
1447
+			if ($itemIndex === 0)
1448
+				$this->_header = $this->createItemWithDataInternal(-1, TListItemType::Header, null);
1449
+			if ($hasSeparator && $itemIndex > 0)
1450
+				$this->createItemWithDataInternal($itemIndex - 1, TListItemType::Separator, null);
1451
+			if ($itemIndex === $editIndex)
1452
+				$itemType = TListItemType::EditItem;
1453
+			else if ($itemIndex === $selectedIndex)
1454
+				$itemType = TListItemType::SelectedItem;
1455 1455
 			else
1456
-				$itemType=$itemIndex%2?TListItemType::AlternatingItem : TListItemType::Item;
1457
-			$items->add($this->createItemWithDataInternal($itemIndex,$itemType,$dataItem));
1456
+				$itemType = $itemIndex % 2 ?TListItemType::AlternatingItem : TListItemType::Item;
1457
+			$items->add($this->createItemWithDataInternal($itemIndex, $itemType, $dataItem));
1458 1458
 			$itemIndex++;
1459 1459
 		}
1460
-		if($itemIndex>0)
1461
-			$this->_footer=$this->createItemWithDataInternal(-1,TListItemType::Footer,null);
1460
+		if ($itemIndex > 0)
1461
+			$this->_footer = $this->createItemWithDataInternal(-1, TListItemType::Footer, null);
1462 1462
 		else
1463 1463
 		{
1464 1464
 			$this->createEmptyContent();
1465 1465
 			$this->dataBindChildren();
1466 1466
 		}
1467
-		$this->setViewState('ItemCount',$itemIndex,0);
1467
+		$this->setViewState('ItemCount', $itemIndex, 0);
1468 1468
 	}
1469 1469
 
1470 1470
 	/**
@@ -1474,15 +1474,15 @@  discard block
 block discarded – undo
1474 1474
 	 */
1475 1475
 	public function render($writer)
1476 1476
 	{
1477
-		if($this->getHasControls())
1477
+		if ($this->getHasControls())
1478 1478
 		{
1479
-			if($this->getItemCount()>0)
1479
+			if ($this->getItemCount() > 0)
1480 1480
 			{
1481 1481
 				$this->applyItemStyles();
1482
-				$repeatInfo=$this->getRepeatInfo();
1483
-				$repeatInfo->renderRepeater($writer,$this);
1482
+				$repeatInfo = $this->getRepeatInfo();
1483
+				$repeatInfo->renderRepeater($writer, $this);
1484 1484
 			}
1485
-			else if($this->_emptyTemplate!==null || $this->getEmptyRenderer()!=='')
1485
+			else if ($this->_emptyTemplate !== null || $this->getEmptyRenderer() !== '')
1486 1486
 				parent::render($writer);
1487 1487
 		}
1488 1488
 	}
@@ -1506,7 +1506,7 @@  discard block
 block discarded – undo
1506 1506
 	 * The datalist item control responsible for the event.
1507 1507
 	 * @var TControl
1508 1508
 	 */
1509
-	private $_item=null;
1509
+	private $_item = null;
1510 1510
 
1511 1511
 	/**
1512 1512
 	 * Constructor.
@@ -1514,7 +1514,7 @@  discard block
 block discarded – undo
1514 1514
 	 */
1515 1515
 	public function __construct($item)
1516 1516
 	{
1517
-		$this->_item=$item;
1517
+		$this->_item = $item;
1518 1518
 	}
1519 1519
 
1520 1520
 	/**
@@ -1545,11 +1545,11 @@  discard block
 block discarded – undo
1545 1545
 	/**
1546 1546
 	 * @var TControl the datalist item control responsible for the event.
1547 1547
 	 */
1548
-	private $_item=null;
1548
+	private $_item = null;
1549 1549
 	/**
1550 1550
 	 * @var TControl the control originally raises the <b>OnCommand</b> event.
1551 1551
 	 */
1552
-	private $_source=null;
1552
+	private $_source = null;
1553 1553
 
1554 1554
 	/**
1555 1555
 	 * Constructor.
@@ -1557,11 +1557,11 @@  discard block
 block discarded – undo
1557 1557
 	 * @param TControl original event sender
1558 1558
 	 * @param TCommandEventParameter original event parameter
1559 1559
 	 */
1560
-	public function __construct($item,$source,TCommandEventParameter $param)
1560
+	public function __construct($item, $source, TCommandEventParameter $param)
1561 1561
 	{
1562
-		$this->_item=$item;
1563
-		$this->_source=$source;
1564
-		parent::__construct($param->getCommandName(),$param->getCommandParameter());
1562
+		$this->_item = $item;
1563
+		$this->_source = $source;
1564
+		parent::__construct($param->getCommandName(), $param->getCommandParameter());
1565 1565
 	}
1566 1566
 
1567 1567
 	/**
@@ -1611,7 +1611,7 @@  discard block
 block discarded – undo
1611 1611
 	 */
1612 1612
 	private $_data;
1613 1613
 
1614
-	private $_tagName='span';
1614
+	private $_tagName = 'span';
1615 1615
 
1616 1616
 	/**
1617 1617
 	 * Returns the tag name used for this control.
@@ -1627,7 +1627,7 @@  discard block
 block discarded – undo
1627 1627
 	 */
1628 1628
 	public function setTagName($value)
1629 1629
 	{
1630
-		$this->_tagName=$value;
1630
+		$this->_tagName = $value;
1631 1631
 	}
1632 1632
 
1633 1633
 	/**
@@ -1653,7 +1653,7 @@  discard block
 block discarded – undo
1653 1653
 	 */
1654 1654
 	public function setItemType($value)
1655 1655
 	{
1656
-		$this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType');
1656
+		$this->_itemType = TPropertyValue::ensureEnum($value, 'TListItemType');
1657 1657
 	}
1658 1658
 
1659 1659
 	/**
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
 	 */
1672 1672
 	public function setItemIndex($value)
1673 1673
 	{
1674
-		$this->_itemIndex=TPropertyValue::ensureInteger($value);
1674
+		$this->_itemIndex = TPropertyValue::ensureInteger($value);
1675 1675
 	}
1676 1676
 
1677 1677
 	/**
@@ -1689,7 +1689,7 @@  discard block
 block discarded – undo
1689 1689
 	 */
1690 1690
 	public function setData($value)
1691 1691
 	{
1692
-		$this->_data=$value;
1692
+		$this->_data = $value;
1693 1693
 	}
1694 1694
 
1695 1695
 	/**
@@ -1719,11 +1719,11 @@  discard block
 block discarded – undo
1719 1719
 	 * @param TEventParameter event parameter
1720 1720
 	 * @return boolean whether the event bubbling should stop here.
1721 1721
 	 */
1722
-	public function bubbleEvent($sender,$param)
1722
+	public function bubbleEvent($sender, $param)
1723 1723
 	{
1724
-		if($param instanceof TCommandEventParameter)
1724
+		if ($param instanceof TCommandEventParameter)
1725 1725
 		{
1726
-			$this->raiseBubbleEvent($this,new TDataListCommandEventParameter($this,$sender,$param));
1726
+			$this->raiseBubbleEvent($this, new TDataListCommandEventParameter($this, $sender, $param));
1727 1727
 			return true;
1728 1728
 		}
1729 1729
 		else
@@ -1749,10 +1749,10 @@  discard block
 block discarded – undo
1749 1749
 	 * @param mixed new item
1750 1750
 	 * @throws TInvalidDataTypeException if the item to be inserted is not a TControl descendant.
1751 1751
 	 */
1752
-	public function insertAt($index,$item)
1752
+	public function insertAt($index, $item)
1753 1753
 	{
1754
-		if($item instanceof TControl)
1755
-			parent::insertAt($index,$item);
1754
+		if ($item instanceof TControl)
1755
+			parent::insertAt($index, $item);
1756 1756
 		else
1757 1757
 			throw new TInvalidDataTypeException('datalistitemcollection_datalistitem_required');
1758 1758
 	}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDataTypeValidator.php 4 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -82,6 +82,7 @@
 block discarded – undo
82 82
 	/**
83 83
 	 * Determine if the given value is of a particular type using RegExp.
84 84
 	 * @param string value to check
85
+	 * @param string $value
85 86
 	 * @return boolean true if value fits the type expression.
86 87
 	 */
87 88
 	protected function evaluateDataTypeCheck($value)
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,9 +62,9 @@
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	/**
65
-     * Sets the date format for a date validation
66
-     * @param string the date format value
67
-     */
65
+	 * Sets the date format for a date validation
66
+	 * @param string the date format value
67
+	 */
68 68
 	public function setDateFormat($value)
69 69
 	{
70 70
 		$this->setViewState('DateFormat', $value, '');
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 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
 	/**
@@ -86,20 +86,20 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	protected function evaluateDataTypeCheck($value)
88 88
 	{
89
-		if($value=='')
89
+		if ($value == '')
90 90
 			return true;
91 91
 
92
-		switch($this->getDataType())
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 99
 				$dateFormat = $this->getDateFormat();
100
-				if(strlen($dateFormat))
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
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
 	protected function getClientScriptOptions()
116 116
 	{
117 117
 		$options = parent::getClientScriptOptions();
118
-		$options['DataType']=$this->getDataType();
119
-		if(($dateFormat=$this->getDateFormat())!=='')
120
-			$options['DateFormat']=$dateFormat;
118
+		$options['DataType'] = $this->getDataType();
119
+		if (($dateFormat = $this->getDateFormat()) !== '')
120
+			$options['DateFormat'] = $dateFormat;
121 121
 		return $options;
122 122
 	}
123 123
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	public function evaluateIsValid()
132 132
 	{
133
-		if(($value=$this->getValidationValue($this->getValidationTarget()))==='')
133
+		if (($value = $this->getValidationValue($this->getValidationTarget())) === '')
134 134
 			return true;
135 135
 
136 136
 		return $this->evaluateDataTypeCheck($value);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,8 +101,7 @@
 block discarded – undo
101 101
 				{
102 102
 					$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$dateFormat);
103 103
 					return $formatter->isValidDate($value);
104
-				}
105
-				else
104
+				} else
106 105
 					return strtotime($value) > 0;
107 106
 		}
108 107
 		return true;
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDatePicker.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -106,6 +106,7 @@  discard block
 block discarded – undo
106 106
 	/**
107 107
 	 * Sets the format of the date string.
108 108
 	 * @param string the format of the date string
109
+	 * @param string $value
109 110
 	 */
110 111
 	public function setDateFormat($value)
111 112
 	{
@@ -245,6 +246,7 @@  discard block
 block discarded – undo
245 246
 
246 247
 	/**
247 248
 	 * @param integer date picker starting year, default is 2000.
249
+	 * @param integer $value
248 250
 	 */
249 251
 	public function setFromYear($value)
250 252
 	{
@@ -354,6 +356,7 @@  discard block
 block discarded – undo
354 356
 
355 357
 	/**
356 358
 	 * @param string date string
359
+	 * @param string $value
357 360
 	 */
358 361
 	public function setDate($value)
359 362
 	{
@@ -731,6 +734,7 @@  discard block
 block discarded – undo
731 734
 	 * "MMMM" will return the month names, "MM" or "MMM" return abbr. month names
732 735
 	 * and "M" return month digits.
733 736
 	 * @param DateTimeFormatInfo localized date format information.
737
+	 * @param DateTimeFormatInfo $info
734 738
 	 * @return array localized month names.
735 739
 	 */
736 740
 	protected function getLocalizedMonthNames($info)
Please login to merge, or discard this patch.
Braces   +11 added lines, -9 removed lines patch added patch discarded remove patch
@@ -420,8 +420,7 @@  discard block
 block discarded – undo
420 420
 		{
421 421
 			parent::render($writer);
422 422
 			$this->renderDatePickerButtons($writer);
423
-		}
424
-		else
423
+		} else
425 424
 		{
426 425
 			$this->renderDropDownListCalendar($writer);
427 426
 			if($this->hasDayPattern())
@@ -468,8 +467,7 @@  discard block
 block discarded – undo
468 467
 		{
469 468
 			$this->setText($value);
470 469
 			return true;
471
-		}
472
-		else
470
+		} else
473 471
 			return false;
474 472
 	}
475 473
 
@@ -742,11 +740,14 @@  discard block
 block discarded – undo
742 740
 			case 'MMM': return $info->getAbbreviatedMonthNames();
743 741
 			case 'MM':
744 742
 				$array = array();
745
-				for($i=1;$i<=12;$i++)
746
-						$array[$i-1] = $i < 10 ? '0'.$i : $i;
743
+				for($i=1;$i<=12;$i++) {
744
+										$array[$i-1] = $i < 10 ? '0'.$i : $i;
745
+				}
747 746
 				return $array;
748 747
 			case 'M':
749
-				$array = array(); for($i=1;$i<=12;$i++) $array[$i-1] = $i;
748
+				$array = array(); for($i=1;$i<=12;$i++) {
749
+					$array[$i-1] = $i;
750
+				}
750 751
 				return $array;
751 752
 			default :	return $info->getMonthNames();
752 753
 		}
@@ -760,8 +761,9 @@  discard block
 block discarded – undo
760 761
 	protected function renderCalendarYearOptions($writer, $selected=null)
761 762
 	{
762 763
 		$years = array();
763
-		for($i = $this->getFromYear(); $i <= $this->getUpToYear(); $i++)
764
-			$years[$i] = $i;
764
+		for($i = $this->getFromYear(); $i <= $this->getUpToYear(); $i++) {
765
+					$years[$i] = $i;
766
+		}
765 767
 		$writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'year');
766 768
 		$writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'year');
767 769
 		$writer->addAttribute('class', 'datepicker_year_options');
Please login to merge, or discard this patch.
Spacing   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	public function getDateFormat()
102 102
 	{
103
-		return $this->getViewState('DateFormat','dd-MM-yyyy');
103
+		return $this->getViewState('DateFormat', 'dd-MM-yyyy');
104 104
 	}
105 105
 
106 106
 	/**
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	public function setDateFormat($value)
111 111
 	{
112
-		$this->setViewState('DateFormat',$value,'dd-MM-yyyy');
112
+		$this->setViewState('DateFormat', $value, 'dd-MM-yyyy');
113 113
 	}
114 114
 
115 115
 	/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	public function getShowCalendar()
119 119
 	{
120
-		return $this->getViewState('ShowCalendar',true);
120
+		return $this->getViewState('ShowCalendar', true);
121 121
 	}
122 122
 
123 123
 	/**
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 */
127 127
 	public function setShowCalendar($value)
128 128
 	{
129
-		$this->setViewState('ShowCalendar',TPropertyValue::ensureBoolean($value),true);
129
+		$this->setViewState('ShowCalendar', TPropertyValue::ensureBoolean($value), true);
130 130
 	}
131 131
 
132 132
 	/**
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	 */
249 249
 	public function setFromYear($value)
250 250
 	{
251
-		$this->setViewState('FromYear', TPropertyValue::ensureInteger($value), intval(@date('Y'))-5);
251
+		$this->setViewState('FromYear', TPropertyValue::ensureInteger($value), intval(@date('Y')) - 5);
252 252
 	}
253 253
 
254 254
 	/**
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 	 */
257 257
 	public function getFromYear()
258 258
 	{
259
-		return $this->getViewState('FromYear', intval(@date('Y'))-5);
259
+		return $this->getViewState('FromYear', intval(@date('Y')) - 5);
260 260
 	}
261 261
 
262 262
 	/**
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 	 */
265 265
 	public function setUpToYear($value)
266 266
 	{
267
-		$this->setViewState('UpToYear', TPropertyValue::ensureInteger($value), intval(@date('Y'))+10);
267
+		$this->setViewState('UpToYear', TPropertyValue::ensureInteger($value), intval(@date('Y')) + 10);
268 268
 	}
269 269
 
270 270
 	/**
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 	 */
273 273
 	public function getUpToYear()
274 274
 	{
275
-		return $this->getViewState('UpToYear', intval(@date('Y'))+10);
275
+		return $this->getViewState('UpToYear', intval(@date('Y')) + 10);
276 276
 	}
277 277
 
278 278
 	/**
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	 */
297 297
 	public function getTimeStamp()
298 298
 	{
299
-		if(trim($this->getText())==='')
299
+		if (trim($this->getText()) === '')
300 300
 			return null;
301 301
 		else
302 302
 			return $this->getTimeStampFromText();
@@ -308,12 +308,12 @@  discard block
 block discarded – undo
308 308
 	 */
309 309
 	public function setTimeStamp($value)
310 310
 	{
311
-		if($value===null || (is_string($value) && trim($value)===''))
311
+		if ($value === null || (is_string($value) && trim($value) === ''))
312 312
 			$this->setText('');
313 313
 		else
314 314
 		{
315 315
 			$date = TPropertyValue::ensureFloat($value);
316
-			$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$this->getDateFormat());
316
+			$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', $this->getDateFormat());
317 317
 			$this->setText($formatter->format($date));
318 318
 		}
319 319
 	}
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 	 */
373 373
 	public function getClientSide()
374 374
 	{
375
-		if($this->_clientScript===null)
375
+		if ($this->_clientScript === null)
376 376
 			$this->_clientScript = $this->createClientScript();
377 377
 		return $this->_clientScript;
378 378
 	}
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 	 */
393 393
 	public function getValidationPropertyValue()
394 394
 	{
395
-		if(($text = $this->getText()) === '')
395
+		if (($text = $this->getText()) === '')
396 396
 			return '';
397 397
 		$date = $this->getTimeStamp();
398 398
 		return $date == null ? $text : $date;
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 	 */
417 417
 	public function render($writer)
418 418
 	{
419
-		if($this->getInputMode() == TDatePickerInputMode::TextBox)
419
+		if ($this->getInputMode() == TDatePickerInputMode::TextBox)
420 420
 		{
421 421
 			parent::render($writer);
422 422
 			$this->renderDatePickerButtons($writer);
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 		else
425 425
 		{
426 426
 			$this->renderDropDownListCalendar($writer);
427
-			if($this->hasDayPattern())
427
+			if ($this->hasDayPattern())
428 428
 			{
429 429
 				$this->renderClientControlScript($writer);
430 430
 				$this->renderDatePickerButtons($writer);
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 	 */
438 438
 	protected function renderDatePickerButtons($writer)
439 439
 	{
440
-		if($this->getShowCalendar())
440
+		if ($this->getShowCalendar())
441 441
 		{
442 442
 			switch ($this->getMode())
443 443
 			{
@@ -459,12 +459,12 @@  discard block
 block discarded – undo
459 459
 	 * @param array the input data collection
460 460
 	 * @return boolean whether the data of the component has been changed
461 461
 	 */
462
-	public function loadPostData($key,$values)
462
+	public function loadPostData($key, $values)
463 463
 	{
464
-		if($this->getInputMode() == TDatePickerInputMode::TextBox)
464
+		if ($this->getInputMode() == TDatePickerInputMode::TextBox)
465 465
 			return parent::loadPostData($key, $values);
466 466
 		$value = $this->getDateFromPostData($key, $values);
467
-		if(!$this->getReadOnly() && $this->getText()!==$value)
467
+		if (!$this->getReadOnly() && $this->getText() !== $value)
468 468
 		{
469 469
 			$this->setText($value);
470 470
 			return true;
@@ -484,26 +484,26 @@  discard block
 block discarded – undo
484 484
 		$date = @getdate();
485 485
 
486 486
 		$pattern = $this->getDateFormat();
487
-		$pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern);
487
+		$pattern = str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern);
488 488
 		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern);
489 489
 
490 490
 		$order = $formatter->getDayMonthYearOrdering();
491 491
 
492
-		if(isset($values[$key.'$day'])) {
493
-			$day = intval($values[$key.'$day']);
494
-		} elseif(in_array('day', $order)) {
492
+		if (isset($values[$key . '$day'])) {
493
+			$day = intval($values[$key . '$day']);
494
+		} elseif (in_array('day', $order)) {
495 495
 			$day = $date['mday'];
496 496
 		} else {
497 497
 			$day = 1;
498 498
 		}
499 499
 
500
-		if(isset($values[$key.'$month']))
501
-			$month = intval($values[$key.'$month']) + 1;
500
+		if (isset($values[$key . '$month']))
501
+			$month = intval($values[$key . '$month']) + 1;
502 502
 		else
503 503
 			$month = $date['mon'];
504 504
 
505
-		if(isset($values[$key.'$year']))
506
-			$year = intval($values[$key.'$year']);
505
+		if (isset($values[$key . '$year']))
506
+			$year = intval($values[$key . '$year']);
507 507
 		else
508 508
 			$year = $date['year'];
509 509
 
@@ -524,12 +524,12 @@  discard block
 block discarded – undo
524 524
 		$options['InputMode'] = $this->getInputMode();
525 525
 		$options['Format'] = $this->getDateFormat();
526 526
 		$options['FirstDayOfWeek'] = $this->getFirstDayOfWeek();
527
-		if(($cssClass=$this->getCssClass())!=='')
527
+		if (($cssClass = $this->getCssClass()) !== '')
528 528
 			$options['ClassName'] = $cssClass;
529 529
 		$options['CalendarStyle'] = $this->getCalendarStyle();
530 530
 		$options['FromYear'] = $this->getFromYear();
531 531
 		$options['UpToYear'] = $this->getUpToYear();
532
-		switch($this->getMode())
532
+		switch ($this->getMode())
533 533
 		{
534 534
 			case TDatePickerMode::Basic:
535 535
 				break;
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 		$options['PositionMode'] = $this->getPositionMode();
544 544
 
545 545
 		$options = array_merge($options, $this->getCulturalOptions());
546
-		if($this->_clientScript!==null)
546
+		if ($this->_clientScript !== null)
547 547
 			$options = array_merge($options,
548 548
 				$this->_clientScript->getOptions()->toArray());
549 549
 		return $options;
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 	 */
556 556
 	protected function getCulturalOptions()
557 557
 	{
558
-		if($this->getCurrentCulture() == 'en')
558
+		if ($this->getCurrentCulture() == 'en')
559 559
 			return array();
560 560
 
561 561
 		$date = $this->getLocalizedCalendarInfo();
@@ -593,14 +593,14 @@  discard block
 block discarded – undo
593 593
 	 */
594 594
 	protected function renderDropDownListCalendar($writer)
595 595
 	{
596
-		if($this->getMode() == TDatePickerMode::Basic)
596
+		if ($this->getMode() == TDatePickerMode::Basic)
597 597
 			$this->setMode(TDatePickerMode::ImageButton);
598 598
 		parent::addAttributesToRender($writer);
599 599
 		$writer->removeAttribute('name');
600 600
 		$writer->removeAttribute('type');
601 601
 		$writer->addAttribute('id', $this->getClientID());
602 602
 
603
-		if(strlen($class = $this->getCssClass()) > 0)
603
+		if (strlen($class = $this->getCssClass()) > 0)
604 604
 			$writer->addAttribute('class', $class);
605 605
 		$writer->renderBeginTag('span');
606 606
 
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 	{
625 625
 		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',
626 626
 						$this->getDateFormat());
627
-		return ($formatter->getDayPattern()!==null);
627
+		return ($formatter->getDayPattern() !== null);
628 628
 	}
629 629
 
630 630
 	/**
@@ -637,14 +637,14 @@  discard block
 block discarded – undo
637 637
 		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',
638 638
 						$this->getDateFormat());
639 639
 
640
-		foreach($formatter->getDayMonthYearOrdering() as $type)
640
+		foreach ($formatter->getDayMonthYearOrdering() as $type)
641 641
 		{
642
-			if($type == 'day')
643
-				$this->renderCalendarDayOptions($writer,$date['mday']);
644
-			elseif($type == 'month')
645
-				$this->renderCalendarMonthOptions($writer,$date['mon']);
646
-			elseif($type == 'year')
647
-				$this->renderCalendarYearOptions($writer,$date['year']);
642
+			if ($type == 'day')
643
+				$this->renderCalendarDayOptions($writer, $date['mday']);
644
+			elseif ($type == 'month')
645
+				$this->renderCalendarMonthOptions($writer, $date['mon']);
646
+			elseif ($type == 'year')
647
+				$this->renderCalendarYearOptions($writer, $date['year']);
648 648
 		}
649 649
 	}
650 650
 
@@ -655,8 +655,8 @@  discard block
 block discarded – undo
655 655
 	protected function getTimeStampFromText()
656 656
 	{
657 657
 		$pattern = $this->getDateFormat();
658
-		$pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern);
659
-		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$pattern);
658
+		$pattern = str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern);
659
+		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern);
660 660
 		return $formatter->parse($this->getText());
661 661
 	}
662 662
 
@@ -666,12 +666,12 @@  discard block
 block discarded – undo
666 666
 	 * @param array list of selection options
667 667
 	 * @param mixed selected key.
668 668
 	 */
669
-	private function renderDropDownListOptions($writer,$options,$selected=null)
669
+	private function renderDropDownListOptions($writer, $options, $selected = null)
670 670
 	{
671
-		foreach($options as $k => $v)
671
+		foreach ($options as $k => $v)
672 672
 		{
673 673
 			$writer->addAttribute('value', $k);
674
-			if($k == $selected)
674
+			if ($k == $selected)
675 675
 				$writer->addAttribute('selected', 'selected');
676 676
 			$writer->renderBeginTag('option');
677 677
 			$writer->write($v);
@@ -684,13 +684,13 @@  discard block
 block discarded – undo
684 684
 	 * @param THtmlWriter the writer used for the rendering purpose
685 685
 	 * @param mixed selected day.
686 686
 	 */
687
-	protected function renderCalendarDayOptions($writer, $selected=null)
687
+	protected function renderCalendarDayOptions($writer, $selected = null)
688 688
 	{
689 689
 		$days = $this->getDropDownDayOptions();
690
-		$writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'day');
691
-		$writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'day');
690
+		$writer->addAttribute('id', $this->getClientID() . TControl::CLIENT_ID_SEPARATOR . 'day');
691
+		$writer->addAttribute('name', $this->getUniqueID() . TControl::ID_SEPARATOR . 'day');
692 692
 		$writer->addAttribute('class', 'datepicker_day_options');
693
-		if($this->getReadOnly() || !$this->getEnabled(true))
693
+		if ($this->getReadOnly() || !$this->getEnabled(true))
694 694
 			$writer->addAttribute('disabled', 'disabled');
695 695
 		$writer->renderBeginTag('select');
696 696
 		$this->renderDropDownListOptions($writer, $days, $selected);
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 						$this->getDateFormat());
707 707
 		$days = array();
708 708
 		$requiresPadding = $formatter->getDayPattern() === 'dd';
709
-		for($i=1;$i<=31;$i++)
709
+		for ($i = 1; $i <= 31; $i++)
710 710
 		{
711 711
 			$days[$i] = $requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i;
712 712
 		}
@@ -718,17 +718,17 @@  discard block
 block discarded – undo
718 718
 	 * @param THtmlWriter the writer used for the rendering purpose
719 719
 	 * @param mixed selected month.
720 720
 	 */
721
-	protected function renderCalendarMonthOptions($writer, $selected=null)
721
+	protected function renderCalendarMonthOptions($writer, $selected = null)
722 722
 	{
723 723
 		$info = $this->getLocalizedCalendarInfo();
724
-		$writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'month');
725
-		$writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'month');
724
+		$writer->addAttribute('id', $this->getClientID() . TControl::CLIENT_ID_SEPARATOR . 'month');
725
+		$writer->addAttribute('name', $this->getUniqueID() . TControl::ID_SEPARATOR . 'month');
726 726
 		$writer->addAttribute('class', 'datepicker_month_options');
727
-		if($this->getReadOnly() || !$this->getEnabled(true))
727
+		if ($this->getReadOnly() || !$this->getEnabled(true))
728 728
 			$writer->addAttribute('disabled', 'disabled');
729 729
 		$writer->renderBeginTag('select');
730 730
 		$this->renderDropDownListOptions($writer,
731
-					$this->getLocalizedMonthNames($info), $selected-1);
731
+					$this->getLocalizedMonthNames($info), $selected - 1);
732 732
 		$writer->renderEndTag();
733 733
 	}
734 734
 
@@ -743,16 +743,16 @@  discard block
 block discarded – undo
743 743
 	{
744 744
 		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',
745 745
 						$this->getDateFormat());
746
-		switch($formatter->getMonthPattern())
746
+		switch ($formatter->getMonthPattern())
747 747
 		{
748 748
 			case 'MMM': return $info->getAbbreviatedMonthNames();
749 749
 			case 'MM':
750 750
 				$array = array();
751
-				for($i=1;$i<=12;$i++)
752
-						$array[$i-1] = $i < 10 ? '0'.$i : $i;
751
+				for ($i = 1; $i <= 12; $i++)
752
+						$array[$i - 1] = $i < 10 ? '0' . $i : $i;
753 753
 				return $array;
754 754
 			case 'M':
755
-				$array = array(); for($i=1;$i<=12;$i++) $array[$i-1] = $i;
755
+				$array = array(); for ($i = 1; $i <= 12; $i++) $array[$i - 1] = $i;
756 756
 				return $array;
757 757
 			default :	return $info->getMonthNames();
758 758
 		}
@@ -763,15 +763,15 @@  discard block
 block discarded – undo
763 763
 	 * @param THtmlWriter the writer used for the rendering purpose
764 764
 	 * @param mixed selected year.
765 765
 	 */
766
-	protected function renderCalendarYearOptions($writer, $selected=null)
766
+	protected function renderCalendarYearOptions($writer, $selected = null)
767 767
 	{
768 768
 		$years = array();
769
-		for($i = $this->getFromYear(); $i <= $this->getUpToYear(); $i++)
769
+		for ($i = $this->getFromYear(); $i <= $this->getUpToYear(); $i++)
770 770
 			$years[$i] = $i;
771
-		$writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'year');
772
-		$writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'year');
771
+		$writer->addAttribute('id', $this->getClientID() . TControl::CLIENT_ID_SEPARATOR . 'year');
772
+		$writer->addAttribute('name', $this->getUniqueID() . TControl::ID_SEPARATOR . 'year');
773 773
 		$writer->addAttribute('class', 'datepicker_year_options');
774
-		if($this->getReadOnly() || !$this->getEnabled(true))
774
+		if ($this->getReadOnly() || !$this->getEnabled(true))
775 775
 			$writer->addAttribute('disabled', 'disabled');
776 776
 		$writer->renderBeginTag('select');
777 777
 		$this->renderDropDownListOptions($writer, $years, $selected);
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 	 */
785 785
 	protected function getDatePickerButtonID()
786 786
 	{
787
-		return $this->getClientID().'button';
787
+		return $this->getClientID() . 'button';
788 788
 	}
789 789
 
790 790
 	/**
@@ -795,9 +795,9 @@  discard block
 block discarded – undo
795 795
 	{
796 796
 		$writer->addAttribute('id', $this->getDatePickerButtonID());
797 797
 		$writer->addAttribute('type', 'button');
798
-		$writer->addAttribute('class', $this->getCssClass().' TDatePickerButton');
799
-		$writer->addAttribute('value',$this->getButtonText());
800
-		if(!$this->getEnabled(true))
798
+		$writer->addAttribute('class', $this->getCssClass() . ' TDatePickerButton');
799
+		$writer->addAttribute('value', $this->getButtonText());
800
+		if (!$this->getEnabled(true))
801 801
 			$writer->addAttribute('disabled', 'disabled');
802 802
 		$writer->renderBeginTag("input");
803 803
 		$writer->renderEndTag();
@@ -814,8 +814,8 @@  discard block
 block discarded – undo
814 814
 		$writer->addAttribute('id', $this->getDatePickerButtonID());
815 815
 		$writer->addAttribute('src', $url);
816 816
 		$writer->addAttribute('alt', ' ');
817
-		$writer->addAttribute('class', $this->getCssClass().' TDatePickerImageButton');
818
-		if(!$this->getEnabled(true))
817
+		$writer->addAttribute('class', $this->getCssClass() . ' TDatePickerImageButton');
818
+		if (!$this->getEnabled(true))
819 819
 			$writer->addAttribute('disabled', 'disabled');
820 820
 		$writer->addAttribute('type', 'image');
821 821
 		$writer->addAttribute('onclick', 'return false;');
@@ -827,10 +827,10 @@  discard block
 block discarded – undo
827 827
 	 * @param string date picker asset file in the self::SCRIPT_PATH directory.
828 828
 	 * @return string date picker asset url.
829 829
 	 */
830
-	protected function getAssetUrl($file='')
830
+	protected function getAssetUrl($file = '')
831 831
 	{
832 832
 		$base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl();
833
-		return $base.'/'.self::SCRIPT_PATH.'/'.$file;
833
+		return $base . '/' . self::SCRIPT_PATH . '/' . $file;
834 834
 	}
835 835
 
836 836
 	/**
@@ -839,9 +839,9 @@  discard block
 block discarded – undo
839 839
 	 */
840 840
 	protected function publishCalendarStyle()
841 841
 	{
842
-		$url = $this->getAssetUrl($this->getCalendarStyle().'.css');
842
+		$url = $this->getAssetUrl($this->getCalendarStyle() . '.css');
843 843
 		$cs = $this->getPage()->getClientScript();
844
-		if(!$cs->isStyleSheetFileRegistered($url))
844
+		if (!$cs->isStyleSheetFileRegistered($url))
845 845
 			$cs->registerStyleSheetFile($url, $url);
846 846
 		return $url;
847 847
 	}
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
 	protected function addAttributesToRender($writer)
854 854
 	{
855 855
 		parent::addAttributesToRender($writer);
856
-		$writer->addAttribute('id',$this->getClientID());
856
+		$writer->addAttribute('id', $this->getClientID());
857 857
 	}
858 858
 
859 859
 	/**
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 	 */
862 862
 	protected function registerCalendarClientScriptPre()
863 863
 	{
864
-		if($this->getShowCalendar())
864
+		if ($this->getShowCalendar())
865 865
 		{
866 866
 			$cs = $this->getPage()->getClientScript();
867 867
 			$cs->registerPradoScript("datepicker");
@@ -870,10 +870,10 @@  discard block
 block discarded – undo
870 870
 
871 871
 	protected function renderClientControlScript($writer)
872 872
 	{
873
-		if($this->getShowCalendar())
873
+		if ($this->getShowCalendar())
874 874
 		{
875 875
 			$cs = $this->getPage()->getClientScript();
876
-			if(!$cs->isEndScriptRegistered('TDatePicker.spacer'))
876
+			if (!$cs->isEndScriptRegistered('TDatePicker.spacer'))
877 877
 			{
878 878
 				$spacer = $this->getAssetUrl('spacer.gif');
879 879
 				$code = "Prado.WebUI.TDatePicker.spacer = '$spacer';";
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
 
883 883
 			$options = TJavaScript::encode($this->getDatePickerOptions());
884 884
 			$code = "new Prado.WebUI.TDatePicker($options);";
885
-			$cs->registerEndScript("prado:".$this->getClientID(), $code);
885
+			$cs->registerEndScript("prado:" . $this->getClientID(), $code);
886 886
 		}
887 887
 	}
888 888
 }
@@ -938,8 +938,8 @@  discard block
 block discarded – undo
938 938
  */
939 939
 class TDatePickerInputMode extends TEnumerable
940 940
 {
941
-	const TextBox='TextBox';
942
-	const DropDownList='DropDownList';
941
+	const TextBox = 'TextBox';
942
+	const DropDownList = 'DropDownList';
943 943
 }
944 944
 
945 945
 /**
@@ -959,10 +959,10 @@  discard block
 block discarded – undo
959 959
  */
960 960
 class TDatePickerMode extends TEnumerable
961 961
 {
962
-	const Basic='Basic';
963
-	const Clickable='Clickable';
964
-	const Button='Button';
965
-	const ImageButton='ImageButton';
962
+	const Basic = 'Basic';
963
+	const Clickable = 'Clickable';
964
+	const Button = 'Button';
965
+	const ImageButton = 'ImageButton';
966 966
 }
967 967
 
968 968
 /**
@@ -979,6 +979,6 @@  discard block
 block discarded – undo
979 979
  */
980 980
 class TDatePickerPositionMode extends TEnumerable
981 981
 {
982
-	const Top='Top';
983
-	const Bottom='Bottom';
982
+	const Top = 'Top';
983
+	const Bottom = 'Bottom';
984 984
 }
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TEditCommandColumn.php 3 patches
Doc Comments   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -234,7 +234,11 @@
 block discarded – undo
234 234
 	 * @param string button caption
235 235
 	 * @param boolean whether the button should cause validation
236 236
 	 * @param string the validation group that the button belongs to
237
-	 * @return mixed the newly created button.
237
+	 * @param string $commandName
238
+	 * @param string $text
239
+	 * @param boolean $causesValidation
240
+	 * @param string $validationGroup
241
+	 * @return TComponent the newly created button.
238 242
 	 */
239 243
 	protected function createButton($commandName,$text,$causesValidation,$validationGroup)
240 244
 	{
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 */
57 57
 	public function getButtonType()
58 58
 	{
59
-		return $this->getViewState('ButtonType',TButtonColumnType::LinkButton);
59
+		return $this->getViewState('ButtonType', TButtonColumnType::LinkButton);
60 60
 	}
61 61
 
62 62
 	/**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public function setButtonType($value)
66 66
 	{
67
-		$this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'TButtonColumnType'),TButtonColumnType::LinkButton);
67
+		$this->setViewState('ButtonType', TPropertyValue::ensureEnum($value, 'TButtonColumnType'), TButtonColumnType::LinkButton);
68 68
 	}
69 69
 
70 70
 	/**
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	public function getEditText()
74 74
 	{
75
-		return $this->getViewState('EditText','Edit');
75
+		return $this->getViewState('EditText', 'Edit');
76 76
 	}
77 77
 
78 78
 	/**
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public function setEditText($value)
82 82
 	{
83
-		$this->setViewState('EditText',$value,'Edit');
83
+		$this->setViewState('EditText', $value, 'Edit');
84 84
 	}
85 85
 
86 86
 	/**
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function getEditImageUrl()
90 90
 	{
91
-		return $this->getViewState('EditImageUrl','');
91
+		return $this->getViewState('EditImageUrl', '');
92 92
 	}
93 93
 
94 94
 	/**
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	public function setEditImageUrl($value)
98 98
 	{
99
-		$this->setViewState('EditImageUrl',$value,'');
99
+		$this->setViewState('EditImageUrl', $value, '');
100 100
 	}
101 101
 
102 102
 	/**
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	 */
105 105
 	public function getUpdateText()
106 106
 	{
107
-		return $this->getViewState('UpdateText','Update');
107
+		return $this->getViewState('UpdateText', 'Update');
108 108
 	}
109 109
 
110 110
 	/**
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	 */
113 113
 	public function setUpdateText($value)
114 114
 	{
115
-		$this->setViewState('UpdateText',$value,'Update');
115
+		$this->setViewState('UpdateText', $value, 'Update');
116 116
 	}
117 117
 
118 118
 	/**
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	public function getUpdateImageUrl()
122 122
 	{
123
-		return $this->getViewState('UpdateImageUrl','');
123
+		return $this->getViewState('UpdateImageUrl', '');
124 124
 	}
125 125
 
126 126
 	/**
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 */
129 129
 	public function setUpdateImageUrl($value)
130 130
 	{
131
-		$this->setViewState('UpdateImageUrl',$value,'');
131
+		$this->setViewState('UpdateImageUrl', $value, '');
132 132
 	}
133 133
 
134 134
 	/**
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 */
137 137
 	public function getCancelText()
138 138
 	{
139
-		return $this->getViewState('CancelText','Cancel');
139
+		return $this->getViewState('CancelText', 'Cancel');
140 140
 	}
141 141
 
142 142
 	/**
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 */
145 145
 	public function setCancelText($value)
146 146
 	{
147
-		$this->setViewState('CancelText',$value,'Cancel');
147
+		$this->setViewState('CancelText', $value, 'Cancel');
148 148
 	}
149 149
 
150 150
 	/**
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 */
153 153
 	public function getCancelImageUrl()
154 154
 	{
155
-		return $this->getViewState('CancelImageUrl','');
155
+		return $this->getViewState('CancelImageUrl', '');
156 156
 	}
157 157
 
158 158
 	/**
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	 */
161 161
 	public function setCancelImageUrl($value)
162 162
 	{
163
-		$this->setViewState('CancelImageUrl',$value,'');
163
+		$this->setViewState('CancelImageUrl', $value, '');
164 164
 	}
165 165
 
166 166
 	/**
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	public function getCausesValidation()
170 170
 	{
171
-		return $this->getViewState('CausesValidation',true);
171
+		return $this->getViewState('CausesValidation', true);
172 172
 	}
173 173
 
174 174
 	/**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	 */
177 177
 	public function setCausesValidation($value)
178 178
 	{
179
-		$this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true);
179
+		$this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true);
180 180
 	}
181 181
 
182 182
 	/**
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	 */
185 185
 	public function getValidationGroup()
186 186
 	{
187
-		return $this->getViewState('ValidationGroup','');
187
+		return $this->getViewState('ValidationGroup', '');
188 188
 	}
189 189
 
190 190
 	/**
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	 */
193 193
 	public function setValidationGroup($value)
194 194
 	{
195
-		$this->setViewState('ValidationGroup',$value,'');
195
+		$this->setViewState('ValidationGroup', $value, '');
196 196
 	}
197 197
 
198 198
 	/**
@@ -204,27 +204,27 @@  discard block
 block discarded – undo
204 204
 	 * @param integer the index to the Columns property that the cell resides in.
205 205
 	 * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)
206 206
 	 */
207
-	public function initializeCell($cell,$columnIndex,$itemType)
207
+	public function initializeCell($cell, $columnIndex, $itemType)
208 208
 	{
209
-		if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem)
209
+		if ($itemType === TListItemType::Item || $itemType === TListItemType::AlternatingItem || $itemType === TListItemType::SelectedItem)
210 210
 		{
211
-			$button=$this->createButton('Edit',$this->getEditText(),false,'');
211
+			$button = $this->createButton('Edit', $this->getEditText(), false, '');
212 212
 			$cell->getControls()->add($button);
213
-			$cell->registerObject('EditButton',$button);
213
+			$cell->registerObject('EditButton', $button);
214 214
 		}
215
-		else if($itemType===TListItemType::EditItem)
215
+		else if ($itemType === TListItemType::EditItem)
216 216
 		{
217
-			$controls=$cell->getControls();
218
-			$button=$this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup());
217
+			$controls = $cell->getControls();
218
+			$button = $this->createButton('Update', $this->getUpdateText(), $this->getCausesValidation(), $this->getValidationGroup());
219 219
 			$controls->add($button);
220
-			$cell->registerObject('UpdateButton',$button);
220
+			$cell->registerObject('UpdateButton', $button);
221 221
 			$controls->add('&nbsp;');
222
-			$button=$this->createButton('Cancel',$this->getCancelText(),false,'');
222
+			$button = $this->createButton('Cancel', $this->getCancelText(), false, '');
223 223
 			$controls->add($button);
224
-			$cell->registerObject('CancelButton',$button);
224
+			$cell->registerObject('CancelButton', $button);
225 225
 		}
226 226
 		else
227
-			parent::initializeCell($cell,$columnIndex,$itemType);
227
+			parent::initializeCell($cell, $columnIndex, $itemType);
228 228
 	}
229 229
 
230 230
 	/**
@@ -236,21 +236,21 @@  discard block
 block discarded – undo
236 236
 	 * @param string the validation group that the button belongs to
237 237
 	 * @return mixed the newly created button.
238 238
 	 */
239
-	protected function createButton($commandName,$text,$causesValidation,$validationGroup)
239
+	protected function createButton($commandName, $text, $causesValidation, $validationGroup)
240 240
 	{
241
-		if($this->getButtonType()===TButtonColumnType::LinkButton)
242
-			$button=Prado::createComponent('System.Web.UI.WebControls.TLinkButton');
243
-		else if($this->getButtonType()===TButtonColumnType::PushButton)
244
-			$button=Prado::createComponent('System.Web.UI.WebControls.TButton');
241
+		if ($this->getButtonType() === TButtonColumnType::LinkButton)
242
+			$button = Prado::createComponent('System.Web.UI.WebControls.TLinkButton');
243
+		else if ($this->getButtonType() === TButtonColumnType::PushButton)
244
+			$button = Prado::createComponent('System.Web.UI.WebControls.TButton');
245 245
 		else	// image buttons
246 246
 		{
247
-			$button=Prado::createComponent('System.Web.UI.WebControls.TImageButton');
248
-			if(strcasecmp($commandName,'Update')===0)
249
-				$url=$this->getUpdateImageUrl();
250
-			else if(strcasecmp($commandName,'Cancel')===0)
251
-				$url=$this->getCancelImageUrl();
247
+			$button = Prado::createComponent('System.Web.UI.WebControls.TImageButton');
248
+			if (strcasecmp($commandName, 'Update') === 0)
249
+				$url = $this->getUpdateImageUrl();
250
+			else if (strcasecmp($commandName, 'Cancel') === 0)
251
+				$url = $this->getCancelImageUrl();
252 252
 			else
253
-				$url=$this->getEditImageUrl();
253
+				$url = $this->getEditImageUrl();
254 254
 			$button->setImageUrl($url);
255 255
 		}
256 256
 		$button->setText($text);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -211,8 +211,7 @@  discard block
 block discarded – undo
211 211
 			$button=$this->createButton('Edit',$this->getEditText(),false,'');
212 212
 			$cell->getControls()->add($button);
213 213
 			$cell->registerObject('EditButton',$button);
214
-		}
215
-		else if($itemType===TListItemType::EditItem)
214
+		} else if($itemType===TListItemType::EditItem)
216 215
 		{
217 216
 			$controls=$cell->getControls();
218 217
 			$button=$this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup());
@@ -222,8 +221,7 @@  discard block
 block discarded – undo
222 221
 			$button=$this->createButton('Cancel',$this->getCancelText(),false,'');
223 222
 			$controls->add($button);
224 223
 			$cell->registerObject('CancelButton',$button);
225
-		}
226
-		else
224
+		} else
227 225
 			parent::initializeCell($cell,$columnIndex,$itemType);
228 226
 	}
229 227
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TFileUpload.php 4 patches
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -177,6 +177,7 @@  discard block
 block discarded – undo
177 177
 	 * @param string the file name used to save the uploaded file
178 178
 	 * @param boolean whether to delete the temporary file after saving.
179 179
 	 * If true, you will not be able to save the uploaded file again.
180
+	 * @param string $fileName
180 181
 	 * @return boolean true if the file saving is successful
181 182
 	 */
182 183
 	public function saveAs($fileName,$deleteTempFile=true)
@@ -199,6 +200,7 @@  discard block
 block discarded – undo
199 200
 	 * This method is primarly used by framework developers.
200 201
 	 * @param string the key that can be used to retrieve data from the input data collection
201 202
 	 * @param array the input data collection
203
+	 * @param boolean $key
202 204
 	 * @return boolean whether the data of the control has been changed
203 205
 	 */
204 206
 	public function loadPostData($key,$values)
@@ -251,7 +253,7 @@  discard block
 block discarded – undo
251 253
 	/**
252 254
 	 * Returns the original file name as the property value to be validated.
253 255
 	 * This method is required by IValidatable property.
254
-	 * @return mixed the property value to be validated
256
+	 * @return string the property value to be validated
255 257
 	 */
256 258
 	public function getValidationPropertyValue()
257 259
 	{
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -189,8 +189,7 @@  discard block
 block discarded – undo
189 189
 				return file_put_contents($fileName,file_get_contents($this->_localName))!==false;
190 190
 			else
191 191
 				return false;
192
-		}
193
-		else
192
+		} else
194 193
 			return false;
195 194
 	}
196 195
 
@@ -211,8 +210,7 @@  discard block
 block discarded – undo
211 210
 			$this->_errorCode=$_FILES[$key]['error'];
212 211
 			$this->_localName=$_FILES[$key]['tmp_name'];
213 212
 			return $this->_dataChanged=true;
214
-		}
215
-		else
213
+		} else
216 214
 			return false;
217 215
 	}
218 216
 
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -140,13 +140,13 @@
 block discarded – undo
140 140
 	 */
141 141
 	public function getIsValid()
142 142
 	{
143
-	    return $this->_isValid;
143
+		return $this->_isValid;
144 144
 	}
145 145
 	/**
146 146
 	 * @param bool wether this control is valid.
147 147
 	 */
148 148
 	public function setIsValid($value)
149 149
 	{
150
-	    $this->_isValid=TPropertyValue::ensureBoolean($value);
150
+		$this->_isValid=TPropertyValue::ensureBoolean($value);
151 151
 	}
152 152
 }
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -35,29 +35,29 @@  discard block
 block discarded – undo
35 35
 	/**
36 36
 	 * Maximum file size (in bytes) allowed to be uploaded, defaults to 1MB.
37 37
 	 */
38
-	const MAX_FILE_SIZE=1048576;
38
+	const MAX_FILE_SIZE = 1048576;
39 39
 	/**
40 40
 	 * @var integer the size of the uploaded file (in bytes)
41 41
 	 */
42
-	private $_fileSize=0;
42
+	private $_fileSize = 0;
43 43
 	/**
44 44
 	 * @var string The original name of the file on the client machine
45 45
 	 */
46
-	private $_fileName='';
46
+	private $_fileName = '';
47 47
 	/**
48 48
 	 * @var string the name of the temporary file storing the uploaded file
49 49
 	 */
50
-	protected $_localName='';
50
+	protected $_localName = '';
51 51
 	/**
52 52
 	 * @var string the uploaded file mime type
53 53
 	 */
54
-	private $_fileType='';
54
+	private $_fileType = '';
55 55
 	/**
56 56
 	 * @var integer error code of the current file upload
57 57
 	 */
58
-	protected $_errorCode=UPLOAD_ERR_NO_FILE;
59
-	private $_dataChanged=false;
60
-	private $_isValid=true;
58
+	protected $_errorCode = UPLOAD_ERR_NO_FILE;
59
+	private $_dataChanged = false;
60
+	private $_isValid = true;
61 61
 
62 62
 	/**
63 63
 	 * @return string tag name of the file upload control
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
 	{
77 77
 		$this->getPage()->ensureRenderInForm($this);
78 78
 		parent::addAttributesToRender($writer);
79
-		$writer->addAttribute('type','file');
80
-		$writer->addAttribute('name',$this->getUniqueID());
81
-		$isEnabled=$this->getEnabled(true);
82
-		if(!$isEnabled && $this->getEnabled())  // in this case parent will not render 'disabled'
83
-			$writer->addAttribute('disabled','disabled');
79
+		$writer->addAttribute('type', 'file');
80
+		$writer->addAttribute('name', $this->getUniqueID());
81
+		$isEnabled = $this->getEnabled(true);
82
+		if (!$isEnabled && $this->getEnabled())  // in this case parent will not render 'disabled'
83
+			$writer->addAttribute('disabled', 'disabled');
84 84
 	}
85 85
 
86 86
 	/**
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
 	public function onPreRender($param)
92 92
 	{
93 93
 		parent::onPreRender($param);
94
-		if(($form=$this->getPage()->getForm())!==null)
94
+		if (($form = $this->getPage()->getForm()) !== null)
95 95
 			$form->setEnctype('multipart/form-data');
96
-		$this->getPage()->getClientScript()->registerHiddenField('MAX_FILE_SIZE',$this->getMaxFileSize());
97
-		if($this->getEnabled(true))
96
+		$this->getPage()->getClientScript()->registerHiddenField('MAX_FILE_SIZE', $this->getMaxFileSize());
97
+		if ($this->getEnabled(true))
98 98
 			$this->getPage()->registerRequiresPostData($this);
99 99
 	}
100 100
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	 */
105 105
 	public function getMaxFileSize()
106 106
 	{
107
-		return $this->getViewState('MaxFileSize',self::MAX_FILE_SIZE);
107
+		return $this->getViewState('MaxFileSize', self::MAX_FILE_SIZE);
108 108
 	}
109 109
 
110 110
 	/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	public function setMaxFileSize($size)
119 119
 	{
120
-		$this->setViewState('MaxFileSize',TPropertyValue::ensureInteger($size),self::MAX_FILE_SIZE);
120
+		$this->setViewState('MaxFileSize', TPropertyValue::ensureInteger($size), self::MAX_FILE_SIZE);
121 121
 	}
122 122
 
123 123
 	/**
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 	 */
170 170
 	public function getHasFile()
171 171
 	{
172
-		return $this->_errorCode===UPLOAD_ERR_OK;
172
+		return $this->_errorCode === UPLOAD_ERR_OK;
173 173
 	}
174 174
 
175 175
 	/**
@@ -179,14 +179,14 @@  discard block
 block discarded – undo
179 179
 	 * If true, you will not be able to save the uploaded file again.
180 180
 	 * @return boolean true if the file saving is successful
181 181
 	 */
182
-	public function saveAs($fileName,$deleteTempFile=true)
182
+	public function saveAs($fileName, $deleteTempFile = true)
183 183
 	{
184
-		if($this->_errorCode===UPLOAD_ERR_OK)
184
+		if ($this->_errorCode === UPLOAD_ERR_OK)
185 185
 		{
186
-			if($deleteTempFile)
187
-				return move_uploaded_file($this->_localName,$fileName);
188
-			else if(is_uploaded_file($this->_localName))
189
-				return file_put_contents($fileName,file_get_contents($this->_localName))!==false;
186
+			if ($deleteTempFile)
187
+				return move_uploaded_file($this->_localName, $fileName);
188
+			else if (is_uploaded_file($this->_localName))
189
+				return file_put_contents($fileName, file_get_contents($this->_localName)) !== false;
190 190
 			else
191 191
 				return false;
192 192
 		}
@@ -201,16 +201,16 @@  discard block
 block discarded – undo
201 201
 	 * @param array the input data collection
202 202
 	 * @return boolean whether the data of the control has been changed
203 203
 	 */
204
-	public function loadPostData($key,$values)
204
+	public function loadPostData($key, $values)
205 205
 	{
206
-		if(isset($_FILES[$key]))
206
+		if (isset($_FILES[$key]))
207 207
 		{
208
-			$this->_fileName=$_FILES[$key]['name'];
209
-			$this->_fileSize=$_FILES[$key]['size'];
210
-			$this->_fileType=$_FILES[$key]['type'];
211
-			$this->_errorCode=$_FILES[$key]['error'];
212
-			$this->_localName=$_FILES[$key]['tmp_name'];
213
-			return $this->_dataChanged=true;
208
+			$this->_fileName = $_FILES[$key]['name'];
209
+			$this->_fileSize = $_FILES[$key]['size'];
210
+			$this->_fileType = $_FILES[$key]['type'];
211
+			$this->_errorCode = $_FILES[$key]['error'];
212
+			$this->_localName = $_FILES[$key]['tmp_name'];
213
+			return $this->_dataChanged = true;
214 214
 		}
215 215
 		else
216 216
 			return false;
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 	 */
236 236
 	public function onFileUpload($param)
237 237
 	{
238
-		$this->raiseEvent('OnFileUpload',$this,$param);
238
+		$this->raiseEvent('OnFileUpload', $this, $param);
239 239
 	}
240 240
 
241 241
 	/**
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 	 */
273 273
 	public function setIsValid($value)
274 274
 	{
275
-	    $this->_isValid=TPropertyValue::ensureBoolean($value);
275
+	    $this->_isValid = TPropertyValue::ensureBoolean($value);
276 276
 	}
277 277
 
278 278
 }
Please login to merge, or discard this patch.