Completed
Push — fix_585 ( 4bfff7...8a5897 )
by Fabio
11:05
created
framework/Web/UI/WebControls/TValidationSummary.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 */
55 55
 	public function getDisplay()
56 56
 	{
57
-		return $this->getViewState('Display',TValidationSummaryDisplayStyle::Fixed);
57
+		return $this->getViewState('Display', TValidationSummaryDisplayStyle::Fixed);
58 58
 	}
59 59
 
60 60
 	/**
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function setDisplay($value)
64 64
 	{
65
-		$this->setViewState('Display',TPropertyValue::ensureEnum($value,'TValidationSummaryDisplayStyle'),TValidationSummaryDisplayStyle::Fixed);
65
+		$this->setViewState('Display', TPropertyValue::ensureEnum($value, 'TValidationSummaryDisplayStyle'), TValidationSummaryDisplayStyle::Fixed);
66 66
 	}
67 67
 
68 68
 	/**
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public function getHeaderText()
72 72
 	{
73
-		return $this->getViewState('HeaderText','');
73
+		return $this->getViewState('HeaderText', '');
74 74
 	}
75 75
 
76 76
 	/**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public function setHeaderText($value)
81 81
 	{
82
-		$this->setViewState('HeaderText',$value,'');
82
+		$this->setViewState('HeaderText', $value, '');
83 83
 	}
84 84
 
85 85
 	/**
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public function getDisplayMode()
89 89
 	{
90
-		return $this->getViewState('DisplayMode',TValidationSummaryDisplayMode::BulletList);
90
+		return $this->getViewState('DisplayMode', TValidationSummaryDisplayMode::BulletList);
91 91
 	}
92 92
 
93 93
 	/**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function setDisplayMode($value)
97 97
 	{
98
-		$this->setViewState('DisplayMode',TPropertyValue::ensureEnum($value,'TValidationSummaryDisplayMode'),TValidationSummaryDisplayMode::BulletList);
98
+		$this->setViewState('DisplayMode', TPropertyValue::ensureEnum($value, 'TValidationSummaryDisplayMode'), TValidationSummaryDisplayMode::BulletList);
99 99
 	}
100 100
 
101 101
 	/**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	public function getEnableClientScript()
105 105
 	{
106
-		return $this->getViewState('EnableClientScript',true);
106
+		return $this->getViewState('EnableClientScript', true);
107 107
 	}
108 108
 
109 109
 	/**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public function setEnableClientScript($value)
113 113
 	{
114
-		$this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true);
114
+		$this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true);
115 115
 	}
116 116
 
117 117
 	/**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function getShowMessageBox()
121 121
 	{
122
-		return $this->getViewState('ShowMessageBox',false);
122
+		return $this->getViewState('ShowMessageBox', false);
123 123
 	}
124 124
 
125 125
 	/**
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public function setShowMessageBox($value)
129 129
 	{
130
-		$this->setViewState('ShowMessageBox',TPropertyValue::ensureBoolean($value),false);
130
+		$this->setViewState('ShowMessageBox', TPropertyValue::ensureBoolean($value), false);
131 131
 	}
132 132
 
133 133
 	/**
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	 */
136 136
 	public function getShowSummary()
137 137
 	{
138
-		return $this->getViewState('ShowSummary',true);
138
+		return $this->getViewState('ShowSummary', true);
139 139
 	}
140 140
 
141 141
 	/**
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	public function setShowSummary($value)
145 145
 	{
146
-		$this->setViewState('ShowSummary',TPropertyValue::ensureBoolean($value),true);
146
+		$this->setViewState('ShowSummary', TPropertyValue::ensureBoolean($value), true);
147 147
 	}
148 148
 
149 149
 	/**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 */
152 152
 	public function getScrollToSummary()
153 153
 	{
154
-		return $this->getViewState('ScrollToSummary',true);
154
+		return $this->getViewState('ScrollToSummary', true);
155 155
 	}
156 156
 
157 157
 	/**
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	 */
160 160
 	public function setScrollToSummary($value)
161 161
 	{
162
-		$this->setViewState('ScrollToSummary',TPropertyValue::ensureBoolean($value),true);
162
+		$this->setViewState('ScrollToSummary', TPropertyValue::ensureBoolean($value), true);
163 163
 	}
164 164
 
165 165
 	/**
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 */
168 168
 	public function getShowAnchor()
169 169
 	{
170
-		return $this->getViewState('ShowAnchor',false);
170
+		return $this->getViewState('ShowAnchor', false);
171 171
 	}
172 172
 
173 173
 	/**
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 	 */
176 176
 	public function setShowAnchor($value)
177 177
 	{
178
-		$this->setViewState('ShowAnchor',TPropertyValue::ensureBoolean($value),false);
178
+		$this->setViewState('ShowAnchor', TPropertyValue::ensureBoolean($value), false);
179 179
 	}
180 180
 
181 181
 	/**
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 */
202 202
 	public function getValidationGroup()
203 203
 	{
204
-		return $this->getViewState('ValidationGroup','');
204
+		return $this->getViewState('ValidationGroup', '');
205 205
 	}
206 206
 
207 207
 	/**
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	 */
210 210
 	public function setValidationGroup($value)
211 211
 	{
212
-		$this->setViewState('ValidationGroup',$value,'');
212
+		$this->setViewState('ValidationGroup', $value, '');
213 213
 	}
214 214
 
215 215
 	protected function addAttributesToRender($writer)
@@ -219,11 +219,11 @@  discard block
 block discarded – undo
219 219
 		if(!$visible)
220 220
 		{
221 221
 			if($display===TValidationSummaryDisplayStyle::None || $display===TValidationSummaryDisplayStyle::Dynamic)
222
-				$writer->addStyleAttribute('display','none');
222
+				$writer->addStyleAttribute('display', 'none');
223 223
 			else
224
-				$writer->addStyleAttribute('visibility','hidden');
224
+				$writer->addStyleAttribute('visibility', 'hidden');
225 225
 		}
226
-		$writer->addAttribute('id',$this->getClientID());
226
+		$writer->addAttribute('id', $this->getClientID());
227 227
 		parent::addAttributesToRender($writer);
228 228
 	}
229 229
 
@@ -235,23 +235,23 @@  discard block
 block discarded – undo
235 235
 	{
236 236
 		if(!$this->getEnabled(true) || !$this->getEnableClientScript())
237 237
 			return;
238
-		$cs = $this->getPage()->getClientScript();
238
+		$cs=$this->getPage()->getClientScript();
239 239
 		$cs->registerPradoScript('validator');
240 240
 
241 241
 		//need to register the validation manager is validation summary is alone.
242 242
 		$formID=$this->getPage()->getForm()->getClientID();
243
-		$scriptKey = "TBaseValidator:$formID";
243
+		$scriptKey="TBaseValidator:$formID";
244 244
 		if($this->getEnableClientScript() && !$cs->isEndScriptRegistered($scriptKey))
245 245
 		{
246
-			$manager['FormID'] = $formID;
247
-			$options = TJavaScript::encode($manager);
246
+			$manager['FormID']=$formID;
247
+			$options=TJavaScript::encode($manager);
248 248
 			$cs->registerPradoScript('validator');
249 249
 			$cs->registerEndScript($scriptKey, "new Prado.ValidationManager({$options});");
250 250
 		}
251 251
 
252 252
 
253 253
 		$options=TJavaScript::encode($this->getClientScriptOptions());
254
-		$script = "new Prado.WebUI.TValidationSummary({$options});";
254
+		$script="new Prado.WebUI.TValidationSummary({$options});";
255 255
 		$cs->registerEndScript($this->getClientID(), $script);
256 256
 	}
257 257
 
@@ -261,8 +261,8 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	protected function getClientScriptOptions()
263 263
 	{
264
-		$options['ID'] = $this->getClientID();
265
-		$options['FormID'] = $this->getPage()->getForm()->getClientID();
264
+		$options['ID']=$this->getClientID();
265
+		$options['FormID']=$this->getPage()->getForm()->getClientID();
266 266
 		if($this->getShowMessageBox())
267 267
 			$options['ShowMessageBox']=true;
268 268
 		if(!$this->getShowSummary())
@@ -272,12 +272,12 @@  discard block
 block discarded – undo
272 272
 		$options['HeaderText']=$this->getHeaderText();
273 273
 		$options['DisplayMode']=$this->getDisplayMode();
274 274
 
275
-		$options['Refresh'] = $this->getAutoUpdate();
276
-		$options['ValidationGroup'] =  $this->getValidationGroup();
277
-		$options['Display'] = $this->getDisplay();
275
+		$options['Refresh']=$this->getAutoUpdate();
276
+		$options['ValidationGroup']=$this->getValidationGroup();
277
+		$options['Display']=$this->getDisplay();
278 278
 
279 279
 		if($this->_clientSide!==null)
280
-			$options = array_merge($options,$this->_clientSide->getOptions()->toArray());
280
+			$options=array_merge($options, $this->_clientSide->getOptions()->toArray());
281 281
 
282 282
 		return $options;
283 283
 	}
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 	public function getClientSide()
290 290
 	{
291 291
 		if($this->_clientSide===null)
292
-			$this->_clientSide = $this->createClientScript();
292
+			$this->_clientSide=$this->createClientScript();
293 293
 		return $this->_clientSide;
294 294
 	}
295 295
 
@@ -308,12 +308,12 @@  discard block
 block discarded – undo
308 308
 	protected function getErrorMessages()
