Completed
Push — prado-3.3 ( f4da81...5dd4b5 )
by Fabio
09:03
created
framework/Web/UI/WebControls/TRepeaterItemRenderer.php 2 patches
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   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@
 block discarded – undo
34 34
 	 * @param TEventParameter event parameter
35 35
 	 * @return boolean whether the event bubbling should stop here.
36 36
 	 */
37
-	public function bubbleEvent($sender,$param)
37
+	public function bubbleEvent($sender, $param)
38 38
 	{
39 39
 		if($param instanceof TCommandEventParameter)
40 40
 		{
41
-			$this->raiseBubbleEvent($this,new TRepeaterCommandEventParameter($this,$sender,$param));
41
+			$this->raiseBubbleEvent($this, new TRepeaterCommandEventParameter($this, $sender, $param));
42 42
 			return true;
43 43
 		}
44 44
 		else
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/THyperLinkColumn.php 2 patches
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   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 */
55 55
 	public function getText()
56 56
 	{
57
-		return $this->getViewState('Text','');
57
+		return $this->getViewState('Text', '');
58 58
 	}
59 59
 
60 60
 	/**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 */
64 64
 	public function setText($value)
65 65
 	{
66
-		$this->setViewState('Text',$value,'');
66
+		$this->setViewState('Text', $value, '');
67 67
 	}
68 68
 
69 69
 	/**
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	public function getDataTextField()
73 73
 	{
74
-		return $this->getViewState('DataTextField','');
74
+		return $this->getViewState('DataTextField', '');
75 75
 	}
76 76
 
77 77
 	/**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public function setDataTextField($value)
81 81
 	{
82
-		$this->setViewState('DataTextField',$value,'');
82
+		$this->setViewState('DataTextField', $value, '');
83 83
 	}
84 84
 
85 85
 	/**
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public function getDataTextFormatString()
89 89
 	{
90
-		return $this->getViewState('DataTextFormatString','');
90
+		return $this->getViewState('DataTextFormatString', '');
91 91
 	}
92 92
 
93 93
 	/**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function setDataTextFormatString($value)
97 97
 	{
98
-		$this->setViewState('DataTextFormatString',$value,'');
98
+		$this->setViewState('DataTextFormatString', $value, '');
99 99
 	}
100 100
 
101 101
 	/**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	public function getImageHeight()
105 105
 	{
106
-		return $this->getViewState('ImageHeight','');
106
+		return $this->getViewState('ImageHeight', '');
107 107
 	}
108 108
 
109 109
 	/**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public function setImageHeight($value)
113 113
 	{
114
-		$this->setViewState('ImageHeight',$value,'');
114
+		$this->setViewState('ImageHeight', $value, '');
115 115
 	}
116 116
 
117 117
 	/**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function getImageUrl()
121 121
 	{
122
-		return $this->getViewState('ImageUrl','');
122
+		return $this->getViewState('ImageUrl', '');
123 123
 	}
124 124
 
125 125
 	/**
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public function setImageUrl($value)
129 129
 	{
130
-		$this->setViewState('ImageUrl',$value,'');
130
+		$this->setViewState('ImageUrl', $value, '');
131 131
 	}
132 132
 
133 133
 	/**
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	 */
136 136
 	public function getImageWidth()
137 137
 	{
138
-		return $this->getViewState('ImageWidth','');
138
+		return $this->getViewState('ImageWidth', '');
139 139
 	}
140 140
 
141 141
 	/**
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	public function setImageWidth($value)
145 145
 	{
146
-		$this->setViewState('ImageWidth',$value,'');
146
+		$this->setViewState('ImageWidth', $value, '');
147 147
 	}
148 148
 
149 149
 	/**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 */
152 152
 	public function getNavigateUrl()
153 153
 	{
154
-		return $this->getViewState('NavigateUrl','');
154
+		return $this->getViewState('NavigateUrl', '');
155 155
 	}
156 156
 
157 157
 	/**
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	 */
161 161
 	public function setNavigateUrl($value)
162 162
 	{
163
-		$this->setViewState('NavigateUrl',$value,'');
163
+		$this->setViewState('NavigateUrl', $value, '');
164 164
 	}
165 165
 
166 166
 	/**
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	public function getDataNavigateUrlField()
170 170
 	{
171
-		return $this->getViewState('DataNavigateUrlField','');
171
+		return $this->getViewState('DataNavigateUrlField', '');
172 172
 	}
173 173
 
174 174
 	/**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	 */
177 177
 	public function setDataNavigateUrlField($value)
178 178
 	{
179
-		$this->setViewState('DataNavigateUrlField',$value,'');
179
+		$this->setViewState('DataNavigateUrlField', $value, '');
180 180
 	}
181 181
 
182 182
 	/**
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	 */
185 185
 	public function getDataNavigateUrlFormatString()
186 186
 	{
187
-		return $this->getViewState('DataNavigateUrlFormatString','');
187
+		return $this->getViewState('DataNavigateUrlFormatString', '');
188 188
 	}
189 189
 
190 190
 	/**
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	 */
193 193
 	public function setDataNavigateUrlFormatString($value)
194 194
 	{
195
-		$this->setViewState('DataNavigateUrlFormatString',$value,'');
195
+		$this->setViewState('DataNavigateUrlFormatString', $value, '');
196 196
 	}
197 197
 
198 198
 	/**
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	 */
201 201
 	public function getTarget()
202 202
 	{
203
-		return $this->getViewState('Target','');
203
+		return $this->getViewState('Target', '');
204 204
 	}
205 205
 
206 206
 	/**
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	 */
210 210
 	public function setTarget($value)
211 211
 	{
212
-		$this->setViewState('Target',$value,'');
212
+		$this->setViewState('Target', $value, '');
213 213
 	}
214 214
 
215 215
 	/**
@@ -220,12 +220,12 @@  discard block
 block discarded – undo
220 220
 	 * @param integer the index to the Columns property that the cell resides in.
221 221
 	 * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)
222 222
 	 */
223
-	public function initializeCell($cell,$columnIndex,$itemType)
223
+	public function initializeCell($cell, $columnIndex, $itemType)
224 224
 	{
225 225
 		if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem)
226 226
 		{
227 227
 			$link=new THyperLink;
228
-			if(($url = $this->getImageUrl())!=='')
228
+			if(($url=$this->getImageUrl())!=='')
229 229
 			{
230 230
 				$link->setImageUrl($url);
231 231
 				if(($width=$this->getImageWidth())!=='')
@@ -237,12 +237,12 @@  discard block
 block discarded – undo
237 237
 			$link->setNavigateUrl($this->getNavigateUrl());
238 238
 			$link->setTarget($this->getTarget());
239 239
 			if($this->getDataTextField()!=='' || $this->getDataNavigateUrlField()!=='')
240
-				$link->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
240
+				$link->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn'));
241 241
 			$cell->getControls()->add($link);
242
-			$cell->registerObject('HyperLink',$link);
242
+			$cell->registerObject('HyperLink', $link);
243 243
 		}
244 244
 		else
245
-			parent::initializeCell($cell,$columnIndex,$itemType);
245
+			parent::initializeCell($cell, $columnIndex, $itemType);
246 246
 	}
247 247
 
248 248
 	/**
@@ -250,20 +250,20 @@  discard block
 block discarded – undo
250 250
 	 * This method is invoked when datagrid performs databinding.
251 251
 	 * It populates the content of the cell with the relevant data from data source.
252 252
 	 */
253
-	public function dataBindColumn($sender,$param)
253
+	public function dataBindColumn($sender, $param)
254 254
 	{
255 255
 		$item=$sender->getNamingContainer();
256 256
 		$data=$item->getData();
257 257
 		if(($field=$this->getDataTextField())!=='')
258 258
 		{
259
-			$value=$this->getDataFieldValue($data,$field);
260
-			$text=$this->formatDataValue($this->getDataTextFormatString(),$value);
259
+			$value=$this->getDataFieldValue($data, $field);
260
+			$text=$this->formatDataValue($this->getDataTextFormatString(), $value);
261 261
 			$sender->setText($text);
262 262
 		}
263 263
 		if(($field=$this->getDataNavigateUrlField())!=='')
264 264
 		{
265
-			$value=$this->getDataFieldValue($data,$field);
266
-			$url=$this->formatDataValue($this->getDataNavigateUrlFormatString(),$value);
265
+			$value=$this->getDataFieldValue($data, $field);
266
+			$url=$this->formatDataValue($this->getDataNavigateUrlFormatString(), $value);
267 267
 			$sender->setNavigateUrl($url);
268 268
 		}
269 269
 	}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TButtonColumn.php 2 patches
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   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 */
58 58
 	public function getText()
59 59
 	{
60
-		return $this->getViewState('Text','');
60
+		return $this->getViewState('Text', '');
61 61
 	}
62 62
 
63 63
 	/**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public function setText($value)
68 68
 	{
69
-		$this->setViewState('Text',$value,'');
69
+		$this->setViewState('Text', $value, '');
70 70
 	}
71 71
 
72 72
 	/**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public function getDataTextField()
76 76
 	{
77
-		return $this->getViewState('DataTextField','');
77
+		return $this->getViewState('DataTextField', '');
78 78
 	}
79 79
 
80 80
 	/**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	public function setDataTextField($value)
84 84
 	{
85
-		$this->setViewState('DataTextField',$value,'');
85
+		$this->setViewState('DataTextField', $value, '');
86 86
 	}
87 87
 
88 88
 	/**
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 */
91 91
 	public function getDataTextFormatString()
92 92
 	{
93
-		return $this->getViewState('DataTextFormatString','');
93
+		return $this->getViewState('DataTextFormatString', '');
94 94
 	}
95 95
 
96 96
 	/**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	public function setDataTextFormatString($value)
100 100
 	{
101
-		$this->setViewState('DataTextFormatString',$value,'');
101
+		$this->setViewState('DataTextFormatString', $value, '');
102 102
 	}
103 103
 
104 104
 	/**
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	 */
107 107
 	public function getImageUrl()
108 108
 	{
109
-		return $this->getViewState('ImageUrl','');
109
+		return $this->getViewState('ImageUrl', '');
110 110
 	}
111 111
 
112 112
 	/**
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	public function setImageUrl($value)
116 116
 	{
117
-		$this->setViewState('ImageUrl',$value,'');
117
+		$this->setViewState('ImageUrl', $value, '');
118 118
 	}
119 119
 
120 120
 	/**
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	public function getDataImageUrlField()
124 124
 	{
125
-		return $this->getViewState('DataImageUrlField','');
125
+		return $this->getViewState('DataImageUrlField', '');
126 126
 	}
127 127
 
128 128
 	/**
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	public function setDataImageUrlField($value)
132 132
 	{
133
-		$this->setViewState('DataImageUrlField',$value,'');
133
+		$this->setViewState('DataImageUrlField', $value, '');
134 134
 	}
135 135
 
136 136
 	/**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	public function getDataImageUrlFormatString()
140 140
 	{
141
-		return $this->getViewState('DataImageUrlFormatString','');
141
+		return $this->getViewState('DataImageUrlFormatString', '');
142 142
 	}
143 143
 
144 144
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 */
147 147
 	public function setDataImageUrlFormatString($value)
148 148
 	{
149
-		$this->setViewState('DataImageUrlFormatString',$value,'');
149
+		$this->setViewState('DataImageUrlFormatString', $value, '');
150 150
 	}
151 151
 
152 152
 	/**
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	 */
155 155
 	public function getButtonType()
156 156
 	{
157
-		return $this->getViewState('ButtonType',TButtonColumnType::LinkButton);
157
+		return $this->getViewState('ButtonType', TButtonColumnType::LinkButton);
158 158
 	}
159 159
 
160 160
 	/**
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	 */
163 163
 	public function setButtonType($value)
164 164
 	{
165
-		$this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'TButtonColumnType'),TButtonColumnType::LinkButton);
165
+		$this->setViewState('ButtonType', TPropertyValue::ensureEnum($value, 'TButtonColumnType'), TButtonColumnType::LinkButton);
166 166
 	}
