Completed
Push — master ( 8f54cc...872df9 )
by Jean-Christophe
03:13
created
Ajax/semantic/html/modules/HtmlDropdown.php 1 patch
Braces   +28 added lines, -20 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		}
102 102
 		if(!$item instanceof HtmlDropdownItem){
103 103
 			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image,$description);
104
-		}elseif($itemO instanceof HtmlDropdownItem){
104
+		} elseif($itemO instanceof HtmlDropdownItem){
105 105
 			$this->addToProperty("class", "vertical");
106 106
 		}
107 107
 		return $itemO;
@@ -115,8 +115,9 @@  discard block
 block discarded – undo
115 115
 	}
116 116
 
117 117
 	public function addInput($name){
118
-		if(!isset($name))
119
-			$name="input-".$this->identifier;
118
+		if(!isset($name)) {
119
+					$name="input-".$this->identifier;
120
+		}
120 121
 		$this->setAction("activate");
121 122
 		$this->input=new HtmlInput($name,"hidden");
122 123
 	}
@@ -173,7 +174,7 @@  discard block
 block discarded – undo
173 174
 			foreach ($items as $k=>$v){
174 175
 				$this->addItem($v)->setData($k);
175 176
 			}
176
-		}else{
177
+		} else{
177 178
 			foreach ($items as $item){
178 179
 				$this->addItem($item);
179 180
 			}
@@ -197,7 +198,7 @@  discard block
 block discarded – undo
197 198
 		if($dropdown===false){
198 199
 			$this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php';
199 200
 			$dropdown="menu";
200
-		}else{
201
+		} else{
201 202
 			$dropdown="dropdown";
202 203
 			$this->mClass="menu";
203 204
 		}
@@ -218,20 +219,24 @@  discard block
 block discarded – undo
218 219
 
219 220
 	public function asButton($floating=false){
220 221
 		$this->removeArrow();
221
-		if($floating)
222
-			$this->addToProperty("class", "floating");
222
+		if($floating) {
223
+					$this->addToProperty("class", "floating");
224
+		}
223 225
 		$this->removePropertyValue("class", "selection");
224 226
 		return $this->addToProperty("class", "button");
225 227
 	}
226 228
 
227 229
 	public function asSelect($name=NULL,$multiple=false,$selection=true){
228
-		if(isset($name))
229
-			$this->addInput($name);
230
-		if($multiple)
231
-			$this->addToProperty("class", "multiple");
230
+		if(isset($name)) {
231
+					$this->addInput($name);
232
+		}
233
+		if($multiple) {
234
+					$this->addToProperty("class", "multiple");
235
+		}
232 236
 		if ($selection){
233
-			if($this->propertyContains("class", "button")===false)
234
-				$this->addToPropertyCtrl("class", "selection",array("selection"));
237
+			if($this->propertyContains("class", "button")===false) {
238
+							$this->addToPropertyCtrl("class", "selection",array("selection"));
239
+			}
235 240
 		}
236 241
 		return $this;
237 242
 	}
@@ -242,8 +247,9 @@  discard block
 block discarded – undo
242 247
 	}
243 248
 
244 249
 	public function setSelect($name=NULL,$multiple=false){
245
-		if(!isset($name))
246
-			$name="select-".$this->identifier;
250
+		if(!isset($name)) {
251
+					$name="select-".$this->identifier;
252
+		}
247 253
 		$this->input=null;
248 254
 		if($multiple){
249 255
 			$this->setProperty("multiple", true);
@@ -279,12 +285,13 @@  discard block
 block discarded – undo
279 285
 		$value=$this->value;
280 286
 		if(isset($this->input) && isset($value)){
281 287
 			$this->input->setProperty("value", $value);
282
-		}else{
288
+		} else{
283 289
 			$this->setProperty("value", $value);
284 290
 		}
285 291
 			$textElement=$this->getElementById("text-".$this->identifier, $this->content);
286
-			if(isset($textElement))
287
-				$textElement->setContent($value);
292
+			if(isset($textElement)) {
293
+							$textElement->setContent($value);
294
+			}
288 295
 		return $this;
289 296
 	}
290 297
 
@@ -294,8 +301,9 @@  discard block
 block discarded – undo
294 301
 	 */
295 302
 	public function run(JsUtils $js) {
296 303
 		if($this->propertyContains("class", "simple")===false){
297
-			if(isset($this->_bsComponent)===false)
298
-				$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params);
304
+			if(isset($this->_bsComponent)===false) {
305
+							$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params);
306
+			}
299 307
 			$this->addEventsOnRun($js);
300 308
 			return $this->_bsComponent;
301 309
 		}
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
@@ -56,10 +56,12 @@  discard block
 block discarded – undo
56 56
 			$js->execOn("mouseover", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'visible');",["preventDefault"=>false,"stopPropagation"=>true]);
57 57
 			$js->execOn("mouseout", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'hidden');",["preventDefault"=>false,"stopPropagation"=>true]);
58 58
 		}
59
-		if(\is_array($this->_deleteBehavior))
60
-			$this->_generateBehavior("delete",$this->_deleteBehavior, $js);
61
-		if(\is_array($this->_editBehavior))
62
-			$this->_generateBehavior("edit",$this->_editBehavior,$js);
59
+		if(\is_array($this->_deleteBehavior)) {
60
+					$this->_generateBehavior("delete",$this->_deleteBehavior, $js);
61
+		}
62
+		if(\is_array($this->_editBehavior)) {
63
+					$this->_generateBehavior("edit",$this->_editBehavior,$js);
64
+		}
63 65
 		return parent::run($js);
64 66
 	}
65 67
 
@@ -95,12 +97,14 @@  discard block
 block discarded – undo
95 97
 			$table->setRowCount(0, \sizeof($captions));
