Completed
Push — master ( 7ed867...85d12a )
by Jean-Christophe
02:44
created
Ajax/semantic/html/collections/table/HtmlTable.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
 
29 29
 	public function __construct($identifier, $rowCount, $colCount) {
30 30
 		parent::__construct($identifier, "table", "ui table");
31
-		$this->content=array ();
31
+		$this->content=array();
32 32
 		$this->setRowCount($rowCount, $colCount);
33
-		$this->_variations=[ Variation::CELLED,Variation::PADDED,Variation::COMPACT ];
34
-		$this->_compileParts=["thead","tbody","tfoot"];
33
+		$this->_variations=[Variation::CELLED, Variation::PADDED, Variation::COMPACT];
34
+		$this->_compileParts=["thead", "tbody", "tfoot"];
35 35
 		$this->_afterCompileEvents=[];
36 36
 	}
37 37
 
@@ -41,17 +41,17 @@  discard block
 block discarded – undo
41 41
 	 * @return HtmlTableContent
42 42
 	 */
43 43
 	public function getPart($key) {
44
-		if (\array_key_exists($key, $this->content) === false) {
44
+		if (\array_key_exists($key, $this->content)===false) {
45 45
 			$this->content[$key]=new HtmlTableContent("", $key);
46
-			if ($key !== "tbody") {
46
+			if ($key!=="tbody") {
47 47
 				$this->content[$key]->setRowCount(1, $this->_colCount);
48 48
 			}
49 49
 		}
50 50
 		return $this->content[$key];
51 51
 	}
52 52
 
53
-	protected function _getFirstPart(){
54
-		if(isset($this->content["thead"])){
53
+	protected function _getFirstPart() {
54
+		if (isset($this->content["thead"])) {
55 55
 			return $this->content["thead"];
56 56
 		}
57 57
 		return $this->content["tbody"];
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 * @return boolean
97 97
 	 */
98 98
 	public function hasPart($key) {
99
-		return \array_key_exists($key, $this->content) === true;
99
+		return \array_key_exists($key, $this->content)===true;
100 100
 	}
101 101
 
102 102
 	/**
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
 		return $this->colAlign($colIndex, "colLeft");
230 230
 	}
231 231
 
232
-	public function setColAlignment($colIndex,$alignment){
233
-		switch ($alignment){
232
+	public function setColAlignment($colIndex, $alignment) {
233
+		switch ($alignment) {
234 234
 			case TextAlignment::LEFT:
235 235
 				$function="colLeft";
236 236
 				break;
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 
249 249
 	private function colAlign($colIndex, $function) {
250 250
 		if (\is_array($colIndex)) {
251
-			foreach ( $colIndex as $cIndex ) {
251
+			foreach ($colIndex as $cIndex) {
252 252
 				$this->colAlign($cIndex, $function);
253 253
 			}
254 254
 		} else {
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 	 * @see HtmlSemDoubleElement::compile()
310 310
 	 */
311 311
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
312
-		if(\sizeof($this->_compileParts)<3){
312
+		if (\sizeof($this->_compileParts)<3) {
313 313
 			$this->_template="%content%";
314 314
 			$this->refresh();
315 315
 		}
@@ -318,11 +318,11 @@  discard block
 block discarded – undo
318 318
 	}
319 319
 
320 320
 	protected function compile_once(JsUtils $js=NULL, &$view=NULL) {
321
-		parent::compile_once($js,$view);
321
+		parent::compile_once($js, $view);
322 322
 		if ($this->propertyContains("class", "sortable")) {
323
-			$this->addEvent("execute", "$('#" . $this->identifier . "').tablesort().data('tablesort').sort($('th.default-sort'));");
323
+			$this->addEvent("execute", "$('#".$this->identifier."').tablesort().data('tablesort').sort($('th.default-sort'));");
324 324
 		}
325
-		if(isset($this->_activeRowSelector)){
325
+		if (isset($this->_activeRowSelector)) {
326 326
 			$this->_activeRowSelector->compile();
327 327
 		}
328 328
 	}
@@ -336,13 +336,13 @@  discard block
 block discarded – undo
336 336
 	public function fromDatabaseObject($object, $function) {
337 337
 		$result=$function($object);
338 338
 		if (\is_array($result)) {
339
-			$result= $this->addRow($function($object));
339
+			$result=$this->addRow($function($object));
340 340
 		} else {
341
-			$result= $this->getBody()->_addRow($result);
341
+			$result=$this->getBody()->_addRow($result);
342 342
 		}
343
-		if(isset($this->_afterCompileEvents["onNewRow"])){
344
-			if(\is_callable($this->_afterCompileEvents["onNewRow"]))
345
-				$this->_afterCompileEvents["onNewRow"]($result,$object);
343
+		if (isset($this->_afterCompileEvents["onNewRow"])) {
344
+			if (\is_callable($this->_afterCompileEvents["onNewRow"]))
345
+				$this->_afterCompileEvents["onNewRow"]($result, $object);
346 346
 		}
347 347
 		return $result;
348 348
 	}
@@ -357,14 +357,14 @@  discard block
 block discarded – undo
357 357
 		return $this;
358 358
 	}
359 359
 
360
-	public function refresh(){
360
+	public function refresh() {
361 361
 		$this->_footer=$this->getFooter();
362 362
 		$this->addEvent("execute", '$("#'.$this->identifier.' tfoot").replaceWith("'.\addslashes($this->_footer).'");');
363 363
 	}
364 364
 
365
-	public function run(JsUtils $js){
366
-		$result= parent::run($js);
367
-		if(isset($this->_footer))
365
+	public function run(JsUtils $js) {
366
+		$result=parent::run($js);
367
+		if (isset($this->_footer))
368 368
 			$this->_footer->run($js);
369 369
 		return $result;
370 370
 	}
@@ -387,47 +387,47 @@  discard block
 block discarded – undo
387 387
 	 * @param boolean $multiple
388 388
 	 * @return HtmlTable
389 389
 	 */
390
-	public function setActiveRowSelector($class="active",$event="click",$multiple=false){
391
-		$this->_activeRowSelector=new ActiveRow($this,$class,$event,$multiple);
390
+	public function setActiveRowSelector($class="active", $event="click", $multiple=false) {
391
+		$this->_activeRowSelector=new ActiveRow($this, $class, $event, $multiple);
392 392
 		return $this;
393 393
 	}
394 394
 
395
-	public function hideColumn($colIndex){
396
-		if(isset($this->content["thead"])){
395
+	public function hideColumn($colIndex) {
396
+		if (isset($this->content["thead"])) {
397 397
 			$this->content["thead"]->hideColumn($colIndex);
398 398
 		}
399 399
 		$this->content["tbody"]->hideColumn($colIndex);
400
-		if(isset($this->content["tfoot"])){
400
+		if (isset($this->content["tfoot"])) {
401 401
 			$this->content["tfoot"]->hideColumn($colIndex);
402 402
 		}
403 403
 		return $this;
404 404
 	}
405 405
 
406
-	public function setColWidth($colIndex,$width){
406
+	public function setColWidth($colIndex, $width) {
407 407
 		$part=$this->_getFirstPart();
408
-		if($part!==null && $part->count()>0)
408
+		if ($part!==null && $part->count()>0)
409 409
 			$part->getCell(0, $colIndex)->setWidth($width);
410 410
 		return $this;
411 411
 	}
412 412
 
413
-	public function setColWidths($widths){
413
+	public function setColWidths($widths) {
414 414
 		$part=$this->_getFirstPart();
415
-		if($part!==null && $part->count()>0){
415
+		if ($part!==null && $part->count()>0) {
416 416
 			$count=$part->getColCount();
417
-			if(!\is_array($widths)){
417
+			if (!\is_array($widths)) {
418 418
 				$widths=\array_fill(0, $count, $widths);
419 419
 			}
420
-			$max=\min(\sizeof($widths),$count);
421
-			for($i=0;$i<$max;$i++){
420
+			$max=\min(\sizeof($widths), $count);
421
+			for ($i=0; $i<$max; $i++) {
422 422
 				$part->getCell(0, $i)->setWidth($widths[$i]);
423 423
 			}
424 424
 		}
425 425
 		return $this;
426 426
 	}
427 427
 
428
-	public function mergeIdentiqualValues($colIndex,$function="strip_tags"){
428
+	public function mergeIdentiqualValues($colIndex, $function="strip_tags") {
429 429
 		$body=$this->getBody();
430
-		$body->mergeIdentiqualValues($colIndex,$function);
430
+		$body->mergeIdentiqualValues($colIndex, $function);
431 431
 		return $this;
432 432
 	}
433 433
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/content/table/HtmlTableContent.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  *
12 12
  */
13 13
 class HtmlTableContent extends HtmlSemCollection {
14
-	protected $_tdTagNames=[ "thead" => "th","tbody" => "td","tfoot" => "th" ];
14
+	protected $_tdTagNames=["thead" => "th", "tbody" => "td", "tfoot" => "th"];
15 15
 
16 16
 	/**
17 17
 	 *
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	public function setRowCount($rowCount, $colCount) {
36 36
 		$count=$this->count();
37
-		for($i=$count; $i < $rowCount; $i++) {
37
+		for ($i=$count; $i<$rowCount; $i++) {
38 38
 			$this->addItem($colCount);
39 39
 		}
40 40
 		return $this;
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 		$tr=new HtmlTR("", $value);
57 57
 		$tr->setContainer($this, $count);
58 58
 		$tr->setTdTagName($this->_tdTagNames[$this->tagName]);
59
-		if (isset($value) === true) {
59
+		if (isset($value)===true) {
60 60
 			$tr->setColCount($value);
61 61
 		}
62 62
 		return $tr;
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	public function setCellValue($row, $col, $value="") {
116 116
 		$cell=$this->getCell($row, $col);
117
-		if (isset($cell) === true) {
117
+		if (isset($cell)===true) {
118 118
 			$cell->setValue($value);
119 119
 		}
120 120
 		return $this;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 * @param mixed $values
126 126
 	 */
127 127
 	public function setValues($values=array()) {
128
-		return $this->_addOrSetValues($values, function(HtmlTR $row,$_values){$row->setValues($_values);});
128
+		return $this->_addOrSetValues($values, function(HtmlTR $row, $_values) {$row->setValues($_values); });
129 129
 	}
130 130
 
131 131
 	/**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 * @param mixed $values
134 134
 	 */
135 135
 	public function addValues($values=array()) {
136
-		return $this->_addOrSetValues($values, function(HtmlTR $row,$_values){$row->addValues($_values);});
136
+		return $this->_addOrSetValues($values, function(HtmlTR $row, $_values) {$row->addValues($_values); });
137 137
 	}
138 138
 
139 139
 	/**
@@ -141,21 +141,21 @@  discard block
 block discarded – undo
141 141
 	 * @param mixed $values
142 142
 	 * @param callable $callback
143 143
 	 */
144
-	protected function _addOrSetValues($values,$callback) {
144
+	protected function _addOrSetValues($values, $callback) {
145 145
 		$count=$this->count();
146 146
 		$isArray=true;
147 147
 		if (!\is_array($values)) {
148 148
 			$values=\array_fill(0, $count, $values);
149 149
 			$isArray=false;
150 150
 		}
151
-		if (JArray::dimension($values) == 1 && $isArray)
152
-			$values=[ $values ];
151
+		if (JArray::dimension($values)==1 && $isArray)
152
+			$values=[$values];
153 153
 
154 154
 		$count=\min(\sizeof($values), $count);
155 155
 
156
-		for($i=0; $i < $count; $i++) {
156
+		for ($i=0; $i<$count; $i++) {
157 157
 			$row=$this->content[$i];
158
-			$callback($row,$values[$i]);
158
+			$callback($row, $values[$i]);
159 159
 		}
160 160
 		return $this;
161 161
 	}
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 			$values=\array_fill(0, $count, $values);
167 167
 		}
168 168
 		$count=\min(\sizeof($values), $count);
169
-		for($i=0; $i < $count; $i++) {
169
+		for ($i=0; $i<$count; $i++) {
170 170
 			$this->getCell($i, $colIndex)->setValue($values[$i]);
171 171
 		}
172 172
 		return $this;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
 	public function addColVariations($colIndex, $variations=array()) {
176 176
 		$count=$this->count();
177
-		for($i=0; $i < $count; $i++) {
177
+		for ($i=0; $i<$count; $i++) {
178 178
 			$this->getCell($i, $colIndex)->addVariations($variations);
179 179
 		}
180 180
 		return $this;
@@ -191,9 +191,9 @@  discard block
 block discarded – undo
191 191
 
192 192
 	private function colAlign($colIndex, $function) {
193 193
 		$count=$this->count();
194
-		for($i=0; $i < $count; $i++) {
194
+		for ($i=0; $i<$count; $i++) {
195 195
 			$index=$this->content[$i]->getColPosition($colIndex);
196
-			if ($index !== NULL)
196
+			if ($index!==NULL)
197 197
 				$this->getCell($i, $index)->$function();
198 198
 		}
199 199
 		return $this;
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 */
226 226
 	public function getColCount() {
227 227
 		$result=0;
228
-		if ($this->count() > 0)
228
+		if ($this->count()>0)
229 229
 			$result=$this->getItem(0)->count();
230 230
 		return $result;
231 231
 	}
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	public function delete($rowIndex, $colIndex=NULL) {
240 240
 		if (isset($colIndex)) {
241 241
 			$row=$this->getItem($rowIndex);
242
-			if (isset($row) === true) {
242
+			if (isset($row)===true) {
243 243
 				$row->delete($colIndex);
244 244
 			}
245 245
 		} else {
@@ -248,9 +248,9 @@  discard block
 block discarded – undo
248 248
 		return $this;
249 249
 	}
250 250
 
251
-	public function toDelete($rowIndex, $colIndex){
251
+	public function toDelete($rowIndex, $colIndex) {
252 252
 		$row=$this->getItem($rowIndex);
253
-		if (isset($row) === true)
253
+		if (isset($row)===true)
254 254
 			$row->toDelete($colIndex);
255 255
 		return $this;
256 256
 	}
@@ -279,17 +279,17 @@  discard block
 block discarded – undo
279 279
 	 */
280 280
 	public function conditionalCellFormat($callback, $format) {
281 281
 		$rows=$this->content;
282
-		foreach ( $rows as $row ) {
282
+		foreach ($rows as $row) {
283 283
 			$row->conditionalCellFormat($callback, $format);
284 284
 		}
285 285
 		return $this;
286 286
 	}
287 287
 
288
-	public function conditionalColFormat($colIndex,$callback,$format){
288
+	public function conditionalColFormat($colIndex, $callback, $format) {
289 289
 		$rows=$this->content;
290
-		foreach ( $rows as $row ) {
290
+		foreach ($rows as $row) {
291 291
 			$cell=$row->getItem($colIndex);
292
-			$cell->conditionnalCellFormat($callback,$format);
292
+			$cell->conditionnalCellFormat($callback, $format);
293 293
 		}
294 294
 		return $this;
295 295
 	}
@@ -301,17 +301,17 @@  discard block
 block discarded – undo
301 301
 	 */
302 302
 	public function conditionalRowFormat($callback, $format) {
303 303
 		$rows=$this->content;
304
-		foreach ( $rows as $row ) {
304
+		foreach ($rows as $row) {
305 305
 			$row->conditionalRowFormat($callback, $format);
306 306
 		}
307 307
 		return $this;
308 308
 	}
309 309
 
310
-	public function hideColumn($colIndex){
310
+	public function hideColumn($colIndex) {
311 311
 		$rows=$this->content;
312
-		foreach ( $rows as $row ) {
312
+		foreach ($rows as $row) {
313 313
 			$cell=$row->getItem($colIndex);
314
-			$cell->addToProperty("style","display:none;");
314
+			$cell->addToProperty("style", "display:none;");
315 315
 		}
316 316
 		return $this;
317 317
 	}
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 	 */
323 323
 	public function applyCells($callback) {
324 324
 		$rows=$this->content;
325
-		foreach ( $rows as $row ) {
325
+		foreach ($rows as $row) {
326 326
 			$row->applyCells($callback);
327 327
 		}
328 328
 		return $this;
@@ -334,25 +334,25 @@  discard block
 block discarded – undo
334 334
 	 */
335 335
 	public function applyRows($callback) {
336 336
 		$rows=$this->content;
337
-		foreach ( $rows as $row ) {
337
+		foreach ($rows as $row) {
338 338
 			$row->apply($callback);
339 339
 		}
340 340
 		return $this;
341 341
 	}
342 342
 
343
-	public function mergeIdentiqualValues($colIndex,$function="strip_tags"){
343
+	public function mergeIdentiqualValues($colIndex, $function="strip_tags") {
344 344
 		$rows=$this->content;
345 345
 		$identiqual=null;
346 346
 		$counter=0;
347 347
 		$cellToMerge=null;
348 348
 		$functionExists=\function_exists($function);
349
-		foreach ( $rows as $row ) {
349
+		foreach ($rows as $row) {
350 350
 			$cell=$row->getItem($colIndex);
351 351
 			$value=$cell->getContent();
352
-			if($functionExists)
353
-				$value=\call_user_func($function,$value);
354
-			if($value!==$identiqual){
355
-				if($counter>0 && isset($cellToMerge)){
352
+			if ($functionExists)
353
+				$value=\call_user_func($function, $value);
354
+			if ($value!==$identiqual) {
355
+				if ($counter>0 && isset($cellToMerge)) {
356 356
 					$cellToMerge->setRowspan($counter);
357 357
 				}
358 358
 				$counter=0;
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 			}
362 362
 			$counter++;
363 363
 		}
364
-		if($counter>0 && isset($cellToMerge)){
364
+		if ($counter>0 && isset($cellToMerge)) {
365 365
 			$cellToMerge->setRowspan($counter);
366 366
 		}
367 367
 		return $this;
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormFields.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		}
36 36
 		if (isset($label))
37 37
 			$this->setLabel($label);
38
-		foreach ( $fields as $field ) {
38
+		foreach ($fields as $field) {
39 39
 			$this->addItem($field);
40 40
 		}
41 41
 		return $this;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function addItem($item) {
59 59
 		$item=parent::addItem($item);
60
-		if($item instanceof HtmlFormField)
60
+		if ($item instanceof HtmlFormField)
61 61
 			$item->setContainer($this);
62 62
 		return $item;
63 63
 	}
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 
99 99
 
100 100
 	public static function radios($name, $items=array(), $label=NULL, $value=null, $type=NULL) {
101
-		$fields=array ();
101
+		$fields=array();
102 102
 		$i=0;
103
-		foreach ( $items as $val => $caption ) {
103
+		foreach ($items as $val => $caption) {
104 104
 			$itemO=new HtmlFormRadio($name."-".$i++, $name, $caption, $val, $type);
105 105
 			if ($val===$value) {
106 106
 				$itemO->getDataField()->setProperty("checked", "");
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 	}
115 115
 
116 116
 	public static function checkeds($name, $items=array(), $label=NULL, $values=array(), $type=NULL) {
117
-		$fields=array ();
117
+		$fields=array();
118 118
 		$i=0;
119
-		foreach ( $items as $val => $caption ) {
119
+		foreach ($items as $val => $caption) {
120 120
 			$itemO=new HtmlFormCheckbox($name."-".$i++, $caption, $val, $type);
121 121
 			$itemO->setName($name);
122 122
 			if (\array_search($val, $values)!==false) {
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlButtonGroups.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
 	protected $_dropdown;
19 19
 	public function __construct($identifier, $elements=array(), $asIcons=false) {
20 20
 		parent::__construct($identifier, "div", "ui buttons");
21
-		if ($asIcons === true)
21
+		if ($asIcons===true)
22 22
 			$this->asIcons();
23 23
 		$this->addElements($elements, $asIcons);
24 24
 	}
25
-	protected function createItem($value){
25
+	protected function createItem($value) {
26 26
 		return new HtmlButton("", $value);
27 27
 	}
28 28
 
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	 * @param boolean $asCombo
32 32
 	 * @return HtmlDropdown
33 33
 	 */
34
-	public function addDropdown($items,$asCombo=false){
35
-		$dd= new HtmlDropdown("dd-".$this->identifier,null,$items);
34
+	public function addDropdown($items, $asCombo=false) {
35
+		$dd=new HtmlDropdown("dd-".$this->identifier, null, $items);
36 36
 		$dd->asButton();
37
-		if($asCombo){
37
+		if ($asCombo) {
38 38
 			$dd->setAction("combo");
39 39
 			$dd->addToProperty("class", "combo");
40 40
 		}
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
 
46 46
 	public function addElement($element, $asIcon=false) {
47 47
 		$item=$this->addItem($element);
48
-		if($asIcon)
48
+		if ($asIcon)
49 49
 			$item->asIcon($element);
50 50
 		return $item;
51 51
 	}
52 52
 
53 53
 	public function addElements($elements, $asIcons=false) {
54
-		foreach ( $elements as $element ) {
54
+		foreach ($elements as $element) {
55 55
 			$this->addElement($element, $asIcons);
56 56
 		}
57 57
 		return $this;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	public function insertOr($aferIndex=0, $or="or") {
61 61
 		$orElement=new HtmlSemDoubleElement("", "div", "or");
62 62
 		$orElement->setProperty("data-text", $or);
63
-		array_splice($this->content, $aferIndex + 1, 0, array ($orElement ));
63
+		array_splice($this->content, $aferIndex+1, 0, array($orElement));
64 64
 		return $this;
65 65
 	}
66 66
 
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 	}
74 74
 
75 75
 	public function asIcons() {
76
-		foreach ( $this->content as $item ) {
77
-			if($item instanceof HtmlButton)
76
+		foreach ($this->content as $item) {
77
+			if ($item instanceof HtmlButton)
78 78
 			$item->asIcon($item->getContent());
79 79
 		}
80 80
 		return $this->addToProperty("class", "icons");
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 * @see \Ajax\bootstrap\html\base\BaseHtml::on()
108 108
 	 */
109 109
 	public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
110
-		foreach ( $this->content as $element ) {
110
+		foreach ($this->content as $element) {
111 111
 			$element->on($event, $jsCode, $stopPropagation, $preventDefault);
112 112
 		}
113 113
 		return $this;
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
 
120 120
 	public function addClasses($classes=array()) {
121 121
 		$i=0;
122
-		if(!\is_array($classes)){
123
-			$classes=array_fill (0,$this->count(),$classes);
122
+		if (!\is_array($classes)) {
123
+			$classes=array_fill(0, $this->count(), $classes);
124 124
 		}
125
-		foreach ( $this->content as $button ) {
125
+		foreach ($this->content as $button) {
126 126
 			$button->addToProperty("class", $classes[$i++]);
127 127
 		}
128 128
 		return $this;
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
 		$this->addElement($function($object));
137 137
 	}
138 138
 
139
-	public function run(JsUtils $js){
140
-		$result= parent::run($js);
139
+	public function run(JsUtils $js) {
140
+		$result=parent::run($js);
141 141
 		return $result->setItemSelector(".ui.button");
142 142
 	}
143 143
 
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlButton.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	}
56 56
 
57 57
 	public function setFocusable($value=true) {
58
-		if ($value === true)
58
+		if ($value===true)
59 59
 			$this->setProperty("tabindex", "0");
60 60
 		else {
61 61
 			$this->removeProperty("tabindex");
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
 
66 66
 	public function setAnimated($content, $animation="") {
67 67
 		$this->setTagName("div");
68
-		$this->addToProperty("class", "animated " . $animation);
69
-		$visible=new HtmlSemDoubleElement("visible-" . $this->identifier, "div");
68
+		$this->addToProperty("class", "animated ".$animation);
69
+		$visible=new HtmlSemDoubleElement("visible-".$this->identifier, "div");
70 70
 		$visible->setClass("visible content");
71 71
 		$visible->setContent($this->content);
72
-		$hidden=new HtmlSemDoubleElement("hidden-" . $this->identifier, "div");
72
+		$hidden=new HtmlSemDoubleElement("hidden-".$this->identifier, "div");
73 73
 		$hidden->setClass("hidden content");
74 74
 		$hidden->setContent($content);
75
-		$this->content=array ($visible,$hidden );
75
+		$this->content=array($visible, $hidden);
76 76
 		return $hidden;
77 77
 	}
78 78
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	public function asIcon($icon) {
85 85
 		$iconO=$icon;
86 86
 		if (\is_string($icon)) {
87
-			$iconO=new HtmlIcon("icon-" . $this->identifier, $icon);
87
+			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
88 88
 		}
89 89
 		$this->addToProperty("class", "icon");
90 90
 		$this->content=$iconO;
@@ -104,17 +104,17 @@  discard block
 block discarded – undo
104 104
 	 * @return HtmlLabel
105 105
 	 */
106 106
 	public function addLabel($label, $before=false, $icon=NULL) {
107
-		$this->tagName="div";$prefix="";
108
-		if($before)
107
+		$this->tagName="div"; $prefix="";
108
+		if ($before)
109 109
 			$prefix="left ";
110 110
 		$this->addToProperty("class", $prefix."labeled");
111 111
 		$isIcon=(isset($this->content[0]) && $this->content[0] instanceof HtmlIcon);
112
-		$this->content=new HtmlButton("button-" . $this->identifier, $this->content);
113
-		if($isIcon){
112
+		$this->content=new HtmlButton("button-".$this->identifier, $this->content);
113
+		if ($isIcon) {
114 114
 			$this->content->addClass("icon");
115 115
 		}
116 116
 		$this->content->setTagName("div");
117
-		$label=new HtmlLabel("label-" . $this->identifier, $label, $icon,"a");
117
+		$label=new HtmlLabel("label-".$this->identifier, $label, $icon, "a");
118 118
 		$label->setBasic();
119 119
 		$this->addContent($label, $before);
120 120
 		return $label;
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 */
127 127
 	public function fromArray($array) {
128 128
 		$array=parent::fromArray($array);
129
-		foreach ( $array as $key => $value ) {
129
+		foreach ($array as $key => $value) {
130 130
 			$this->setProperty($key, $value);
131 131
 		}
132 132
 		return $array;
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 		return $this->addToProperty("class", "positive");
141 141
 	}
142 142
 
143
-	public function setColor($color){
144
-		if(\is_array($this->content)){
145
-			foreach ($this->content as $content){
146
-				if($content instanceof HtmlButton)
143
+	public function setColor($color) {
144
+		if (\is_array($this->content)) {
145
+			foreach ($this->content as $content) {
146
+				if ($content instanceof HtmlButton)
147 147
 					$content->setColor($color);
148 148
 			}
149 149
 		}
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 * @return HtmlButton
202 202
 	 */
203 203
 	public static function social($identifier, $social, $value=NULL) {
204
-		if ($value === NULL)
204
+		if ($value===NULL)
205 205
 			$value=\ucfirst($social);
206 206
 		$return=new HtmlButton($identifier, $value);
207 207
 		$return->addIcon($social);
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
 	 * {@inheritDoc}
239 239
 	 * @see HtmlSemDoubleElement::asLink()
240 240
 	 */
241
-	public function asLink($href=NULL,$target=NULL) {
242
-		parent::asLink($href,$target);
241
+	public function asLink($href=NULL, $target=NULL) {
242
+		parent::asLink($href, $target);
243 243
 		return $this;
244 244
 	}
245 245
 
@@ -252,10 +252,10 @@  discard block
 block discarded – undo
252 252
 	 * @param string $icon
253 253
 	 * @return HtmlButtonGroups
254 254
 	 */
255
-	public static function dropdown($identifier,$value,$items=[],$asCombo=false,$icon=null){
256
-		$result=new HtmlButtonGroups($identifier,[$value]);
257
-		$result->addDropdown($items,$asCombo);
258
-		if(isset($icon))
255
+	public static function dropdown($identifier, $value, $items=[], $asCombo=false, $icon=null) {
256
+		$result=new HtmlButtonGroups($identifier, [$value]);
257
+		$result->addDropdown($items, $asCombo);
258
+		if (isset($icon))
259 259
 			$result->setIcon($icon);
260 260
 		return $result;
261 261
 	}
Please login to merge, or discard this patch.
Ajax/common/traits/JsUtilsInternalTrait.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@  discard block
 block discarded – undo
2 2
 namespace Ajax\common\traits;
3 3
 use Ajax\common\BaseGui;
4 4
 
5
-trait JsUtilsInternalTrait{
5
+trait JsUtilsInternalTrait {
6 6
 
7
-	protected $jquery_code_for_compile=array ();
8
-	protected $jquery_code_for_compile_at_last=array ();
7
+	protected $jquery_code_for_compile=array();
8
+	protected $jquery_code_for_compile_at_last=array();
9 9
 
10 10
 	protected function _addToCompile($jsScript) {
11 11
 		$this->jquery_code_for_compile[]=$jsScript;
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 	 * @param BaseGui $library
16 16
 	 * @param mixed $view
17 17
 	 */
18
-	protected function _compileLibrary(BaseGui $library=NULL, &$view=NULL){
18
+	protected function _compileLibrary(BaseGui $library=NULL, &$view=NULL) {
19 19
 		if ($library!=NULL) {
20
-			if(isset($view))
20
+			if (isset($view))
21 21
 				$library->compileHtml($this, $view);
22 22
 			if ($library->isAutoCompile()) {
23 23
 				$library->compile(true);
@@ -25,20 +25,20 @@  discard block
 block discarded – undo
25 25
 		}
26 26
 	}
27 27
 
28
-	protected function defer($script){
28
+	protected function defer($script) {
29 29
 		$result="window.defer=function (method) {if (window.jQuery) method(); else setTimeout(function() { defer(method) }, 50);};";
30 30
 		$result.="window.defer(function(){".$script."})";
31 31
 		return $result;
32 32
 	}
33 33
 
34
-	protected function ready($script){
34
+	protected function ready($script) {
35 35
 		$result='$(document).ready(function() {'."\n";
36 36
 		$result.=$script.'})';
37 37
 		return $result;
38 38
 	}
39 39
 
40 40
 	protected function minify($input) {
41
-		if(trim($input) === "") return $input;
41
+		if (trim($input)==="") return $input;
42 42
 		return preg_replace(
43 43
 				array(
44 44
 						// Remove comment(s)
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlAbsractItem.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 abstract class HtmlAbsractItem extends HtmlSemDoubleElement {
13 13
 
14
-	public function __construct($identifier, $baseClass,$content=NULL) {
14
+	public function __construct($identifier, $baseClass, $content=NULL) {
15 15
 		parent::__construct($identifier, "div", $baseClass);
16 16
 		$this->content=array();
17 17
 		$this->initContent($content);
@@ -19,59 +19,59 @@  discard block
 block discarded – undo
19 19
 
20 20
 	abstract protected function initContent($content);
21 21
 
22
-	public function setIcon($icon){
22
+	public function setIcon($icon) {
23 23
 		$this->content["icon"]=new HtmlIcon("icon-".$this->identifier, $icon);
24 24
 	}
25 25
 
26
-	public function removeIcon(){
27
-		if(isset($this->content["icon"]))
26
+	public function removeIcon() {
27
+		if (isset($this->content["icon"]))
28 28
 			unset($this->content["icon"]);
29 29
 		return $this;
30 30
 	}
31 31
 
32
-	public function setImage($image){
32
+	public function setImage($image) {
33 33
 		$image=new HtmlImg("icon-".$this->identifier, $image);
34 34
 		$image->asAvatar();
35 35
 		$this->content["image"]=$image;
36 36
 	}
37 37
 
38
-	private function createContent(){
39
-		$this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier,"div","content");
38
+	private function createContent() {
39
+		$this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content");
40 40
 		return $this->content["content"];
41 41
 	}
42 42
 
43
-	public function setTitle($title,$description=NULL,$baseClass="title"){
44
-		$title=new HtmlSemDoubleElement("","div",$baseClass,$title);
45
-		if(\array_key_exists("content", $this->content)===false){
43
+	public function setTitle($title, $description=NULL, $baseClass="title") {
44
+		$title=new HtmlSemDoubleElement("", "div", $baseClass, $title);
45
+		if (\array_key_exists("content", $this->content)===false) {
46 46
 			$this->createContent();
47 47
 		}
48 48
 		$this->content["content"]->addContent($title);
49
-		if(isset($description)){
50
-			$description=new HtmlSemDoubleElement("","div","description",$description);
49
+		if (isset($description)) {
50
+			$description=new HtmlSemDoubleElement("", "div", "description", $description);
51 51
 			$this->content["content"]->addContent($description);
52 52
 		}
53 53
 		return $this;
54 54
 	}
55 55
 
56
-	public function getPart($partName="header"){
57
-		$content=\array_merge($this->content["content"]->getContent(),array(@$this->content["icon"],@$this->content["image"]));
56
+	public function getPart($partName="header") {
57
+		$content=\array_merge($this->content["content"]->getContent(), array(@$this->content["icon"], @$this->content["image"]));
58 58
 		return $this->getElementByPropertyValue("class", $partName, $content);
59 59
 	}
60 60
 
61
-	public function setActive($value=true){
62
-		if($value){
61
+	public function setActive($value=true) {
62
+		if ($value) {
63 63
 			$this->setTagName("div");
64 64
 			$this->removeProperty("href");
65 65
 			$this->addToPropertyCtrl("class", "active", array("active"));
66
-		}else{
66
+		} else {
67 67
 			$this->removePropertyValue("class", "active");
68 68
 		}
69 69
 		return $this;
70 70
 	}
71 71
 
72
-	public function asLink($href=NULL,$part=NULL){
72
+	public function asLink($href=NULL, $part=NULL) {
73 73
 		$this->setTagName("a");
74
-		if(isset($href))
74
+		if (isset($href))
75 75
 			$this->setProperty("href", $href);
76 76
 		return $this;
77 77
 	}
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
84 84
 	 */
85 85
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
86
-		if(\is_array($this->content) && JArray::isAssociative($this->content))
87
-			$this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]);
86
+		if (\is_array($this->content) && JArray::isAssociative($this->content))
87
+			$this->content=JArray::sortAssociative($this->content, ["icon", "image", "content"]);
88 88
 		return parent::compile($js, $view);
89 89
 	}
90 90
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlStepItem.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -8,53 +8,53 @@
 block discarded – undo
8 8
 class HtmlStepItem extends HtmlAbsractItem {
9 9
 
10 10
 	public function __construct($identifier, $content) {
11
-		parent::__construct($identifier,"step",$content);
11
+		parent::__construct($identifier, "step", $content);
12 12
 	}
13
-	protected function initContent($content){
14
-		if(\is_array($content)){
15
-			if(JArray::isAssociative($content)===false){
13
+	protected function initContent($content) {
14
+		if (\is_array($content)) {
15
+			if (JArray::isAssociative($content)===false) {
16 16
 				$icon=@$content[0];
17 17
 				$title=@$content[1];
18 18
 				$desc=@$content[2];
19 19
 				$status=@$content[3];
20
-			}else{
20
+			} else {
21 21
 				$icon=@$content["icon"];
22 22
 				$title=@$content["title"];
23 23
 				$desc=@$content["description"];
24 24
 				$status=@$content["status"];
25 25
 			}
26
-			if(isset($icon)){
26
+			if (isset($icon)) {
27 27
 				$this->setIcon($icon);
28 28
 			}
29
-			if(isset($status)){
29
+			if (isset($status)) {
30 30
 				$this->setStatus($status);
31 31
 			}
32
-			if(isset($title)){
33
-				$this->setTitle($title,$desc);
32
+			if (isset($title)) {
33
+				$this->setTitle($title, $desc);
34 34
 			}
35
-		}else{
35
+		} else {
36 36
 			$this->setContent($content);
37 37
 		}
38 38
 	}
39 39
 
40
-	public function setActive($value=true){
41
-		if($value)
40
+	public function setActive($value=true) {
41
+		if ($value)
42 42
 			$this->setStatus(StepStatus::ACTIVE);
43 43
 		else
44 44
 			$this->setStatus(StepStatus::NONE);
45 45
 		return $this;
46 46
 	}
47 47
 
48
-	public function setCompleted(){
49
-		$this->removePropertyValues("class", [StepStatus::COMPLETED,StepStatus::DISABLED]);
48
+	public function setCompleted() {
49
+		$this->removePropertyValues("class", [StepStatus::COMPLETED, StepStatus::DISABLED]);
50 50
 		return $this->setStatus(StepStatus::COMPLETED);
51 51
 	}
52 52
 
53
-	public function setStatus($status){
53
+	public function setStatus($status) {
54 54
 		return $this->addToPropertyCtrl("class", $status, StepStatus::getConstants());
55 55
 	}
56 56
 
57
-	public function removeStatus(){
57
+	public function removeStatus() {
58 58
 		$this->removePropertyValues("class", StepStatus::getConstants());
59 59
 	}
60 60
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlStep.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
 use Ajax\common\html\HtmlDoubleElement;
10 10
 use Ajax\semantic\html\base\constants\Side;
11 11
 
12
-class HtmlStep extends HtmlSemCollection{
12
+class HtmlStep extends HtmlSemCollection {
13 13
 	protected $_activeStep;
14 14
 	protected $_startStep;
15 15
 
16
-	public function __construct( $identifier,$steps=array()){
17
-		parent::__construct( $identifier,"div", "ui steps");
16
+	public function __construct($identifier, $steps=array()) {
17
+		parent::__construct($identifier, "div", "ui steps");
18 18
 		$this->addItems($steps);
19 19
 	}
20 20
 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	 * @see \Ajax\common\html\html5\HtmlCollection::createItem()
25 25
 	 */
26 26
 	protected function createItem($value) {
27
-		$itemO=new HtmlStepItem("item-".\sizeof($this->content),$value);
27
+		$itemO=new HtmlStepItem("item-".\sizeof($this->content), $value);
28 28
 		return $itemO;
29 29
 	}
30 30
 
@@ -32,50 +32,50 @@  discard block
 block discarded – undo
32 32
 	 * @param string|array $step
33 33
 	 * @return HtmlStepItem
34 34
 	 */
35
-	public function addStep($step){
35
+	public function addStep($step) {
36 36
 		return $this->addItem($step);
37 37
 	}
38 38
 
39
-	public function setOrdered(){
39
+	public function setOrdered() {
40 40
 		return $this->addToProperty("class", "ordered");
41 41
 	}
42 42
 
43
-	public function isOrdered(){
43
+	public function isOrdered() {
44 44
 		return $this->propertyContains("class", "ordered");
45 45
 	}
46 46
 
47
-	public function setVertical(){
47
+	public function setVertical() {
48 48
 		return $this->addToProperty("class", "vertical");
49 49
 	}
50 50
 
51
-	protected function defineActiveStep(){
51
+	protected function defineActiveStep() {
52 52
 		$activestep=$this->_activeStep;
53 53
 		$count=$this->count();
54
-		if(!$this->isOrdered()){
55
-			for($i=$this->_startStep;$i<$count;$i++){
54
+		if (!$this->isOrdered()) {
55
+			for ($i=$this->_startStep; $i<$count; $i++) {
56 56
 				$step=$this->content[$i];
57 57
 				$step->removeStatus();
58
-				if($i<$activestep)
58
+				if ($i<$activestep)
59 59
 					$step->setCompleted();
60 60
 				elseif ($i===$activestep)
61 61
 					$step->setActive();
62 62
 				else
63 63
 					$step->setDisabled();
64 64
 			}
65
-		}else{
66
-			foreach ($this->content as $step){
65
+		} else {
66
+			foreach ($this->content as $step) {
67 67
 				$step->removeStatus();
68 68
 			}
69
-			if($activestep<$count)
69
+			if ($activestep<$count)
70 70
 				$this->content[$activestep]->setActive();
71 71
 		}
72 72
 		return $this;
73 73
 	}
74 74
 
75 75
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
76
-		if(isset($this->_activeStep) && \is_numeric($this->_activeStep))
76
+		if (isset($this->_activeStep) && \is_numeric($this->_activeStep))
77 77
 			$this->defineActiveStep();
78
-		return parent::compile($js,$view);
78
+		return parent::compile($js, $view);
79 79
 	}
80 80
 
81 81
 	public function setActiveStep($_activeStep) {
@@ -83,15 +83,15 @@  discard block
 block discarded – undo
83 83
 		return $this;
84 84
 	}
85 85
 
86
-	public function setAttached($side="",HtmlDoubleElement $toElement=NULL){
87
-		if(isset($toElement)){
88
-			$toElement->addToPropertyCtrl("class", "attached",array("attached"));
86
+	public function setAttached($side="", HtmlDoubleElement $toElement=NULL) {
87
+		if (isset($toElement)) {
88
+			$toElement->addToPropertyCtrl("class", "attached", array("attached"));
89 89
 		}
90
-		return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
90
+		return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached"));
91 91
 	}
92 92
 
93
-	public function asLink(){
94
-		foreach ($this->content as $step){
93
+	public function asLink() {
94
+		foreach ($this->content as $step) {
95 95
 			$step->asLink();
96 96
 		}
97 97
 		return $this;
Please login to merge, or discard this patch.