167 167
 
168 168
 	/**
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 	 */
171 171
 	public function getCommandName()
172 172
 	{
173
-		return $this->getViewState('CommandName','');
173
+		return $this->getViewState('CommandName', '');
174 174
 	}
175 175
 
176 176
 	/**
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 */
180 180
 	public function setCommandName($value)
181 181
 	{
182
-		$this->setViewState('CommandName',$value,'');
182
+		$this->setViewState('CommandName', $value, '');
183 183
 	}
184 184
 
185 185
 	/**
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	 */
188 188
 	public function getCausesValidation()
189 189
 	{
190
-		return $this->getViewState('CausesValidation',true);
190
+		return $this->getViewState('CausesValidation', true);
191 191
 	}
192 192
 
193 193
 	/**
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	 */
196 196
 	public function setCausesValidation($value)
197 197
 	{
198
-		$this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true);
198
+		$this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true);
199 199
 	}
200 200
 
201 201
 	/**
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 	 */
204 204
 	public function getValidationGroup()
205 205
 	{
206
-		return $this->getViewState('ValidationGroup','');
206
+		return $this->getViewState('ValidationGroup', '');
207 207
 	}
208 208
 
209 209
 	/**
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 	 */
212 212
 	public function setValidationGroup($value)
213 213
 	{
214
-		$this->setViewState('ValidationGroup',$value,'');
214
+		$this->setViewState('ValidationGroup', $value, '');
215 215
 	}
216 216
 
217 217
 	/**
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	 * @param integer the index to the Columns property that the cell resides in.
223 223
 	 * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)
224 224
 	 */
225
-	public function initializeCell($cell,$columnIndex,$itemType)
225
+	public function initializeCell($cell, $columnIndex, $itemType)
226 226
 	{
227 227
 		if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem)