309 309
 	{
310 310
 		$validators=$this->getPage()->getValidators($this->getValidationGroup());
311
-		$messages = array();
311
+		$messages=array();
312 312
 		foreach($validators as $validator)
313 313
 		{
314 314
 			if(!$validator->getIsValid() && ($msg=$validator->getErrorMessage())!=='')
315 315
 				//$messages[] = $validator->getAnchoredMessage($msg);
316
-				$messages[] = $msg;
316
+				$messages[]=$msg;
317 317
 		}
318 318
 		return $messages;
319 319
 	}
@@ -356,9 +356,9 @@  discard block
 block discarded – undo
356 356
 	{
357 357
 		$header=$this->getHeaderText();
358 358
 		$messages=$this->getErrorMessages();
359
-		$content = '';
359
+		$content='';
360 360
 		if(strlen($header))
361
-			$content.= $header."<br/>\n";
361
+			$content.=$header."<br/>\n";
362 362
 		foreach($messages as $message)
363 363
 			$content.="$message<br/>\n";
364 364
 		$writer->write($content);
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
 	{
375 375
 		$header=$this->getHeaderText();
376 376
 		$messages=$this->getErrorMessages();
377
-		$content = $header;
377
+		$content=$header;
378 378
 		foreach($messages as $message)
379
-			$content.= ' '.$message;
379
+			$content.=' '.$message;
380 380
 		$writer->write($content);
381 381
 	}
382 382
 
@@ -390,13 +390,13 @@  discard block
 block discarded – undo
390 390
 	{
391 391
 		$header=$this->getHeaderText();
392 392
 		$messages=$this->getErrorMessages();
393
-		$content = $header;
394
-		if(count($messages)>0)
393
+		$content=$header;
394
+		if(count($messages) > 0)
395 395
 		{
396
-			$content .= "<ul>\n";
396
+			$content.="<ul>\n";
397 397
 			foreach($messages as $message)
398
-				$content.= '<li>'.$message."</li>\n";
399
-			$content .= "</ul>\n";
398
+				$content.='<li>'.$message."</li>\n";
399
+			$content.="</ul>\n";
400 400
 		}
401 401
 		$writer->write($content);
402 402
 	}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDataGridPagerStyle.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -41,24 +41,24 @@  discard block
 block discarded – undo
41 41
 	protected function __getZappableSleepProps(&$exprops)
42 42
 	{
43 43
 		parent::__getZappableSleepProps($exprops);
44
-		if ($this->_mode===null)
45
-			$exprops[] = "\0TDataGridPagerStyle\0_mode";
46
-		if ($this->_nextText===null)
47
-			$exprops[] = "\0TDataGridPagerStyle\0_nextText";
48
-		if ($this->_prevText===null)
49
-			$exprops[] = "\0TDataGridPagerStyle\0_prevText";
50
-		if ($this->_firstText===null)
51
-			$exprops[] = "\0TDataGridPagerStyle\0_firstText";
52
-		if ($this->_lastText===null)
53
-			$exprops[] = "\0TDataGridPagerStyle\0_lastText";
54
-		if ($this->_buttonCount===null)
55
-			$exprops[] = "\0TDataGridPagerStyle\0_buttonCount";
56
-		if ($this->_position===null)
57
-			$exprops[] = "\0TDataGridPagerStyle\0_position";
58
-		if ($this->_visible===null)
59
-			$exprops[] = "\0TDataGridPagerStyle\0_visible";
60
-		if ($this->_buttonType===null)
61
-			$exprops[] = "\0TDataGridPagerStyle\0_buttonType";
44
+		if($this->_mode===null)
45
+			$exprops[]="\0TDataGridPagerStyle\0_mode";
46
+		if($this->_nextText===null)
47
+			$exprops[]="\0TDataGridPagerStyle\0_nextText";
48
+		if($this->_prevText===null)
49
+			$exprops[]="\0TDataGridPagerStyle\0_prevText";
50
+		if($this->_firstText===null)
51
+			$exprops[]="\0TDataGridPagerStyle\0_firstText";
52
+		if($this->_lastText===null)
53
+			$exprops[]="\0TDataGridPagerStyle\0_lastText";
54
+		if($this->_buttonCount===null)
55
+			$exprops[]="\0TDataGridPagerStyle\0_buttonCount";
56
+		if($this->_position===null)
57
+			$exprops[]="\0TDataGridPagerStyle\0_position";
58
+		if($this->_visible===null)
59
+			$exprops[]="\0TDataGridPagerStyle\0_visible";
60
+		if($this->_buttonType===null)
61
+			$exprops[]="\0TDataGridPagerStyle\0_buttonType";
62 62
 	}
63 63
 
64 64
 	/**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public function getMode()
68 68
 	{
69
-		return $this->_mode===null?TDataGridPagerMode::NextPrev : $this->_mode;
69
+		return $this->_mode===null ? TDataGridPagerMode::NextPrev : $this->_mode;
70 70
 	}
71 71
 
72 72
 	/**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public function setMode($value)
76 76
 	{
77
-		$this->_mode=TPropertyValue::ensureEnum($value,'TDataGridPagerMode');
77
+		$this->_mode=TPropertyValue::ensureEnum($value, 'TDataGridPagerMode');
78 78
 	}
79 79
 
80 80
 	/**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	public function getButtonType()
84 84
 	{
85
-		return $this->_buttonType===null?TDataGridPagerButtonType::LinkButton:$this->_buttonType;
85
+		return $this->_buttonType===null ? TDataGridPagerButtonType::LinkButton : $this->_buttonType;
86 86
 	}
87 87
 
88 88
 	/**
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 */
91 91
 	public function setButtonType($value)
92 92
 	{
93
-		$this->_buttonType=TPropertyValue::ensureEnum($value,'TDataGridPagerButtonType');
93
+		$this->_buttonType=TPropertyValue::ensureEnum($value, 'TDataGridPagerButtonType');
94 94
 	}
95 95
 
96 96
 	/**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	public function getNextPageText()
100 100
 	{
101
-		return $this->_nextText===null?'>':$this->_nextText;
101
+		return $this->_nextText===null ? '>' : $this->_nextText;
102 102
 	}
103 103
 
104 104
 	/**
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	public function getPrevPageText()
116 116
 	{
117
-		return $this->_prevText===null?'<':$this->_prevText;
117
+		return $this->_prevText===null ? '<' : $this->_prevText;
118 118
 	}
119 119
 
120 120
 	/**
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	public function getFirstPageText()
132 132
 	{
133
-		return $this->_firstText===null?'<<':$this->_firstText;
133
+		return $this->_firstText===null ? '<<' : $this->_firstText;
134 134
 	}
135 135
 
136 136
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 */
147 147
 	public function getLastPageText()
148 148
 	{
149
-		return $this->_lastText===null?'>>':$this->_lastText;
149
+		return $this->_lastText===null ? '>>' : $this->_lastText;
150 150
 	}
151 151
 
152 152
 	/**
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	 */
163 163
 	public function getPageButtonCount()
164 164
 	{
165
-		return $this->_buttonCount===null?10:$this->_buttonCount;
165
+		return $this->_buttonCount===null ? 10 : $this->_buttonCount;
166 166
 	}
167 167
 
168 168
 	/**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	public function setPageButtonCount($value)
173 173
 	{
174
-		if(($value=TPropertyValue::ensureInteger($value))<1)
174
+		if(($value=TPropertyValue::ensureInteger($value)) < 1)
175 175
 			throw new TInvalidDataValueException('datagridpagerstyle_pagebuttoncount_invalid');
176 176
 		$this->_buttonCount=$value;
177 177
 	}
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	 */
182 182
 	public function getPosition()
183 183
 	{
184
-		return $this->_position===null?TDataGridPagerPosition::Bottom:$this->_position;
184
+		return $this->_position===null ? TDataGridPagerPosition::Bottom : $this->_position;
185 185
 	}
186 186
 
187 187
 	/**
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	 */
190 190
 	public function setPosition($value)
191 191
 	{
192
-		$this->_position=TPropertyValue::ensureEnum($value,'TDataGridPagerPosition');
192
+		$this->_position=TPropertyValue::ensureEnum($value, 'TDataGridPagerPosition');
193 193
 	}
194 194
 
195 195
 	/**
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 */
198 198
 	public function getVisible()
199 199
 	{
200
-		return $this->_visible===null?true:$this->_visible;
200
+		return $this->_visible===null ? true : $this->_visible;
201 201
 	}
202 202
 
203 203
 	/**
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TSlider.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public function setDirection($value)
75 75
 	{
76
-		$this->setViewState('Direction', TPropertyValue::ensureEnum($value,'TSliderDirection'),TSliderDirection::Horizontal);
76
+		$this->setViewState('Direction', TPropertyValue::ensureEnum($value, 'TSliderDirection'), TSliderDirection::Horizontal);
77 77
 	}
78 78
 
79 79
 	/**
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 */
82 82
 	public function getCssUrl()
83 83
 	{
84
-		return $this->getViewState('CssUrl','');
84
+		return $this->getViewState('CssUrl', '');
85 85
 	}
86 86
 
87 87
 	/**
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function setCssUrl($value)
91 91
 	{
92
-		$this->setViewState('CssUrl',TPropertyValue::ensureString($value),'');
92
+		$this->setViewState('CssUrl', TPropertyValue::ensureString($value), '');
93 93
 	}
94 94
 
95 95
 	/**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function getMaxValue()
99 99
 	{
100
-		return $this->getViewState('MaxValue',100.0);
100
+		return $this->getViewState('MaxValue', 100.0);
101 101
 	}
102 102
 
103 103
 	/**
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	public function setMaxValue($value)
107 107
 	{
108
-		$this->setViewState('MaxValue', TPropertyValue::ensureFloat($value),100.0);
108
+		$this->setViewState('MaxValue', TPropertyValue::ensureFloat($value), 100.0);
109 109
 	}
110 110
 
111 111
 	/**
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 */
114 114
 	public function getMinValue()
115 115
 	{
116
-		return $this->getViewState('MinValue',0.0);
116
+		return $this->getViewState('MinValue', 0.0);
117 117
 	}
118 118
 
119 119
 	/**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public function setMinValue($value)
123 123
 	{
124
-		$this->setViewState('MinValue', TPropertyValue::ensureFloat($value),0.0);
124
+		$this->setViewState('MinValue', TPropertyValue::ensureFloat($value), 0.0);
125 125
 	}
126 126
 
127 127
 	/**
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	/**
148 148
 	 * @return boolean wether to display a progress indicator or not. Defaults to true.
149 149
 	 */
150
-	public function getProgressIndicator ()
150
+	public function getProgressIndicator()
151 151
 	{
152 152
 		return $this->getViewState('ProgressIndicator', true);
153 153
 	}
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	/**
156 156
 	 * @param boolean wether to display a progress indicator or not. Defaults to true.
157 157
 	 */
158
-	public function setProgressIndicator ($value)
158
+	public function setProgressIndicator($value)
159 159
 	{
160 160
 		$this->setViewState('ProgressIndicator', TPropertyValue::ensureBoolean($value), true);
161 161
 	}
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	 */
165 165
 	public function getValue()
166 166
 	{
167
-		return $this->getViewState('Value',0.0);
167
+		return $this->getViewState('Value', 0.0);
168 168
 	}
169 169
 
170 170
 	/**
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	 */
173 173
 	public function setValue($value)
174 174
 	{
175
-		$this->setViewState('Value', TPropertyValue::ensureFloat($value),0.0);
175
+		$this->setViewState('Value', TPropertyValue::ensureFloat($value), 0.0);
176 176
 	}
177 177
 
178 178
 	/**
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	 */
225 225
 	public function getAutoPostBack()
226 226
 	{
227
-		return $this->getViewState('AutoPostBack',false);
227
+		return $this->getViewState('AutoPostBack', false);
228 228
 	}
229 229
 
230 230
 	/**
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 	 */
236 236
 	public function setAutoPostBack($value)
237 237
 	{
238
-		$this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),false);
238
+		$this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), false);
239 239
 	}
