Completed
Push — prado4-sauce ( 31ba42...77d75b )
by Fabio
16:20 queued 08:27
created
framework/Web/UI/WebControls/TTableRow.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
 	/**
91 91
 	 * Sets the horizontal alignment of the contents within the table item.
92
-     * Valid values include 'NotSet', 'Justify', 'Left', 'Right', 'Center'
92
+	 * Valid values include 'NotSet', 'Justify', 'Left', 'Right', 'Center'
93 93
 	 * @param string the horizontal alignment
94 94
 	 */
95 95
 	public function setHorizontalAlign($value)
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 	/**
112 112
 	 * Sets the vertical alignment of the contents within the table item.
113
-     * Valid values include 'NotSet','Top','Bottom','Middle'
113
+	 * Valid values include 'NotSet','Top','Bottom','Middle'
114 114
 	 * @param string the horizontal alignment
115 115
 	 */
116 116
 	public function setVerticalAlign($value)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public function getTableSection()
123 123
 	{
124
-		return $this->getViewState('TableSection',TTableRowSection::Body);
124
+		return $this->getViewState('TableSection', TTableRowSection::Body);
125 125
 	}
126 126
 
127 127
 	/**
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 */
130 130
 	public function setTableSection($value)
131 131
 	{
132
-		$this->setViewState('TableSection',TPropertyValue::ensureEnum($value,'Prado\\Web\\UI\\WebControls\\TTableRowSection'),TTableRowSection::Body);
132
+		$this->setViewState('TableSection', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TTableRowSection'), TTableRowSection::Body);
133 133
 	}
134 134
 
135 135
 	/**
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTabPanel.php 3 patches
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 	}
82 82
 
83 83
 	/**
84
-     * Returns the index of the active tab view.
85
-     * Note, this property may not return the correct index.
86
-     * To ensure the correctness, call {@link getActiveView()} first.
84
+	 * Returns the index of the active tab view.
85
+	 * Note, this property may not return the correct index.
86
+	 * To ensure the correctness, call {@link getActiveView()} first.
87 87
 	 * @return integer the zero-based index of the active tab view. If -1, it means no active tab view. Default is 0 (the first view is active).
88 88
 	 */
89 89
 	public function getActiveViewIndex()
@@ -100,24 +100,24 @@  discard block
 block discarded – undo
100 100
 		$this->setViewState('ActiveViewIndex',TPropertyValue::ensureInteger($value),0);
101 101
 	}
102 102
 
103
-    /**
104
-     * Returns the ID of the active tab view.
105
-     * Note, this property may not return the correct ID.
106
-     * To ensure the correctness, call {@link getActiveView()} first.
107
-     * @return string The ID of the active tab view. Defaults to '', meaning not set.
108
-     */
109
-    public function getActiveViewID()
110
-    {
103
+	/**
104
+	 * Returns the ID of the active tab view.
105
+	 * Note, this property may not return the correct ID.
106
+	 * To ensure the correctness, call {@link getActiveView()} first.
107
+	 * @return string The ID of the active tab view. Defaults to '', meaning not set.
108
+	 */
109
+	public function getActiveViewID()
110
+	{
111 111
 		return $this->getViewState('ActiveViewID','');
112
-    }
112
+	}
113 113
 
114
-    /**
115
-     * @param string The ID of the active tab view.
116
-     */
117
-    public function setActiveViewID($value)
118
-    {
114
+	/**
115
+	 * @param string The ID of the active tab view.
116
+	 */
117
+	public function setActiveViewID($value)
118
+	{
119 119
 		$this->setViewState('ActiveViewID',$value,'');
120
-    }
120
+	}
121 121
 
122 122
 	/**
123 123
 	 * Returns the currently active view.
@@ -172,63 +172,63 @@  discard block
 block discarded – undo
172 172
 			throw new TInvalidOperationException('tabpanel_view_inexistent');
173 173
 	}
174 174
 
175
-    /**
176
-     * @return bool status of automatic tab switch on hover
177
-     */
178
-    public function getAutoSwitch()
179
-    {
180
-        return TPropertyValue::ensureBoolean($this->getViewState('AutoSwitch'));
181
-    }
182
-
183
-    /**
184
-     * @param bool whether to enable automatic tab switch on hover
185
-     */
186
-    public function setAutoSwitch($value)
187
-    {
188
-        $this->setViewState('AutoSwitch',TPropertyValue::ensureBoolean($value));
189
-    }
190
-
191
-
192
-    /**
193
-     * @return string URL for the CSS file including all relevant CSS class definitions. Defaults to ''.
194
-     */
195
-    public function getCssUrl()
196
-    {
197
-        return $this->getViewState('CssUrl','default');
198
-    }
199
-
200
-    /**
201
-     * @param string URL for the CSS file including all relevant CSS class definitions.
202
-     */
203
-    public function setCssUrl($value)
204
-    {
205
-        $this->setViewState('CssUrl',TPropertyValue::ensureString($value),'');
206
-    }
207
-
208
-    /**
209
-     * @return string CSS class for the whole tab control div. Defaults to 'tab-panel'.
210
-     */
211
-    public function getCssClass()
212
-    {
213
-    	$cssClass=parent::getCssClass();
214
-    	return $cssClass===''?'tab-panel':$cssClass;
215
-    }
216
-
217
-    /**
218
-     * @return string CSS class for the currently displayed view div. Defaults to 'tab-view'.
219
-     */
220
-    public function getViewCssClass()
221
-    {
222
-        return $this->getViewStyle()->getCssClass();
223
-    }
224
-
225
-    /**
226
-     * @param string CSS class for the currently displayed view div.
227
-     */
228
-    public function setViewCssClass($value)
229
-    {
230
-        $this->getViewStyle()->setCssClass($value);
231
-    }
175
+	/**
176
+	 * @return bool status of automatic tab switch on hover
177
+	 */
178
+	public function getAutoSwitch()
179
+	{
180
+		return TPropertyValue::ensureBoolean($this->getViewState('AutoSwitch'));
181
+	}
182
+
183
+	/**
184
+	 * @param bool whether to enable automatic tab switch on hover
185
+	 */
186
+	public function setAutoSwitch($value)
187
+	{
188
+		$this->setViewState('AutoSwitch',TPropertyValue::ensureBoolean($value));
189
+	}
190
+
191
+
192
+	/**
193
+	 * @return string URL for the CSS file including all relevant CSS class definitions. Defaults to ''.
194
+	 */
195
+	public function getCssUrl()
196
+	{
197
+		return $this->getViewState('CssUrl','default');
198
+	}
199
+
200
+	/**
201
+	 * @param string URL for the CSS file including all relevant CSS class definitions.
202
+	 */
203
+	public function setCssUrl($value)
204
+	{
205
+		$this->setViewState('CssUrl',TPropertyValue::ensureString($value),'');
206
+	}
207
+
208
+	/**
209
+	 * @return string CSS class for the whole tab control div. Defaults to 'tab-panel'.
210
+	 */
211
+	public function getCssClass()
212
+	{
213
+		$cssClass=parent::getCssClass();
214
+		return $cssClass===''?'tab-panel':$cssClass;
215
+	}
216
+
217
+	/**
218
+	 * @return string CSS class for the currently displayed view div. Defaults to 'tab-view'.
219
+	 */
220
+	public function getViewCssClass()
221
+	{
222
+		return $this->getViewStyle()->getCssClass();
223
+	}
224
+
225
+	/**
226
+	 * @param string CSS class for the currently displayed view div.
227
+	 */
228
+	public function setViewCssClass($value)
229
+	{
230
+		$this->getViewStyle()->setCssClass($value);
231
+	}
232 232
 