228 228
 		{
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
 			$button->setCausesValidation($this->getCausesValidation());
243 243
 			$button->setValidationGroup($this->getValidationGroup());
244 244
 			if($this->getDataTextField()!=='' || ($buttonType===TButtonColumnType::ImageButton && $this->getDataImageUrlField()!==''))
245
-				$button->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
245
+				$button->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn'));
246 246
 			$cell->getControls()->add($button);
247
-			$cell->registerObject('Button',$button);
247
+			$cell->registerObject('Button', $button);
248 248
 		}
249 249
 		else
250
-			parent::initializeCell($cell,$columnIndex,$itemType);
250
+			parent::initializeCell($cell, $columnIndex, $itemType);
251 251
 	}
252 252
 
253 253
 	/**
@@ -255,20 +255,20 @@  discard block
 block discarded – undo
255 255
 	 * This method is invoked when datagrid performs databinding.
256 256
 	 * It populates the content of the cell with the relevant data from data source.
257 257
 	 */
258
-	public function dataBindColumn($sender,$param)
258
+	public function dataBindColumn($sender, $param)
259 259
 	{
260 260
 		if($sender instanceof IButtonControl)
261 261
 		{
262 262
 			if(($field=$this->getDataTextField())!=='')
263 263
 			{
264
-				$value=$this->getDataFieldValue($sender->getNamingContainer()->getData(),$field);
265
-				$text=$this->formatDataValue($this->getDataTextFormatString(),$value);
264
+				$value=$this->getDataFieldValue($sender->getNamingContainer()->getData(), $field);
265
+				$text=$this->formatDataValue($this->getDataTextFormatString(), $value);
266 266
 				$sender->setText($text);
267 267
 			}
268 268
 			if(($sender instanceof TImageButton) && ($field=$this->getDataImageUrlField())!=='')
269 269
 			{
270
-				$value=$this->getDataFieldValue($sender->getNamingContainer()->getData(),$field);
271
-				$url=$this->formatDataValue($this->getDataImageUrlFormatString(),$value);
270
+				$value=$this->getDataFieldValue($sender->getNamingContainer()->getData(), $field);
271
+				$url=$this->formatDataValue($this->getDataImageUrlFormatString(), $value);
272 272
 				$sender->setImageUrl($url);
273 273
 			}
274 274
 		}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TLiteral.php 2 patches
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
@@ -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/ActiveControls/TActiveFileUpload.php 2 patches
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -223,14 +223,12 @@  discard block
 block discarded – undo
223 223
 				// this is the most secure method, file info can't be forged from client side, no matter what
224 224
 				$token = md5('TActiveFileUpload::Params::'.$this->ClientID.'::'+rand(1000*1000,9999*1000));
225 225
 				$cache->set($token, serialize($params), 5*60); // expire in 5 minutes - the callback should arrive back in seconds, actually
226
-			}
227
-		else
226
+			} else
228 227
 		if ($mgr = Prado::getApplication()->getSecurityManager())
229 228
 			{
230 229
 				// this is a less secure method, file info can be still forged from client side, but only if attacker knows the secret application key
231 230
 				$token = urlencode(base64_encode($mgr->encrypt(serialize($params))));
232
-			}
233
-		else
231
+			} else
234 232
 			throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');
235 233
 
236 234
 		return $token;
@@ -244,14 +242,12 @@  discard block
 block discarded – undo
244 242
 				assert($v!='');
245 243
 				$cache->delete($token); // remove it from cache so it can't be used again and won't take up space either
246 244
 				$params = unserialize($v);
247
-			}
248
-		else
245
+			} else
249 246
 		if ($mgr = Prado::getApplication()->getSecurityManager())
250 247
 			{
251 248
 				$v = $mgr->decrypt(base64_decode(urldecode($token)));
252 249
 				$params = unserialize($v);
253
-			}
254
-		else
250
+			} else
255 251
 			throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');
256 252
 
257 253
 		assert($params instanceof TActiveFileUploadCallbackParams);
Please login to merge, or discard this patch.
Spacing   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallbackEventHandler, INamingContainer
44 44
 {
45 45
 
46
-	const SCRIPT_PATH = 'prado/activefileupload';
46
+	const SCRIPT_PATH='prado/activefileupload';
47 47
 
48 48
 	/**
49 49
 	 * @var THiddenField a flag to tell which component is doing the callback.
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 * TActiveControlAdapter. If you override this class, be sure to set the
73 73
 	 * adapter appropriately by, for example, by calling this constructor.
74 74
 	 */
75
-	public function __construct(){
75
+	public function __construct() {
76 76
 		parent::__construct();
77 77
 		$this->setAdapter(new TActiveControlAdapter($this));
78 78
 	}
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 */
85 85
 	protected function getAssetUrl($file='')
86 86
 	{
87
-		$base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl();
87
+		$base=$this->getPage()->getClientScript()->getPradoScriptAssetUrl();
88 88
 		return $base.'/'.self::SCRIPT_PATH.'/'.$file;
89 89
 	}
90 90
 
@@ -97,18 +97,18 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function onFileUpload($param)
99 99
 	{
100
-		if ($this->_flag->getValue() && $this->getPage()->getIsPostBack() && $param == $this->_target->getUniqueID()){
100
+		if($this->_flag->getValue() && $this->getPage()->getIsPostBack() && $param==$this->_target->getUniqueID()) {
101 101
 			// save the file so that it will persist past the end of this return.
102
-			$localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),''));
102
+			$localName=str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()), ''));
103 103
 			parent::saveAs($localName);
104
-			$this->_localName = $localName;
104
+			$this->_localName=$localName;
105 105
 
106
-			$params = new TActiveFileUploadCallbackParams;
107
-			$params->localName = $localName;
108
-			$params->fileName = addslashes($this->getFileName());
109
-			$params->fileSize = $this->getFileSize();
110
-			$params->fileType = $this->getFileType();
111
-			$params->errorCode = $this->getErrorCode();
106
+			$params=new TActiveFileUploadCallbackParams;
107
+			$params->localName=$localName;
108
+			$params->fileName=addslashes($this->getFileName());
109
+			$params->fileSize=$this->getFileSize();
110
+			$params->fileType=$this->getFileType();
111
+			$params->errorCode=$this->getErrorCode();
112 112
 
113 113
 			// return some javascript to display a completion status.
114 114
 			echo <<<EOS
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 * @return string the path where the uploaded file will be stored temporarily, in namespace format
134 134
 	 * default "Application.runtime.*"
135 135
 	 */
