Completed
Push — master ( 263c12...bbe42f )
by Jean-Christophe
06:53
created
Ajax/semantic/html/collections/table/HtmlTable.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -330,8 +330,9 @@  discard block
 block discarded – undo
330 330
 			$result= $this->getBody()->_addRow($result);
331 331
 		}
332 332
 		if(isset($this->_afterCompileEvents["onNewRow"])){
333
-			if(\is_callable($this->_afterCompileEvents["onNewRow"]))
334
-				$this->_afterCompileEvents["onNewRow"]($result,$object);
333
+			if(\is_callable($this->_afterCompileEvents["onNewRow"])) {
334
+							$this->_afterCompileEvents["onNewRow"]($result,$object);
335
+			}
335 336
 		}
336 337
 		return $result;
337 338
 	}
@@ -353,8 +354,9 @@  discard block
 block discarded – undo
353 354
 
354 355
 	public function run(JsUtils $js){
355 356
 		$result= parent::run($js);
356
-		if(isset($this->_footer))
357
-			$this->_footer->run($js);
357
+		if(isset($this->_footer)) {
358
+					$this->_footer->run($js);
359
+		}
358 360
 		return $result;
359 361
 	}
360 362
 
@@ -394,8 +396,9 @@  discard block
 block discarded – undo
394 396
 
395 397
 	public function setColWidth($colIndex,$width){
396 398
 		$part=$this->_getFirstPart();
397
-		if($part!==null && $part->count()>0)
398
-			$part->getCell(0, $colIndex)->setWidth($width);
399
+		if($part!==null && $part->count()>0) {
400
+					$part->getCell(0, $colIndex)->setWidth($width);
401
+		}
399 402
 		return $this;
400 403
 	}
401 404
 
Please login to merge, or discard this patch.
Ajax/semantic/widgets/datatable/DataTable.php 1 patch
Braces   +38 added lines, -26 removed lines patch added patch discarded remove patch
@@ -57,10 +57,12 @@  discard block
 block discarded – undo
57 57
 			$js->execOn("mouseover", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'visible');",["preventDefault"=>false,"stopPropagation"=>true]);
58 58
 			$js->execOn("mouseout", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'hidden');",["preventDefault"=>false,"stopPropagation"=>true]);
59 59
 		}
60
-		if(\is_array($this->_deleteBehavior))
61
-			$this->_generateBehavior("delete",$this->_deleteBehavior, $js);
62
-		if(\is_array($this->_editBehavior))
63
-			$this->_generateBehavior("edit",$this->_editBehavior,$js);
60
+		if(\is_array($this->_deleteBehavior)) {
61
+					$this->_generateBehavior("delete",$this->_deleteBehavior, $js);
62
+		}
63
+		if(\is_array($this->_editBehavior)) {
64
+					$this->_generateBehavior("edit",$this->_editBehavior,$js);
65
+		}
64 66
 		return parent::run($js);
65 67
 	}
66 68
 
@@ -93,12 +95,14 @@  discard block
 block discarded – undo
93 95
 			$table->setRowCount(0, \sizeof($captions));
94 96
 			$this->_generateHeader($table,$captions);
95 97
 
96
-			if(isset($this->_compileParts))
97
-				$table->setCompileParts($this->_compileParts);
98
+			if(isset($this->_compileParts)) {
99
+							$table->setCompileParts($this->_compileParts);
100
+			}
98 101
 
99 102
 			if(isset($this->_searchField) && isset($js)){
100
-				if(isset($this->_urls["refresh"]))
101
-					$this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]);
103
+				if(isset($this->_urls["refresh"])) {
104
+									$this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]);
105
+				}
102 106
 			}
103 107
 
104 108
 			$this->_generateContent($table);
@@ -123,8 +127,9 @@  discard block
 block discarded – undo
123 127
 	}
124 128
 