240 240
 
241 241
 	/**
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	 */
281 281
 	public function onValueChanged($param)
282 282
 	{
283
-		$this->raiseEvent('OnValueChanged',$this,$param);
283
+		$this->raiseEvent('OnValueChanged', $this, $param);
284 284
 	}
285 285
 
286 286
 	/**
@@ -290,9 +290,9 @@  discard block
 block discarded – undo
290 290
 	 * @param array the input data collection
291 291
 	 * @return boolean whether the data of the component has been changed
292 292
 	 */
293
-	public function loadPostData($key,$values)
293
+	public function loadPostData($key, $values)
294 294
 	{
295
-		$value=(float)$values[$this->getClientID().'_1'];
295
+		$value=(float) $values[$this->getClientID().'_1'];
296 296
 		if($this->getValue()!==$value)
297 297
 		{
298 298
 			$this->setValue($value);
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 	public function getClientSide()
317 317
 	{
318 318
 		if($this->_clientScript===null)
319
-			$this->_clientScript = $this->createClientScript();
319
+			$this->_clientScript=$this->createClientScript();
320 320
 		return $this->_clientScript;
321 321
 	}
322 322
 
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 	/**
332 332
 	 * @return string the HTML tag name for slider. Defaults to div.
333 333
 	 */
334
-	public function getTagName ()
334
+	public function getTagName()
335 335
 	{
336 336
 		return "div";
337 337
 	}
@@ -343,10 +343,10 @@  discard block
 block discarded – undo
343 343
 	protected function addAttributesToRender($writer)
344 344
 	{
345 345
 		parent::addAttributesToRender($writer);
346
-		$writer->addAttribute('id',$this->getClientID());
347
-		if ($this->getCssClass()==='')
346
+		$writer->addAttribute('id', $this->getClientID());
347
+		if($this->getCssClass()==='')
348 348
 		{
349
-			$class=($this->getDirection()==TSliderDirection::Horizontal)?'HorizontalSlider':'VerticalSlider';
349
+			$class=($this->getDirection()==TSliderDirection::Horizontal) ? 'HorizontalSlider' : 'VerticalSlider';
350 350
 			$writer->addAttribute('class', 'Slider '.$class);
351 351
 		}
352 352
 
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 		$writer->addAttribute('id', $this->getClientID().'_track');
363 363
 		$writer->renderBeginTag('div');
364 364
 		// Render the 'Progress Indicator'
365
-		if ($this->getProgressIndicator())
365
+		if($this->getProgressIndicator())
366 366
 		{
367 367
 			$writer->addAttribute('class', 'Progress');
368 368
 			$writer->addAttribute('id', $this->getClientID().'_progress');
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 	 * This method is invoked right before the control rendering, if the control is visible.
400 400
 	 * @param mixed event parameter
401 401
 	 */
402
-	public function onPreRender ($param)
402
+	public function onPreRender($param)
403 403
 	{
404 404
 		parent::onPreRender($param);
405 405
 		$this->registerStyleSheet();
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 			$url=$manager->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'TSlider');
422 422
 			$url.='/TSlider.css';
423 423
 		}
424
-		$this->getPage()->getClientScript()->registerStyleSheetFile($url,$url);
424
+		$this->getPage()->getClientScript()->registerStyleSheetFile($url, $url);
425 425
 	}
426 426
 
427 427
 	/**
@@ -430,12 +430,12 @@  discard block
 block discarded – undo
430 430
 	protected function registerSliderClientScript()
431 431
 	{
432 432
 		$page=$this->getPage();
433
-		$cs = $page->getClientScript();
433
+		$cs=$page->getClientScript();
434 434
 		$cs->registerPradoScript("slider");
435 435
 		$id=$this->getClientID();
436
-		$cs->registerHiddenField($id.'_1',$this->getValue());
436
+		$cs->registerHiddenField($id.'_1', $this->getValue());
437 437
 		$page->registerRequiresPostData($this);
438
-		$cs->registerPostBackControl($this->getClientClassName(),$this->getSliderOptions());
438
+		$cs->registerPostBackControl($this->getClientClassName(), $this->getSliderOptions());
439 439
 	}
440 440
 
441 441
 	/**
@@ -445,30 +445,30 @@  discard block
 block discarded – undo
445 445
 	protected function getSliderOptions()
446 446
 	{
447 447
 		// PostBack Options :
448
-		$options['ID'] = $this->getClientID();
449
-		$options['EventTarget'] = $this->getUniqueID();
450
-		$options['AutoPostBack'] = $this->getAutoPostBack();
448
+		$options['ID']=$this->getClientID();
449
+		$options['EventTarget']=$this->getUniqueID();
450
+		$options['AutoPostBack']=$this->getAutoPostBack();
451 451
 
452 452
 		// Slider Control options
453 453
 		$minValue=$this->getMinValue();
454 454
 		$maxValue=$this->getMaxValue();
455
-		$options['axis'] = strtolower($this->getDirection());
456
-		$options['maximum'] = $maxValue;
457
-		$options['minimum'] = $minValue;
458
-		$options['range'] = array($minValue, $maxValue);
459
-		$options['sliderValue'] = $this->getValue();
460
-		$options['disabled'] = !$this->getEnabled();
455
+		$options['axis']=strtolower($this->getDirection());
456
+		$options['maximum']=$maxValue;
457
+		$options['minimum']=$minValue;
458
+		$options['range']=array($minValue, $maxValue);
459
+		$options['sliderValue']=$this->getValue();
460
+		$options['disabled']=!$this->getEnabled();
461 461
 		$values=$this->getValues();
462
-		if (!empty($values))
462
+		if(!empty($values))
463 463
 		{
464 464
 			// Values are provided. Check if min/max are present in them
465
-			if (!in_array($minValue, $values)) $values[]=$minValue;
466
-			if (!in_array($maxValue, $values)) $values[]=$maxValue;
465
+			if(!in_array($minValue, $values)) $values[]=$minValue;
466
+			if(!in_array($maxValue, $values)) $values[]=$maxValue;
467 467
 			// Remove all values outsize the range [min..max]
468
-			foreach ($values as $idx=>$value)
468
+			foreach($values as $idx=>$value)
469 469
 			{
470
-				if ($value < $minValue) unset ($values[$idx]);
471
-				if ($value > $maxValue) unset ($values[$idx]);
470
+				if($value < $minValue) unset ($values[$idx]);
471
+				if($value > $maxValue) unset ($values[$idx]);
472 472
 			}
473 473
 		}
474 474
 		else
@@ -476,19 +476,19 @@  discard block
 block discarded – undo
476 476
 			// Values are not provided, generate automatically using stepsize
477 477
 			$step=$this->getStepSize();
478 478
 			// We want at most self::MAX_STEPS values, so, change the step if necessary
479
-			if (($maxValue-$minValue)/$step > self::MAX_STEPS)
479
+			if(($maxValue - $minValue) / $step > self::MAX_STEPS)
480 480
 			{
481
-				$step=($maxValue-$minValue)/self::MAX_STEPS;
481
+				$step=($maxValue - $minValue) / self::MAX_STEPS;
482 482
 			}
483 483
 			$values=array();
484
-			for ($i=$minValue;$i<=$maxValue;$i+=$step)
484
+			for($i=$minValue; $i <= $maxValue; $i+=$step)
485 485
 				$values[]=$i;
486 486
 			// Add max if it's not in the array because of step
487
-			if (!in_array($maxValue, $values)) $values[]=$maxValue;
487
+			if(!in_array($maxValue, $values)) $values[]=$maxValue;
488 488
 		}
489
-		$options['values'] = $values;
489
+		$options['values']=$values;
490 490
 		if($this->_clientScript!==null)
491
-			$options = array_merge($options,$this->_clientScript->getOptions()->toArray());
491
+			$options=array_merge($options, $this->_clientScript->getOptions()->toArray());
492 492
 		return $options;
493 493
 	}
494 494
 }
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTable.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
 				if(($border=$this->getBorderWidth())==='')
111 111
 					$border=1;
112 112
 				else
113
-					$border=(int)$border;
113
+					$border=(int) $border;
114 114
 			}
115 115
 		}
116
-		$writer->addAttribute('border',"$border");
116
+		$writer->addAttribute('border', "$border");
117 117
 	}
118 118
 
119 119
 	/**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 */
140 140
 	public function getCaption()
141 141
 	{
142
-		return $this->getViewState('Caption','');
142
+		return $this->getViewState('Caption', '');
143 143
 	}
144 144
 
145 145
 	/**
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	 */
148 148
 	public function setCaption($value)
149 149
 	{
150
-		$this->setViewState('Caption',$value,'');
150
+		$this->setViewState('Caption', $value, '');
151 151
 	}
152 152
 
153 153
 	/**
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	 */
156 156
 	public function getCaptionAlign()
157 157
 	{
158
-		return $this->getViewState('CaptionAlign',TTableCaptionAlign::NotSet);
158
+		return $this->getViewState('CaptionAlign', TTableCaptionAlign::NotSet);
159 159
 	}
160 160
 
161 161
 	/**
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 */
164 164
 	public function setCaptionAlign($value)
165 165
 	{
166
-		$this->setViewState('CaptionAlign',TPropertyValue::ensureEnum($value,'TTableCaptionAlign'),TTableCaptionAlign::NotSet);
166
+		$this->setViewState('CaptionAlign', TPropertyValue::ensureEnum($value, 'TTableCaptionAlign'), TTableCaptionAlign::NotSet);
167 167
 	}
168 168
 
169 169
 	/**
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 		if(($caption=$this->getCaption())!=='')
273 273
 		{
274 274
 			if(($align=$this->getCaptionAlign())!==TTableCaptionAlign::NotSet)
275
-				$writer->addAttribute('align',strtolower($align));
275
+				$writer->addAttribute('align', strtolower($align));
276 276
 			$writer->renderBeginTag('caption');
277 277
 			$writer->write($caption);
278 278
 			$writer->renderEndTag();
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 					{
312 312
 						if($currentSection===TTableRowSection::Header)
313 313
 						{
314
-							if($index>0)
314
+							if($index > 0)
315 315
 								$writer->renderEndTag();
316 316
 							if($section===TTableRowSection::Body)
317 317
 								$writer->renderBeginTag('tbody');
@@ -369,10 +369,10 @@  discard block
 block discarded – undo
369 369
 	 * @param mixed new item
370 370
 	 * @throws TInvalidDataTypeException if the item to be inserted is not a TTableRow object.
371 371
 	 */
372
-	public function insertAt($index,$item)
372
+	public function insertAt($index, $item)
373 373
 	{
374 374
 		if($item instanceof TTableRow)
375
-			parent::insertAt($index,$item);
375
+			parent::insertAt($index, $item);
376 376
 		else
377 377
 			throw new TInvalidDataTypeException('tablerowcollection_tablerow_required');
378 378
 	}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDataGridColumn.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -83,8 +83,8 @@  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);
86
+		if(!preg_match(TControl::ID_FORMAT, $value))
87
+			throw new TInvalidDataValueException('datagridcolumn_id_invalid', get_class($this), $value);
88 88
 		$this->_id=$value;
89 89
 	}