136
-	public function getTempPath(){
136
+	public function getTempPath() {
137 137
 		return $this->getViewState('TempPath', 'Application.runtime.*');
138 138
 	}
139 139
 
@@ -141,15 +141,15 @@  discard block
 block discarded – undo
141 141
 	 * @param string the path where the uploaded file will be stored temporarily in namespace format
142 142
 	 * default "Application.runtime.*"
143 143
 	 */
144
-	public function setTempPath($value){
145
-		$this->setViewState('TempPath',$value,'Application.runtime.*');
144
+	public function setTempPath($value) {
145
+		$this->setViewState('TempPath', $value, 'Application.runtime.*');
146 146
 	}
147 147
 
148 148
 	/**
149 149
 	 * @return boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true.
150 150
 	 * Note: When set to false, you will need to trigger the callback yourself.
151 151
 	 */
152
-	public function getAutoPostBack(){
152
+	public function getAutoPostBack() {
153 153
 		return $this->getViewState('AutoPostBack', true);
154 154
 	}
155 155
 
@@ -157,28 +157,28 @@  discard block
 block discarded – undo
157 157
 	 * @param boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true.
158 158
 	 * Note: When set to false, you will need to trigger the callback yourself.
159 159
 	 */
160
-	public function setAutoPostBack($value){
161
-		$this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),true);
160
+	public function setAutoPostBack($value) {
161
+		$this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), true);
162 162
 	}
163 163
 
164 164
 	/**
165 165
 	 * @return string A chuck of javascript that will need to be called if {{@link getAutoPostBack AutoPostBack} is set to false}
166 166
 	 */