125 129
 	protected function _applyStyleAttributes($table){
126
-		if(isset($this->_hiddenColumns))
127
-			$this->_hideColumns();
130
+		if(isset($this->_hiddenColumns)) {
131
+					$this->_hideColumns();
132
+		}
128 133
 			if(isset($this->_colWidths)){
129 134
 				foreach ($this->_colWidths as $colIndex=>$width){
130 135
 					$table->setColWidth($colIndex,$width);
@@ -176,8 +181,9 @@  discard block
 block discarded – undo
176 181
 			$field=$ck->getField();
177 182
 			$field->setProperty("value",$id);
178 183
 			$field->setProperty("name", "selection[]");
179
-			if(isset($checkedClass))
180
-				$field->setClass($checkedClass);
184
+			if(isset($checkedClass)) {
185
+							$field->setClass($checkedClass);
186
+			}
181 187
 			\array_unshift($values, $ck);
182 188
 		}
183 189
 		$result=$table->newRow();
@@ -190,8 +196,9 @@  discard block
 block discarded – undo
190 196
 
191 197
 	protected function _generatePagination($table,$js=NULL){
192 198
 		if(isset($this->_toolbar)){
193
-			if($this->_toolbarPosition==PositionInTable::FOOTER)
194
-				$this->_toolbar->setFloated("left");
199
+			if($this->_toolbarPosition==PositionInTable::FOOTER) {
200
+							$this->_toolbar->setFloated("left");
201
+			}
195 202
 		}
196 203
 		$footer=$table->getFooter();
197 204
 		$footer->mergeCol();
@@ -210,8 +217,9 @@  discard block
 block discarded – undo
210 217
 
211 218
 	protected function _getFieldName($index){
212 219
 		$fieldName=parent::_getFieldName($index);
213
-		if(\is_object($fieldName))
214
-			$fieldName="field-".$index;
220
+		if(\is_object($fieldName)) {
221
+					$fieldName="field-".$index;
222
+		}
215 223
 		return $fieldName."[]";
216 224
 	}
217 225
 
@@ -251,7 +259,7 @@  discard block
 block discarded – undo
251 259
 		$hasPart=$table->hasPart($part);
252 260
 		if($hasPart){
253 261
 			$row=$table->getPart($part)->addRow(\sizeof($captions));
254
-		}else{
262
+		} else{
255 263
 			$row=$table->getPart($part)->getRow(0);
256 264
 		}
257 265
 		$row->mergeCol();
@@ -276,7 +284,7 @@  discard block
 block discarded – undo
276 284
 			$this->_urls["refresh"]=JArray::getValue($urls, "refresh",0);
277 285
 			$this->_urls["edit"]=JArray::getValue($urls, "edit",1);
278 286
 			$this->_urls["delete"]=JArray::getValue($urls, "delete",2);
279
-		}else{
287
+		} else{
280 288
 			$this->_urls=["refresh"=>$urls,"edit"=>$urls,"delete"=>$urls];
281 289
 		}
282 290
 		return $this;
@@ -350,8 +358,9 @@  discard block
 block discarded – undo
350 358
 
351 359
 	protected function getTargetSelector() {
352 360
 		$result=$this->_targetSelector;
353
-		if(!isset($result))
354
-			$result="#".$this->identifier;
361
+		if(!isset($result)) {
362
+					$result="#".$this->identifier;
363
+		}
355 364
 		return $result;
356 365
 	}
357 366
 
@@ -366,8 +375,9 @@  discard block
 block discarded – undo
366 375
 	}
367 376
 
368 377
 	public function getRefreshSelector() {
369
-		if(isset($this->_refreshSelector))
370
-			return $this->_refreshSelector;
378
+		if(isset($this->_refreshSelector)) {
379
+					return $this->_refreshSelector;
380
+		}
371 381
 		return "#".$this->identifier." tbody";
372 382
 	}
373 383
 
@@ -386,8 +396,9 @@  discard block
 block discarded – undo
386 396
 	 */
387 397
 	public function show($modelInstance){
388 398
 		if(\is_array($modelInstance)){
389
-			if(\is_array(array_values($modelInstance)[0]))
390
-				$modelInstance=\json_decode(\json_encode($modelInstance), FALSE);
399
+			if(\is_array(array_values($modelInstance)[0])) {
400
+							$modelInstance=\json_decode(\json_encode($modelInstance), FALSE);
401
+			}
391 402
 		}
392 403
 		$this->_modelInstance=$modelInstance;
393 404
 	}
@@ -427,8 +438,9 @@  discard block
 block discarded – undo
427 438
 	}
428 439
 