90 90
 
@@ -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,7 +141,7 @@  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
 	/**
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
 	 */
151 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 155
 			$style=new TTableItemStyle;
156
-			$this->setViewState('HeaderStyle',$style,null);
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,7 +195,7 @@  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
 	/**
@@ -204,10 +204,10 @@  discard block
 block discarded – undo
204 204
 	 */
205 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 209
 			$style=new TTableItemStyle;
210
-			$this->setViewState('FooterStyle',$style,null);
210
+			$this->setViewState('FooterStyle', $style, null);
211 211
 		}
212 212
 		return $style;
213 213
 	}
@@ -218,10 +218,10 @@  discard block
 block discarded – undo
218 218
 	 */
219 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 223
 			$style=new TTableItemStyle;
224
-			$this->setViewState('ItemStyle',$style,null);
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,7 +257,7 @@  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
 	/**
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	 */
266 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,7 +296,7 @@  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 301
 		if($value===$defaultValue)
302 302
 			unset($this->_viewState[$key]);
@@ -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 381
 		if($itemType===TListItemType::Header)
382
-			$this->initializeHeaderCell($cell,$columnIndex);
382
+			$this->initializeHeaderCell($cell, $columnIndex);
383 383
 		else if($itemType===TListItemType::Footer)
384
-			$this->initializeFooterCell($cell,$columnIndex);
384
+			$this->initializeFooterCell($cell, $columnIndex);
385 385
 	}
386 386
 
387 387
 	/**
@@ -409,7 +409,7 @@  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 414
 		$text=$this->getHeaderText();
415 415
 
@@ -481,7 +481,7 @@  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 486
 		$text=$this->getFooterText();
487 487
 		if(($classPath=$this->getFooterRenderer())!=='')
@@ -517,13 +517,13 @@  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 522
 		if($formatString==='')
523 523
 			return TPropertyValue::ensureString($value);
524 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 529
 				if(eval("\$result=$expression;")===false)
@@ -532,11 +532,11 @@  discard block
 block discarded – undo
532 532
 			}
533 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
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDataBoundControl.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -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','');
94
+		$dsid=$this->getViewState('DataSourceID', '');
95 95
 		if($dsid!=='' && $value==='')
96 96
 			$this->_requiresBindToNull=true;
97
-		$this->setViewState('DataSourceID',$value,'');
97
+		$this->setViewState('DataSourceID', $value, '');
98 98
 		$this->onDataSourceChanged();
99 99
 	}
100 100
 
@@ -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)
218
+		if(($value=TPropertyValue::ensureInteger($value)) < 0)
219 219
 			$value=0;
220
-		$this->setViewState('CurrentPageIndex',$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
 	/**
@@ -338,10 +338,10 @@  discard block
 block discarded – undo
338 338
 			{
339 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,7 +356,7 @@  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 361
 		if(!$this->_ignoreDataSourceViewChanged)
362 362
 			$this->setRequiresDataBinding(true);
@@ -367,13 +367,13 @@  discard block
 block discarded – undo
367 367
 		if(!$this->_currentViewValid)
368 368
 		{
369 369
 			if($this->_currentView && $this->_currentViewIsFromDataSourceID)
370
-				$this->_currentView->detachEventHandler('DataSourceViewChanged',array($this,'dataSourceViewChanged'));
370
+				$this->_currentView->detachEventHandler('DataSourceViewChanged', array($this, 'dataSourceViewChanged'));
371 371
 			if(($dataSource=$this->determineDataSource())!==null)
372 372
 			{
373 373
 				if(($view=$dataSource->getView($this->getDataMember()))===null)
374
-					throw new TInvalidDataValueException('databoundcontrol_datamember_invalid',$this->getDataMember());
374
+					throw new TInvalidDataValueException('databoundcontrol_datamember_invalid', $this->getDataMember());
375 375
 				if($this->_currentViewIsFromDataSourceID=$this->getUsingDataSourceID())
376
-					$view->attachEventHandler('OnDataSourceViewChanged',array($this,'dataSourceViewChanged'));
376
+					$view->attachEventHandler('OnDataSourceViewChanged', array($this, 'dataSourceViewChanged'));
377 377
 				$this->_currentView=$view;
378 378
 			}
379 379
 			else
@@ -390,14 +390,14 @@  discard block
 block discarded – undo
390 390
 			if(($dsid=$this->getDataSourceID())!=='')
391 391
 			{
392 392
 				if(($dataSource=$this->getNamingContainer()->findControl($dsid))===null)
393
-					throw new TInvalidDataValueException('databoundcontrol_datasourceid_inexistent',$dsid);
393
+					throw new TInvalidDataValueException('databoundcontrol_datasourceid_inexistent', $dsid);
394 394
 				else if(!($dataSource instanceof IDataSource))
395
-					throw new TInvalidDataValueException('databoundcontrol_datasourceid_invalid',$dsid);
395
+					throw new TInvalidDataValueException('databoundcontrol_datasourceid_invalid', $dsid);
396 396
 				else
397 397
 					$this->_currentDataSource=$dataSource;
398 398
 			}
399 399
 			else if(($dataSource=$this->getDataSource())!==null)
400
-				$this->_currentDataSource=new TReadOnlyDataSource($dataSource,$this->getDataMember());
400
+				$this->_currentDataSource=new TReadOnlyDataSource($dataSource, $this->getDataMember());
401 401
 			else
402 402
 				$this->_currentDataSource=null;
403 403
 			$this->_currentDataSourceValid=true;
@@ -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
 	/**
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 	{
429 429
 		parent::onInit($param);
430 430
 		$page=$this->getPage();
431
-		$page->attachEventHandler('OnPreLoad',array($this,'pagePreLoad'));
431
+		$page->attachEventHandler('OnPreLoad', array($this, 'pagePreLoad'));
432 432
 	}
433 433
 
434 434
 	/**
@@ -437,7 +437,7 @@  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 442
 		$this->_initialized=true;
443 443
 		$isPostBack=$this->getPage()->getIsPostBack();
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 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
 		}
@@ -487,17 +487,17 @@  discard block
 block discarded – undo
487 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()
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDatePicker.php 1 patch
Spacing   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	/**
81 81
 	 * Script path relative to the TClientScriptManager::SCRIPT_PATH
82 82
 	 */