167
-	public function getCallbackJavascript(){
167
+	public function getCallbackJavascript() {
168 168
 		return "Prado.WebUI.TActiveFileUpload.fileChanged(\"{$this->getClientID()}\")";
169 169
 	}
170 170
 
171 171
 	/**
172 172
 	 * @throws TInvalidDataValueException if the {@link getTempPath TempPath} is not writable.
173 173
 	 */
174
-	public function onInit($sender){
174
+	public function onInit($sender) {
175 175
 		parent::onInit($sender);
176 176
 
177
-		if (!Prado::getApplication()->getCache())
178
-		  if (!Prado::getApplication()->getSecurityManager())
177
+		if(!Prado::getApplication()->getCache())
178
+		  if(!Prado::getApplication()->getSecurityManager())
179 179
 			throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');
180 180
 
181
-		if (!is_writable(Prado::getPathOfNamespace($this->getTempPath()))){
181
+		if(!is_writable(Prado::getPathOfNamespace($this->getTempPath()))) {
182 182
 			throw new TInvalidDataValueException("activefileupload_temppath_invalid", $this->getTempPath());
183 183
 		}
184 184
 	}
@@ -190,17 +190,17 @@  discard block
 block discarded – undo
190 190
 	 * This method is mainly used by framework and control developers.
191 191
 	 * @param TCallbackEventParameter the event parameter
192 192
 	 */
193
- 	public function raiseCallbackEvent($param){
194
- 		$cp = $param->getCallbackParameter();
195
-		if ($key = $cp->targetID == $this->_target->getUniqueID()){
193
+ 	public function raiseCallbackEvent($param) {
194
+ 		$cp=$param->getCallbackParameter();
195
+		if($key=$cp->targetID==$this->_target->getUniqueID()) {
196 196
 
197
-			$params = $this->popParamsByToken($cp->callbackToken);
197
+			$params=$this->popParamsByToken($cp->callbackToken);
198 198
 
199
-			$_FILES[$key]['name'] = stripslashes($params->fileName);
200
-			$_FILES[$key]['size'] = intval($params->fileSize);
201
-			$_FILES[$key]['type'] = $params->fileType;
202
-			$_FILES[$key]['error'] = intval($params->errorCode);
203
-			$_FILES[$key]['tmp_name'] = $params->localName;
199
+			$_FILES[$key]['name']=stripslashes($params->fileName);
200
+			$_FILES[$key]['size']=intval($params->fileSize);
201
+			$_FILES[$key]['type']=$params->fileType;
202
+			$_FILES[$key]['error']=intval($params->errorCode);
203
+			$_FILES[$key]['tmp_name']=$params->localName;
204 204
 			$this->loadPostData($key, null);
205 205
 
206 206
 			$this->raiseEvent('OnFileUpload', $this, $param);
@@ -219,17 +219,17 @@  discard block
 block discarded – undo
219 219
 
220 220
 	protected function pushParamsAndGetToken(TActiveFileUploadCallbackParams $params)
221 221
 	{
222
-		if ($cache = Prado::getApplication()->getCache())
222
+		if($cache=Prado::getApplication()->getCache())
223 223
 			{
224 224
 				// this is the most secure method, file info can't be forged from client side, no matter what
225
-				$token = md5('TActiveFileUpload::Params::'.$this->ClientID.'::'+rand(1000*1000,9999*1000));
226
-				$cache->set($token, serialize($params), 5*60); // expire in 5 minutes - the callback should arrive back in seconds, actually
225
+				$token=md5('TActiveFileUpload::Params::'.$this->ClientID.'::'+rand(1000 * 1000, 9999 * 1000));
226
+				$cache->set($token, serialize($params), 5 * 60); // expire in 5 minutes - the callback should arrive back in seconds, actually
227 227
 			}
228 228
 		else
229
-		if ($mgr = Prado::getApplication()->getSecurityManager())
229
+		if($mgr=Prado::getApplication()->getSecurityManager())
230 230
 			{
231 231
 				// this is a less secure method, file info can be still forged from client side, but only if attacker knows the secret application key
232
-				$token = urlencode(base64_encode($mgr->encrypt(serialize($params))));
232
+				$token=urlencode(base64_encode($mgr->encrypt(serialize($params))));
233 233
 			}
234 234
 		else
235 235
 			throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');
@@ -239,18 +239,18 @@  discard block
 block discarded – undo
239 239
 
240 240
 	protected function popParamsByToken($token)
241 241
 	{
242
-		if ($cache = Prado::getApplication()->getCache())
242
+		if($cache=Prado::getApplication()->getCache())
243 243
 			{
244
-				$v = $cache->get($token);
244
+				$v=$cache->get($token);
245 245
 				assert($v!='');
246 246
 				$cache->delete($token); // remove it from cache so it can't be used again and won't take up space either
247
-				$params = unserialize($v);
247
+				$params=unserialize($v);
248 248
 			}
249 249
 		else
250
-		if ($mgr = Prado::getApplication()->getSecurityManager())
250
+		if($mgr=Prado::getApplication()->getSecurityManager())
251 251
 			{
252
-				$v = $mgr->decrypt(base64_decode(urldecode($token)));
253
-				$params = unserialize($v);
252
+				$v=$mgr->decrypt(base64_decode(urldecode($token)));
253
+				$params=unserialize($v);
254 254
 			}
255 255
 		else
256 256
 			throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');
@@ -267,19 +267,19 @@  discard block
 block discarded – undo
267 267
 	{
268 268
 		parent::onPreRender($param);
269 269
 
270
-		if(!$this->getPage()->getIsPostBack() && isset($_GET['TActiveFileUpload_InputId']) && isset($_GET['TActiveFileUpload_TargetId']) && $_GET['TActiveFileUpload_InputId'] == $this->getClientID())
270
+		if(!$this->getPage()->getIsPostBack() && isset($_GET['TActiveFileUpload_InputId']) && isset($_GET['TActiveFileUpload_TargetId']) && $_GET['TActiveFileUpload_InputId']==$this->getClientID())
271 271
 		{
272 272
 			// tricky workaround to intercept "uploaded file too big" error: real uploads happens in onFileUpload instead
273
-			$this->_errorCode = UPLOAD_ERR_FORM_SIZE;
274
-			$localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),''));
275
-			$fileName = addslashes($this->getFileName());
273
+			$this->_errorCode=UPLOAD_ERR_FORM_SIZE;
274
+			$localName=str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()), ''));
275
+			$fileName=addslashes($this->getFileName());
276 276
 
277
-			$params = new TActiveFileUploadCallbackParams;
278
-			$params->localName = $localName;
279
-			$params->fileName = $fileName;
280
-			$params->fileSize = $this->getFileSize();
281
-			$params->fileType = $this->getFileType();
282
-			$params->errorCode = $this->getErrorCode();
277
+			$params=new TActiveFileUploadCallbackParams;
278
+			$params->localName=$localName;
279
+			$params->fileName=$fileName;
280
+			$params->fileSize=$this->getFileSize();
281
+			$params->fileType=$this->getFileType();
282
+			$params->errorCode=$this->getErrorCode();
283 283
 
284 284
 			echo <<<EOS
285 285
 <script language="Javascript">
@@ -297,30 +297,30 @@  discard block
 block discarded – undo
297 297
 		}
298 298
 	}
299 299
 
300
-	public function createChildControls(){
301
-		$this->_flag = Prado::createComponent('THiddenField');
300
+	public function createChildControls() {
301
+		$this->_flag=Prado::createComponent('THiddenField');
302 302
 		$this->_flag->setID('Flag');
303 303
 		$this->getControls()->add($this->_flag);
304 304
 
305
-		$this->_busy = Prado::createComponent('TImage');
305
+		$this->_busy=Prado::createComponent('TImage');
306 306
 		$this->_busy->setID('Busy');
307 307
 		$this->_busy->setImageUrl($this->getAssetUrl('ActiveFileUploadIndicator.gif'));
308 308
 		$this->_busy->setStyle("display:none");
309 309
 		$this->getControls()->add($this->_busy);
310 310
 
311
-		$this->_success = Prado::createComponent('TImage');
311
+		$this->_success=Prado::createComponent('TImage');
312 312
 		$this->_success->setID('Success');
313 313
 		$this->_success->setImageUrl($this->getAssetUrl('ActiveFileUploadComplete.png'));
314 314
 		$this->_success->setStyle("display:none");
315 315
 		$this->getControls()->add($this->_success);
316 316
 
317
-		$this->_error = Prado::createComponent('TImage');
317
+		$this->_error=Prado::createComponent('TImage');
318 318
 		$this->_error->setID('Error');
319 319
 		$this->_error->setImageUrl($this->getAssetUrl('ActiveFileUploadError.png'));
320 320
 		$this->_error->setStyle("display:none");
321 321
 		$this->getControls()->add($this->_error);
322 322
 
323
-		$this->_target = Prado::createComponent('TInlineFrame');
323
+		$this->_target=Prado::createComponent('TInlineFrame');
324 324
 		$this->_target->setID('Target');
325 325
 		$this->_target->setFrameUrl($this->getAssetUrl('ActiveFileUploadBlank.html'));
326 326
 		$this->_target->setStyle("width:0px; height:0px;");
@@ -332,10 +332,10 @@  discard block
 block discarded – undo
332 332
 	/**
333 333
 	 * Removes localfile on ending of the callback.
334 334
 	 */
335
-	public function onUnload($param){
336
-		if ($this->getPage()->getIsCallback() &&
335
+	public function onUnload($param) {
336
+		if($this->getPage()->getIsCallback() &&
337 337
 			$this->getHasFile() &&
338
-			file_exists($this->getLocalName())){
338
+			file_exists($this->getLocalName())) {
339 339
 				unlink($this->getLocalName());
340 340
 		}
341 341
 		parent::onUnload($param);
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 	/**
345 345
 	 * @return TBaseActiveCallbackControl standard callback control options.
346 346
 	 */
347
-	public function getActiveControl(){
347
+	public function getActiveControl() {
348 348
 		return $this->getAdapter()->getBaseActiveControl();
349 349
 	}
350 350
 
@@ -360,18 +360,18 @@  discard block
 block discarded – undo
360 360
 	 * Adds ID attribute, and renders the javascript for active component.
361 361
 	 * @param THtmlWriter the writer used for the rendering purpose
362 362
 	 */
363
-	public function addAttributesToRender($writer){
363
+	public function addAttributesToRender($writer) {
364 364
 		parent::addAttributesToRender($writer);
365
-		$writer->addAttribute('id',$this->getClientID());
365
+		$writer->addAttribute('id', $this->getClientID());
366 366
 
367 367
 		$this->getPage()->getClientScript()->registerPradoScript('activefileupload');
368
-		$this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(),$this->getClientOptions());
368
+		$this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getClientOptions());
369 369
 	}
370 370
 
371 371
 	/**
372 372
 	 * @return string corresponding javascript class name for this control.
373 373
 	 */
374
-	protected function getClientClassName(){
374
+	protected function getClientClassName() {
375 375
 		return 'Prado.WebUI.TActiveFileUpload';
376 376
 	}
377 377
 
@@ -385,18 +385,18 @@  discard block
 block discarded – undo
385 385
 	 * 					completeID => complete client ID,
386 386
 	 * 					errorID => error client ID)
387 387
 	 */
388
-	protected function getClientOptions(){
389
-		$options['ID'] = $this->getClientID();
390
-		$options['EventTarget'] = $this->getUniqueID();
391
-
392
-		$options['inputID'] = $this->getClientID();
393
-		$options['flagID'] = $this->_flag->getClientID();
394
-		$options['targetID'] = $this->_target->getUniqueID();
395
-		$options['formID'] = $this->getPage()->getForm()->getClientID();
396
-		$options['indicatorID'] = $this->_busy->getClientID();
397
-		$options['completeID'] = $this->_success->getClientID();
398
-		$options['errorID'] = $this->_error->getClientID();
399
-		$options['autoPostBack'] = $this->getAutoPostBack();
388
+	protected function getClientOptions() {
389
+		$options['ID']=$this->getClientID();
390
+		$options['EventTarget']=$this->getUniqueID();
391
+
392
+		$options['inputID']=$this->getClientID();
393
+		$options['flagID']=$this->_flag->getClientID();
394
+		$options['targetID']=$this->_target->getUniqueID();
395
+		$options['formID']=$this->getPage()->getForm()->getClientID();
396
+		$options['indicatorID']=$this->_busy->getClientID();
397
+		$options['completeID']=$this->_success->getClientID();
398
+		$options['errorID']=$this->_error->getClientID();
399
+		$options['autoPostBack']=$this->getAutoPostBack();
400 400
 		return $options;
401 401
 	}
402 402
 
@@ -407,12 +407,12 @@  discard block
 block discarded – undo
407 407
 	 * If true, you will not be able to save the uploaded file again.
408 408
 	 * @return boolean true if the file saving is successful
409 409
 	 */
410
-	public function saveAs($fileName,$deleteTempFile=true){
411
-		if (($this->getErrorCode()===UPLOAD_ERR_OK) && (file_exists($this->getLocalName()))){
412
-			if ($deleteTempFile)
413
-				return rename($this->getLocalName(),$fileName);
410
+	public function saveAs($fileName, $deleteTempFile=true) {
411
+		if(($this->getErrorCode()===UPLOAD_ERR_OK) && (file_exists($this->getLocalName()))) {
412
+			if($deleteTempFile)
413
+				return rename($this->getLocalName(), $fileName);
414 414
 			else
415
-				return copy($this->getLocalName(),$fileName);
415
+				return copy($this->getLocalName(), $fileName);
416 416
 		} else
417 417
 			return false;
418 418
 	}
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 	 * @return TImage the image displayed when an upload
422 422
 	 * 		completes successfully.
423 423
 	 */
424
-	public function getSuccessImage(){
424
+	public function getSuccessImage() {
425 425
 		$this->ensureChildControls();
426 426
 		return $this->_success;
427 427
 	}
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 	 * @return TImage the image displayed when an upload
431 431
 	 * 		does not complete successfully.
432 432
 	 */
433
-	public function getErrorImage(){
433
+	public function getErrorImage() {
434 434
 		$this->ensureChildControls();
435 435
 		return $this->_error;
436 436
 	}
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 	 * @return TImage the image displayed when an upload
440 440
 	 * 		is in progress.
441 441
 	 */
442
-	public function getBusyImage(){
442
+	public function getBusyImage() {
443 443
 		$this->ensureChildControls();
444 444
 		return $this->_busy;
445 445
 	}
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActivePager.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -127,8 +127,7 @@  discard block
 block discarded – undo
127 127
 				$button->setCssClass($this->getButtonCssClass());
128 128
 				return $button;
129 129
 			}
130
-		}
131
-		else if($buttonType===TPagerButtonType::ImageButton)
130
+		} else if($buttonType===TPagerButtonType::ImageButton)
132 131
 		{
133 132
 			$button = new TActiveImageButton;
134 133
 			$button->setImageUrl($this->getPageImageUrl($text,$commandName));
@@ -136,8 +135,7 @@  discard block
 block discarded – undo
136 135
 				$button->Visible = true;
137 136
 			else
138 137
 				$button->Visible = false;
139
-		}
140
-		else
138
+		} else
141 139
 		{
142 140
 			$button=new TActiveButton;
143 141
 			if(!$enabled)
@@ -197,8 +195,7 @@  discard block
 block discarded – undo
197 195
 			TWebControl::render($writer);
198 196
 			if($this->getActiveControl()->canUpdateClientSide())
199 197
 				$this->getPage()->getCallbackClient()->replaceContent($this,$writer);
200
-		}
201
-		else
198
+		} else
202 199
 		{
203 200
 			$this->getPage()->getAdapter()->registerControlToRender($this,$writer);
204 201
 		}
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -94,11 +94,11 @@  discard block
 block discarded – undo
94 94
 		);
95 95
 
96 96
 		$this->getControls()->add($list);
97
-		$list->setDataSource(range(1,$this->getPageCount()));
97
+		$list->setDataSource(range(1, $this->getPageCount()));
98 98
 		$list->dataBind();
99 99
 		$list->setSelectedIndex($this->getCurrentPageIndex());
100 100
 		$list->setAutoPostBack(true);
101
-		$list->attachEventHandler('OnSelectedIndexChanged',array($this,'listIndexChanged'));
101
+		$list->attachEventHandler('OnSelectedIndexChanged', array($this, 'listIndexChanged'));
102 102
 		$list->attachEventHandler('OnCallback', array($this, 'handleCallback'));
103 103
 	}
104 104
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	 * @param string CommandParameter corresponding to the OnCommand event of the button
115 115
 	 * @return mixed the button instance
116 116
 	 */
117
-	protected function createPagerButton($buttonType,$enabled,$text,$commandName,$commandParameter)
117
+	protected function createPagerButton($buttonType, $enabled, $text, $commandName, $commandParameter)
118 118
 	{
119 119
 		if($buttonType===TPagerButtonType::LinkButton)
120 120
 		{
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
 		}
131 131
 		else if($buttonType===TPagerButtonType::ImageButton)
132 132
 		{
133
-			$button = new TActiveImageButton;
134
-			$button->setImageUrl($this->getPageImageUrl($text,$commandName));
133
+			$button=new TActiveImageButton;
134
+			$button->setImageUrl($this->getPageImageUrl($text, $commandName));
135 135
 			if($enabled)
136
-				$button->Visible = true;
136
+				$button->Visible=true;
137 137
 			else
138
-				$button->Visible = false;
138
+				$button->Visible=false;
139 139
 		}
140 140
 		else
141 141
 		{
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
 		if($buttonType===TPagerButtonType::ImageButton)
148 148
 		{
149
-			$button->ImageUrl = $text;
149
+			$button->ImageUrl=$text;
150 150
 		}
151 151
 
152 152
 		$button->setText($text);
@@ -170,14 +170,14 @@  discard block
 block discarded – undo
170 170
 	 * @param mixed $sender
171 171
 	 * @param TCallbackEventParameter $param
172 172
 	 */
173
-	public function handleCallback ($sender,$param)
173
+	public function handleCallback($sender, $param)
174 174
 	{
175 175
 		// Update all the buttons pagers attached to the same control.
176 176
 		// Dropdown pagers doesn't need to be re-rendered.
177 177
 		$controlToPaginate=$this->getControlToPaginate();
178
-		foreach ($this->getNamingContainer()->findControlsByType('TActivePager', false) as $control)
178
+		foreach($this->getNamingContainer()->findControlsByType('TActivePager', false) as $control)
179 179
 		{
180
-			if ($control->getMode() !== TPagerMode::DropDownList && $control->getControlToPaginate()===$controlToPaginate)
180
+			if($control->getMode()!==TPagerMode::DropDownList && $control->getControlToPaginate()===$controlToPaginate)
181 181
 			{
182 182
 				$control->render($param->getNewWriter());
183 183
 				// FIXME : With some very fast machine, the getNewWriter() consecutive calls are in the same microsecond, resulting
@@ -189,18 +189,18 @@  discard block
 block discarded – undo
189 189
 		$this->onCallback($param);
190 190
 	}
191 191
 
192
-	public function render ($writer)
192
+	public function render($writer)
193 193
 	{
194 194
 		if($this->getHasPreRendered())
195 195
 		{
196
-			$this->setDisplay(($this->getPageCount()==1)?TDisplayStyle::None:TDisplayStyle::Dynamic);
196
+			$this->setDisplay(($this->getPageCount()==1) ? TDisplayStyle::None : TDisplayStyle::Dynamic);
197 197
 			TWebControl::render($writer);
198 198
 			if($this->getActiveControl()->canUpdateClientSide())
199
-				$this->getPage()->getCallbackClient()->replaceContent($this,$writer);
199
+				$this->getPage()->getCallbackClient()->replaceContent($this, $writer);
200 200
 		}
201 201
 		else
202 202
 		{
203
-			$this->getPage()->getAdapter()->registerControlToRender($this,$writer);
203
+			$this->getPage()->getAdapter()->registerControlToRender($this, $writer);
204 204
 		}
205 205
 	}
206 206
 }
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveRepeater.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,8 +95,7 @@
 block discarded – undo
95 95
 		if($this->getHasPreRendered()) {
96 96
 			$this->renderRepeater($writer);
97 97
 			if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(),$writer);
98
-		}
99
-		else {
98
+		} else {
100 99
 			$this->getPage()->getAdapter()->registerControlToRender($this,$writer);
101 100
 		}
102 101
 	}
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		parent::setDataSource($value);
58 58
 		if($this->getActiveControl()->canUpdateClientSide()) {
59 59
 			$this->renderPager();
60
-			$this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
60
+			$this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter());
61 61
 		}
62 62
 	}
63 63
 
@@ -94,10 +94,10 @@  discard block
 block discarded – undo
94 94
 	public function render($writer) {
95 95
 		if($this->getHasPreRendered()) {
96 96
 			$this->renderRepeater($writer);
97
-			if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(),$writer);
97
+			if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(), $writer);
98 98
 		}
99 99
 		else {
100
-			$this->getPage()->getAdapter()->registerControlToRender($this,$writer);
100
+			$this->getPage()->getAdapter()->registerControlToRender($this, $writer);
101 101
 		}
102 102
 	}
103 103
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 		foreach($pager as $item) {
112 112
 			if($item->ControlToPaginate==$this->ID) {
113 113
 				$writer=$this->getResponse()->createHtmlWriter();
114
-				$this->getPage()->getAdapter()->registerControlToRender($item,$writer);
114
+				$this->getPage()->getAdapter()->registerControlToRender($item, $writer);
115 115
 			}
116 116
 		}
117 117
 	}
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	 * @param THtmlWriter writer for the rendering purpose
124 124
 	 */
125 125
 	private function renderRepeater($writer) {
126
-		$writer->addAttribute('id',$this->getSurroundingTagID());
126
+		$writer->addAttribute('id', $this->getSurroundingTagID());
127 127
 		$writer->renderBeginTag($this->getSurroundingTag());
128 128
 		parent::render($writer);
129 129
 		$writer->renderEndTag();
Please login to merge, or discard this patch.
framework/Collections/TQueue.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,8 +81,7 @@
 block discarded – undo
81 81
 				$this->_d[]=$item;
82 82
 				++$this->_c;
83 83
 			}
84
-		}
85
-		else if($data!==null)
84
+		} else if($data!==null)
86 85
 			throw new TInvalidDataTypeException('queue_data_not_iterable');
87 86
 	}