429 440
 	public function hideColumn($colIndex){
430
-		if(!\is_array($this->_hiddenColumns))
431
-			$this->_hiddenColumns=[];
441
+		if(!\is_array($this->_hiddenColumns)) {
442
+					$this->_hiddenColumns=[];
443
+		}
432 444
 		$this->_hiddenColumns[]=$colIndex;
433 445
 		return $this;
434 446
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/content/table/HtmlTableContent.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@  discard block
 block discarded – undo
22 22
 	 */
23 23
 	public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) {
24 24
 		parent::__construct($identifier, $tagName, "");
25
-		if (isset($rowCount) && isset($colCount))
26
-			$this->setRowCount($rowCount, $colCount);
25
+		if (isset($rowCount) && isset($colCount)) {
26
+					$this->setRowCount($rowCount, $colCount);
27
+		}
27 28
 	}
28 29
 
29 30
 	/**
@@ -148,8 +149,9 @@  discard block
 block discarded – undo
148 149
 			$values=\array_fill(0, $count, $values);
149 150
 			$isArray=false;
150 151
 		}
151
-		if (JArray::dimension($values) == 1 && $isArray)
152
-			$values=[ $values ];
152
+		if (JArray::dimension($values) == 1 && $isArray) {
153
+					$values=[ $values ];
154
+		}
153 155
 
154 156
 		$count=\min(\sizeof($values), $count);
155 157
 
@@ -193,8 +195,9 @@  discard block
 block discarded – undo
193 195
 		$count=$this->count();
194 196
 		for($i=0; $i < $count; $i++) {
195 197
 			$index=$this->content[$i]->getColPosition($colIndex);
196
-			if ($index !== NULL)
197
-				$this->getCell($i, $index)->$function();
198
+			if ($index !== NULL) {
199
+							$this->getCell($i, $index)->$function();
200
+			}
198 201
 		}
199 202
 		return $this;
200 203
 	}
@@ -225,8 +228,9 @@  discard block
 block discarded – undo
225 228
 	 */
226 229
 	public function getColCount() {
227 230
 		$result=0;
228
-		if ($this->count() > 0)
229
-			$result=$this->getItem(0)->count();
231
+		if ($this->count() > 0) {
232
+					$result=$this->getItem(0)->count();
233
+		}
230 234
 		return $result;
231 235
 	}
232 236
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/table/traits/TableTrait.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,15 +22,17 @@
 block discarded – undo
22 22
 
23 23
 	public function setBasic($very=false) {
24 24
 		$table=$this->_self;
25
-		if ($very)
26
-			$table->addToPropertyCtrl("class", "very", array ("very" ));
25
+		if ($very) {
26
+					$table->addToPropertyCtrl("class", "very", array ("very" ));
27
+		}
27 28
 		return $table->addToPropertyCtrl("class", "basic", array ("basic" ));
28 29
 	}
29 30
 
30 31
 	public function setCompact($very=false) {
31 32
 		$table=$this->_self;
32
-		if ($very)
33
-			$table->addToPropertyCtrl("class", "very", array ("very" ));
33
+		if ($very) {
34
+					$table->addToPropertyCtrl("class", "very", array ("very" ));
35
+		}
34 36
 		return $table->addToPropertyCtrl("class", "compact", array ("compact" ));
35 37
 	}
36 38
 
Please login to merge, or discard this patch.
Ajax/semantic/html/base/traits/BaseTrait.php 1 patch
Braces   +28 added lines, -20 removed lines patch added patch discarded remove patch
@@ -48,8 +48,9 @@  discard block
 block discarded – undo
48 48
 
49 49
 	public function setVariations($variations) {
50 50
 		$this->_self->setProperty("class", $this->_self->_baseClass);
51
-		if (\is_string($variations))
52
-			$variations=\explode(" ", $variations);
51
+		if (\is_string($variations)) {
52
+					$variations=\explode(" ", $variations);
53
+		}
53 54
 		foreach ( $variations as $variation ) {
54 55
 			$this->_self->addVariation($variation);
55 56
 		}
@@ -62,8 +63,9 @@  discard block
 block discarded – undo
62 63
 	}
63 64
 
64 65
 	public function addVariations($variations=array()) {
65
-		if (\is_string($variations))
66
-			$variations=\explode(" ", $variations);
66
+		if (\is_string($variations)) {
67
+					$variations=\explode(" ", $variations);
68
+		}
67 69
 		foreach ( $variations as $variation ) {
68 70
 			$this->_self->addVariation($variation);
69 71
 		}
@@ -71,8 +73,9 @@  discard block
 block discarded – undo
71 73
 	}
72 74
 