233 233
 	/**
234 234
 	 * @return TStyle the style for all the view div
@@ -244,21 +244,21 @@  discard block
 block discarded – undo
244 244
 		return $style;
245 245
 	}
246 246
 
247
-    /**
248
-     * @return string CSS class for non-active tabs. Defaults to 'tab-normal'.
249
-     */
250
-    public function getTabCssClass()
251
-    {
252
-        return $this->getTabStyle()->getCssClass();
253
-    }
247
+	/**
248
+	 * @return string CSS class for non-active tabs. Defaults to 'tab-normal'.
249
+	 */
250
+	public function getTabCssClass()
251
+	{
252
+		return $this->getTabStyle()->getCssClass();
253
+	}
254 254
 
255
-    /**
256
-     * @param string CSS class for non-active tabs.
257
-     */
258
-    public function setTabCssClass($value)
259
-    {
260
-        $this->getTabStyle()->setCssClass($value);
261
-    }
255
+	/**
256
+	 * @param string CSS class for non-active tabs.
257
+	 */
258
+	public function setTabCssClass($value)
259
+	{
260
+		$this->getTabStyle()->setCssClass($value);
261
+	}
262 262
 
263 263
 	/**
264 264
 	 * @return TStyle the style for all the inactive tab div
@@ -274,21 +274,21 @@  discard block
 block discarded – undo
274 274
 		return $style;
275 275
 	}
276 276
 
277
-    /**
278
-     * @return string CSS class for the active tab. Defaults to 'tab-active'.
279
-     */
280
-    public function getActiveTabCssClass()
281
-    {
282
-        return $this->getActiveTabStyle()->getCssClass();
283
-    }
284
-
285
-    /**
286
-     * @param string CSS class for the active tab.
287
-     */
288
-    public function setActiveTabCssClass($value)
289
-    {
290
-        $this->getActiveTabStyle()->setCssClass($value);
291
-    }
277
+	/**
278
+	 * @return string CSS class for the active tab. Defaults to 'tab-active'.
279
+	 */
280
+	public function getActiveTabCssClass()
281
+	{
282
+		return $this->getActiveTabStyle()->getCssClass();
283
+	}
284
+
285
+	/**
286
+	 * @param string CSS class for the active tab.
287
+	 */
288
+	public function setActiveTabCssClass($value)
289
+	{
290
+		$this->getActiveTabStyle()->setCssClass($value);
291
+	}
292 292
 
293 293
 	/**
294 294
 	 * @return TStyle the style for the active tab div
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -136,15 +136,13 @@  discard block
 block discarded – undo
136 136
 				$activeView=$views->itemAt($index);
137 137
 			else
138 138
 				throw new TInvalidDataValueException('tabpanel_activeviewid_invalid',$id);
139
-		}
140
-		else if(($index=$this->getActiveViewIndex())>=0)
139
+		} else if(($index=$this->getActiveViewIndex())>=0)
141 140
 		{
142 141
 			if($index<$views->getCount())
143 142
 				$activeView=$views->itemAt($index);
144 143
 			else
145 144
 				throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid',$index);
146
-		}
147
-		else
145
+		} else
148 146
 		{
149 147
 			foreach($views as $index=>$view)
150 148
 			{
@@ -320,8 +318,7 @@  discard block
 block discarded – undo
320 318
 				$this->setActiveViewIndex($index);
321 319
 				$this->setActiveViewID($view->getID(false));
322 320
 				$view->setActive(true);
323
-			}
324
-			else
321
+			} else
325 322
 				$v->setActive(false);
326 323
 		}
327 324
 	}
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function getActiveViewIndex()
96 96
 	{
97
-		return $this->getViewState('ActiveViewIndex',0);
97
+		return $this->getViewState('ActiveViewIndex', 0);
98 98
 	}
99 99
 
100 100
 	/**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	public function setActiveViewIndex($value)
105 105
 	{
106
-		$this->setViewState('ActiveViewIndex',TPropertyValue::ensureInteger($value),0);
106
+		$this->setViewState('ActiveViewIndex', TPropertyValue::ensureInteger($value), 0);
107 107
 	}
108 108
 
109 109
     /**
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function getActiveViewID()
116 116
     {
117
-		return $this->getViewState('ActiveViewID','');
117
+		return $this->getViewState('ActiveViewID', '');
118 118
     }
119 119
 
120 120
     /**
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function setActiveViewID($value)
124 124
     {
125
-		$this->setViewState('ActiveViewID',$value,'');
125
+		$this->setViewState('ActiveViewID', $value, '');
126 126
     }
127 127
 
128 128
 	/**
@@ -138,17 +138,17 @@  discard block
 block discarded – undo
138 138
 		$views=$this->getViews();
139 139
 		if(($id=$this->getActiveViewID())!=='')
140 140
 		{
141
-			if(($index=$views->findIndexByID($id))>=0)
141
+			if(($index=$views->findIndexByID($id)) >= 0)
142 142
 				$activeView=$views->itemAt($index);
143 143
 			else
144
-				throw new TInvalidDataValueException('tabpanel_activeviewid_invalid',$id);
144
+				throw new TInvalidDataValueException('tabpanel_activeviewid_invalid', $id);
145 145
 		}
146
-		else if(($index=$this->getActiveViewIndex())>=0)
146
+		else if(($index=$this->getActiveViewIndex()) >= 0)
147 147
 		{
148
-			if($index<$views->getCount())
148
+			if($index < $views->getCount())
149 149
 				$activeView=$views->itemAt($index);
150 150
 			else
151
-				throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid',$index);
151
+				throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid', $index);
152 152
 		}
153 153
 		else
154 154
 		{
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	 */
173 173
 	public function setActiveView($view)