88 87
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
  * @package System.Collections
33 33
  * @since 3.1
34 34
  */
35
-class TQueue extends TComponent implements IteratorAggregate,Countable
35
+class TQueue extends TComponent implements IteratorAggregate, Countable
36 36
 {
37 37
 	/**
38 38
 	 * internal data storage
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 */
102 102
 	public function contains($item)
103 103
 	{
104
-		return array_search($item,$this->_d,true)!==false;
104
+		return array_search($item, $this->_d, true)!==false;
105 105
 	}
106 106
 
107 107
 	/**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	public function enqueue($item)
142 142
 	{
143 143
 		++$this->_c;
144
-		$this->_d[] = $item;
144
+		$this->_d[]=$item;
145 145
 	}
146 146
 
147 147
 	/**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 */
152 152
 	public function getIterator()
153 153
 	{
154
-		return new ArrayIterator( $this->_d );
154
+		return new ArrayIterator($this->_d);
155 155
 	}
156 156
 
157 157
 	/**
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	 */
258 258
 	public function valid()
259 259
 	{
260
-		return $this->_i<$this->_c;
260
+		return $this->_i < $this->_c;
261 261
 	}
262 262
 }
263 263
 
Please login to merge, or discard this patch.
framework/Xml/TXmlDocument.php 3 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -66,6 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
 	/**
68 68
 	 * @param TXmlElement parent element of this element
69
+	 * @param TXmlElement|null $parent
69 70
 	 */
