Passed
Push — master ( 47de24...d4bd11 )
by Jean-Christophe
03:33
created
Ajax/semantic/html/content/table/HtmlTableContent.php 1 patch
Spacing   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -16,13 +16,13 @@  discard block
 block discarded – undo
16 16
 class HtmlTableContent extends HtmlSemCollection {
17 17
 	protected $_focusable=false;
18 18
 
19
-	protected $_tdTagNames = [
19
+	protected $_tdTagNames=[
20 20
 		"thead" => "th",
21 21
 		"tbody" => "td",
22 22
 		"tfoot" => "th"
23 23
 	];
24 24
 
25
-	protected $_merged = false;
25
+	protected $_merged=false;
26 26
 
27 27
 	/**
28 28
 	 *
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 * @param int $rowCount
32 32
 	 * @param int $colCount
33 33
 	 */
34
-	public function __construct($identifier, $tagName = "tbody", $rowCount = NULL, $colCount = NULL) {
34
+	public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) {
35 35
 		parent::__construct($identifier, $tagName, "");
36 36
 		if (isset($rowCount) && isset($colCount))
37 37
 			$this->setRowCount($rowCount, $colCount);
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 	 * @return HtmlTableContent
45 45
 	 */
46 46
 	public function setRowCount($rowCount, $colCount) {
47
-		$count = $this->count();
48
-		for ($i = $count; $i < $rowCount; $i ++) {
47
+		$count=$this->count();
48
+		for ($i=$count; $i<$rowCount; $i++) {
49 49
 			$this->addItem($colCount);
50 50
 		}
51 51
 		return $this;
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	public function refreshTR() {
59
-		$this->_template = "%wrapContentBefore%%content%%wrapContentAfter%";
59
+		$this->_template="%wrapContentBefore%%content%%wrapContentAfter%";
60 60
 	}
61 61
 
62 62
 	/**
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
 	 * @return HtmlTR
68 68
 	 */
69 69
 	protected function createItem($value) {
70
-		$count = $this->count();
71
-		$tr = new HtmlTR("");
70
+		$count=$this->count();
71
+		$tr=new HtmlTR("");
72 72
 		$tr->setContainer($this, $count);
73
-		if($this->_focusable) {
73
+		if ($this->_focusable) {
74 74
 			$tr->setProperty('tabindex', $count);
75 75
 		}
76 76
 		$tr->setTdTagName($this->_tdTagNames[$this->tagName]);
77
-		if (isset($value) === true) {
77
+		if (isset($value)===true) {
78 78
 			$tr->setColCount($value);
79 79
 		}
80 80
 		return $tr;
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 		return $this->addItem($row);
103 103
 	}
104 104
 
105
-	public function addMergeRow($colCount, $value = null) {
106
-		$row = $this->addRow($colCount);
105
+	public function addMergeRow($colCount, $value=null) {
106
+		$row=$this->addRow($colCount);
107 107
 		$row->mergeCol();
108 108
 		if (isset($value)) {
109 109
 			$row->setValues([
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
 	 * @return HtmlTD|HtmlDoubleElement
130 130
 	 */
131 131
 	public function getCell($row, $col) {
132
-		$row = $this->getItem($row);
132
+		$row=$this->getItem($row);
133 133
 		if (isset($row) && $row instanceof HtmlCollection) {
134
-			$col = $row->getItem($col);
134
+			$col=$row->getItem($col);
135 135
 		} else {
136
-			$col = $row;
136
+			$col=$row;
137 137
 		}
138 138
 		return $col;
139 139
 	}
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
 	 * @param mixed $value
155 155
 	 * @return HtmlTableContent
156 156
 	 */
157
-	public function setCellValue($row, $col, $value = "") {
158
-		$cell = $this->getCell($row, $col);
159
-		if (isset($cell) === true) {
157
+	public function setCellValue($row, $col, $value="") {
158
+		$cell=$this->getCell($row, $col);
159
+		if (isset($cell)===true) {
160 160
 			$cell->setValue($value);
161 161
 		}
162 162
 		return $this;
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 	 *
168 168
 	 * @param mixed $values
169 169
 	 */
170
-	public function setValues($values = array()) {
171
-		return $this->_addOrSetValues($values, function (HtmlTR $row, $_values) {
170
+	public function setValues($values=array()) {
171
+		return $this->_addOrSetValues($values, function(HtmlTR $row, $_values) {
172 172
 			$row->setValues($_values);
173 173
 		});
174 174
 	}
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
 	 *
179 179
 	 * @param mixed $values
180 180
 	 */
181
-	public function addValues($values = array()) {
182
-		return $this->_addOrSetValues($values, function (HtmlTR $row, $_values) {
181
+	public function addValues($values=array()) {
182
+		return $this->_addOrSetValues($values, function(HtmlTR $row, $_values) {
183 183
 			$row->addValues($_values);
184 184
 		});
185 185
 	}
@@ -191,42 +191,42 @@  discard block
 block discarded – undo
191 191
 	 * @param callable $callback
192 192
 	 */
193 193
 	protected function _addOrSetValues($values, $callback) {
194
-		$count = $this->count();
195
-		$isArray = true;
196
-		if (! \is_array($values)) {
197
-			$values = \array_fill(0, $count, $values);
198
-			$isArray = false;
194
+		$count=$this->count();
195
+		$isArray=true;
196
+		if (!\is_array($values)) {
197
+			$values=\array_fill(0, $count, $values);
198
+			$isArray=false;
199 199
 		}
200
-		if (JArray::dimension($values) == 1 && $isArray)
201
-			$values = [
200
+		if (JArray::dimension($values)==1 && $isArray)
201
+			$values=[
202 202
 				$values
203 203
 			];
204 204
 
205
-		$count = \min(\sizeof($values), $count);
205
+		$count=\min(\sizeof($values), $count);
206 206
 
207
-		for ($i = 0; $i < $count; $i ++) {
208
-			$row = $this->content[$i];
207
+		for ($i=0; $i<$count; $i++) {
208
+			$row=$this->content[$i];
209 209
 			$callback($row, $values[$i]);
210 210
 		}
211 211
 		return $this;
212 212
 	}
213 213
 
214
-	public function setColValues($colIndex, $values = array()) {
215
-		$count = $this->count();
216
-		if (! \is_array($values)) {
217
-			$values = \array_fill(0, $count, $values);
214
+	public function setColValues($colIndex, $values=array()) {
215
+		$count=$this->count();
216
+		if (!\is_array($values)) {
217
+			$values=\array_fill(0, $count, $values);
218 218
 		}
219
-		$count = \min(\sizeof($values), $count);
220
-		for ($i = 0; $i < $count; $i ++) {
219
+		$count=\min(\sizeof($values), $count);
220
+		for ($i=0; $i<$count; $i++) {
221 221
 			$this->getCell($i, $colIndex)->setValue($values[$i]);
222 222
 		}
223 223
 		return $this;
224 224
 	}
225 225
 
226
-	public function addColVariations($colIndex, $variations = array()) {
227
-		$count = $this->count();
228
-		for ($i = 0; $i < $count; $i ++) {
229
-			$cell = $this->getCell($i, $colIndex);
226
+	public function addColVariations($colIndex, $variations=array()) {
227
+		$count=$this->count();
228
+		for ($i=0; $i<$count; $i++) {
229
+			$cell=$this->getCell($i, $colIndex);
230 230
 			if ($cell instanceof BaseTrait)
231 231
 				$cell->addVariations($variations);
232 232
 		}
@@ -234,41 +234,41 @@  discard block
 block discarded – undo
234 234
 	}
235 235
 
236 236
 	public function addPropertyCol($colIndex, $name, $value) {
237
-		$count = $this->count();
238
-		for ($i = 0; $i < $count; $i ++) {
239
-			$cell = $this->getCell($i, $colIndex);
237
+		$count=$this->count();
238
+		for ($i=0; $i<$count; $i++) {
239
+			$cell=$this->getCell($i, $colIndex);
240 240
 			if (isset($cell))
241 241
 				$cell->addToProperty($name, $value);
242 242
 		}
243 243
 		return $this;
244 244
 	}
245 245
 
246
-	public function setRowValues($rowIndex, $values = array()) {
247
-		$count = $this->count();
248
-		if (! \is_array($values)) {
249
-			$values = \array_fill(0, $count, $values);
246
+	public function setRowValues($rowIndex, $values=array()) {
247
+		$count=$this->count();
248
+		if (!\is_array($values)) {
249
+			$values=\array_fill(0, $count, $values);
250 250
 		}
251 251
 		$this->getItem($rowIndex)->setValues($values);
252 252
 		return $this;
253 253
 	}
254 254
 
255 255
 	private function colAlign($colIndex, $function) {
256
-		$count = $this->count();
257
-		for ($i = 0; $i < $count; $i ++) {
258
-			$index = $this->content[$i]->getColPosition($colIndex);
259
-			if ($index !== NULL)
256
+		$count=$this->count();
257
+		for ($i=0; $i<$count; $i++) {
258
+			$index=$this->content[$i]->getColPosition($colIndex);
259
+			if ($index!==NULL)
260 260
 				$this->getCell($i, $index)->$function();
261 261
 		}
262 262
 		return $this;
263 263
 	}
264 264
 
265 265
 	private function colAlignFromRight($colIndex, $function) {
266
-		$count = $this->count();
267
-		for ($i = 0; $i < $count; $i ++) {
268
-			$maxRow = $this->content[$i]->count();
269
-			$index = $maxRow - $colIndex - 1;
270
-			if (($cell = $this->getCell($i, $index)) !== NULL) {
271
-				if ($cell->getColspan() == 1)
266
+		$count=$this->count();
267
+		for ($i=0; $i<$count; $i++) {
268
+			$maxRow=$this->content[$i]->count();
269
+			$index=$maxRow-$colIndex-1;
270
+			if (($cell=$this->getCell($i, $index))!==NULL) {
271
+				if ($cell->getColspan()==1)
272 272
 					$cell->$function();
273 273
 			}
274 274
 		}
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
 	 * @return int
315 315
 	 */
316 316
 	public function getColCount() {
317
-		$result = 0;
318
-		if ($this->count() > 0)
319
-			$result = $this->getItem(0)->count();
317
+		$result=0;
318
+		if ($this->count()>0)
319
+			$result=$this->getItem(0)->count();
320 320
 		return $result;
321 321
 	}
322 322
 
@@ -327,10 +327,10 @@  discard block
 block discarded – undo
327 327
 	 * @param int $colIndex
328 328
 	 * @return HtmlTableContent
329 329
 	 */
330
-	public function delete($rowIndex, $colIndex = NULL) {
330
+	public function delete($rowIndex, $colIndex=NULL) {
331 331
 		if (isset($colIndex)) {
332
-			$row = $this->getItem($rowIndex);
333
-			if (isset($row) === true) {
332
+			$row=$this->getItem($rowIndex);
333
+			if (isset($row)===true) {
334 334
 				$row->delete($colIndex);
335 335
 			}
336 336
 		} else {
@@ -340,24 +340,24 @@  discard block
 block discarded – undo
340 340
 	}
341 341
 
342 342
 	public function toDelete($rowIndex, $colIndex) {
343
-		$row = $this->getItem($rowIndex);
344
-		if (isset($row) === true)
343
+		$row=$this->getItem($rowIndex);
344
+		if (isset($row)===true)
345 345
 			$row->toDelete($colIndex);
346 346
 		return $this;
347 347
 	}
348 348
 
349 349
 	public function toRowspanned($rowIndex, $colIndex) {
350
-		$row = $this->getItem($rowIndex);
351
-		if (isset($row) === true)
350
+		$row=$this->getItem($rowIndex);
351
+		if (isset($row)===true)
352 352
 			$row->toRowspanned($colIndex);
353 353
 		return $this;
354 354
 	}
355 355
 
356
-	public function mergeCol($rowIndex = 0, $colIndex = 0) {
356
+	public function mergeCol($rowIndex=0, $colIndex=0) {
357 357
 		return $this->getItem($rowIndex)->mergeCol($colIndex);
358 358
 	}
359 359
 
360
-	public function mergeRow($rowIndex = 0, $colIndex = 0) {
360
+	public function mergeRow($rowIndex=0, $colIndex=0) {
361 361
 		return $this->getItem($rowIndex)->mergeRow($colIndex);
362 362
 	}
363 363
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 	 * @return HtmlTableContent
378 378
 	 */
379 379
 	public function conditionalCellFormat($callback, $format) {
380
-		$rows = $this->content;
380
+		$rows=$this->content;
381 381
 		foreach ($rows as $row) {
382 382
 			$row->conditionalCellFormat($callback, $format);
383 383
 		}
@@ -385,9 +385,9 @@  discard block
 block discarded – undo
385 385
 	}
386 386
 
387 387
 	public function conditionalColFormat($colIndex, $callback, $format) {
388
-		$rows = $this->content;
388
+		$rows=$this->content;
389 389
 		foreach ($rows as $row) {
390
-			$cell = $row->getItem($colIndex);
390
+			$cell=$row->getItem($colIndex);
391 391
 			$cell->conditionnalCellFormat($callback, $format);
392 392
 		}
393 393
 		return $this;
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 	 * @return HtmlTableContent
401 401
 	 */
402 402
 	public function conditionalRowFormat($callback, $format) {
403
-		$rows = $this->content;
403
+		$rows=$this->content;
404 404
 		foreach ($rows as $row) {
405 405
 			$row->conditionalRowFormat($callback, $format);
406 406
 		}
@@ -408,9 +408,9 @@  discard block
 block discarded – undo
408 408
 	}
409 409
 
410 410
 	public function hideColumn($colIndex) {
411
-		$rows = $this->content;
411
+		$rows=$this->content;
412 412
 		foreach ($rows as $row) {
413
-			$cell = $row->getItem($colIndex);
413
+			$cell=$row->getItem($colIndex);
414 414
 			$cell->addToProperty("style", "display:none;");
415 415
 		}
416 416
 		return $this;
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 	 * @return HtmlTableContent
423 423
 	 */
424 424
 	public function applyCells($callback) {
425
-		$rows = $this->content;
425
+		$rows=$this->content;
426 426
 		foreach ($rows as $row) {
427 427
 			$row->applyCells($callback);
428 428
 		}
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 	 * @return HtmlTableContent
436 436
 	 */
437 437
 	public function applyRows($callback) {
438
-		$rows = $this->content;
438
+		$rows=$this->content;
439 439
 		foreach ($rows as $row) {
440 440
 			$row->apply($callback);
441 441
 		}
@@ -450,28 +450,28 @@  discard block
 block discarded – undo
450 450
 	 * @see https://fomantic-ui.com/collections/table.html#definition needs rowspanned class
451 451
 	 * @since fomantic-ui 2.4.8
452 452
 	 */
453
-	public function mergeIdentiqualValues($colIndex, $function = "strip_tags") {
454
-		$rows = $this->content;
455
-		$identiqual = null;
456
-		$counter = 0;
457
-		$cellToMerge = null;
458
-		$functionExists = \function_exists($function);
453
+	public function mergeIdentiqualValues($colIndex, $function="strip_tags") {
454
+		$rows=$this->content;
455
+		$identiqual=null;
456
+		$counter=0;
457
+		$cellToMerge=null;
458
+		$functionExists=\function_exists($function);
459 459
 		foreach ($rows as $row) {
460
-			$cell = $row->getItem($colIndex);
461
-			$value = $cell->getContent();
460
+			$cell=$row->getItem($colIndex);
461
+			$value=$cell->getContent();
462 462
 			if ($functionExists)
463
-				$value = \call_user_func($function, $value);
464
-			if ($value !== $identiqual) {
465
-				if ($counter > 0 && isset($cellToMerge)) {
463
+				$value=\call_user_func($function, $value);
464
+			if ($value!==$identiqual) {
465
+				if ($counter>0 && isset($cellToMerge)) {
466 466
 					$cellToMerge->setRowspanned($counter);
467 467
 				}
468
-				$counter = 0;
469
-				$cellToMerge = $cell;
470
-				$identiqual = $value;
468
+				$counter=0;
469
+				$cellToMerge=$cell;
470
+				$identiqual=$value;
471 471
 			}
472
-			$counter ++;
472
+			$counter++;
473 473
 		}
474
-		if ($counter > 0 && isset($cellToMerge)) {
474
+		if ($counter>0 && isset($cellToMerge)) {
475 475
 			$cellToMerge->setRowspanned($counter);
476 476
 		}
477 477
 		return $this;
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 	}
483 483
 
484 484
 	public function _setMerged($value) {
485
-		$this->_merged = $value;
485
+		$this->_merged=$value;
486 486
 		return $this;
487 487
 	}
488 488
 
@@ -490,6 +490,6 @@  discard block
 block discarded – undo
490 490
 	 * @param bool $focusable
491 491
 	 */
492 492
 	public function setFocusable(bool $focusable): void {
493
-		$this->_focusable = $focusable;
493
+		$this->_focusable=$focusable;
494 494
 	}
495 495
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/table/traits/TableTrait.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
10 10
  */
11 11
 trait TableTrait {
12 12
 
13
-	abstract public function addEvent($event, $jsCode, $stopPropagation = false, $preventDefault = false);
13
+	abstract public function addEvent($event, $jsCode, $stopPropagation=false, $preventDefault=false);
14 14
 
15
-	abstract public function getOn($event, $url, $responseElement = "", $parameters = array());
15
+	abstract public function getOn($event, $url, $responseElement="", $parameters=array());
16 16
 
17 17
 	protected function addToPropertyTable($property, $value) {
18 18
 		return $this->_self->addToProperty($property, $value);
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 		return $this->addToPropertyTable("class", "celled");
23 23
 	}
24 24
 
25
-	public function setBasic($very = false) {
26
-		$table = $this->_self;
25
+	public function setBasic($very=false) {
26
+		$table=$this->_self;
27 27
 		if ($very)
28 28
 			$table->addToPropertyCtrl("class", "very", array(
29 29
 				"very"
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 		));
34 34
 	}
35 35
 
36
-	public function setCompact($very = false) {
37
-		$table = $this->_self;
36
+	public function setCompact($very=false) {
37
+		$table=$this->_self;
38 38
 		if ($very)
39 39
 			$table->addToPropertyCtrl("class", "very", array(
40 40
 				"very"
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 		return $this->addToPropertyTable("class", "structured");
57 57
 	}
58 58
 
59
-	public function setSortable($colIndex = NULL) {
60
-		$table = $this->_self;
59
+	public function setSortable($colIndex=NULL) {
60
+		$table=$this->_self;
61 61
 		if (isset($colIndex) && $table->hasPart("thead")) {
62 62
 			$table->getHeader()->sort($colIndex);
63 63
 		}
@@ -80,29 +80,29 @@  discard block
 block discarded – undo
80 80
 		return $this->addToPropertyTable("class", "striped");
81 81
 	}
82 82
 
83
-	public function onRowClick($jsCode, $stopPropagation = false, $preventDefault = false) {
83
+	public function onRowClick($jsCode, $stopPropagation=false, $preventDefault=false) {
84 84
 		return $this->onRow("click", $jsCode, $stopPropagation, $preventDefault);
85 85
 	}
86 86
 
87
-	public function onRow($event, $jsCode, $stopPropagation = false, $preventDefault = false) {
88
-		return $this->_self->addEvent($event . "{{tbody tr}}", $jsCode, $stopPropagation, $preventDefault);
87
+	public function onRow($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
88
+		return $this->_self->addEvent($event."{{tbody tr}}", $jsCode, $stopPropagation, $preventDefault);
89 89
 	}
90 90
 
91
-	public function getOnRow($event, $url, $responseElement = "", $parameters = array()) {
92
-		$jsCondition = '!$(this).closest("tr").is(":focus")';
91
+	public function getOnRow($event, $url, $responseElement="", $parameters=array()) {
92
+		$jsCondition='!$(this).closest("tr").is(":focus")';
93 93
 		if (isset($parameters['jsCondition'])) {
94
-			$jsCondition = '(' . $parameters['jsCondition'] . ' && ' . $jsCondition . ')';
94
+			$jsCondition='('.$parameters['jsCondition'].' && '.$jsCondition.')';
95 95
 		}
96
-		$parameters = \array_merge($parameters, [
96
+		$parameters=\array_merge($parameters, [
97 97
 			"stopPropagation" => false,
98 98
 			"preventDefault" => false,
99 99
 			"jsCondition" => $jsCondition
100 100
 		]);
101
-		$selector = "tbody tr";
101
+		$selector="tbody tr";
102 102
 		if (isset($parameters["selector"])) {
103
-			$selector = $parameters["selector"];
103
+			$selector=$parameters["selector"];
104 104
 		}
105
-		return $this->_self->getOn($event . "{{" . $selector . "}}", $url, $responseElement, $parameters);
105
+		return $this->_self->getOn($event."{{".$selector."}}", $url, $responseElement, $parameters);
106 106
 	}
107 107
 
108 108
 	public function onPageChange($jsCode) {
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
 		return $this->_self->getBsComponent()->getScript();
120 120
 	}
121 121
 
122
-	public function addEventsOnRun(JsUtils $js = NULL) {
123
-		$script = parent::addEventsOnRun($js);
124
-		$innerScript = $this->_self->getInnerScript();
125
-		if (! isset($innerScript)) {
122
+	public function addEventsOnRun(JsUtils $js=NULL) {
123
+		$script=parent::addEventsOnRun($js);
124
+		$innerScript=$this->_self->getInnerScript();
125
+		if (!isset($innerScript)) {
126 126
 			$this->_self->setInnerScript($script);
127 127
 		}
128 128
 		return $script;
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/table/HtmlTable.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
 
41 41
 	public function __construct($identifier, $rowCount, $colCount) {
42 42
 		parent::__construct($identifier, "table", "ui table");
43
-		$this->content=array ();
43
+		$this->content=array();
44 44
 		$this->setRowCount($rowCount, $colCount);
45
-		$this->_variations=[ Variation::CELLED,Variation::PADDED,Variation::COMPACT ];
46
-		$this->_compileParts=["thead","tbody","tfoot"];
45
+		$this->_variations=[Variation::CELLED, Variation::PADDED, Variation::COMPACT];
46
+		$this->_compileParts=["thead", "tbody", "tfoot"];
47 47
 		$this->_afterCompileEvents=[];
48 48
 	}
49 49
 
@@ -53,17 +53,17 @@  discard block
 block discarded – undo
53 53
 	 * @return HtmlTableContent
54 54
 	 */
55 55
 	public function getPart($key) {
56
-		if (\array_key_exists($key, $this->content) === false) {
56
+		if (\array_key_exists($key, $this->content)===false) {
57 57
 			$this->content[$key]=new HtmlTableContent("", $key);
58
-			if ($key !== "tbody") {
58
+			if ($key!=="tbody") {
59 59
 				$this->content[$key]->setRowCount(1, $this->_colCount);
60 60
 			}
61 61
 		}
62 62
 		return $this->content[$key];
63 63
 	}
64 64
 
65
-	protected function _getFirstPart(){
66
-		if(isset($this->content["thead"])){
65
+	protected function _getFirstPart() {
66
+		if (isset($this->content["thead"])) {
67 67
 			return $this->content["thead"];
68 68
 		}
69 69
 		return $this->content["tbody"];
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 * @return boolean
109 109
 	 */
110 110
 	public function hasPart($key) {
111
-		return \array_key_exists($key, $this->content) === true;
111
+		return \array_key_exists($key, $this->content)===true;
112 112
 	}
113 113
 
114 114
 	/**
@@ -268,8 +268,8 @@  discard block
 block discarded – undo
268 268
 		return $this->colAlign($colIndex, "colLeftFromRight");
269 269
 	}
270 270
 
271
-	public function setColAlignment($colIndex,$alignment){
272
-		switch ($alignment){
271
+	public function setColAlignment($colIndex, $alignment) {
272
+		switch ($alignment) {
273 273
 			case TextAlignment::LEFT:
274 274
 				$function="colLeft";
275 275
 				break;
@@ -289,8 +289,8 @@  discard block
 block discarded – undo
289 289
 		return $this;
290 290
 	}
291 291
 	
292
-	public function setColAlignmentFromRight($colIndex,$alignment){
293
-		switch ($alignment){
292
+	public function setColAlignmentFromRight($colIndex, $alignment) {
293
+		switch ($alignment) {
294 294
 			case TextAlignment::LEFT:
295 295
 				$function="colLeftFromRight";
296 296
 				break;
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 
313 313
 	private function colAlign($colIndex, $function) {
314 314
 		if (\is_array($colIndex)) {
315
-			foreach ( $colIndex as $cIndex ) {
315
+			foreach ($colIndex as $cIndex) {
316 316
 				$this->colAlign($cIndex, $function);
317 317
 			}
318 318
 		} else {
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 	 * @see HtmlSemDoubleElement::compile()
374 374
 	 */
375 375
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
376
-		if(\sizeof($this->_compileParts)<3){
376
+		if (\sizeof($this->_compileParts)<3) {
377 377
 			$this->_template="%content%";
378 378
 			$this->refresh($js);
379 379
 		}
@@ -382,9 +382,9 @@  discard block
 block discarded – undo
382 382
 	}
383 383
 
384 384
 	protected function compile_once(JsUtils $js=NULL, &$view=NULL) {
385
-		parent::compile_once($js,$view);
385
+		parent::compile_once($js, $view);
386 386
 		if ($this->propertyContains("class", "sortable")) {
387
-			$this->addEvent("execute", "$('#" . $this->identifier . "').tablesort().data('tablesort').sort($('th.default-sort'));");
387
+			$this->addEvent("execute", "$('#".$this->identifier."').tablesort().data('tablesort').sort($('th.default-sort'));");
388 388
 		}
389 389
 	}
390 390
 
@@ -397,13 +397,13 @@  discard block
 block discarded – undo
397 397
 	public function fromDatabaseObject($object, $function) {
398 398
 		$result=$function($object);
399 399
 		if (\is_array($result)) {
400
-			$result= $this->addRow($function($object));
400
+			$result=$this->addRow($function($object));
401 401
 		} else {
402
-			$result= $this->getBody()->_addRow($result);
402
+			$result=$this->getBody()->_addRow($result);
403 403
 		}
404
-		if(isset($this->_afterCompileEvents["onNewRow"])){
405
-			if(\is_callable($this->_afterCompileEvents["onNewRow"]))
406
-				$this->_afterCompileEvents["onNewRow"]($result,$object);
404
+		if (isset($this->_afterCompileEvents["onNewRow"])) {
405
+			if (\is_callable($this->_afterCompileEvents["onNewRow"]))
406
+				$this->_afterCompileEvents["onNewRow"]($result, $object);
407 407
 		}
408 408
 		return $result;
409 409
 	}
@@ -418,26 +418,26 @@  discard block
 block discarded – undo
418 418
 		return $this;
419 419
 	}
420 420
 	
421
-	public function refreshTR(){
421
+	public function refreshTR() {
422 422
 		$this->setCompileParts();
423 423
 		$this->getPart("tbody")->refreshTR();
424 424
 	}
425 425
 
426
-	public function refresh($js){
426
+	public function refresh($js) {
427 427
 		$this->_footer=$this->getFooter();
428
-		if(isset($js)){
429
-			$js->exec('$("#'.$this->identifier.' tfoot").replaceWith("'.\addslashes($this->_footer).'");',true);
428
+		if (isset($js)) {
429
+			$js->exec('$("#'.$this->identifier.' tfoot").replaceWith("'.\addslashes($this->_footer).'");', true);
430 430
 		}
431 431
 	}
432 432
 
433
-	public function run(JsUtils $js){
434
-		if(!$this->_runned){
435
-			if(isset($this->_activeRowSelector)){
433
+	public function run(JsUtils $js) {
434
+		if (!$this->_runned) {
435
+			if (isset($this->_activeRowSelector)) {
436 436
 				$this->_activeRowSelector->run();
437 437
 			}
438 438
 		}
439
-		$result= parent::run($js);
440
-		if(isset($this->_footer))
439
+		$result=parent::run($js);
440
+		if (isset($this->_footer))
441 441
 			$this->_footer->run($js);
442 442
 		$this->_runned=true;
443 443
 		return $result;
@@ -461,51 +461,51 @@  discard block
 block discarded – undo
461 461
 	 * @param boolean $multiple
462 462
 	 * @return HtmlTable
463 463
 	 */
464
-	public function setActiveRowSelector($class="active",$event="click",$multiple=false){
465
-		$this->_activeRowSelector=new ActiveRow($this,$class,$event,$multiple);
464
+	public function setActiveRowSelector($class="active", $event="click", $multiple=false) {
465
+		$this->_activeRowSelector=new ActiveRow($this, $class, $event, $multiple);
466 466
 		return $this;
467 467
 	}
468 468
 	
469
-	public function hasActiveRowSelector(){
469
+	public function hasActiveRowSelector() {
470 470
 		return isset($this->_activeRowSelector);
471 471
 	}
472 472
 
473
-	public function hideColumn($colIndex){
474
-		if(isset($this->content["thead"])){
473
+	public function hideColumn($colIndex) {
474
+		if (isset($this->content["thead"])) {
475 475
 			$this->content["thead"]->hideColumn($colIndex);
476 476
 		}
477 477
 		$this->content["tbody"]->hideColumn($colIndex);
478
-		if(isset($this->content["tfoot"])){
478
+		if (isset($this->content["tfoot"])) {
479 479
 			$this->content["tfoot"]->hideColumn($colIndex);
480 480
 		}
481 481
 		return $this;
482 482
 	}
483 483
 
484
-	public function setColWidth($colIndex,$width){
484
+	public function setColWidth($colIndex, $width) {
485 485
 		$part=$this->_getFirstPart();
486
-		if($part!==null && $part->count()>0)
486
+		if ($part!==null && $part->count()>0)
487 487
 			$part->getCell(0, $colIndex)->setWidth($width);
488 488
 		return $this;
489 489
 	}
490 490
 
491
-	public function setColWidths($widths){
491
+	public function setColWidths($widths) {
492 492
 		$part=$this->_getFirstPart();
493
-		if($part!==null && $part->count()>0){
493
+		if ($part!==null && $part->count()>0) {
494 494
 			$count=$part->getColCount();
495
-			if(!\is_array($widths)){
495
+			if (!\is_array($widths)) {
496 496
 				$widths=\array_fill(0, $count, $widths);
497 497
 			}
498
-			$max=\min(\sizeof($widths),$count);
499
-			for($i=0;$i<$max;$i++){
498
+			$max=\min(\sizeof($widths), $count);
499
+			for ($i=0; $i<$max; $i++) {
500 500
 				$part->getCell(0, $i)->setWidth($widths[$i]);
501 501
 			}
502 502
 		}
503 503
 		return $this;
504 504
 	}
505 505
 
506
-	public function mergeIdentiqualValues($colIndex,$function="strip_tags"){
506
+	public function mergeIdentiqualValues($colIndex, $function="strip_tags") {
507 507
 		$body=$this->getBody();
508
-		$body->mergeIdentiqualValues($colIndex,$function);
508
+		$body->mergeIdentiqualValues($colIndex, $function);
509 509
 		return $this;
510 510
 	}
511 511
 	/**
@@ -519,16 +519,16 @@  discard block
 block discarded – undo
519 519
 	 * @param mixed $_innerScript
520 520
 	 */
521 521
 	public function setInnerScript($_innerScript) {
522
-		$this->_innerScript = $_innerScript;
522
+		$this->_innerScript=$_innerScript;
523 523
 	}
524 524
 	
525
-	public function onActiveRowChange($jsCode){
526
-		$this->on("activeRowChange",$jsCode);
525
+	public function onActiveRowChange($jsCode) {
526
+		$this->on("activeRowChange", $jsCode);
527 527
 		return $this;
528 528
 	}
529 529
 	
530
-	public function addMergeRow($colCount,$value=null){
531
-		return $this->getBody()->addMergeRow($colCount,$value);
530
+	public function addMergeRow($colCount, $value=null) {
531
+		return $this->getBody()->addMergeRow($colCount, $value);
532 532
 	}
533 533
 
534 534
 	/**
Please login to merge, or discard this patch.