174 174
 	{
175
-		if($this->getViews()->indexOf($view)>=0)
175
+		if($this->getViews()->indexOf($view) >= 0)
176 176
 			$this->activateView($view);
177 177
 		else
178 178
 			throw new TInvalidOperationException('tabpanel_view_inexistent');
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      */
192 192
     public function setAutoSwitch($value)
193 193
     {
194
-        $this->setViewState('AutoSwitch',TPropertyValue::ensureBoolean($value));
194
+        $this->setViewState('AutoSwitch', TPropertyValue::ensureBoolean($value));
195 195
     }
196 196
 
197 197
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      */
201 201
     public function getCssUrl()
202 202
     {
203
-        return $this->getViewState('CssUrl','default');
203
+        return $this->getViewState('CssUrl', 'default');
204 204
     }
205 205
 
206 206
     /**
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
      */
209 209
     public function setCssUrl($value)
210 210
     {
211
-        $this->setViewState('CssUrl',TPropertyValue::ensureString($value),'');
211
+        $this->setViewState('CssUrl', TPropertyValue::ensureString($value), '');
212 212
     }
213 213
 
214 214
     /**
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
     public function getCssClass()
218 218
     {
219 219
     	$cssClass=parent::getCssClass();
220
-    	return $cssClass===''?'tab-panel':$cssClass;
220
+    	return $cssClass==='' ? 'tab-panel' : $cssClass;
221 221
     }
222 222
 
223 223
     /**
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
 	 */
242 242
 	public function getViewStyle()
243 243
 	{
244
-		if(($style=$this->getViewState('ViewStyle',null))===null)
244
+		if(($style=$this->getViewState('ViewStyle', null))===null)
245 245
 		{
246 246
 			$style=new TStyle;
247 247
 			$style->setCssClass('tab-view');
248
-			$this->setViewState('ViewStyle',$style,null);
248
+			$this->setViewState('ViewStyle', $style, null);
249 249
 		}
250 250
 		return $style;
251 251
 	}
@@ -271,11 +271,11 @@  discard block
 block discarded – undo
271 271
 	 */
272 272
 	public function getTabStyle()
273 273
 	{
274
-		if(($style=$this->getViewState('TabStyle',null))===null)
274
+		if(($style=$this->getViewState('TabStyle', null))===null)
275 275
 		{
276 276
 			$style=new TStyle;
277 277
 			$style->setCssClass('tab-normal');
278
-			$this->setViewState('TabStyle',$style,null);
278
+			$this->setViewState('TabStyle', $style, null);
279 279
 		}
280 280
 		return $style;
281 281
 	}
@@ -301,11 +301,11 @@  discard block
 block discarded – undo
301 301
 	 */
302 302
 	public function getActiveTabStyle()
303 303
 	{
304
-		if(($style=$this->getViewState('ActiveTabStyle',null))===null)
304
+		if(($style=$this->getViewState('ActiveTabStyle', null))===null)
305 305
 		{
306 306
 			$style=new TStyle;
307 307
 			$style->setCssClass('tab-active');
308
-			$this->setViewState('ActiveTabStyle',$style,null);
308
+			$this->setViewState('ActiveTabStyle', $style, null);
309 309
 		}
310 310
 		return $style;
311 311
 	}
@@ -339,11 +339,11 @@  discard block
 block discarded – undo
339 339
 	 * @param array the input data collection
340 340
 	 * @return boolean whether the data of the control has been changed
341 341
 	 */
342
-	public function loadPostData($key,$values)
342
+	public function loadPostData($key, $values)
343 343
 	{
344 344
 		if(($index=$values[$this->getClientID().'_1'])!==null)
345 345
 		{
346
-			$index=(int)$index;
346
+			$index=(int) $index;
347 347
 			$currentIndex=$this->getActiveViewIndex();
348 348
 			if($currentIndex!==$index)
349 349
 			{
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 	 */
384 384
 	protected function addAttributesToRender($writer)
385 385
 	{
386
-		$writer->addAttribute('id',$this->getClientID());
386
+		$writer->addAttribute('id', $this->getClientID());
387 387
 		$this->setCssClass($this->getCssClass());
388 388
 		parent::addAttributesToRender($writer);
389 389
 	}
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 	public function onPreRender($param)
397 397
 	{
398 398
 		parent::onPreRender($param);
399
-		$this->getActiveView();  // determine the active view
399
+		$this->getActiveView(); // determine the active view
400 400
 		$this->registerStyleSheet();
401 401
 
402 402
 		$page=$this->getPage();
@@ -411,17 +411,17 @@  discard block
 block discarded – undo
411 411
 	 */
412 412
 	protected function registerStyleSheet()
413 413
 	{
414
-		$url = $this->getCssUrl();
414
+		$url=$this->getCssUrl();
415 415
 
416
-		if($url === '') {
416
+		if($url==='') {
417 417
 			return;
418 418
 		}
419 419
 
420
-		if($url === 'default') {
421
-			$url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'tabpanel.css');
420
+		if($url==='default') {
421
+			$url=$this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'tabpanel.css');
422 422
 		}
423 423
 
424
-		if($url !== '') {
424
+		if($url!=='') {
425 425
 			$this->getPage()->getClientScript()->registerStyleSheetFile($url, $url);
426 426
 		}
427 427
 	}
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 		$code="new $className($options);";
440 440
 		$cs->registerEndScript("prado:$id", $code);
441 441
 		// ensure an item is always active and visible
442
-		$index = $this->getActiveViewIndex();
442
+		$index=$this->getActiveViewIndex();
443 443
 		if(!$this->getViews()->itemAt($index)->Visible)
444 444
 			$index=0;
445 445
 		$cs->registerHiddenField($id.'_1', $index);
@@ -460,19 +460,19 @@  discard block
 block discarded – undo
460 460
 	 */
461 461
 	protected function getClientOptions()
462 462
 	{
463
-		$options['ID'] = $this->getClientID();
464
-		$options['ActiveCssClass'] = $this->getActiveTabCssClass();
465
-		$options['NormalCssClass'] = $this->getTabCssClass();
466
-		$viewIDs = array();
467
-		$viewVis = array();
463
+		$options['ID']=$this->getClientID();
464
+		$options['ActiveCssClass']=$this->getActiveTabCssClass();
465
+		$options['NormalCssClass']=$this->getTabCssClass();
466
+		$viewIDs=array();
467
+		$viewVis=array();
468 468
 		foreach($this->getViews() as $view)
469 469
 		{
470
-			$viewIDs[] = $view->getClientID();
471
-			$viewVis[] = $view->getVisible();
470
+			$viewIDs[]=$view->getClientID();
471
+			$viewVis[]=$view->getVisible();
472 472
 		}
473
-		$options['Views'] = $viewIDs;
474
-		$options['ViewsVis'] = $viewVis;
475
-		$options['AutoSwitch'] = $this->getAutoSwitch();
473
+		$options['Views']=$viewIDs;
474
+		$options['ViewsVis']=$viewVis;
475
+		$options['AutoSwitch']=$this->getAutoSwitch();
476 476
 
477 477
 		return $options;
478 478
 	}
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 	public function renderContents($writer)
508 508
 	{
509 509
 		$views=$this->getViews();
510
-		if($views->getCount()>0)
510
+		if($views->getCount() > 0)
511 511
 		{
512 512
 			$writer->writeLine();
513 513
 			// render tab bar
Please login to merge, or discard this patch.
framework/Web/UI/JuiControls/TJuiDatePicker.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,10 +90,10 @@
 block discarded – undo
90 90
 	{
91 91
 		return array('altField', 'altFormat', 'appendText', 'autoSize', 'buttonImage', 'buttonImageOnly', 'buttonText', 'calculateWeek',
92 92
 								 'changeMonth', 'changeYear', 'closeText', 'constrainInput', 'currentText', 'dateFormat', 'dayNames', 'dayNamesMin',
93
-				         'dayNamesShort', 'defaultDate', 'duration', 'firstDay', 'gotoCurrent', 'hideIfNoPrevNext', 'isRTL', 'maxDate',
93
+						 'dayNamesShort', 'defaultDate', 'duration', 'firstDay', 'gotoCurrent', 'hideIfNoPrevNext', 'isRTL', 'maxDate',
94 94
 								 'minDate', 'monthNames', 'monthNamesShort', 'navigationAsDateFormat', 'nextText', 'numberOfMonths', 'prevText',
95 95
 								 'selectOtherMonths', 'shortYearCutoff', 'showAnim', 'showButtonPanel', 'showCurrentAtPos', 'showMonthAfterYear',
96
-				         'showOn', 'showOptions', 'showOtherMonths', 'showWeek', 'stepMonths', 'weekHeader', 'yearRange', 'yearSuffix',
96
+						 'showOn', 'showOptions', 'showOtherMonths', 'showWeek', 'stepMonths', 'weekHeader', 'yearRange', 'yearSuffix',
97 97
 								 'beforeShow', 'beforeShowDay', 'onChangeMonthYear', 'onClose', 'onSelect');
98 98
 	}
99 99
 
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * it will register an additional clientscript to set the language specific global default settings.
44 44
 	 * @var boolean true, if this is the first instance of TJuiDatePicker, false otherwise
45 45
 	 */
46
-	private static $_first = true;
46
+	private static $_first=true;
47 47
 
48 48
 	/**
49 49
 	 * Creates a new callback control, sets the adapter to
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public function getOptions()
80 80
 	{
81
-		if (($options=$this->getViewState('JuiOptions'))===null)
81
+		if(($options=$this->getViewState('JuiOptions'))===null)
82 82
 		{
83 83
 		  $options=new TJuiControlOptions($this);
84 84
 		  $this->setViewState('JuiOptions', $options);
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 	 */
173 173
 	protected function getCurrentCulture()
174 174
 	{
175
-		$app = $this->getApplication()->getGlobalization(false);
176
-		return $this->getCulture() == '' ?
175
+		$app=$this->getApplication()->getGlobalization(false);
176
+		return $this->getCulture()=='' ?
177 177
 				($app ? $app->getCulture() : 'en') : $this->getCulture();
178 178
 	}
179 179
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 	 */
183 183
 	public function getDateFormat()
184 184
 	{
185
-		return $this->getViewState('DateFormat','dd-MM-yyyy');
185
+		return $this->getViewState('DateFormat', 'dd-MM-yyyy');
186 186
 	}
187 187
 
188 188
 	/**
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	 */
192 192
 	public function setDateFormat($value)
193 193
 	{
194
-		$this->setViewState('DateFormat',$value,'dd-MM-yyyy');
194
+		$this->setViewState('DateFormat', $value, 'dd-MM-yyyy');
195 195
 	}
196 196
 
197 197
 	/**
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
 			$this->setText('');
258 258
 		else
259 259
 		{
260
-			$date = TPropertyValue::ensureFloat($value);
261
-			$formatter = new TSimpleDateFormatter($this->getDateFormat());
260
+			$date=TPropertyValue::ensureFloat($value);
261
+			$formatter=new TSimpleDateFormatter($this->getDateFormat());
262 262
 			$this->setText($formatter->format($date));
263 263
 		}
264 264
 	}
@@ -269,9 +269,9 @@  discard block
 block discarded – undo
269 269
 	 */
270 270
 	protected function getTimeStampFromText()
271 271
 	{
272
-		$pattern = $this->getDateFormat();
273
-		$pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern);
274
-		$formatter = new TSimpleDateFormatter($pattern);
272
+		$pattern=$this->getDateFormat();
273
+		$pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern);
274
+		$formatter=new TSimpleDateFormatter($pattern);
275 275
 		return $formatter->parse($this->getText());
276 276
 	}
277 277
 
@@ -282,10 +282,10 @@  discard block
 block discarded – undo
282 282
 	 */
283 283
 	public function getValidationPropertyValue()
284 284
 	{
285
-		if(($text = $this->getText()) === '')
285
+		if(($text=$this->getText())==='')
286 286
 			return '';
287
-		$date = $this->getTimeStamp();
288
-		return $date == null ? $text : $date;
287
+		$date=$this->getTimeStamp();
288
+		return $date==null ? $text : $date;
289 289
 	}
290 290
 
291 291
 }
292 292
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveMultiView.php 3 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 class TActiveMultiView extends TMultiView implements IActiveControl
31 31
 {
32 32
 	/**
33
-	* Creates a new callback control, sets the adapter to
34
-	* TActiveControlAdapter.
35
-	*/
33
+	 * Creates a new callback control, sets the adapter to
34
+	 * TActiveControlAdapter.
35
+	 */
36 36
 	public function __construct()
37 37
 	{
38 38
 		parent::__construct();
@@ -40,28 +40,28 @@  discard block
 block discarded – undo
40 40
 	}
41 41
 
42 42
 	/**
43
-	* @return TBaseActiveControl standard active control options.
44
-	*/
43
+	 * @return TBaseActiveControl standard active control options.
44
+	 */
45 45
 	public function getActiveControl()
46 46
 	{
47 47
 		return $this->getAdapter()->getBaseActiveControl();
48 48
 	}
49 49
 
50 50
 	/**
51
-	* Returns the id of the surrounding container (span).
52
-	* @return string container id
53
-	*/
51
+	 * Returns the id of the surrounding container (span).
52
+	 * @return string container id
53
+	 */
54 54
 	protected function getContainerID()
55 55
 	{
56 56
 		return $this->ClientID.'_Container';
57 57
 	}
58 58
 
59 59
 	/**
60
-	* Renders the TActiveMultiView.
61
-	* If the MutliView did not pass the prerender phase yet, it will register itself for rendering later.
62
-	* Else it will call the {@link renderMultiView()} method which will do the rendering of the MultiView.
63
-	* @param THtmlWriter writer for the rendering purpose
64
-	*/
60
+	 * Renders the TActiveMultiView.
61
+	 * If the MutliView did not pass the prerender phase yet, it will register itself for rendering later.
62
+	 * Else it will call the {@link renderMultiView()} method which will do the rendering of the MultiView.
63
+	 * @param THtmlWriter writer for the rendering purpose
64
+	 */
65 65
 	public function render($writer)
66 66
 	{
67 67
 		if($this->getHasPreRendered()) {
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 	}
75 75
 
76 76
 	/**
77
-	* Renders the TActiveMultiView by writing a span tag with the container id obtained from {@link getContainerID()}
78
-	* which will be called by the replacement method of the client script to update it's content.
79
-	* @param $writer THtmlWriter writer for the rendering purpose
80
-	*/
77
+	 * Renders the TActiveMultiView by writing a span tag with the container id obtained from {@link getContainerID()}
78
+	 * which will be called by the replacement method of the client script to update it's content.
79
+	 * @param $writer THtmlWriter writer for the rendering purpose
80
+	 */
81 81
 	protected function renderMultiView($writer)
82 82
 	{
83 83
 		$writer->addAttribute('id', $this->getContainerID());
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
 	}
88 88
 
89 89
 	/**
90
-	* @param integer the zero-based index of the current view in the view collection. -1 if no active view.
91
-	* @throws TInvalidDataValueException if the view index is invalid
92
-	*/
90
+	 * @param integer the zero-based index of the current view in the view collection. -1 if no active view.
91
+	 * @throws TInvalidDataValueException if the view index is invalid
92
+	 */
93 93
 	public function setActiveViewIndex($value)
94 94
 	{
95 95
 		$old=parent::getActiveViewIndex();
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
 	}
100 100
 
101 101
 	/**
102
-	* @param TView the view to be activated
103
-	* @throws TInvalidOperationException if the view is not in the view collection
104
-	*/
102
+	 * @param TView the view to be activated
103
+	 * @throws TInvalidOperationException if the view is not in the view collection
104
+	 */
105 105
 	public function setActiveView($value)
106 106
 	{
107 107
 		$old=parent::getActiveView();
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@
 block discarded – undo
58 58
 		if ($this->sourcepath === NULL)
59 59
 		{
60 60
 			$this->sourcepath = $sourcepath;
61
-		}
62
-		else
61
+		} else
63 62
 		{
64 63
 			$this->sourcepath->append($sourcepath);
65 64
 		}
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
 		if($this->getHasPreRendered()) {
68 68
 			$this->renderMultiView($writer);
69 69
 			if($this->getActiveControl()->canUpdateClientSide())
70
-				$this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer);
70
+				$this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(), $writer);
71 71
 		}
72 72
 		else
73
-			$this->getPage()->getAdapter()->registerControlToRender($this,$writer);
73
+			$this->getPage()->getAdapter()->registerControlToRender($this, $writer);
74 74
 	}
75 75
 
76 76
 	/**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		$old=parent::getActiveViewIndex();
96 96
 		parent::setActiveViewIndex($value);
97 97
 		if($this->getActiveControl()->canUpdateClientSide() && $old!=$value)
98
-			$this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
98
+			$this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter());
99 99
 	}
100 100
 
101 101
 	/**
@@ -107,6 +107,6 @@  discard block
 block discarded – undo
107 107
 		$old=parent::getActiveView();
108 108
 		parent::setActiveView($value);
109 109
 		if($this->getActiveControl()->canUpdateClientSide() && $old!=$value)
110
-			$this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
110
+			$this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter());
111 111
 	}
112 112
 }
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveDatePicker.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@
 block discarded – undo
32 32
 
33 33
 	/**
34 34
 	 * @return boolean a value indicating whether an automatic postback to the server
35
-     * will occur whenever the user modifies the text in the TActiveDatePicker control and
36
-     * then tabs out of the component. Defaults to true.
35
+	 * will occur whenever the user modifies the text in the TActiveDatePicker control and
36
+	 * then tabs out of the component. Defaults to true.
37 37
 	 */
38 38
 	public function getAutoPostBack()
39 39
 	{
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public function getAutoPostBack()
48 48
 	{
49
-		return $this->getViewState('AutoPostBack',true);
49
+		return $this->getViewState('AutoPostBack', true);
50 50
 	}
51 51
 
52 52
 	/**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 */
58 58
 	public function setAutoPostBack($value)
59 59
 	{
60
-		$this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),true);
60
+		$this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), true);
61 61
 	}
62 62
 
63 63
 	/**
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	protected function getDatePickerOptions()
68 68
 	{
69
-		$options = parent::getDatePickerOptions();
69
+		$options=parent::getDatePickerOptions();
70 70
 		$options['CausesValidation']=$this->getCausesValidation();
71 71
 		$options['ValidationGroup']=$this->getValidationGroup();
72
-		$options['EventTarget'] = $this->getUniqueID();
73
-		$options['ShowCalendar'] = $this->getShowCalendar();
74
-		$options['AutoPostBack'] = $this->getAutoPostBack();
72
+		$options['EventTarget']=$this->getUniqueID();
73
+		$options['ShowCalendar']=$this->getShowCalendar();
74
+		$options['AutoPostBack']=$this->getAutoPostBack();
75 75
 		return $options;
76 76
 	}
77 77
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	/**
90 90
 	 * @return TBaseActiveCallbackControl standard callback control options.
91 91
 	 */
92
-	public function getActiveControl(){
92
+	public function getActiveControl() {
93 93
 		return $this->getAdapter()->getBaseActiveControl();
94 94
 	}
95 95
 
@@ -97,21 +97,21 @@  discard block
 block discarded – undo
97 97
 	 * Client-side Text property can only be updated after the OnLoad stage.
98 98
 	 * @param string text content for the textbox
99 99
 	 */
100
-	public function setText($value){
101
-		if(parent::getText() === $value)
100
+	public function setText($value) {
101
+		if(parent::getText()===$value)
102 102
 			return;
103 103
 
104 104
 		parent::setText($value);
105
-		if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()){
105
+		if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()) {
106 106
 			$cb=$this->getPage()->getCallbackClient();
107 107
 			$cb->setValue($this, $value);
108
-			if ($this->getInputMode()==TDatePickerInputMode::DropDownList)
108
+			if($this->getInputMode()==TDatePickerInputMode::DropDownList)
109 109
 			{
110
-				$s = new TDateTimeStamp;
111
-				$date = $s->getDate($this->getTimeStampFromText());
110
+				$s=new TDateTimeStamp;
111
+				$date=$s->getDate($this->getTimeStampFromText());
112 112
 				$id=$this->getClientID();
113 113
 				$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'day', 'Value', $date['mday'], 'select');
114
-				$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'month', 'Value', $date['mon']-1, 'select');
114
+				$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'month', 'Value', $date['mon'] - 1, 'select');
115 115
 				$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'year', 'Value', $date['year'], 'select');
116 116
 
117 117
 			}
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	 * This method is mainly used by framework and control developers.
125 125
 	 * @param TCallbackEventParameter the event parameter