83
-	const SCRIPT_PATH = 'prado/datepicker';
83
+	const SCRIPT_PATH='prado/datepicker';
84 84
 
85 85
 	/**
86 86
 	 * @var TDatePickerClientScript validator client-script options.
@@ -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
 	/**
@@ -312,8 +312,8 @@  discard block
 block discarded – undo
312 312
 			$this->setText('');
313 313
 		else
314 314
 		{
315
-			$date = TPropertyValue::ensureFloat($value);
316
-			$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$this->getDateFormat());
315
+			$date=TPropertyValue::ensureFloat($value);
316
+			$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $this->getDateFormat());
317 317
 			$this->setText($formatter->format($date));
318 318
 		}
319 319
 	}
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 	public function getClientSide()
374 374
 	{
375 375
 		if($this->_clientScript===null)
376
-			$this->_clientScript = $this->createClientScript();
376
+			$this->_clientScript=$this->createClientScript();
377 377
 		return $this->_clientScript;
378 378
 	}
379 379
 
@@ -392,10 +392,10 @@  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
-		$date = $this->getTimeStamp();
398
-		return $date == null ? $text : $date;
397
+		$date=$this->getTimeStamp();
398
+		return $date==null ? $text : $date;
399 399
 	}
400 400
 
401 401
 	/**
@@ -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);
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 	{
440 440
 		if($this->getShowCalendar())
441 441
 		{
442
-			switch ($this->getMode())
442
+			switch($this->getMode())
443 443
 			{
444 444
 				case TDatePickerMode::Button:
445 445
 					$this->renderButtonDatePicker($writer);
@@ -459,11 +459,11 @@  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
-		$value = $this->getDateFromPostData($key, $values);
466
+		$value=$this->getDateFromPostData($key, $values);
467 467
 		if(!$this->getReadOnly() && $this->getText()!==$value)
468 468
 		{
469 469
 			$this->setText($value);
@@ -481,30 +481,30 @@  discard block
 block discarded – undo
481 481
 	 */
482 482
 	protected function getDateFromPostData($key, $values)
483 483
 	{
484
-		$date = @getdate();
484
+		$date=@getdate();
485 485
 
486 486
 		if(isset($values[$key.'$day']))
487
-			$day = intval($values[$key.'$day']);
487
+			$day=intval($values[$key.'$day']);
488 488
 		else
489
-			$day = $date['mday'];
489
+			$day=$date['mday'];
490 490
 
491 491
 		if(isset($values[$key.'$month']))
492
-			$month = intval($values[$key.'$month']) + 1;
492
+			$month=intval($values[$key.'$month']) + 1;
493 493
 		else
494
-			$month = $date['mon'];
494
+			$month=$date['mon'];
495 495
 
496 496
 		if(isset($values[$key.'$year']))
497
-			$year = intval($values[$key.'$year']);
497
+			$year=intval($values[$key.'$year']);
498 498
 		else
499
-			$year = $date['year'];
499
+			$year=$date['year'];
500 500
 
501
-		$s = Prado::createComponent('System.Util.TDateTimeStamp');
502
-		$date = $s->getTimeStamp(0, 0, 0, $month, $day, $year);
501
+		$s=Prado::createComponent('System.Util.TDateTimeStamp');
502
+		$date=$s->getTimeStamp(0, 0, 0, $month, $day, $year);
503 503
 		//$date = @mktime(0, 0, 0, $month, $day, $year);
504 504
 
505
-		$pattern = $this->getDateFormat();
506
-		$pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern);
507
-		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern);
505
+		$pattern=$this->getDateFormat();
506
+		$pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern);
507
+		$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern);
508 508
 		return $formatter->format($date);
509 509
 	}
510 510
 
@@ -514,31 +514,31 @@  discard block
 block discarded – undo
514 514
 	 */
515 515
 	protected function getDatePickerOptions()
516 516
 	{
517
-		$options['ID'] = $this->getClientID();
518
-		$options['InputMode'] = $this->getInputMode();
519
-		$options['Format'] = $this->getDateFormat();
520
-		$options['FirstDayOfWeek'] = $this->getFirstDayOfWeek();
517
+		$options['ID']=$this->getClientID();
518
+		$options['InputMode']=$this->getInputMode();
519
+		$options['Format']=$this->getDateFormat();
520
+		$options['FirstDayOfWeek']=$this->getFirstDayOfWeek();
521 521
 		if(($cssClass=$this->getCssClass())!=='')
522
-			$options['ClassName'] = $cssClass;
523
-		$options['CalendarStyle'] = $this->getCalendarStyle();
524
-		$options['FromYear'] = $this->getFromYear();
525
-		$options['UpToYear'] = $this->getUpToYear();
522
+			$options['ClassName']=$cssClass;
523
+		$options['CalendarStyle']=$this->getCalendarStyle();
524
+		$options['FromYear']=$this->getFromYear();
525
+		$options['UpToYear']=$this->getUpToYear();
526 526
 		switch($this->getMode())
527 527
 		{
528 528
 			case TDatePickerMode::Basic:
529 529
 				break;
530 530
 			case TDatePickerMode::Clickable:
531
-				$options['TriggerEvent'] = "click";
531
+				$options['TriggerEvent']="click";
532 532
 				break;
533 533
 			default:
534
-				$options['Trigger'] = $this->getDatePickerButtonID();
534
+				$options['Trigger']=$this->getDatePickerButtonID();
535 535
 				break;
536 536
 		}
537
-		$options['PositionMode'] = $this->getPositionMode();
537
+		$options['PositionMode']=$this->getPositionMode();
538 538
 
539
-		$options = array_merge($options, $this->getCulturalOptions());
539
+		$options=array_merge($options, $this->getCulturalOptions());
540 540
 		if($this->_clientScript!==null)
541
-			$options = array_merge($options,
541
+			$options=array_merge($options,
542 542
 				$this->_clientScript->getOptions()->toArray());
543 543
 		return $options;
544 544
 	}
@@ -549,13 +549,13 @@  discard block
 block discarded – undo
549 549
 	 */
550 550
 	protected function getCulturalOptions()
551 551
 	{
552
-		if($this->getCurrentCulture() == 'en')
552
+		if($this->getCurrentCulture()=='en')
553 553
 			return array();
554 554
 
555
-		$date = $this->getLocalizedCalendarInfo();
556
-		$options['MonthNames'] = $date->getMonthNames();
557
-		$options['AbbreviatedMonthNames'] = $date->getAbbreviatedMonthNames();
558
-		$options['ShortWeekDayNames'] = $date->getAbbreviatedDayNames();
555
+		$date=$this->getLocalizedCalendarInfo();
556
+		$options['MonthNames']=$date->getMonthNames();
557
+		$options['AbbreviatedMonthNames']=$date->getAbbreviatedMonthNames();
558
+		$options['ShortWeekDayNames']=$date->getAbbreviatedDayNames();
559 559
 
560 560
 		return $options;
561 561
 	}
@@ -565,8 +565,8 @@  discard block
 block discarded – undo
565 565
 	 */
566 566
 	protected function getCurrentCulture()
567 567
 	{
568
-		$app = $this->getApplication()->getGlobalization(false);
569
-		return $this->getCulture() == '' ?
568
+		$app=$this->getApplication()->getGlobalization(false);
569
+		return $this->getCulture()=='' ?
570 570
 				($app ? $app->getCulture() : 'en') : $this->getCulture();
571 571
 	}
572 572
 
@@ -576,9 +576,9 @@  discard block
 block discarded – undo
576 576
 	protected function getLocalizedCalendarInfo()
577 577
 	{
578 578
 		//expensive operations
579
-		$culture = $this->getCurrentCulture();
579
+		$culture=$this->getCurrentCulture();
580 580
 		Prado::using('System.I18N.core.DateTimeFormatInfo');
581
-		$info = Prado::createComponent('System.I18N.core.CultureInfo', $culture);
581
+		$info=Prado::createComponent('System.I18N.core.CultureInfo', $culture);
582 582
 		return $info->getDateTimeFormat();
583 583
 	}
584 584
 
@@ -587,19 +587,19 @@  discard block
 block discarded – undo
587 587
 	 */
588 588
 	protected function renderDropDownListCalendar($writer)
589 589
 	{
590
-		if($this->getMode() == TDatePickerMode::Basic)
590
+		if($this->getMode()==TDatePickerMode::Basic)
591 591
 			$this->setMode(TDatePickerMode::ImageButton);
592 592
 		parent::addAttributesToRender($writer);
593 593
 		$writer->removeAttribute('name');
594 594
 		$writer->removeAttribute('type');
595 595
 		$writer->addAttribute('id', $this->getClientID());
596 596
 
597
-		if(strlen($class = $this->getCssClass()) > 0)
597
+		if(strlen($class=$this->getCssClass()) > 0)
598 598
 			$writer->addAttribute('class', $class);
599 599
 		$writer->renderBeginTag('span');
600 600
 
601
-		$s = Prado::createComponent('System.Util.TDateTimeStamp');
602
-		$date = $s->getDate($this->getTimeStampFromText());
601
+		$s=Prado::createComponent('System.Util.TDateTimeStamp');
602
+		$date=$s->getDate($this->getTimeStampFromText());
603 603
 		//$date = @getdate($this->getTimeStampFromText());
604 604
 
605 605
 		$this->renderCalendarSelections($writer, $date);
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 
617 617
 	protected function hasDayPattern()
618 618
 	{
619
-		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',
619
+		$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter',
620 620
 						$this->getDateFormat());
621 621
 		return ($formatter->getDayPattern()!==null);
622 622
 	}
@@ -628,17 +628,17 @@  discard block
 block discarded – undo
628 628
 	 */
629 629
 	protected function renderCalendarSelections($writer, $date)
630 630
 	{
631
-		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',
631
+		$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter',
632 632
 						$this->getDateFormat());
633 633
 
634 634
 		foreach($formatter->getDayMonthYearOrdering() as $type)
635 635
 		{
636
-			if($type == 'day')
637
-				$this->renderCalendarDayOptions($writer,$date['mday']);
638
-			elseif($type == 'month')
639
-				$this->renderCalendarMonthOptions($writer,$date['mon']);
640
-			elseif($type == 'year')
641
-				$this->renderCalendarYearOptions($writer,$date['year']);
636
+			if($type=='day')
637
+				$this->renderCalendarDayOptions($writer, $date['mday']);
638
+			elseif($type=='month')
639
+				$this->renderCalendarMonthOptions($writer, $date['mon']);
640
+			elseif($type=='year')
641
+				$this->renderCalendarYearOptions($writer, $date['year']);
642 642
 		}
643 643
 	}