73 75
 	public function addStates($states=array()) {
74
-		if (\is_string($states))
75
-			$states=\explode(" ", $states);
76
+		if (\is_string($states)) {
77
+					$states=\explode(" ", $states);
78
+		}
76 79
 		foreach ( $states as $state ) {
77 80
 			$this->_self->addState($state);
78 81
 		}
@@ -81,8 +84,9 @@  discard block
 block discarded – undo
81 84
 
82 85
 	public function setStates($states) {
83 86
 		$this->_self->setProperty("class", $this->_self->_baseClass);
84
-		if (\is_string($states))
85
-			$states=\explode(" ", $states);
87
+		if (\is_string($states)) {
88
+					$states=\explode(" ", $states);
89
+		}
86 90
 		foreach ( $states as $state ) {
87 91
 			$this->_self->addState($state);
88 92
 		}
@@ -114,8 +118,9 @@  discard block
 block discarded – undo
114 118
 	 * @return HtmlSemDoubleElement
115 119
 	 */
116 120
 	public function setDisabled($disable=true) {
117
-		if($disable)
118
-			$this->_self->addToProperty("class", "disabled");
121
+		if($disable) {
122
+					$this->_self->addToProperty("class", "disabled");
123
+		}
119 124
 		return $this;
120 125
 	}
121 126
 
@@ -149,14 +154,16 @@  discard block
 block discarded – undo
149 154
 	 * @return HtmlSemDoubleElement
150 155
 	 */
151 156
 	public function setActive($value=true){
152
-		if($value)
153
-			$this->_self->addToProperty("class", "active");
157
+		if($value) {
158
+					$this->_self->addToProperty("class", "active");
159
+		}
154 160
 		return $this;
155 161
 	}
156 162
 
157 163
 	public function setAttached($value=true){
158
-		if($value)
159
-			$this->_self->addToPropertyCtrl("class", "attached", array ("attached" ));
164
+		if($value) {
165
+					$this->_self->addToPropertyCtrl("class", "attached", array ("attached" ));
166
+		}
160 167
 		return $this;
161 168
 	}
162 169
 
@@ -166,9 +173,9 @@  discard block
 block discarded – undo
166 173
 	public function setInverted($recursive=true) {
167 174
 		if($recursive===true){
168 175
 			$content=$this->_self->getContent();
169
-			if($content instanceof HtmlSemDoubleElement)
170
-				$content->setInverted($recursive);
171
-			elseif(\is_array($content) || $content instanceof \Traversable){
176
+			if($content instanceof HtmlSemDoubleElement) {
177
+							$content->setInverted($recursive);
178
+			} elseif(\is_array($content) || $content instanceof \Traversable){
172 179
 				foreach ($content as $elm){
173 180
 					if($elm instanceof  HtmlSemDoubleElement){
174 181
 						$elm->setInverted($recursive);
@@ -204,9 +211,10 @@  discard block
 block discarded – undo
204 211
 			if(isset($array[$key])){
205 212
 				$p=JString::replaceAtFirstAndLast($array[$key], $before, "", $after, "");
206 213
 				$array[$key]=$before.$p.$value.$after;
207
-			}else
208
-				$array[$key]=$before.$value.$after;
209
-		}else{
214
+			} else {
215
+							$array[$key]=$before.$value.$after;
216
+			}
217
+		} else{
210 218
 			$array[$key]=$value;
211 219
 		}
212 220
 		return $this;
Please login to merge, or discard this patch.
Ajax/common/html/traits/BaseHtmlPropertiesTrait.php 1 patch
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
 	}
35 35
 
36 36
 	public function getProperty($name) {
37
-		if (array_key_exists($name, $this->_self->properties))
38
-			return $this->_self->properties[$name];
37
+		if (array_key_exists($name, $this->_self->properties)) {
38
+					return $this->_self->properties[$name];
39
+		}
39 40
 	}
40 41
 
41 42
 	public function addToProperty($name, $value, $separator=" ") {
@@ -45,10 +46,11 @@  discard block
 block discarded – undo
45 46
 			}
46 47
 		} else if ($value !== "" && $this->_self->propertyContains($name, $value) === false) {
47 48
 			$v=@$this->_self->properties[$name];
48
-			if (isset($v) && $v !== "")
49
-				$v=$v . $separator . $value;
50
-				else
51
-					$v=$value;
49
+			if (isset($v) && $v !== "") {
50
+							$v=$v . $separator . $value;
51
+			} else {
52
+									$v=$value;
53
+				}
52 54
 
53 55
 					return $this->_self->setProperty($name, $v);
54 56
 		}
@@ -71,8 +73,9 @@  discard block
 block discarded – undo
71 73
 	}
72 74
 
73 75
 	protected function addToPropertyUnique($name, $value, $typeCtrl) {
74
-		if (@class_exists($typeCtrl, true))
75
-			$typeCtrl=$typeCtrl::getConstants();
76
+		if (@class_exists($typeCtrl, true)) {
77
+					$typeCtrl=$typeCtrl::getConstants();
78
+		}
76 79
 			if (\is_array($typeCtrl)) {
77 80
 				$this->_self->removeOldValues($this->_self->properties[$name], $typeCtrl);
78 81
 			}
@@ -91,8 +94,9 @@  discard block
 block discarded – undo
91 94
 	}
92 95
 
93 96
 	public function removeProperty($name) {
94
-		if (\array_key_exists($name, $this->_self->properties))
95
-			unset($this->_self->properties[$name]);
97
+		if (\array_key_exists($name, $this->_self->properties)) {
98
+					unset($this->_self->properties[$name]);
99
+		}
96 100
 			return $this;
97 101
 	}
98 102
 
@@ -105,8 +109,9 @@  discard block
 block discarded – undo
105 109
 	}
106 110
 
107 111
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
108
-		if ($this->_self->ctrl($name, $value, $typeCtrl) === true)
109
-			return $this->_self->setProperty($name, $value);
112
+		if ($this->_self->ctrl($name, $value, $typeCtrl) === true) {
113
+					return $this->_self->setProperty($name, $value);
114
+		}
110 115
 			return $this;
111 116
 	}
112 117
 
Please login to merge, or discard this patch.
Ajax/semantic/widgets/dataform/DataForm.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 				$this->_generateFields($form, [$v], $headers, $i, $wrappers);
64 64
 				$i++;
65 65
 			}