96 98
 			$this->_generateHeader($table,$captions);
97 99
 
98
-			if(isset($this->_compileParts))
99
-				$table->setCompileParts($this->_compileParts);
100
+			if(isset($this->_compileParts)) {
101
+							$table->setCompileParts($this->_compileParts);
102
+			}
100 103
 
101 104
 			if(isset($this->_searchField) && isset($js)){
102
-				if(isset($this->_urls["refresh"]))
103
-					$this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]);
105
+				if(isset($this->_urls["refresh"])) {
106
+									$this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]);
107
+				}
104 108
 			}
105 109
 
106 110
 			$this->_generateContent($table);
@@ -118,8 +122,9 @@  discard block
 block discarded – undo
118 122
 
119 123
 			$this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE,"table",PositionInTable::AFTERTABLE]);
120 124
 			$this->_compileForm();
121
-			if(isset($this->_hiddenColumns))
122
-				$this->_hideColumns();
125
+			if(isset($this->_hiddenColumns)) {
126
+							$this->_hideColumns();
127
+			}
123 128
 			$this->_generated=true;
124 129
 		}
125 130
 		return parent::compile($js,$view);
@@ -169,8 +174,9 @@  discard block
 block discarded – undo
169 174
 			$field=$ck->getField();
170 175
 			$field->setProperty("value",$id);
171 176
 			$field->setProperty("name", "selection[]");
172
-			if(isset($checkedClass))
173
-				$field->setClass($checkedClass);
177
+			if(isset($checkedClass)) {
178
+							$field->setClass($checkedClass);
179
+			}
174 180
 			\array_unshift($values, $ck);
175 181
 		}
176 182
 		$result=$table->newRow();
@@ -183,8 +189,9 @@  discard block
 block discarded – undo
183 189
 
184 190
 	protected function _generatePagination($table,$js=NULL){
185 191
 		if(isset($this->_toolbar)){
186
-			if($this->_toolbarPosition==PositionInTable::FOOTER)
187
-				$this->_toolbar->setFloated("left");
192
+			if($this->_toolbarPosition==PositionInTable::FOOTER) {
193
+							$this->_toolbar->setFloated("left");
194
+			}
188 195
 		}
189 196
 		$footer=$table->getFooter();
190 197
 		$footer->mergeCol();
@@ -203,8 +210,9 @@  discard block
 block discarded – undo
203 210
 
204 211
 	protected function _getFieldName($index){
205 212
 		$fieldName=parent::_getFieldName($index);
206
-		if(\is_object($fieldName))
207
-			$fieldName="field-".$index;
213
+		if(\is_object($fieldName)) {
214
+					$fieldName="field-".$index;
215
+		}
208 216
 		return $fieldName."[]";
209 217
 	}
210 218
 
@@ -244,7 +252,7 @@  discard block
 block discarded – undo
244 252
 		$hasPart=$table->hasPart($part);
245 253
 		if($hasPart){
246 254
 			$row=$table->getPart($part)->addRow(\sizeof($captions));
247
-		}else{
255
+		} else{
248 256
 			$row=$table->getPart($part)->getRow(0);
249 257
 		}
250 258
 		$row->mergeCol();
@@ -269,7 +277,7 @@  discard block
 block discarded – undo
269 277
 			$this->_urls["refresh"]=JArray::getValue($urls, "refresh",0);
270 278
 			$this->_urls["edit"]=JArray::getValue($urls, "edit",1);
271 279
 			$this->_urls["delete"]=JArray::getValue($urls, "delete",2);
272
-		}else{
280
+		} else{
273 281
 			$this->_urls=["refresh"=>$urls,"edit"=>$urls,"delete"=>$urls];
274 282
 		}
275 283
 		return $this;
@@ -343,8 +351,9 @@  discard block
 block discarded – undo
343 351
 
344 352
 	protected function getTargetSelector() {
345 353
 		$result=$this->_targetSelector;
346
-		if(!isset($result))
347
-			$result="#".$this->identifier;
354
+		if(!isset($result)) {
355
+					$result="#".$this->identifier;
356
+		}
348 357
 		return $result;
349 358
 	}
350 359
 
@@ -359,8 +368,9 @@  discard block
 block discarded – undo
359 368
 	}
360 369
 
361 370
 	public function getRefreshSelector() {
362
-		if(isset($this->_refreshSelector))
363
-			return $this->_refreshSelector;
371
+		if(isset($this->_refreshSelector)) {
372
+					return $this->_refreshSelector;
373
+		}
364 374
 		return "#".$this->identifier." tbody";
365 375
 	}
366 376
 
@@ -379,8 +389,9 @@  discard block
 block discarded – undo
379 389
 	 */
380 390
 	public function show($modelInstance){
381 391
 		if(\is_array($modelInstance)){
382
-			if(\is_array(array_values($modelInstance)[0]))
383
-				$modelInstance=\json_decode(\json_encode($modelInstance), FALSE);
392
+			if(\is_array(array_values($modelInstance)[0])) {
393
+							$modelInstance=\json_decode(\json_encode($modelInstance), FALSE);
394
+			}
384 395
 		}
385 396
 		$this->_modelInstance=$modelInstance;
386 397
 	}
@@ -420,8 +431,9 @@  discard block
 block discarded – undo
420 431
 	}
421 432
 
422 433
 	public function hideColumn($colIndex){
423
-		if(!\is_array($this->_hiddenColumns))
424
-			$this->_hiddenColumns=[];
434
+		if(!\is_array($this->_hiddenColumns)) {
435
+					$this->_hiddenColumns=[];
436
+		}
425 437
 		$this->_hiddenColumns[]=$colIndex;
426 438
 		return $this;
427 439
 	}
Please login to merge, or discard this patch.