644 644
 
@@ -648,9 +648,9 @@  discard block
 block discarded – undo
648 648
 	 */
649 649
 	protected function getTimeStampFromText()
650 650
 	{
651
-		$pattern = $this->getDateFormat();
652
-		$pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern);
653
-		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$pattern);
651
+		$pattern=$this->getDateFormat();
652
+		$pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern);
653
+		$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern);
654 654
 		return $formatter->parse($this->getText());
655 655
 	}
656 656
 
@@ -660,12 +660,12 @@  discard block
 block discarded – undo
660 660
 	 * @param array list of selection options
661 661
 	 * @param mixed selected key.
662 662
 	 */
663
-	private function renderDropDownListOptions($writer,$options,$selected=null)
663
+	private function renderDropDownListOptions($writer, $options, $selected=null)
664 664
 	{
665 665
 		foreach($options as $k => $v)
666 666
 		{
667 667
 			$writer->addAttribute('value', $k);
668
-			if($k == $selected)
668
+			if($k==$selected)
669 669
 				$writer->addAttribute('selected', 'selected');
670 670
 			$writer->renderBeginTag('option');
671 671
 			$writer->write($v);
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 	 */
681 681
 	protected function renderCalendarDayOptions($writer, $selected=null)
682 682
 	{
683
-		$days = $this->getDropDownDayOptions();
683
+		$days=$this->getDropDownDayOptions();
684 684
 		$writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'day');
685 685
 		$writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'day');
686 686
 		$writer->addAttribute('class', 'datepicker_day_options');
@@ -696,13 +696,13 @@  discard block
 block discarded – undo
696 696
 	 */
697 697
 	protected function getDropDownDayOptions()
698 698
 	{
699
-		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',
699
+		$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter',
700 700
 						$this->getDateFormat());
701
-		$days = array();
702
-		$requiresPadding = $formatter->getDayPattern() === 'dd';
703
-		for($i=1;$i<=31;$i++)
701
+		$days=array();
702
+		$requiresPadding=$formatter->getDayPattern()==='dd';
703
+		for($i=1; $i <= 31; $i++)
704 704
 		{
705
-			$days[$i] = $requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i;
705
+			$days[$i]=$requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i;
706 706
 		}
707 707
 		return $days;
708 708
 	}
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 	 */
715 715
 	protected function renderCalendarMonthOptions($writer, $selected=null)
716 716
 	{
717
-		$info = $this->getLocalizedCalendarInfo();
717
+		$info=$this->getLocalizedCalendarInfo();
718 718
 		$writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'month');
719 719
 		$writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'month');
720 720
 		$writer->addAttribute('class', 'datepicker_month_options');
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
 			$writer->addAttribute('disabled', 'disabled');
723 723
 		$writer->renderBeginTag('select');
724 724
 		$this->renderDropDownListOptions($writer,
725
-					$this->getLocalizedMonthNames($info), $selected-1);
725
+					$this->getLocalizedMonthNames($info), $selected - 1);
726 726
 		$writer->renderEndTag();
727 727
 	}
728 728
 
@@ -735,18 +735,18 @@  discard block
 block discarded – undo
735 735
 	 */
736 736
 	protected function getLocalizedMonthNames($info)
737 737
 	{
738
-		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',
738
+		$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter',
739 739
 						$this->getDateFormat());
740 740
 		switch($formatter->getMonthPattern())
741 741
 		{
742 742
 			case 'MMM': return $info->getAbbreviatedMonthNames();
743 743
 			case 'MM':
744
-				$array = array();
745
-				for($i=1;$i<=12;$i++)
746
-						$array[$i-1] = $i < 10 ? '0'.$i : $i;
744
+				$array=array();
745
+				for($i=1; $i <= 12; $i++)
746
+						$array[$i - 1]=$i < 10 ? '0'.$i : $i;
747 747
 				return $array;
748 748
 			case 'M':
749
-				$array = array(); for($i=1;$i<=12;$i++) $array[$i-1] = $i;
749
+				$array=array(); for($i=1; $i <= 12; $i++) $array[$i - 1]=$i;
750 750
 				return $array;
751 751
 			default :	return $info->getMonthNames();
752 752
 		}
@@ -759,9 +759,9 @@  discard block
 block discarded – undo
759 759
 	 */
760 760
 	protected function renderCalendarYearOptions($writer, $selected=null)
761 761
 	{
762
-		$years = array();
763
-		for($i = $this->getFromYear(); $i <= $this->getUpToYear(); $i++)
764
-			$years[$i] = $i;
762
+		$years=array();
763
+		for($i=$this->getFromYear(); $i <= $this->getUpToYear(); $i++)
764
+			$years[$i]=$i;
765 765
 		$writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'year');
766 766
 		$writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'year');
767 767
 		$writer->addAttribute('class', 'datepicker_year_options');
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
 		$writer->addAttribute('id', $this->getDatePickerButtonID());
791 791
 		$writer->addAttribute('type', 'button');
792 792
 		$writer->addAttribute('class', $this->getCssClass().' TDatePickerButton');
793
-		$writer->addAttribute('value',$this->getButtonText());
793
+		$writer->addAttribute('value', $this->getButtonText());
794 794
 		if(!$this->getEnabled(true))
795 795
 			$writer->addAttribute('disabled', 'disabled');
796 796
 		$writer->renderBeginTag("input");
@@ -803,8 +803,8 @@  discard block
 block discarded – undo
803 803
 	 */
804 804
 	 protected function renderImageButtonDatePicker($writer)