126 126
 	 */
127
- 	public function raiseCallbackEvent($param){
127
+ 	public function raiseCallbackEvent($param) {
128 128
 		$this->onCallback($param);
129 129
 	}
130 130
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	 * handler can be invoked.
136 136
 	 * @param TCallbackEventParameter event parameter to be passed to the event handlers
137 137
 	 */
138
-	public function onCallback($param){
138
+	public function onCallback($param) {
139 139
 		$this->raiseEvent('OnCallback', $this, $param);
140 140
 	}
141 141
 
@@ -145,22 +145,22 @@  discard block
 block discarded – undo
145 145
 
146 146
 	protected function registerCalendarClientScriptPre()
147 147
 	{
148
-		$cs = $this->getPage()->getClientScript();
148
+		$cs=$this->getPage()->getClientScript();
149 149
 		$cs->registerPradoScript("activedatepicker");
150 150
 	}
151 151
 
152 152
 	protected function renderClientControlScript($writer)
153 153
 	{
154
-		$cs = $this->getPage()->getClientScript();
154
+		$cs=$this->getPage()->getClientScript();
155 155
 		if(!$cs->isEndScriptRegistered('TDatePicker.spacer'))
156 156
 		{
157
-			$spacer = $this->getAssetUrl('spacer.gif');
158
-			$code = "Prado.WebUI.TDatePicker.spacer = '$spacer';";
157
+			$spacer=$this->getAssetUrl('spacer.gif');
158
+			$code="Prado.WebUI.TDatePicker.spacer = '$spacer';";
159 159
 			$cs->registerEndScript('TDatePicker.spacer', $code);
160 160
 		}
161 161
 
162
-		$options = TJavaScript::encode($this->getDatePickerOptions());
163
-		$code = "new Prado.WebUI.TActiveDatePicker($options);";
162
+		$options=TJavaScript::encode($this->getDatePickerOptions());
163
+		$code="new Prado.WebUI.TActiveDatePicker($options);";
164 164
 		$cs->registerEndScript("prado:".$this->getClientID(), $code);
165 165
 	}
166 166
 
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveHiddenField.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
  */
23 23
 class TActiveHiddenField extends THiddenField implements ICallbackEventHandler, IActiveControl
24 24
 {
25
-    /**
25
+	/**
26 26
 	 * Creates a new callback control, sets the adapter to
27 27
 	 * TActiveControlAdapter. If you override this class, be sure to set the
28 28
 	 * adapter appropriately by, for example, by calling this constructor.
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function setValue($value)
57 57
 	{
58
-		if(parent::getValue() === $value)
58
+		if(parent::getValue()===$value)
59 59
 			return;
60 60
 
61 61
 		parent::setValue($value);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	protected function addAttributesToRender($writer)
112 112
 	{
113 113
 		parent::addAttributesToRender($writer);
114
-		$writer->addAttribute('id',$this->getClientID());
114
+		$writer->addAttribute('id', $this->getClientID());
115 115
 		$this->getActiveControl()->registerCallbackClientScript(
116 116
 			$this->getClientClassName(), $this->getPostBackOptions());
117 117
 	}
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActivePanel.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@
 block discarded – undo
60 60
 	 * @param THtmlWriter the writer used for the rendering purpose
61 61
 	 */
62 62
 	protected function addAttributesToRender($writer) {
63
-	    $writer->addAttribute('id',$this->getClientID());
64
-	    parent::addAttributesToRender($writer);
63
+		$writer->addAttribute('id',$this->getClientID());
64
+		parent::addAttributesToRender($writer);
65 65
 	}
66 66
 
67 67
 	/**
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@
 block discarded – undo
58 58
 		if ($this->sourcepath === NULL)
59 59
 		{
60 60
 			$this->sourcepath = $sourcepath;
61
-		}
62
-		else
61
+		} else
63 62
 		{
64 63
 			$this->sourcepath->append($sourcepath);
65 64
 		}
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 * @param THtmlWriter the writer used for the rendering purpose
61 61
 	 */
62 62
 	protected function addAttributesToRender($writer) {
63
-	    $writer->addAttribute('id',$this->getClientID());
63
+	    $writer->addAttribute('id', $this->getClientID());
64 64
 	    parent::addAttributesToRender($writer);
65 65
 	}
66 66
 
@@ -77,17 +77,17 @@  discard block
 block discarded – undo
77 77
 		{
78 78
 			parent::render($writer);
79 79
 			if($this->getActiveControl()->canUpdateClientSide())
80
-				$this->getPage()->getCallbackClient()->replaceContent($this,$writer);
80
+				$this->getPage()->getCallbackClient()->replaceContent($this, $writer);
81 81
 		}
82 82
 		else
83 83
 		{
84
-			$this->getPage()->getAdapter()->registerControlToRender($this,$writer);
85
-			if ($this->getHasControls())
84
+			$this->getPage()->getAdapter()->registerControlToRender($this, $writer);
85
+			if($this->getHasControls())
86 86
 			{
87 87
 				// If we update a TActivePanel on callback,
88 88
 				// We shouldn't update all childs, because the whole content will be replaced by
89 89
 				// the parent
90
-				foreach ($this->findControlsByType('IActiveControl', false) as $control)
90
+				foreach($this->findControlsByType('IActiveControl', false) as $control)
91 91
 				{
92 92
 						$control->getActiveControl()->setEnableUpdate(false);
93 93
 				}
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveCheckBoxList.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@
 block discarded – undo
116 116
 			&& $this->getPage()->getClientSupportsJavaScript())
117 117
 		{
118 118
 		  $this->getActiveControl()->registerCallbackClientScript(
119
-		    $this->getClientClassName(), $this->getPostBackOptions());
119
+			$this->getClientClassName(), $this->getPostBackOptions());
120 120
 		}
121 121
 	}
122 122
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
 
88 88
 	/**
89 89
 	 * Creates a control used for repetition (used as a template).
90
-	 * @return TControl the control to be repeated
90
+	 * @return TActiveCheckBoxListItem the control to be repeated
91 91
 	 */
92 92
 	protected function createRepeatedControl()
93 93
 	{
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 * updated later.
73 73
 	 *@return boolean always true
74 74
 	 */
75
-	protected function getSpanNeeded ()
75
+	protected function getSpanNeeded()
76 76
 	{
77 77
 	  return true;
78 78
 	}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	protected function createRepeatedControl()
93 93
 	{
94
-		$control = new TActiveCheckBoxListItem;
94
+		$control=new TActiveCheckBoxListItem;
95 95
 		$control->getAdapter()->setBaseActiveControl($this->getActiveControl());
96 96
 		return $control;
97 97
 	}
Please login to merge, or discard this patch.
framework/Web/UI/TTemplateControl.php 4 patches
Indentation   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -238,90 +238,90 @@
 block discarded – undo
238 238
 		parent::initRecursive($namingContainer);
239 239
 	}
240 240
         
241
-        /**
242
-         * Function to update view controls with data in a given AR object.
243
-         * View controls and AR object need to have the same name in IDs and Attrs respectively.
244
-         * @param TActiveRecord $arObj
245
-         * @param Boolean $throwExceptions Wheter or not to throw exceptions
246
-         * @author Daniel Sampedro <[email protected]>
247
-         */
248
-        public function tryToUpdateView($arObj, $throwExceptions = false)
249
-        {
250
-                $objAttrs = get_class_vars(get_class($arObj));
251
-                foreach (array_keys($objAttrs) as $key)
252
-                {
253
-                        try
254
-                        {
255
-                                if ($key != "RELATIONS")
256
-                                {
257
-                                        $control = $this->{$key};
258
-                                        if ($control instanceof TTextBox)
259
-                                                $control->Text = $arObj->{$key};
260
-                                        elseif ($control instanceof TCheckBox)
261
-                                                $control->Checked = (boolean) $arObj->{$key};
262
-                                        elseif ($control instanceof TDatePicker)
263
-                                                $control->Date = $arObj->{$key};
264
-                                }
265
-                                else
266
-                                {
267
-                                        foreach ($objAttrs["RELATIONS"] as $relKey => $relValues)
268
-                                        {
269
-                                                $relControl = $this->{$relKey};
270
-                                                switch ($relValues[0])
271
-                                                {
272
-                                                        case TActiveRecord::BELONGS_TO:
273
-                                                        case TActiveRecord::HAS_ONE:
274
-                                                                $relControl->Text = $arObj->{$relKey};
275
-                                                                break;
276
-                                                        case TActiveRecord::HAS_MANY:
277
-                                                                if ($relControl instanceof TListControl)
278
-                                                                {
279
-                                                                        $relControl->DataSource = $arObj->{$relKey};
280
-                                                                        $relControl->dataBind();
281
-                                                                }
282
-                                                                break;
283
-                                                }
284
-                                        }
285
-                                        break;
286
-                                }
287
-                        } 
288
-                        catch (Exception $ex)
289
-                        {
290
-                                if ($throwExceptions)
291
-                                        throw $ex;
292
-                        }
293
-                }
294
-        }
241
+		/**
242
+		 * Function to update view controls with data in a given AR object.
243
+		 * View controls and AR object need to have the same name in IDs and Attrs respectively.
244
+		 * @param TActiveRecord $arObj
245
+		 * @param Boolean $throwExceptions Wheter or not to throw exceptions
246
+		 * @author Daniel Sampedro <[email protected]>
247
+		 */
248
+		public function tryToUpdateView($arObj, $throwExceptions = false)
249
+		{
250
+				$objAttrs = get_class_vars(get_class($arObj));
251
+				foreach (array_keys($objAttrs) as $key)
252
+				{
253
+						try
254
+						{
255
+								if ($key != "RELATIONS")
256
+								{
257
+										$control = $this->{$key};
258
+										if ($control instanceof TTextBox)
259
+												$control->Text = $arObj->{$key};
260
+										elseif ($control instanceof TCheckBox)
261
+												$control->Checked = (boolean) $arObj->{$key};
262
+										elseif ($control instanceof TDatePicker)
263
+												$control->Date = $arObj->{$key};
264
+								}
265
+								else
266
+								{
267
+										foreach ($objAttrs["RELATIONS"] as $relKey => $relValues)
268
+										{
269
+												$relControl = $this->{$relKey};
270
+												switch ($relValues[0])
271
+												{
272
+														case TActiveRecord::BELONGS_TO:
273
+														case TActiveRecord::HAS_ONE:
274
+																$relControl->Text = $arObj->{$relKey};
275
+																break;
276
+														case TActiveRecord::HAS_MANY:
277
+																if ($relControl instanceof TListControl)
278
+																{
279
+																		$relControl->DataSource = $arObj->{$relKey};
280
+																		$relControl->dataBind();
281
+																}
282
+																break;
283
+												}
284
+										}
285
+										break;
286
+								}
287
+						} 
288
+						catch (Exception $ex)
289
+						{
290
+								if ($throwExceptions)
291
+										throw $ex;
292
+						}
293
+				}
294
+		}
295 295
 
296
-        /**
297
-         * Function to try to update an AR object with data in view controls.
298
-         * @param TActiveRecord $arObj
299
-         * @param Boolean $throwExceptions Wheter or not to throw exceptions
300
-         * @author Daniel Sampedro <[email protected]>
301
-         */
302
-        public function tryToUpdateAR($arObj, $throwExceptions = false)
303
-        {
304
-                $objAttrs = get_class_vars(get_class($arObj));
305
-                foreach (array_keys($objAttrs) as $key)
306
-                {
307
-                        try
308
-                        {
309
-                                if ($key == "RELATIONS")
310
-                                        break;
311
-                                $control = $this->{$key};
312
-                                if ($control instanceof TTextBox)
313
-                                        $arObj->{$key} = $control->Text;
314
-                                elseif ($control instanceof TCheckBox)
315
-                                        $arObj->{$key} = $control->Checked;
316
-                                elseif ($control instanceof TDatePicker)
317
-                                        $arObj->{$key} = $control->Date;
318
-                        } 
319
-                        catch (Exception $ex)
320
-                        {
321
-                                if ($throwExceptions)
322
-                                        throw $ex;
323
-                        }
324
-                }
325
-        }
296
+		/**
297
+		 * Function to try to update an AR object with data in view controls.
298
+		 * @param TActiveRecord $arObj
299
+		 * @param Boolean $throwExceptions Wheter or not to throw exceptions
300
+		 * @author Daniel Sampedro <[email protected]>
301
+		 */
302
+		public function tryToUpdateAR($arObj, $throwExceptions = false)
303
+		{
304
+				$objAttrs = get_class_vars(get_class($arObj));
305
+				foreach (array_keys($objAttrs) as $key)
306
+				{
307
+						try
308
+						{
309
+								if ($key == "RELATIONS")
310
+										break;
311
+								$control = $this->{$key};
312
+								if ($control instanceof TTextBox)
313
+										$arObj->{$key} = $control->Text;
314
+								elseif ($control instanceof TCheckBox)
315
+										$arObj->{$key} = $control->Checked;
316
+								elseif ($control instanceof TDatePicker)
317
+										$arObj->{$key} = $control->Date;
318
+						} 
319
+						catch (Exception $ex)
320
+						{
321
+								if ($throwExceptions)
322
+										throw $ex;
323
+						}
324
+				}
325
+		}
326 326
 }
327 327
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -69,8 +69,7 @@  discard block
 block discarded – undo
69 69
 			if(!isset(self::$_template[$class]))
70 70
 				self::$_template[$class]=$this->loadTemplate();
71 71
 			return self::$_template[$class];
72
-		}
73
-		else
72
+		} else
74 73
 			return $this->_localTemplate;