70 71
 	public function setParent($parent)
71 72
 	{
@@ -175,6 +176,7 @@  discard block
 block discarded – undo
175 176
 	}
176 177
 
177 178
 	/**
179
+	 * @param string $tagName
178 180
 	 * @return TList list of all child elements that have the specified tag-name
179 181
 	 */
180 182
 	public function getElementsByTagName($tagName)
@@ -334,6 +336,7 @@  discard block
 block discarded – undo
334 336
 
335 337
 	/**
336 338
 	 * @param string version of this XML document
339
+	 * @param string $version
337 340
 	 */
338 341
 	public function setVersion($version)
339 342
 	{
@@ -350,6 +353,7 @@  discard block
 block discarded – undo
350 353
 
351 354
 	/**
352 355
 	 * @param string encoding of this XML document
356
+	 * @param string $encoding
353 357
 	 */
354 358
 	public function setEncoding($encoding)
355 359
 	{
@@ -473,6 +477,7 @@  discard block
 block discarded – undo
473 477
 	/**
474 478
 	 * Recursively converts DOM XML nodes into TXmlElement
475 479
 	 * @param DOMXmlNode the node to be converted
480
+	 * @param DOMElement $node
476 481
 	 * @return TXmlElement the converted TXmlElement
477 482
 	 */
478 483
 	protected function buildElement($node)
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	public function getHasElement()
111 111
 	{
112
-		return $this->_elements!==null && $this->_elements->getCount()>0;
112
+		return $this->_elements!==null && $this->_elements->getCount() > 0;
113 113
 	}
114 114
 
115 115
 	/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	public function getHasAttribute()
119 119
 	{
120
-		return $this->_attributes!==null && $this->_attributes->getCount()>0;
120
+		return $this->_attributes!==null && $this->_attributes->getCount() > 0;
121 121
 	}
122 122
 
123 123
 	/**
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
 	 * @param string attribute name
136 136
 	 * @param string attribute value
137 137
 	 */
138
-	public function setAttribute($name,$value)
138
+	public function setAttribute($name, $value)
139 139
 	{
140
-		$this->getAttributes()->add($name,TPropertyValue::ensureString($value));
140
+		$this->getAttributes()->add($name, TPropertyValue::ensureString($value));
141 141
 	}
142 142
 
143 143
 	/**
@@ -203,12 +203,12 @@  discard block
 block discarded – undo
203 203
 				$attr.=" $name=\"$value\"";
204 204
 			}
205 205
 		}
206
-		$prefix=str_repeat(' ',$indent*4);
206
+		$prefix=str_repeat(' ', $indent * 4);
207 207
 		if($this->getHasElement())
208 208
 		{
209 209
 			$str=$prefix."<{$this->_tagName}$attr>\n";
210 210
 			foreach($this->getElements() as $element)
211
-				$str.=$element->toString($indent+1)."\n";
211
+				$str.=$element->toString($indent + 1)."\n";
212 212
 			$str.=$prefix."</{$this->_tagName}>";
213 213
 			return $str;
214 214
 		}
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
 	private function xmlEncode($str)
243 243
 	{
244
-		return strtr($str,array(
244
+		return strtr($str, array(
245 245
 			'>'=>'&gt;',
246 246
 			'<'=>'&lt;',
247 247
 			'&'=>'&amp;',
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 	 * @param string version of this XML document
318 318
 	 * @param string encoding of this XML document
319 319
 	 */
320
-	public function __construct($version='1.0',$encoding='')
320
+	public function __construct($version='1.0', $encoding='')
321 321
 	{
322 322
 		parent::__construct('');
323 323
 		$this->setVersion($version);
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 		if(($str=@file_get_contents($file))!==false)
368 368
 			return $this->loadFromString($str);
369 369
 		else
370
-			throw new TIOException('xmldocument_file_read_failed',$file);
370
+			throw new TIOException('xmldocument_file_read_failed', $file);
371 371
 	}
372 372
 
373 373
 	/**
@@ -395,17 +395,17 @@  discard block
 block discarded – undo
395 395
 		$attributes->clear();
396 396
 
397 397
 		static $bSimpleXml;
398
-		if($bSimpleXml === null)
399
-			$bSimpleXml = (boolean)function_exists('simplexml_load_string');
398
+		if($bSimpleXml===null)
399
+			$bSimpleXml=(boolean) function_exists('simplexml_load_string');
400 400
 
401 401
 		if($bSimpleXml)
402 402
 		{
403
-			$simpleDoc = simplexml_load_string($string);
404
-			$docNamespaces = $simpleDoc->getDocNamespaces(false);
405
-			$simpleDoc = null;
403
+			$simpleDoc=simplexml_load_string($string);
404
+			$docNamespaces=$simpleDoc->getDocNamespaces(false);
405
+			$simpleDoc=null;
406 406
 			foreach($docNamespaces as $prefix => $uri)
407 407
 			{
408
- 				if($prefix === '')
408
+ 				if($prefix==='')
409 409
    					$attributes->add('xmlns', $uri);
410 410
    				else
411 411
    					$attributes->add('xmlns:'.$prefix, $uri);
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 		}
414 414
 
415 415
 		foreach($element->attributes as $name=>$attr)
416
-			$attributes->add(($attr->prefix === '' ? '' : $attr->prefix . ':') .$name,$attr->value);
416
+			$attributes->add(($attr->prefix==='' ? '' : $attr->prefix.':').$name, $attr->value);
417 417
 		foreach($element->childNodes as $child)
418 418
 		{
419 419
 			if($child instanceof DOMElement)
@@ -430,13 +430,13 @@  discard block
 block discarded – undo
430 430
 	 */
431 431
 	public function saveToFile($file)
432 432
 	{
433
-		if(($fw=fopen($file,'w'))!==false)
433
+		if(($fw=fopen($file, 'w'))!==false)
434 434
 		{
435
-			fwrite($fw,$this->saveToString());
435
+			fwrite($fw, $this->saveToString());
436 436
 			fclose($fw);
437 437
 		}
438 438
 		else
439
-			throw new TIOException('xmldocument_file_write_failed',$file);
439
+			throw new TIOException('xmldocument_file_write_failed', $file);
440 440
 	}
441 441
 
442 442
 	/**
@@ -445,8 +445,8 @@  discard block
 block discarded – undo
445 445
 	 */
446 446
 	public function saveToString()
447 447
 	{
448
-		$version=empty($this->_version)?' version="1.0"':' version="'.$this->_version.'"';
449
-		$encoding=empty($this->_encoding)?'':' encoding="'.$this->_encoding.'"';
448
+		$version=empty($this->_version) ? ' version="1.0"' : ' version="'.$this->_version.'"';
449
+		$encoding=empty($this->_encoding) ? '' : ' encoding="'.$this->_encoding.'"';
450 450
 		return "<?xml{$version}{$encoding}?>\n".$this->toString(0);
451 451
 	}
452 452
 
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 		$element=new TXmlElement($node->tagName);
481 481
 		$element->setValue($node->nodeValue);
482 482
 		foreach($node->attributes as $name=>$attr)
483
-			$element->getAttributes()->add(($attr->prefix === '' ? '' : $attr->prefix . ':') . $name,$attr->value);
483
+			$element->getAttributes()->add(($attr->prefix==='' ? '' : $attr->prefix.':').$name, $attr->value);
484 484
 
485 485
 		foreach($node->childNodes as $child)
486 486
 		{
@@ -534,11 +534,11 @@  discard block
 block discarded – undo
534 534
 	 * @param mixed new item
535 535
 	 * @throws TInvalidDataTypeException if the item to be inserted is not a TXmlElement object.
536 536
 	 */
537
-	public function insertAt($index,$item)
537
+	public function insertAt($index, $item)
538 538
 	{
539 539
 		if($item instanceof TXmlElement)
540 540
 		{
541
-			parent::insertAt($index,$item);
541
+			parent::insertAt($index, $item);
542 542
 			if($item->getParent()!==null)
543 543
 				$item->getParent()->getElements()->remove($item);
544 544
 			$item->setParent($this->_o);
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -211,13 +211,11 @@  discard block
 block discarded – undo
211 211
 				$str.=$element->toString($indent+1)."\n";
212 212
 			$str.=$prefix."</{$this->_tagName}>";
213 213
 			return $str;
214
-		}
215
-		else if(($value=$this->getValue())!=='')
214
+		} else if(($value=$this->getValue())!=='')
216 215
 		{
217 216
 			$value=$this->xmlEncode($value);
218 217
 			return $prefix."<{$this->_tagName}$attr>$value</{$this->_tagName}>";
219
-		}
220
-		else
218
+		} else
221 219
 			return $prefix."<{$this->_tagName}$attr />";
222 220
 	}
223 221
 
@@ -434,8 +432,7 @@  discard block
 block discarded – undo
434 432
 		{
435 433
 			fwrite($fw,$this->saveToString());
436 434
 			fclose($fw);
437
-		}
438
-		else
435
+		} else
439 436
 			throw new TIOException('xmldocument_file_write_failed',$file);
440 437
 	}
441 438
 
@@ -542,8 +539,7 @@  discard block
 block discarded – undo
542 539
 			if($item->getParent()!==null)
543 540
 				$item->getParent()->getElements()->remove($item);
544 541
 			$item->setParent($this->_o);
545
-		}
546
-		else
542
+		} else
547 543
 			throw new TInvalidDataTypeException('xmlelementlist_xmlelement_required');
548 544
 	}
549 545
 
Please login to merge, or discard this patch.