Completed
Push — master ( a4feba...3ad5ef )
by Jean-Christophe
03:50
created
Ajax/semantic/html/views/HtmlCard.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@  discard block
 block discarded – undo
37 37
 
38 38
 	private function getPart($part, $index=NULL) {
39 39
 		if (\array_key_exists($part, $this->content)) {
40
-			if (isset($index))
41
-				return $this->content[$part][$index];
40
+			if (isset($index)) {
41
+							return $this->content[$part][$index];
42
+			}
42 43
 			return $this->content[$part];
43 44
 		}
44 45
 		return NULL;
@@ -140,8 +141,9 @@  discard block
 block discarded – undo
140 141
 		$this->addToProperty("class", "link");
141 142
 		if ($href !== "") {
142 143
 			$this->setProperty("href", $href);
143
-			if (isset($target))
144
-				$this->setProperty("target", $target);
144
+			if (isset($target)) {
145
+							$this->setProperty("target", $target);
146
+			}
145 147
 		}
146 148
 		return $this;
147 149
 	}
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
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 			foreach ($values as $v){
60 60
 				$form->addField($v);
61 61
 			}
62
-		}else{
62
+		} else{
63 63
 			$separators[]=$count;
64 64
 			for($i=0;$i<$size;$i++){
65 65
 				$this->_generateFields($form, $values, $headers, $separators[$i], $separators[$i+1], $wrappers);
@@ -70,18 +70,20 @@  discard block
 block discarded – undo
70 70
 	protected function _generateFields($form,$values,$headers,$sepFirst,$sepLast,$wrappers){
71 71
 		$wrapper=null;
72 72
 		$fields=\array_slice($values, $sepFirst+1,$sepLast-$sepFirst);
73
-		if(isset($headers[$sepFirst+1]))
74
-			$form->addHeader($headers[$sepFirst+1],4,true);
73
+		if(isset($headers[$sepFirst+1])) {
74
+					$form->addHeader($headers[$sepFirst+1],4,true);
75
+		}
75 76
 			if(isset($wrappers[$sepFirst+1])){
76 77
 				$wrapper=$wrappers[$sepFirst+1];
77 78
 			}
78 79
 			if(\sizeof($fields)===1){
79 80
 				$added=$form->addField($fields[0]);
80
-			}elseif(\sizeof($fields)>1){
81
+			} elseif(\sizeof($fields)>1){
81 82
 				$added=$form->addFields($fields);
82 83
 			}
83
-			if(isset($wrapper))
84
-				$added->wrap($wrapper[0],$wrapper[1]);
84
+			if(isset($wrapper)) {
85
+							$added->wrap($wrapper[0],$wrapper[1]);
86
+			}
85 87
 	}
86 88
 
87 89
 	/**
Please login to merge, or discard this patch.
Ajax/service/AjaxCall.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,9 @@
 block discarded – undo
14 14
 	}
15 15
 
16 16
 	public function compile(JsUtils $js=null) {
17
-		if ($js==null)
18
-			return;
17
+		if ($js==null) {
18
+					return;
19
+		}
19 20
 		$params="{}";
20 21
 		$jsCallback=NULL;
21 22
 		$attr="id";
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlMessage.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -68,10 +68,11 @@  discard block
 block discarded – undo
68 68
 	}
69 69
 
70 70
 	public function setDismissable($dismiss=true){
71
-		if($dismiss===true)
72
-			$this->close=new HtmlIcon("close-".$this->identifier, "close");
73
-		else
74
-			$this->close=NULL;
71
+		if($dismiss===true) {
72
+					$this->close=new HtmlIcon("close-".$this->identifier, "close");
73
+		} else {
74
+					$this->close=NULL;
75
+		}
75 76
 		return $this;
76 77
 	}
77 78
 
@@ -113,8 +114,9 @@  discard block
 block discarded – undo
113 114
 	public function setMessage($message){
114 115
 		if(\is_array($this->content)){
115 116
 			$this->content[\sizeof($this->content)-1]=$message;
116
-		}else
117
-			$this->setContent($message);
117
+		} else {
118
+					$this->setContent($message);
119
+		}
118 120
 	}
119 121
 
120 122
 	public function setTimeout($_timeout) {
Please login to merge, or discard this patch.
Ajax/semantic/widgets/datatable/DataTable.php 1 patch
Braces   +29 added lines, -20 removed lines patch added patch discarded remove patch
@@ -55,10 +55,12 @@  discard block
 block discarded – undo
55 55
 			$js->execOn("mouseover", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'visible');",["preventDefault"=>false,"stopPropagation"=>true]);
56 56
 			$js->execOn("mouseout", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'hidden');",["preventDefault"=>false,"stopPropagation"=>true]);
57 57
 		}
58
-		if(\is_array($this->_deleteBehavior))
59
-			$this->_generateBehavior("delete",$this->_deleteBehavior, $js);
60
-		if(\is_array($this->_editBehavior))
61
-			$this->_generateBehavior("edit",$this->_editBehavior,$js);
58
+		if(\is_array($this->_deleteBehavior)) {
59
+					$this->_generateBehavior("delete",$this->_deleteBehavior, $js);
60
+		}
61
+		if(\is_array($this->_editBehavior)) {
62
+					$this->_generateBehavior("edit",$this->_editBehavior,$js);
63
+		}
62 64
 		return parent::run($js);
63 65
 	}
64 66
 
@@ -94,12 +96,14 @@  discard block
 block discarded – undo
94 96
 			$table->setRowCount(0, \sizeof($captions));
95 97
 			$this->_generateHeader($table,$captions);
96 98
 
97
-			if(isset($this->_compileParts))
98
-				$table->setCompileParts($this->_compileParts);
99
+			if(isset($this->_compileParts)) {
100
+							$table->setCompileParts($this->_compileParts);
101
+			}
99 102
 
100 103
 			if(isset($this->_searchField) && isset($js)){
101
-				if(isset($this->_urls["refresh"]))
102
-					$this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]);
104
+				if(isset($this->_urls["refresh"])) {
105
+									$this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]);
106
+				}
103 107
 			}
104 108
 
105 109
 			$this->_generateContent($table);
@@ -159,8 +163,9 @@  discard block
 block discarded – undo
159 163
 			$field=$ck->getField();
160 164
 			$field->setProperty("value",$id);
161 165
 			$field->setProperty("name", "selection[]");
162
-			if(isset($checkedClass))
163
-				$field->setClass($checkedClass);
166
+			if(isset($checkedClass)) {
167
+							$field->setClass($checkedClass);
168
+			}
164 169
 			\array_unshift($values, $ck);
165 170
 		}
166 171
 		$result=$table->newRow();
@@ -173,8 +178,9 @@  discard block
 block discarded – undo
173 178
 
174 179
 	protected function _generatePagination($table,$js=NULL){
175 180
 		if(isset($this->_toolbar)){
176
-			if($this->_toolbarPosition==PositionInTable::FOOTER)
177
-				$this->_toolbar->setFloated("left");
181
+			if($this->_toolbarPosition==PositionInTable::FOOTER) {
182
+							$this->_toolbar->setFloated("left");
183
+			}
178 184
 		}
179 185
 		$footer=$table->getFooter();
180 186
 		$footer->mergeCol();
@@ -231,7 +237,7 @@  discard block
 block discarded – undo
231 237
 		$hasPart=$table->hasPart($part);
232 238
 		if($hasPart){
233 239
 			$row=$table->getPart($part)->addRow(\sizeof($captions));
234
-		}else{
240
+		} else{
235 241
 			$row=$table->getPart($part)->getRow(0);
236 242
 		}
237 243
 		$row->mergeCol();
@@ -256,7 +262,7 @@  discard block
 block discarded – undo
256 262
 			$this->_urls["refresh"]=JArray::getValue($urls, "refresh",0);
257 263
 			$this->_urls["edit"]=JArray::getValue($urls, "edit",1);
258 264
 			$this->_urls["delete"]=JArray::getValue($urls, "delete",2);
259
-		}else{
265
+		} else{
260 266
 			$this->_urls=["refresh"=>$urls,"edit"=>$urls,"delete"=>$urls];
261 267
 		}
262 268
 		return $this;
@@ -330,8 +336,9 @@  discard block
 block discarded – undo
330 336
 
331 337
 	protected function getTargetSelector() {
332 338
 		$result=$this->_targetSelector;
333
-		if(!isset($result))
334
-			$result="#".$this->identifier;
339
+		if(!isset($result)) {
340
+					$result="#".$this->identifier;
341
+		}
335 342
 		return $result;
336 343
 	}
337 344
 
@@ -346,8 +353,9 @@  discard block
 block discarded – undo
346 353
 	}
347 354
 
348 355
 	public function getRefreshSelector() {
349
-		if(isset($this->_refreshSelector))
350
-			return $this->_refreshSelector;
356
+		if(isset($this->_refreshSelector)) {
357
+					return $this->_refreshSelector;
358
+		}
351 359
 		return "#".$this->identifier." tbody";
352 360
 	}
353 361
 
@@ -362,8 +370,9 @@  discard block
 block discarded – undo
362 370
 	 */
363 371
 	public function show($modelInstance){
364 372
 		if(\is_array($modelInstance)){
365
-			if(\is_array(array_values($modelInstance)[0]))
366
-				$modelInstance=\json_decode(\json_encode($modelInstance), FALSE);
373
+			if(\is_array(array_values($modelInstance)[0])) {
374
+							$modelInstance=\json_decode(\json_encode($modelInstance), FALSE);
375
+			}
367 376
 		}
368 377
 		$this->_modelInstance=$modelInstance;
369 378
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/table/HtmlTable.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -271,8 +271,9 @@  discard block
 block discarded – undo
271 271
 			$result= $this->getBody()->_addRow($result);
272 272
 		}
273 273
 		if(isset($this->_afterCompileEvents["onNewRow"])){
274
-			if(\is_callable($this->_afterCompileEvents["onNewRow"]))
275
-				$this->_afterCompileEvents["onNewRow"]($result,$object);
274
+			if(\is_callable($this->_afterCompileEvents["onNewRow"])) {
275
+							$this->_afterCompileEvents["onNewRow"]($result,$object);
276
+			}
276 277
 		}
277 278
 		return $result;
278 279
 	}
@@ -293,8 +294,9 @@  discard block
 block discarded – undo
293 294
 
294 295
 	public function run(JsUtils $js){
295 296
 		$result= parent::run($js);
296
-		if(isset($this->_footer))
297
-			$this->_footer->run($js);
297
+		if(isset($this->_footer)) {
298
+					$this->_footer->run($js);
299
+		}
298 300
 		return $result;
299 301
 	}
300 302
 
Please login to merge, or discard this patch.
Ajax/common/components/SimpleComponent.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 			//echo $itemSelector.":::".$jsCode."<br>";
29 29
 			if($event=="execute"){
30 30
 				$this->jquery_code_for_compile []=$jsCode;
31
-			}else if($event=="beforeExecute"){
31
+			} else if($event=="beforeExecute"){
32 32
 				\array_unshift($this->jquery_code_for_compile, $jsCode);
33
-			}else{
33
+			} else{
34 34
 				$selector=$this->_createSelector($itemSelector, $this->attachTo);
35 35
 				$this->jquery_code_for_compile []="$( \"".$selector."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
36 36
 			}
@@ -38,10 +38,12 @@  discard block
 block discarded – undo
38 38
 	}
39 39
 
40 40
 	protected function _createSelector($itemSelector,$selector){
41
-		if(!isset($itemSelector))
42
-			$itemSelector=$this->itemSelector;
43
-		if(isset($itemSelector) && $itemSelector!=="")
44
-			$selector.=" ".$itemSelector;
41
+		if(!isset($itemSelector)) {
42
+					$itemSelector=$this->itemSelector;
43
+		}
44
+		if(isset($itemSelector) && $itemSelector!=="") {
45
+					$selector.=" ".$itemSelector;
46
+		}
45 47
 		return $selector;
46 48
 	}
47 49
 
@@ -84,8 +86,9 @@  discard block
 block discarded – undo
84 86
 
85 87
 	protected function setParamCtrl($key, $value, $typeCtrl) {
86 88
 		if (\is_array($typeCtrl)) {
87
-			if (array_search($value, $typeCtrl)===false)
88
-				throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
89
+			if (array_search($value, $typeCtrl)===false) {
90
+							throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
91
+			}
89 92
 		} else {
90 93
 			if (!$typeCtrl($value)) {
91 94
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName);
Please login to merge, or discard this patch.