805 805
 	{
806
-		$url = $this->getButtonImageUrl();
807
-		$url = empty($url) ? $this->getAssetUrl('calendar.png') : $url;
806
+		$url=$this->getButtonImageUrl();
807
+		$url=empty($url) ? $this->getAssetUrl('calendar.png') : $url;
808 808
 		$writer->addAttribute('id', $this->getDatePickerButtonID());
809 809
 		$writer->addAttribute('src', $url);
810 810
 		$writer->addAttribute('alt', ' ');
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 	 */
824 824
 	protected function getAssetUrl($file='')
825 825
 	{
826
-		$base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl();
826
+		$base=$this->getPage()->getClientScript()->getPradoScriptAssetUrl();
827 827
 		return $base.'/'.self::SCRIPT_PATH.'/'.$file;
828 828
 	}
829 829
 
@@ -833,8 +833,8 @@  discard block
 block discarded – undo
833 833
 	 */
834 834
 	protected function publishCalendarStyle()
835 835
 	{
836
-		$url = $this->getAssetUrl($this->getCalendarStyle().'.css');
837
-		$cs = $this->getPage()->getClientScript();
836
+		$url=$this->getAssetUrl($this->getCalendarStyle().'.css');
837
+		$cs=$this->getPage()->getClientScript();
838 838
 		if(!$cs->isStyleSheetFileRegistered($url))
839 839
 			$cs->registerStyleSheetFile($url, $url);
840 840
 		return $url;
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
 	protected function addAttributesToRender($writer)
848 848
 	{
849 849
 		parent::addAttributesToRender($writer);
850
-		$writer->addAttribute('id',$this->getClientID());
850
+		$writer->addAttribute('id', $this->getClientID());
851 851
 	}
852 852
 
853 853
 	/**
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
 	{
858 858
 		if($this->getShowCalendar())
859 859
 		{
860
-			$cs = $this->getPage()->getClientScript();
860
+			$cs=$this->getPage()->getClientScript();
861 861
 			$cs->registerPradoScript("datepicker");
862 862
 		}
863 863
 	}
@@ -866,16 +866,16 @@  discard block
 block discarded – undo
866 866
 	{
867 867
 		if($this->getShowCalendar())
868 868
 		{
869
-			$cs = $this->getPage()->getClientScript();
869
+			$cs=$this->getPage()->getClientScript();
870 870
 			if(!$cs->isEndScriptRegistered('TDatePicker.spacer'))
871 871
 			{
872
-				$spacer = $this->getAssetUrl('spacer.gif');
873
-				$code = "Prado.WebUI.TDatePicker.spacer = '$spacer';";
872
+				$spacer=$this->getAssetUrl('spacer.gif');
873
+				$code="Prado.WebUI.TDatePicker.spacer = '$spacer';";
874 874
 				$cs->registerEndScript('TDatePicker.spacer', $code);
875 875
 			}
876 876
 
877
-			$options = TJavaScript::encode($this->getDatePickerOptions());
878
-			$code = "new Prado.WebUI.TDatePicker($options);";
877
+			$options=TJavaScript::encode($this->getDatePickerOptions());
878
+			$code="new Prado.WebUI.TDatePicker($options);";
879 879
 			$cs->registerEndScript("prado:".$this->getClientID(), $code);
880 880
 		}
881 881
 	}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TListControl.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 */
114 114
 	public function getEnableClientScript()
115 115
 	{
116
-		return $this->getViewState('EnableClientScript',true);
116
+		return $this->getViewState('EnableClientScript', true);
117 117
 	}
118 118
 
119 119
 	/**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public function setEnableClientScript($value)
123 123
 	{
124
-		$this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true);
124
+		$this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true);
125 125
 	}
126 126
 
127 127
 	/**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 		$page=$this->getPage();
134 134
 		$page->ensureRenderInForm($this);
135 135
 		if($this->getIsMultiSelect())
136
-			$writer->addAttribute('multiple','multiple');
136
+			$writer->addAttribute('multiple', 'multiple');
137 137
 		if($this->getEnabled(true))
138 138
 		{
139 139
 			if($this->getAutoPostBack()
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 			}
145 145
 		}
146 146
 		else if($this->getEnabled())
147
-			$writer->addAttribute('disabled','disabled');
147
+			$writer->addAttribute('disabled', 'disabled');
148 148
 		parent::addAttributesToRender($writer);
149 149
 	}
150 150
 
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
 	 */
154 154
 	protected function renderClientControlScript($writer)
155 155
 	{
156
-		$writer->addAttribute('id',$this->getClientID());
157
-		$this->getPage()->getClientScript()->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions());
156
+		$writer->addAttribute('id', $this->getClientID());
157
+		$this->getPage()->getClientScript()->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions());
158 158
 	}
159 159
 
160 160
 	/**
@@ -172,10 +172,10 @@  discard block
 block discarded – undo
172 172
 	 */
173 173
 	protected function getPostBackOptions()
174 174
 	{
175
-		$options['ID'] = $this->getClientID();
176
-		$options['CausesValidation'] = $this->getCausesValidation();
177
-		$options['ValidationGroup'] = $this->getValidationGroup();
178
-		$options['EventTarget'] = $this->getUniqueID();
175
+		$options['ID']=$this->getClientID();
176
+		$options['CausesValidation']=$this->getCausesValidation();
177
+		$options['ValidationGroup']=$this->getValidationGroup();
178
+		$options['EventTarget']=$this->getUniqueID();
179 179
 		return $options;
180 180
 	}
181 181
 
@@ -224,18 +224,18 @@  discard block
 block discarded – undo
224 224
 			$item=$items->createListItem();
225 225
 			if(is_array($object) || is_object($object))
226 226
 			{
227
-				$text=TDataFieldAccessor::getDataFieldValue($object,$textField);
228
-				$value=TDataFieldAccessor::getDataFieldValue($object,$valueField);
227
+				$text=TDataFieldAccessor::getDataFieldValue($object, $textField);
228
+				$value=TDataFieldAccessor::getDataFieldValue($object, $valueField);
229 229
 				$item->setValue($value);
230 230
 				if($groupField!=='')
231
-					$item->setAttribute('Group',TDataFieldAccessor::getDataFieldValue($object,$groupField));
231
+					$item->setAttribute('Group', TDataFieldAccessor::getDataFieldValue($object, $groupField));
232 232
 			}
233 233
 			else
234 234
 			{
235 235
 				$text=$object;
236 236
 				$item->setValue("$key");
237 237
 			}
238
-			$item->setText($this->formatDataValue($textFormat,$text));
238
+			$item->setText($this->formatDataValue($textFormat, $text));
239 239
 		}
240 240
 		// SelectedValue or SelectedIndex may be set before databinding
241 241
 		// so we make them be effective now
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 	{
288 288
 		parent::saveState();
289 289
 		if($this->_items)
290
-			$this->setViewState('Items',$this->_items->saveState(),null);
290
+			$this->setViewState('Items', $this->_items->saveState(), null);
291 291
 		else
292 292
 			$this->clearViewState('Items');
293 293
 	}
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 		if(!$this->getIsDataBound())
304 304
 		{
305 305
 			$this->_items=$this->createListItemCollection();
306
-			$this->_items->loadState($this->getViewState('Items',null));
306
+			$this->_items->loadState($this->getViewState('Items', null));
307 307
 		}
308 308
 		$this->clearViewState('Items');
309 309
 	}
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 	 */
322 322
 	public function getAppendDataBoundItems()
323 323
 	{
324
-		return $this->getViewState('AppendDataBoundItems',false);
324
+		return $this->getViewState('AppendDataBoundItems', false);
325 325
 	}
326 326
 
327 327
 	/**
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 	 */
330 330
 	public function setAppendDataBoundItems($value)
331 331
 	{
332
-		$this->setViewState('AppendDataBoundItems',TPropertyValue::ensureBoolean($value),false);
332
+		$this->setViewState('AppendDataBoundItems', TPropertyValue::ensureBoolean($value), false);
333 333
 	}
334 334
 
335 335
 	/**
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 	 */
340 340
 	public function getAutoPostBack()
341 341
 	{
342
-		return $this->getViewState('AutoPostBack',false);
342
+		return $this->getViewState('AutoPostBack', false);
343 343
 	}
344 344
 
345 345
 	/**
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 	 */
351 351
 	public function setAutoPostBack($value)
352 352
 	{
353
-		$this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),false);
353
+		$this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), false);
354 354
 	}
355 355
 
356 356
 	/**
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 	 */
359 359
 	public function getCausesValidation()
360 360
 	{
361
-		return $this->getViewState('CausesValidation',true);
361
+		return $this->getViewState('CausesValidation', true);
362 362
 	}
363 363
 
364 364
 	/**
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 	 */
367 367
 	public function setCausesValidation($value)
368 368
 	{
369
-		$this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true);
369
+		$this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true);
370 370
 	}
371 371
 
372 372
 	/**
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 	 */
375 375
 	public function getDataTextField()
376 376
 	{
377
-		return $this->getViewState('DataTextField','');
377
+		return $this->getViewState('DataTextField', '');
378 378
 	}
379 379
 
380 380
 	/**
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 	 */
383 383
 	public function setDataTextField($value)
384 384
 	{
385
-		$this->setViewState('DataTextField',$value,'');
385
+		$this->setViewState('DataTextField', $value, '');
386 386
 	}
387 387
 
388 388
 	/**
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 	 */
391 391
 	public function getDataTextFormatString()
392 392
 	{
393
-		return $this->getViewState('DataTextFormatString','');
393
+		return $this->getViewState('DataTextFormatString', '');
394 394
 	}
395 395
 
396 396
 	/**
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 	 */
403 403
 	public function setDataTextFormatString($value)
404 404
 	{
405
-		$this->setViewState('DataTextFormatString',$value,'');
405
+		$this->setViewState('DataTextFormatString', $value, '');
406 406
 	}
407 407
 
408 408
 	/**
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	 */
411 411
 	public function getDataValueField()
412 412
 	{
413
-		return $this->getViewState('DataValueField','');
413
+		return $this->getViewState('DataValueField', '');
414 414
 	}
415 415
 
416 416
 	/**
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 	 */
419 419
 	public function setDataValueField($value)
420 420
 	{
421
-		$this->setViewState('DataValueField',$value,'');
421
+		$this->setViewState('DataValueField', $value, '');
422 422
 	}
423 423
 
424 424
 	/**
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 	 */
427 427
 	public function getDataGroupField()
428 428
 	{
429
-		return $this->getViewState('DataGroupField','');
429
+		return $this->getViewState('DataGroupField', '');
430 430
 	}
431 431
 
432 432
 	/**
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 	 */
435 435
 	public function setDataGroupField($value)
436 436
 	{
437
-		$this->setViewState('DataGroupField',$value,'');
437
+		$this->setViewState('DataGroupField', $value, '');
438 438
 	}
439 439
 
440 440
 	/**
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 	 */
443 443
 	public function getItemCount()
444 444
 	{
445
-		return $this->_items?$this->_items->getCount():0;
445
+		return $this->_items ? $this->_items->getCount() : 0;
446 446
 	}
447 447
 
448 448
 	/**
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 	 */
451 451
 	public function getHasItems()
452 452
 	{
453
-		return ($this->_items && $this->_items->getCount()>0);
453
+		return ($this->_items && $this->_items->getCount() > 0);
454 454
 	}
455 455
 