75 74
 	}
76 75
 
@@ -205,8 +204,7 @@  discard block
 block discarded – undo
205 204
 			$controls=$placeholder->getParent()->getControls();
206 205
 			$loc=$controls->remove($placeholder);
207 206
 			$controls->insertAt($loc,$content);
208
-		}
209
-		else
207
+		} else
210 208
 			throw new TConfigurationException('templatecontrol_placeholder_inexistent',$id);
211 209
 	}
212 210
 
@@ -232,8 +230,7 @@  discard block
 block discarded – undo
232 230
 			$master->ensureChildControls();
233 231
 			foreach($this->_contents as $id=>$content)
234 232
 				$master->injectContent($id,$content);
235
-		}
236
-		else if(!empty($this->_contents))
233
+		} else if(!empty($this->_contents))
237 234
 			throw new TConfigurationException('templatecontrol_mastercontrol_required',get_class($this));
238 235
 		parent::initRecursive($namingContainer);
239 236
 	}
@@ -261,8 +258,7 @@  discard block
 block discarded – undo
261 258
                                                 $control->Checked = (boolean) $arObj->{$key};
262 259
                                         elseif ($control instanceof TDatePicker)
263 260
                                                 $control->Date = $arObj->{$key};
264
-                                }
265
-                                else
261
+                                } else
266 262
                                 {
267 263
                                         foreach ($objAttrs["RELATIONS"] as $relKey => $relValues)
268 264
                                         {
@@ -284,8 +280,7 @@  discard block
 block discarded – undo
284 280
                                         }
285 281
                                         break;
286 282
                                 }
