Completed
Push — namespace2 ( fc6e2b...8a6673 )
by Fabio
08:49
created
framework/Web/UI/WebControls/TListItem.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 * @param boolean whether the item is enabled
54 54
 	 * @param boolean whether the item is selected
55 55
 	 */
56
-	public function __construct($text='',$value='',$enabled=true,$selected=false)
56
+	public function __construct($text='', $value='', $enabled=true, $selected=false)
57 57
 	{
58 58
 		$this->setText($text);
59 59
 		$this->setValue($value);
@@ -70,16 +70,16 @@  discard block
 block discarded – undo
70 70
 	protected function __getZappableSleepProps(&$exprops)
71 71
 	{
72 72
 		parent::__getZappableSleepProps($exprops);
73
-		if ($this->_attributes===null)
74
-			$exprops[] = "\0TListItem\0_attributes";
73
+		if($this->_attributes===null)
74
+			$exprops[]="\0TListItem\0_attributes";
75 75
 		if($this->_text==='')
76
-			$exprops[] = "\0TListItem\0_text";
76
+			$exprops[]="\0TListItem\0_text";
77 77
 		if($this->_value==='')
78
-			$exprops[] = "\0TListItem\0_value";
79
-		if ($this->_enabled===true)
80
-			$exprops[] = "\0TListItem\0_enabled";
81
-		if ($this->_selected===false)
82
-			$exprops[] = "\0TListItem\0_selected";
78
+			$exprops[]="\0TListItem\0_value";
79
+		if($this->_enabled===true)
80
+			$exprops[]="\0TListItem\0_enabled";
81
+		if($this->_selected===false)
82
+			$exprops[]="\0TListItem\0_selected";
83 83
 	}
84 84
 
85 85
 	/**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function getText()
121 121
 	{
122
-		return $this->_text===''?$this->_value:$this->_text;
122
+		return $this->_text==='' ? $this->_value : $this->_text;
123 123
 	}
124 124
 
125 125
 	/**
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	 */
136 136
 	public function getValue()
137 137
 	{
138
-		return $this->_value===''?$this->_text:$this->_value;
138
+		return $this->_value==='' ? $this->_text : $this->_value;
139 139
 	}
140 140
 
141 141
 	/**
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	 */
162 162
 	public function getHasAttributes()
163 163
 	{
164
-		return $this->_attributes && $this->_attributes->getCount()>0;
164
+		return $this->_attributes && $this->_attributes->getCount() > 0;
165 165
 	}
166 166
 
167 167
 	/**
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 	 */
171 171
 	public function hasAttribute($name)
172 172
 	{
173
-		return $this->_attributes?$this->_attributes->contains($name):false;
173
+		return $this->_attributes ? $this->_attributes->contains($name) : false;
174 174
 	}
175 175
 
176 176
 	/**
@@ -178,16 +178,16 @@  discard block
 block discarded – undo
178 178
 	 */
179 179
 	public function getAttribute($name)
180 180
 	{
181
-		return $this->_attributes?$this->_attributes->itemAt($name):null;
181
+		return $this->_attributes ? $this->_attributes->itemAt($name) : null;
182 182
 	}
183 183
 
184 184
 	/**
185 185
 	 * @param string attribute name
186 186
 	 * @param string value of the attribute
187 187
 	 */
188
-	public function setAttribute($name,$value)
188
+	public function setAttribute($name, $value)
189 189
 	{
190
-		$this->getAttributes()->add($name,$value);
190
+		$this->getAttributes()->add($name, $value);
191 191
 	}
192 192
 
193 193
 	/**
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 */
198 198
 	public function removeAttribute($name)
199 199
 	{
200
-		return $this->_attributes?$this->_attributes->remove($name):null;
200
+		return $this->_attributes ? $this->_attributes->remove($name) : null;
201 201
 	}
202 202
 }
203 203
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TFlushOutput.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	public function __construct()
46 46
 	{
47 47
 		parent::__construct();
48
-		$this->EnableViewState = false;
48
+		$this->EnableViewState=false;
49 49
 	}