456 456
 	/**
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 		if($this->_items)
472 472
 		{
473 473
 			$n=$this->_items->getCount();
474
-			for($i=0;$i<$n;++$i)
474
+			for($i=0; $i < $n; ++$i)
475 475
 				if($this->_items->itemAt($i)->getSelected())
476 476
 					return $i;
477 477
 		}
@@ -483,12 +483,12 @@  discard block
 block discarded – undo
483 483
 	 */
484 484
 	public function setSelectedIndex($index)
485 485
 	{
486
-		if(($index=TPropertyValue::ensureInteger($index))<0)
486
+		if(($index=TPropertyValue::ensureInteger($index)) < 0)
487 487
 			$index=-1;
488 488
 		if($this->_items)
489 489
 		{
490 490
 			$this->clearSelection();
491
-			if($index>=0 && $index<$this->_items->getCount())
491
+			if($index >= 0 && $index < $this->_items->getCount())
492 492
 				$this->_items->itemAt($index)->setSelected(true);
493 493
 		}
494 494
 		$this->_cachedSelectedIndex=$index;
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 		if($this->_items)
506 506
 		{
507 507
 			$n=$this->_items->getCount();
508
-			for($i=0;$i<$n;++$i)
508
+			for($i=0; $i < $n; ++$i)
509 509
 				if($this->_items->itemAt($i)->getSelected())
510 510
 					$selections[]=$i;
511 511
 		}
@@ -525,14 +525,14 @@  discard block
 block discarded – undo
525 525
 				$n=$this->_items->getCount();
526 526
 				foreach($indices as $index)
527 527
 				{
528
-					if($index>=0 && $index<$n)
528
+					if($index >= 0 && $index < $n)
529 529
 						$this->_items->itemAt($index)->setSelected(true);
530 530
 				}
531 531
 			}
532 532
 			$this->_cachedSelectedIndices=$indices;
533 533
 		}
534 534
 		else
535
-			throw new TNotSupportedException('listcontrol_multiselect_unsupported',get_class($this));
535
+			throw new TNotSupportedException('listcontrol_multiselect_unsupported', get_class($this));
536 536
 
537 537
 		if($this->getAdapter() instanceof IListControlAdapter)
538 538
 			$this->getAdapter()->setSelectedIndices($indices);
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 	 */
544 544
 	public function getSelectedItem()
545 545
 	{
546
-		if(($index=$this->getSelectedIndex())>=0)
546
+		if(($index=$this->getSelectedIndex()) >= 0)
547 547
 			return $this->_items->itemAt($index);
548 548
 		else
549 549
 			return null;
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 	public function getSelectedValue()
582 582
 	{
583 583
 		$index=$this->getSelectedIndex();
584
-		return $index>=0?$this->getItems()->itemAt($index)->getValue():'';
584
+		return $index >= 0 ? $this->getItems()->itemAt($index)->getValue() : '';
585 585
 	}
586 586
 
587 587
 	/**
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 			$this->_cachedSelectedValues=$values;
650 650
 		}
651 651
 		else
652
-			throw new TNotSupportedException('listcontrol_multiselect_unsupported',get_class($this));
652
+			throw new TNotSupportedException('listcontrol_multiselect_unsupported', get_class($this));
653 653
 
654 654
 		if($this->getAdapter() instanceof IListControlAdapter)
655 655
 			$this->getAdapter()->setSelectedValues($values);
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
 	 */
692 692
 	public function getValidationGroup()
693 693
 	{
694
-		return $this->getViewState('ValidationGroup','');
694
+		return $this->getViewState('ValidationGroup', '');
695 695
 	}
696 696
 
697 697
 	/**
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 	 */
700 700
 	public function setValidationGroup($value)
701 701
 	{
702
-		$this->setViewState('ValidationGroup',$value,'');
702
+		$this->setViewState('ValidationGroup', $value, '');
703 703
 	}
704 704
 
705 705
 	/**
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 	 */
709 709
 	public function getPromptText()
710 710
 	{
711
-		return $this->getViewState('PromptText','');
711
+		return $this->getViewState('PromptText', '');
712 712
 	}
713 713
 
714 714
 	/**
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 	 */
718 718
 	public function setPromptText($value)
719 719
 	{
720
-		$this->setViewState('PromptText',$value,'');
720
+		$this->setViewState('PromptText', $value, '');
721 721
 	}
722 722
 
723 723
 	/**
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
 	 */
728 728
 	public function getPromptValue()
729 729
 	{
730
-		return $this->getViewState('PromptValue','');
730
+		return $this->getViewState('PromptValue', '');
731 731
 	}
732 732
 
733 733
 	/**
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
 	 */
738 738
 	public function setPromptValue($value)
739 739
 	{
740
-		$this->setViewState('PromptValue',(string)$value,'');
740
+		$this->setViewState('PromptValue', (string) $value, '');
741 741
 	}
742 742
 
743 743
 	/**
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
 	 */
749 749
 	public function onSelectedIndexChanged($param)
750 750
 	{
751
-		$this->raiseEvent('OnSelectedIndexChanged',$this,$param);
751
+		$this->raiseEvent('OnSelectedIndexChanged', $this, $param);
752 752
 		$this->onTextChanged($param);
753 753
 	}
754 754
 
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
 	 */
761 761
 	public function onTextChanged($param)
762 762
 	{
763
-		$this->raiseEvent('OnTextChanged',$this,$param);
763
+		$this->raiseEvent('OnTextChanged', $this, $param);
764 764
 	}
765 765
 
766 766
 	/**
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
 			$value=$text;
777 777
 		if($value!=='')
778 778
 		{
779
-			$writer->addAttribute('value',$value);
779
+			$writer->addAttribute('value', $value);
780 780
 			$writer->renderBeginTag('option');
781 781
 			$writer->write(THttpUtility::htmlEncode($text));
782 782
 			$writer->renderEndTag();
@@ -814,14 +814,14 @@  discard block
 block discarded – undo
814 814
 							}
815 815
 							if($group!==null)
816 816
 							{
817
-								$writer->addAttribute('label',$group);
817
+								$writer->addAttribute('label', $group);
818 818
 								$writer->renderBeginTag('optgroup');
819 819
 								$writer->writeLine();
820 820
 								$previousGroup=$group;
821 821
 							}
822 822
 						}
823 823
 						foreach($item->getAttributes() as $name=>$value)
824
-							$writer->addAttribute($name,$value);
824
+							$writer->addAttribute($name, $value);
825 825
 					}
826 826
 					else if($previousGroup!==null)
827 827
 					{
@@ -830,8 +830,8 @@  discard block
 block discarded – undo
830 830
 						$previousGroup=null;
831 831
 					}
832 832
 					if($item->getSelected())
833
-						$writer->addAttribute('selected','selected');
834
-					$writer->addAttribute('value',$item->getValue());
833
+						$writer->addAttribute('selected', 'selected');
834
+					$writer->addAttribute('value', $item->getValue());
835 835
 					$writer->renderBeginTag('option');
836 836
 					$writer->write(THttpUtility::htmlEncode($item->getText()));
837 837
 					$writer->renderEndTag();
@@ -858,13 +858,13 @@  discard block
 block discarded – undo
858 858
 	 * @param mixed the data to be formatted
859 859
 	 * @return string the formatted result
860 860
 	 */
861
-	protected function formatDataValue($formatString,$value)
861
+	protected function formatDataValue($formatString, $value)
862 862
 	{
863 863
 		if($formatString==='')
864 864
 			return TPropertyValue::ensureString($value);
865 865
 		else if($formatString[0]==='#')
866 866
 		{
867
-			$expression=strtr(substr($formatString,1),array('{0}'=>'$value'));
867
+			$expression=strtr(substr($formatString, 1), array('{0}'=>'$value'));
868 868
 			try
869 869
 			{
870 870
 				if(eval("\$result=$expression;")===false)
@@ -873,11 +873,11 @@  discard block
 block discarded – undo
873 873
 			}
874 874
 			catch(Exception $e)
875 875
 			{
876
-				throw new TInvalidDataValueException('listcontrol_expression_invalid',get_class($this),$expression,$e->getMessage());
876
+				throw new TInvalidDataValueException('listcontrol_expression_invalid', get_class($this), $expression, $e->getMessage());
877 877
 			}
878 878
 		}
879 879
 		else
880
-			return sprintf($formatString,$value);
880
+			return sprintf($formatString, $value);
881 881
 	}
882 882
 }
883 883
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TPanel.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	{
72 72
 		parent::addAttributesToRender($writer);
73 73
 		if(($butt=$this->getDefaultButton())!=='')
74
-			$writer->addAttribute('id',$this->getClientID());
74
+			$writer->addAttribute('id', $this->getClientID());
75 75
 	}
76 76
 
77 77
 	/**
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	public function getGroupingText()
170 170
 	{
171
-		return $this->getViewState('GroupingText','');
171
+		return $this->getViewState('GroupingText', '');
172 172
 	}
173 173
 
174 174
 	/**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	 */
177 177
 	public function setGroupingText($value)
178 178
 	{
179
-		$this->setViewState('GroupingText',$value,'');
179
+		$this->setViewState('GroupingText', $value, '');
180 180
 	}
181 181
 
182 182
 	/**
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 		if(($butt=$this->getDefaultButton())!=='')
231 231
 		{
232 232
 			if(($button=$this->findControl($butt))===null)
233
-				throw new TInvalidDataValueException('panel_defaultbutton_invalid',$butt);
233
+				throw new TInvalidDataValueException('panel_defaultbutton_invalid', $butt);
234 234
 			else
235 235
 				$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
236 236
 		}
Please login to merge, or discard this patch.