287
-                        } 
288
-                        catch (Exception $ex)
283
+                        } catch (Exception $ex)
289 284
                         {
290 285
                                 if ($throwExceptions)
291 286
                                         throw $ex;
@@ -315,8 +310,7 @@  discard block
 block discarded – undo
315 310
                                         $arObj->{$key} = $control->Checked;
316 311
                                 elseif ($control instanceof TDatePicker)
317 312
                                         $arObj->{$key} = $control->Date;
318
-                        } 
319
-                        catch (Exception $ex)
313
+                        } catch (Exception $ex)
320 314
                         {
321 315
                                 if ($throwExceptions)
322 316
                                         throw $ex;
Please login to merge, or discard this patch.
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -146,6 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * Registers a content control.
147 147
 	 * @param string ID of the content
148 148
 	 * @param TContent
149
+	 * @param string $id
149 150
 	 */
150 151
 	public function registerContent($id,TContent $object)
151 152
 	{
@@ -160,6 +161,7 @@  discard block
 block discarded – undo
160 161
 	 * This method should only be used by framework and control developers.
161 162
 	 * @param string placeholder ID
162 163
 	 * @param TContentPlaceHolder placeholder control
164
+	 * @param string $id
163 165
 	 */
164 166
 	public function registerContentPlaceHolder($id,TContentPlaceHolder $object)
165 167
 	{
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	protected function loadTemplate()
119 119
 	{
120
-		Prado::trace("Loading template ".get_class($this),'\Prado\Web\UI\TTemplateControl');
120
+		Prado::trace("Loading template ".get_class($this), '\Prado\Web\UI\TTemplateControl');
121 121
 		$template=$this->getService()->getTemplateManager()->getTemplateByClassName(get_class($this));
122 122
 		return $template;
123 123
 	}
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
 			foreach($tpl->getDirective() as $name=>$value)
135 135
 			{
136 136
 				if(is_string($value))
137
-					$this->setSubProperty($name,$value);
137
+					$this->setSubProperty($name, $value);
138 138
 				else
139
-					throw new TConfigurationException('templatecontrol_directive_invalid',get_class($this),$name);
139
+					throw new TConfigurationException('templatecontrol_directive_invalid', get_class($this), $name);
140 140
 			}
141 141
 			$tpl->instantiateIn($this);
142 142
 		}
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
 	 * @param string ID of the content
148 148
 	 * @param TContent
149 149
 	 */
150
-	public function registerContent($id,TContent $object)
150
+	public function registerContent($id, TContent $object)
151 151
 	{
152 152
 		if(isset($this->_contents[$id]))
153
-			throw new TConfigurationException('templatecontrol_contentid_duplicated',$id);
153
+			throw new TConfigurationException('templatecontrol_contentid_duplicated', $id);
154 154
 		else
155 155
 			$this->_contents[$id]=$object;
156 156
 	}
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 	 * @param string placeholder ID
162 162
 	 * @param TContentPlaceHolder placeholder control
163 163
 	 */
164
-	public function registerContentPlaceHolder($id,TContentPlaceHolder $object)
164
+	public function registerContentPlaceHolder($id, TContentPlaceHolder $object)
165 165
 	{
166 166
 		if(isset($this->_placeholders[$id]))
167
-			throw new TConfigurationException('templatecontrol_placeholderid_duplicated',$id);
167
+			throw new TConfigurationException('templatecontrol_placeholderid_duplicated', $id);
168 168
 		else
169 169
 			$this->_placeholders[$id]=$object;
170 170
 	}
@@ -199,17 +199,17 @@  discard block
 block discarded – undo
199 199
 	 * @param string ID of the content control
200 200
 	 * @param TContent the content to be injected
201 201
 	 */
202
-	public function injectContent($id,$content)
202
+	public function injectContent($id, $content)
203 203
 	{
204 204
 		if(isset($this->_placeholders[$id]))
205 205
 		{
206 206
 			$placeholder=$this->_placeholders[$id];
207 207
 			$controls=$placeholder->getParent()->getControls();
208 208
 			$loc=$controls->remove($placeholder);
209
-			$controls->insertAt($loc,$content);
209
+			$controls->insertAt($loc, $content);
210 210
 		}
211 211
 		else
212
-			throw new TConfigurationException('templatecontrol_placeholder_inexistent',$id);
212
+			throw new TConfigurationException('templatecontrol_placeholder_inexistent', $id);
213 213
 	}
214 214
 
215 215
 	/**
@@ -233,10 +233,10 @@  discard block
 block discarded – undo
233 233
 			$this->getControls()->add($master);
234 234
 			$master->ensureChildControls();
235 235
 			foreach($this->_contents as $id=>$content)
236
-				$master->injectContent($id,$content);
236
+				$master->injectContent($id, $content);
237 237
 		}
238 238
 		else if(!empty($this->_contents))
239
-			throw new TConfigurationException('templatecontrol_mastercontrol_required',get_class($this));
239
+			throw new TConfigurationException('templatecontrol_mastercontrol_required', get_class($this));
240 240
 		parent::initRecursive($namingContainer);
241 241
 	}
242 242
         
@@ -247,38 +247,38 @@  discard block
 block discarded – undo
247 247
          * @param Boolean $throwExceptions Wheter or not to throw exceptions
248 248
          * @author Daniel Sampedro <[email protected]>
249 249
          */
250
-        public function tryToUpdateView($arObj, $throwExceptions = false)
250
+        public function tryToUpdateView($arObj, $throwExceptions=false)
251 251
         {
252
-                $objAttrs = get_class_vars(get_class($arObj));
253
-                foreach (array_keys($objAttrs) as $key)
252
+                $objAttrs=get_class_vars(get_class($arObj));
253
+                foreach(array_keys($objAttrs) as $key)
254 254
                 {
255 255
                         try
256 256
                         {
257
-                                if ($key != "RELATIONS")
257
+                                if($key!="RELATIONS")
258 258
                                 {
259
-                                        $control = $this->{$key};
260
-                                        if ($control instanceof TTextBox)
261
-                                                $control->Text = $arObj->{$key};
262
-                                        elseif ($control instanceof TCheckBox)
263
-                                                $control->Checked = (boolean) $arObj->{$key};
264
-                                        elseif ($control instanceof TDatePicker)
265
-                                                $control->Date = $arObj->{$key};
259
+                                        $control=$this->{$key};
260
+                                        if($control instanceof TTextBox)
261
+                                                $control->Text=$arObj->{$key};
262
+                                        elseif($control instanceof TCheckBox)
263
+                                                $control->Checked=(boolean) $arObj->{$key};
264
+                                        elseif($control instanceof TDatePicker)
265
+                                                $control->Date=$arObj->{$key};
266 266
                                 }
267 267
                                 else
268 268
                                 {
269
-                                        foreach ($objAttrs["RELATIONS"] as $relKey => $relValues)
269
+                                        foreach($objAttrs["RELATIONS"] as $relKey => $relValues)
270 270
                                         {
271
-                                                $relControl = $this->{$relKey};
272
-                                                switch ($relValues[0])
271
+                                                $relControl=$this->{$relKey};
272
+                                                switch($relValues[0])
273 273
                                                 {
274 274
                                                         case TActiveRecord::BELONGS_TO:
275 275
                                                         case TActiveRecord::HAS_ONE:
276
-                                                                $relControl->Text = $arObj->{$relKey};
276
+                                                                $relControl->Text=$arObj->{$relKey};
277 277
                                                                 break;
278 278
                                                         case TActiveRecord::HAS_MANY:
279
-                                                                if ($relControl instanceof TListControl)
279
+                                                                if($relControl instanceof TListControl)
280 280
                                                                 {
281
-                                                                        $relControl->DataSource = $arObj->{$relKey};
281
+                                                                        $relControl->DataSource=$arObj->{$relKey};
282 282
                                                                         $relControl->dataBind();
283 283
                                                                 }
284 284
                                                                 break;
@@ -287,9 +287,9 @@  discard block
 block discarded – undo
287 287
                                         break;
288 288
                                 }
289 289
                         } 
290
-                        catch (Exception $ex)
290
+                        catch(Exception $ex)
291 291
                         {
292
-                                if ($throwExceptions)
292
+                                if($throwExceptions)
293 293
                                         throw $ex;
294 294
                         }
295 295
                 }
@@ -301,26 +301,26 @@  discard block
 block discarded – undo
301 301
          * @param Boolean $throwExceptions Wheter or not to throw exceptions
302 302
          * @author Daniel Sampedro <[email protected]>
303 303
          */
304
-        public function tryToUpdateAR($arObj, $throwExceptions = false)
304
+        public function tryToUpdateAR($arObj, $throwExceptions=false)
305 305
         {
306
-                $objAttrs = get_class_vars(get_class($arObj));
307
-                foreach (array_keys($objAttrs) as $key)
306
+                $objAttrs=get_class_vars(get_class($arObj));
307
+                foreach(array_keys($objAttrs) as $key)
308 308
                 {
309 309
                         try
310 310
                         {
311
-                                if ($key == "RELATIONS")
311
+                                if($key=="RELATIONS")
312 312
                                         break;
313
-                                $control = $this->{$key};
314
-                                if ($control instanceof TTextBox)
315
-                                        $arObj->{$key} = $control->Text;
316
-                                elseif ($control instanceof TCheckBox)
317
-                                        $arObj->{$key} = $control->Checked;
318
-                                elseif ($control instanceof TDatePicker)
319
-                                        $arObj->{$key} = $control->Date;
313
+                                $control=$this->{$key};
314
+                                if($control instanceof TTextBox)
315
+                                        $arObj->{$key}=$control->Text;
316
+                                elseif($control instanceof TCheckBox)
317
+                                        $arObj->{$key}=$control->Checked;
318
+                                elseif($control instanceof TDatePicker)
319
+                                        $arObj->{$key}=$control->Date;
320 320
                         } 
321
-                        catch (Exception $ex)
321
+                        catch(Exception $ex)
322 322
                         {
323
-                                if ($throwExceptions)
323
+                                if($throwExceptions)
324 324
                                         throw $ex;
325 325
                         }
326 326
                 }
Please login to merge, or discard this patch.