50 50
 
51 51
 	/**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	public function setContinueBuffering($value)
63 63
 	{
64
-		$this->_continueBuffering = TPropertyValue::ensureBoolean($value);
64
+		$this->_continueBuffering=TPropertyValue::ensureBoolean($value);
65 65
 	}
66 66
 
67 67
 	/**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 //$writer->write('<!-- flush -->');
74 74
 		// ajax responses can't be parsed by the client side before loaded and returned completely,
75 75
 		// so don't bother with flushing output somewhere mid-page if refreshing in a callback
76
-		if (!$this->Page->IsCallback)
76
+		if(!$this->Page->IsCallback)
77 77
 		{
78 78
 			$this->Page->flushWriter();
79 79
 //			$this->Application->flushOutput($this->ContinueBuffering);
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDropDownListColumn.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		parent::loadState($state);
78 78
 		$this->_stateLoaded=true;
79 79
 		if(!$this->_dataBound)
80
-			$this->_listControl->getItems()->loadState($this->getViewState('Items',null));
80
+			$this->_listControl->getItems()->loadState($this->getViewState('Items', null));
81 81
 	}
82 82
 
83 83
 	/**
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public function saveState()
88 88
 	{
89
-		$this->setViewState('Items',$this->_listControl->getItems()->saveState(),null);
89
+		$this->setViewState('Items', $this->_listControl->getItems()->saveState(), null);
90 90
 		return parent::saveState();
91 91
 	}
92 92
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public function getDataTextField()
113 113
 	{
114
-		return $this->getViewState('DataTextField','');
114
+		return $this->getViewState('DataTextField', '');
115 115
 	}
116 116
 
117 117
 	/**
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	public function setDataTextField($value)
124 124
 	{
125
-		$this->setViewState('DataTextField',$value,'');
125
+		$this->setViewState('DataTextField', $value, '');
126 126
 	}
127 127
 
128 128
 	/**
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	public function getDataTextFormatString()
132 132
 	{
133
-		return $this->getViewState('DataTextFormatString','');
133
+		return $this->getViewState('DataTextFormatString', '');
134 134
 	}
135 135
 
136 136
 	/**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	public function setDataTextFormatString($value)
140 140
 	{
141
-		$this->setViewState('DataTextFormatString',$value,'');
141
+		$this->setViewState('DataTextFormatString', $value, '');
142 142
 	}
143 143
 
144 144
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 */
147 147
 	public function getDataValueField()
148 148
 	{
149
-		return $this->getViewState('DataValueField','');
149
+		return $this->getViewState('DataValueField', '');
150 150
 	}
151 151
 
152 152
 	/**
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	public function setDataValueField($value)
159 159
 	{
160
-		$this->setViewState('DataValueField',$value,'');
160
+		$this->setViewState('DataValueField', $value, '');
161 161
 	}
162 162
 
163 163
 	/**
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	 */
166 166
 	public function getReadOnly()
167 167
 	{
168
-		return $this->getViewState('ReadOnly',false);
168
+		return $this->getViewState('ReadOnly', false);
169 169
 	}
170 170
 
171 171
 	/**
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 */
174 174
 	public function setReadOnly($value)
175 175
 	{
176
-		$this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false);
176
+		$this->setViewState('ReadOnly', TPropertyValue::ensureBoolean($value), false);
177 177
 	}
178 178
 
179 179
 	/**
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 */
198 198
 	public function getListValueField()
199 199
 	{
200
-		return $this->getViewState('ListValueField','');
200
+		return $this->getViewState('ListValueField', '');
201 201
 	}
202 202
 
203 203
 	/**
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 */
206 206
 	public function setListValueField($value)
207 207
 	{
208
-		$this->setViewState('ListValueField',$value,'');
208
+		$this->setViewState('ListValueField', $value, '');
209 209
 	}
210 210
 
211 211
 	/**
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 	 */
214 214
 	public function getListTextField()