66
-		}else{
66
+		} else{
67 67
 			$separators[]=$count;
68 68
 			for($i=0;$i<$size;$i++){
69 69
 				$fields=\array_slice($values, $separators[$i]+1,$separators[$i+1]-$separators[$i]);
@@ -74,17 +74,19 @@  discard block
 block discarded – undo
74 74
 
75 75
 	protected function _generateFields($form,$values,$headers,$sepFirst,$wrappers){
76 76
 		$wrapper=null;
77
-		if(isset($headers[$sepFirst+1]))
78
-			$form->addHeader($headers[$sepFirst+1],4,true);
77
+		if(isset($headers[$sepFirst+1])) {
78
+					$form->addHeader($headers[$sepFirst+1],4,true);
79
+		}
79 80
 		if(isset($wrappers[$sepFirst+1])){
80 81
 			$wrapper=$wrappers[$sepFirst+1];
81 82
 		}
82 83
 		if(\sizeof($values)===1){
83 84
 			$added=$form->addField($values[0]);
84
-		}elseif(\sizeof($values)>1){
85
+		} elseif(\sizeof($values)>1){
85 86
 			$added=$form->addFields($values);
86
-		}else
87
-			return;
87
+		} else {
88
+					return;
89
+		}
88 90
 		if(isset($wrapper)){
89 91
 			$added->wrap($wrapper[0],$wrapper[1]);
90 92
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/content/view/HtmlViewGroups.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,9 @@
 block discarded – undo
30 30
 			if (isset($extra)) {
31 31
 				$result->addExtraContent($extra);
32 32
 			}
33
-		} else
34
-			$result->addItemContent($value);
33
+		} else {
34
+					$result->addItemContent($value);
35
+		}
35 36
 		return $result;
36 37
 	}
37 38
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/view/ContentPartTrait.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,9 @@
 block discarded – undo
18 18
 
19 19
 	public function getPart($partKey, $index=NULL,$force=false) {
20 20
 		if (\array_key_exists($partKey, $this->content)) {
21
-			if (isset($index))
22
-				return $this->content[$partKey][$index];
21
+			if (isset($index)) {
22
+							return $this->content[$partKey][$index];
23
+			}
23 24
 			return $this->content[$partKey];
24 25
 		}
25 26
 		if($force){
Please login to merge, or discard this patch.