215 215
 	{
216
-		return $this->getViewState('ListTextField','');
216
+		return $this->getViewState('ListTextField', '');
217 217
 	}
218 218
 
219 219
 	/**
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	 */
222 222
 	public function setListTextField($value)
223 223
 	{
224
-		$this->setViewState('ListTextField',$value,'');
224
+		$this->setViewState('ListTextField', $value, '');
225 225
 	}
226 226
 
227 227
 	/**
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	 */
230 230
 	public function getListTextFormatString()
231 231
 	{
232
-		return $this->getViewState('ListTextFormatString','');
232
+		return $this->getViewState('ListTextFormatString', '');
233 233
 	}
234 234
 
235 235
 	/**
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	 */
238 238
 	public function setListTextFormatString($value)
239 239
 	{
240
-		$this->setViewState('ListTextFormatString',$value,'');
240
+		$this->setViewState('ListTextFormatString', $value, '');
241 241
 	}
242 242
 
243 243
 	/**
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	 * @param integer the index to the Columns property that the cell resides in.
252 252
 	 * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)
253 253
 	 */
254
-	public function initializeCell($cell,$columnIndex,$itemType)
254
+	public function initializeCell($cell, $columnIndex, $itemType)
255 255
 	{
256 256
 		if(!$this->_dataBound && $this->_listControl->getDataSource()!==null)
257 257
 		{
@@ -268,21 +268,21 @@  discard block
 block discarded – undo
268 268
 				{
269 269
 					$listControl=clone $this->_listControl;
270 270
 					$cell->getControls()->add($listControl);
271
-					$cell->registerObject('DropDownList',$listControl);
271
+					$cell->registerObject('DropDownList', $listControl);
272 272
 					$control=$listControl;
273 273
 				}
274 274
 				else
275 275
 					$control=$cell;
276
-				$control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
276
+				$control->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn'));
277 277
 				break;
278 278
 			case TListItemType::Item:
279 279
 			case TListItemType::AlternatingItem:
280 280
 			case TListItemType::SelectedItem:
281 281
 				if($this->getDataTextField()!=='' || $this->getDataValueField()!=='')
282
-					$cell->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
282
+					$cell->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn'));
283 283
 				break;
284 284
 			default:
285
-				parent::initializeCell($cell,$columnIndex,$itemType);
285
+				parent::initializeCell($cell, $columnIndex, $itemType);
286 286
 				break;
287 287
 		}
288 288
 	}
@@ -292,21 +292,21 @@  discard block
 block discarded – undo
292 292
 	 * This method is invoked when datagrid performs databinding.
293 293
 	 * It populates the content of the cell with the relevant data from data source.
294 294
 	 */
295
-	public function dataBindColumn($sender,$param)
295
+	public function dataBindColumn($sender, $param)
296 296
 	{
297 297
 		$item=$sender->getNamingContainer();
298 298
 		$data=$item->getData();
299 299
 		if(($valueField=$this->getDataValueField())!=='')
300
-			$value=$this->getDataFieldValue($data,$valueField);
300
+			$value=$this->getDataFieldValue($data, $valueField);
301 301
 		else
302 302
 			$value='';
303 303
 		if(($textField=$this->getDataTextField())!=='')
304 304
 		{
305
-			$text=$this->getDataFieldValue($data,$textField);
305
+			$text=$this->getDataFieldValue($data, $textField);
306 306
 			if($valueField==='')
307 307
 				$value=$text;
308 308
 			$formatString=$this->getDataTextFormatString();
309
-			$text=$this->formatDataValue($formatString,$text);
309
+			$text=$this->formatDataValue($formatString, $text);
310 310
 		}
311 311
 		else
312 312
 			$text=$value;
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDropDownList.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	protected function addAttributesToRender($writer)
54 54
 	{
55
-		$writer->addAttribute('name',$this->getUniqueID());
55
+		$writer->addAttribute('name', $this->getUniqueID());
56 56
 		parent::addAttributesToRender($writer);
57 57
 	}
58 58
 
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
 	 * @param array the input data collection
74 74
 	 * @return boolean whether the data of the component has been changed
75 75
 	 */
76
-	public function loadPostData($key,$values)
76
+	public function loadPostData($key, $values)
77 77
 	{
78 78
 		if(!$this->getEnabled(true))
79 79
 			return false;
80 80
 		$this->ensureDataBound();
81
-		$selection=isset($values[$key])?$values[$key]:null;
81
+		$selection=isset($values[$key]) ? $values[$key] : null;
82 82
 		if($selection!==null)
83 83
 		{
84
-			$index=$this->getItems()->findIndexByValue($selection,false);
84
+			$index=$this->getItems()->findIndexByValue($selection, false);
85 85
 			if($this->getSelectedIndex()!==$index)
86 86
 			{
87 87
 				$this->setSelectedIndex($index);
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TFileUpload.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
 	{
77 77
 		$this->getPage()->ensureRenderInForm($this);
78 78
 		parent::addAttributesToRender($writer);
79
-		$writer->addAttribute('type','file');
80
-		$writer->addAttribute('name',$this->getUniqueID());
79
+		$writer->addAttribute('type', 'file');
80
+		$writer->addAttribute('name', $this->getUniqueID());
81 81
 		$isEnabled=$this->getEnabled(true);
82 82
 		if(!$isEnabled && $this->getEnabled())  // in this case parent will not render 'disabled'
83
-			$writer->addAttribute('disabled','disabled');
83
+			$writer->addAttribute('disabled', 'disabled');
84 84
 	}
85 85
 
86 86
 	/**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		parent::onPreRender($param);
94 94
 		if(($form=$this->getPage()->getForm())!==null)
95 95
 			$form->setEnctype('multipart/form-data');
96
-		$this->getPage()->getClientScript()->registerHiddenField('MAX_FILE_SIZE',$this->getMaxFileSize());
96
+		$this->getPage()->getClientScript()->registerHiddenField('MAX_FILE_SIZE', $this->getMaxFileSize());
97 97
 		if($this->getEnabled(true))
98 98
 			$this->getPage()->registerRequiresPostData($this);
99 99
 	}
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	 */
105 105
 	public function getMaxFileSize()
106 106
 	{
107
-		return $this->getViewState('MaxFileSize',self::MAX_FILE_SIZE);
107
+		return $this->getViewState('MaxFileSize', self::MAX_FILE_SIZE);
108 108
 	}
109 109
 
110 110
 	/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	public function setMaxFileSize($size)
119 119
 	{
120
-		$this->setViewState('MaxFileSize',TPropertyValue::ensureInteger($size),self::MAX_FILE_SIZE);
120
+		$this->setViewState('MaxFileSize', TPropertyValue::ensureInteger($size), self::MAX_FILE_SIZE);
121 121
 	}
122 122
 
123 123
 	/**
@@ -179,14 +179,14 @@  discard block
 block discarded – undo
179 179
 	 * If true, you will not be able to save the uploaded file again.
180 180
 	 * @return boolean true if the file saving is successful
181 181
 	 */
182
-	public function saveAs($fileName,$deleteTempFile=true)
182
+	public function saveAs($fileName, $deleteTempFile=true)
183 183
 	{
184 184
 		if($this->_errorCode===UPLOAD_ERR_OK)
185 185
 		{
186 186
 			if($deleteTempFile)
187
-				return move_uploaded_file($this->_localName,$fileName);
187
+				return move_uploaded_file($this->_localName, $fileName);
188 188
 			else if(is_uploaded_file($this->_localName))
189
-				return file_put_contents($fileName,file_get_contents($this->_localName))!==false;
189
+				return file_put_contents($fileName, file_get_contents($this->_localName))!==false;
190 190
 			else
191 191
 				return false;
192 192
 		}
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 * @param array the input data collection
202 202
 	 * @return boolean whether the data of the control has been changed
203 203
 	 */
204
-	public function loadPostData($key,$values)
204
+	public function loadPostData($key, $values)
205 205
 	{
206 206
 		if(isset($_FILES[$key]))
207 207
 		{
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 	 */
236 236
 	public function onFileUpload($param)
237 237
 	{
238
-		$this->raiseEvent('OnFileUpload',$this,$param);
238
+		$this->raiseEvent('OnFileUpload', $this, $param);
239 239
 	}
240 240
 
241 241
 	/**
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TLiteral.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	public function getText()
38 38
 	{
39
-		return $this->getViewState('Text','');
39
+		return $this->getViewState('Text', '');
40 40
 	}
41 41
 
42 42
 	/**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public function setText($value)
47 47
 	{
48
-		$this->setViewState('Text',TPropertyValue::ensureString($value),'');
48
+		$this->setViewState('Text', TPropertyValue::ensureString($value), '');
49 49
 	}
50 50
 
51 51
 	/**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public function getEncode()
81 81
 	{
82
-		return $this->getViewState('Encode',false);
82
+		return $this->getViewState('Encode', false);
83 83
 	}
84 84
 
85 85
 	/**
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public function setEncode($value)
89 89
 	{
90
-		$this->setViewState('Encode',TPropertyValue::ensureBoolean($value),false);
90
+		$this->setViewState('Encode', TPropertyValue::ensureBoolean($value), false);
91 91
 	}
92 92
 
93 93
 	/**
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TRegularExpressionValidator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function getRegularExpression()
64 64
 	{
65
-		return $this->getViewState('RegularExpression','');
65
+		return $this->getViewState('RegularExpression', '');
66 66
 	}
67 67
 
68 68
 	/**
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public function setRegularExpression($value)
72 72
 	{
73
-		$this->setViewState('RegularExpression',$value,'');
73
+		$this->setViewState('RegularExpression', $value, '');
74 74
 	}
75 75
 
76 76
 	/**
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
 	{
85 85
 		if(($value=$this->getValidationValue($this->getValidationTarget()))==='')
86 86
 			return true;
87
-		if(($expression=addcslashes($this->getRegularExpression(),"/"))!=='')
87
+		if(($expression=addcslashes($this->getRegularExpression(), "/"))!=='')
88 88
 		{
89
-			$mods = $this->getPatternModifiers();
90
-			return preg_match("/^$expression\$/{$mods}",$value);
89
+			$mods=$this->getPatternModifiers();
90
+			return preg_match("/^$expression\$/{$mods}", $value);
91 91
 		}
92 92
 		else
93 93
 			return true;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 */
134 134
 	protected function getClientScriptOptions()
135 135
 	{
136
-		$options = parent::getClientScriptOptions();
136
+		$options=parent::getClientScriptOptions();
137 137
 		$options['ValidationExpression']=$this->getRegularExpression();
138 138
 		$options['PatternModifiers']=$this->getClientSidePatternModifiers();
139 139
 		return $options;
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TCaptchaValidator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public function getCaptchaControl()
52 52
 	{
53
-		return $this->getViewState('CaptchaControl','');
53
+		return $this->getViewState('CaptchaControl', '');
54 54
 	}
55 55
 
56 56
 	/**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	public function setCaptchaControl($value)
63 63
 	{
64
-		$this->setViewState('CaptchaControl',TPropertyValue::ensureString($value),'');
64
+		$this->setViewState('CaptchaControl', TPropertyValue::ensureString($value), '');
65 65
 	}
66 66
 
67 67
 	/**
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
 		if(($id=$this->getCaptchaControl())==='')
88 88
 			throw new TConfigurationException('captchavalidator_captchacontrol_required');
89 89
 		else if(($control=$this->findControl($id))===null)
90
-			throw new TConfigurationException('captchavalidator_captchacontrol_inexistent',$id);
90
+			throw new TConfigurationException('captchavalidator_captchacontrol_inexistent', $id);
91 91
 		else if(!($control instanceof TCaptcha))
92
-			throw new TConfigurationException('captchavalidator_captchacontrol_invalid',$id);
92
+			throw new TConfigurationException('captchavalidator_captchacontrol_invalid', $id);
93 93
 		else
94 94
 			return $control;
95 95
 	}
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 	private function generateTokenHash($token)
119 119
 	{
120
-		for($h=0,$i=strlen($token)-1;$i>=0;--$i)
120
+		for($h=0, $i=strlen($token) - 1; $i >= 0; --$i)
121 121
 			$h+=ord($token[$i]);
122 122
 		return $h;
123 123
 	}
Please login to merge, or discard this patch.
framework/Web/UI/TTemplateControl.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 */
116 116
 	protected function loadTemplate()
117 117
 	{
118
-		Prado::trace("Loading template ".get_class($this),'System.Web.UI.TTemplateControl');
118
+		Prado::trace("Loading template ".get_class($this), 'System.Web.UI.TTemplateControl');
119 119
 		$template=$this->getService()->getTemplateManager()->getTemplateByClassName(get_class($this));
120 120
 		return $template;
121 121
 	}
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
 			foreach($tpl->getDirective() as $name=>$value)
133 133
 			{
134 134
 				if(is_string($value))
135
-					$this->setSubProperty($name,$value);
135
+					$this->setSubProperty($name, $value);
136 136
 				else
137
-					throw new TConfigurationException('templatecontrol_directive_invalid',get_class($this),$name);
137
+					throw new TConfigurationException('templatecontrol_directive_invalid', get_class($this), $name);
138 138
 			}
139 139
 			$tpl->instantiateIn($this);
140 140
 		}
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 	 * @param string ID of the content
146 146
 	 * @param TContent
147 147
 	 */
148
-	public function registerContent($id,TContent $object)
148
+	public function registerContent($id, TContent $object)
149 149
 	{
150 150
 		if(isset($this->_contents[$id]))
151
-			throw new TConfigurationException('templatecontrol_contentid_duplicated',$id);
151
+			throw new TConfigurationException('templatecontrol_contentid_duplicated', $id);
152 152
 		else
153 153
 			$this->_contents[$id]=$object;
154 154
 	}
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
 	 * @param string placeholder ID
160 160
 	 * @param TContentPlaceHolder placeholder control
161 161
 	 */
162
-	public function registerContentPlaceHolder($id,TContentPlaceHolder $object)
162
+	public function registerContentPlaceHolder($id, TContentPlaceHolder $object)
163 163
 	{
164 164
 		if(isset($this->_placeholders[$id]))
165
-			throw new TConfigurationException('templatecontrol_placeholderid_duplicated',$id);
165
+			throw new TConfigurationException('templatecontrol_placeholderid_duplicated', $id);
166 166
 		else
167 167
 			$this->_placeholders[$id]=$object;
168 168
 	}
@@ -197,17 +197,17 @@  discard block
 block discarded – undo
197 197
 	 * @param string ID of the content control
198 198
 	 * @param TContent the content to be injected
199 199
 	 */
200
-	public function injectContent($id,$content)
200
+	public function injectContent($id, $content)
201 201
 	{
202 202
 		if(isset($this->_placeholders[$id]))
203 203
 		{
204 204
 			$placeholder=$this->_placeholders[$id];
205 205
 			$controls=$placeholder->getParent()->getControls();
206 206
 			$loc=$controls->remove($placeholder);
207
-			$controls->insertAt($loc,$content);
207
+			$controls->insertAt($loc, $content);
208 208
 		}
209 209
 		else
210
-			throw new TConfigurationException('templatecontrol_placeholder_inexistent',$id);
210
+			throw new TConfigurationException('templatecontrol_placeholder_inexistent', $id);
211 211
 	}
212 212
 
213 213
 	/**
@@ -231,10 +231,10 @@  discard block
 block discarded – undo
231 231
 			$this->getControls()->add($master);
232 232
 			$master->ensureChildControls();
233 233
 			foreach($this->_contents as $id=>$content)
234
-				$master->injectContent($id,$content);
234
+				$master->injectContent($id, $content);
235 235
 		}
236 236
 		else if(!empty($this->_contents))
237
-			throw new TConfigurationException('templatecontrol_mastercontrol_required',get_class($this));
237
+			throw new TConfigurationException('templatecontrol_mastercontrol_required', get_class($this));
238 238
 		parent::initRecursive($namingContainer);
239 239
 	}
240 240
         
@@ -245,38 +245,38 @@  discard block
 block discarded – undo
245 245
          * @param Boolean $throwExceptions Wheter or not to throw exceptions
246 246
          * @author Daniel Sampedro <[email protected]>
247 247
          */
248
-        public function tryToUpdateView($arObj, $throwExceptions = false)
248
+        public function tryToUpdateView($arObj, $throwExceptions=false)
249 249
         {
250
-                $objAttrs = get_class_vars(get_class($arObj));
251
-                foreach (array_keys($objAttrs) as $key)
250
+                $objAttrs=get_class_vars(get_class($arObj));
251
+                foreach(array_keys($objAttrs) as $key)
252 252
                 {
253 253
                         try
254 254
                         {
255
-                                if ($key != "RELATIONS")
255
+                                if($key!="RELATIONS")
256 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};
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 264
                                 }
265 265
                                 else
266 266
                                 {
267
-                                        foreach ($objAttrs["RELATIONS"] as $relKey => $relValues)
267
+                                        foreach($objAttrs["RELATIONS"] as $relKey => $relValues)
268 268
                                         {
269
-                                                $relControl = $this->{$relKey};
270
-                                                switch ($relValues[0])
269
+                                                $relControl=$this->{$relKey};
270
+                                                switch($relValues[0])
271 271
                                                 {
272 272
                                                         case TActiveRecord::BELONGS_TO:
273 273
                                                         case TActiveRecord::HAS_ONE:
274
-                                                                $relControl->Text = $arObj->{$relKey};
274
+                                                                $relControl->Text=$arObj->{$relKey};
275 275
                                                                 break;
276 276
                                                         case TActiveRecord::HAS_MANY:
277
-                                                                if ($relControl instanceof TListControl)
277
+                                                                if($relControl instanceof TListControl)
278 278
                                                                 {
279
-                                                                        $relControl->DataSource = $arObj->{$relKey};
279
+                                                                        $relControl->DataSource=$arObj->{$relKey};
280 280
                                                                         $relControl->dataBind();
281 281
                                                                 }
282 282
                                                                 break;
@@ -285,9 +285,9 @@  discard block
 block discarded – undo
285 285
                                         break;
286 286
                                 }
287 287
                         } 
288
-                        catch (Exception $ex)
288
+                        catch(Exception $ex)
289 289
                         {
290
-                                if ($throwExceptions)
290
+                                if($throwExceptions)
291 291
                                         throw $ex;
292 292
                         }
293 293
                 }
@@ -299,26 +299,26 @@  discard block
 block discarded – undo
299 299
          * @param Boolean $throwExceptions Wheter or not to throw exceptions
300 300
          * @author Daniel Sampedro <[email protected]>
301 301
          */
302
-        public function tryToUpdateAR($arObj, $throwExceptions = false)
302
+        public function tryToUpdateAR($arObj, $throwExceptions=false)
303 303
         {
304
-                $objAttrs = get_class_vars(get_class($arObj));
305
-                foreach (array_keys($objAttrs) as $key)
304
+                $objAttrs=get_class_vars(get_class($arObj));
305
+                foreach(array_keys($objAttrs) as $key)
306 306
                 {
307 307
                         try
308 308
                         {
309
-                                if ($key == "RELATIONS")
309
+                                if($key=="RELATIONS")
310 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;
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 318
                         } 
319
-                        catch (Exception $ex)
319
+                        catch(Exception $ex)
320 320
                         {
321
-                                if ($throwExceptions)
321
+                                if($throwExceptions)
322 322
                                         throw $ex;
323 323
                         }
324 324
                 }
Please login to merge, or discard this patch.