Completed
Push — master ( 80e027...da7bd7 )
by Jean-Christophe
04:34
created
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);
@@ -157,8 +161,9 @@  discard block
 block discarded – undo
157 161
 			$field=$ck->getField();
158 162
 			$field->setProperty("value",$this->_instanceViewer->getIdentifier());
159 163
 			$field->setProperty("name", "selection[]");
160
-			if(isset($checkedClass))
161
-				$field->setClass($checkedClass);
164
+			if(isset($checkedClass)) {
165
+							$field->setClass($checkedClass);
166
+			}
162 167
 			\array_unshift($values, $ck);
163 168
 		}
164 169
 		$result=$table->newRow();
@@ -170,8 +175,9 @@  discard block
 block discarded – undo
170 175
 
171 176
 	protected function _generatePagination($table,$js=NULL){
172 177
 		if(isset($this->_toolbar)){
173
-			if($this->_toolbarPosition==PositionInTable::FOOTER)
174
-				$this->_toolbar->setFloated("left");
178
+			if($this->_toolbarPosition==PositionInTable::FOOTER) {
179
+							$this->_toolbar->setFloated("left");
180
+			}
175 181
 		}
176 182
 		$footer=$table->getFooter();
177 183
 		$footer->mergeCol();
@@ -228,7 +234,7 @@  discard block
 block discarded – undo
228 234
 		$hasPart=$table->hasPart($part);
229 235
 		if($hasPart){
230 236
 			$row=$table->getPart($part)->addRow(\sizeof($captions));
231
-		}else{
237
+		} else{
232 238
 			$row=$table->getPart($part)->getRow(0);
233 239
 		}
234 240
 		$row->mergeCol();
@@ -253,7 +259,7 @@  discard block
 block discarded – undo
253 259
 			$this->_urls["refresh"]=JArray::getValue($urls, "refresh",0);
254 260
 			$this->_urls["edit"]=JArray::getValue($urls, "edit",1);
255 261
 			$this->_urls["delete"]=JArray::getValue($urls, "delete",2);
256
-		}else{
262
+		} else{
257 263
 			$this->_urls=["refresh"=>$urls,"edit"=>$urls,"delete"=>$urls];
258 264
 		}
259 265
 		return $this;
@@ -327,8 +333,9 @@  discard block
 block discarded – undo
327 333
 
328 334
 	protected function getTargetSelector() {
329 335
 		$result=$this->_targetSelector;
330
-		if(!isset($result))
331
-			$result="#".$this->identifier;
336
+		if(!isset($result)) {
337
+					$result="#".$this->identifier;
338
+		}
332 339
 		return $result;
333 340
 	}
334 341
 
@@ -343,8 +350,9 @@  discard block
 block discarded – undo
343 350
 	}
344 351
 
345 352
 	public function getRefreshSelector() {
346
-		if(isset($this->_refreshSelector))
347
-			return $this->_refreshSelector;
353
+		if(isset($this->_refreshSelector)) {
354
+					return $this->_refreshSelector;
355
+		}
348 356
 		return "#".$this->identifier." tbody";
349 357
 	}
350 358
 
@@ -359,8 +367,9 @@  discard block
 block discarded – undo
359 367
 	 */
360 368
 	public function show($modelInstance){
361 369
 		if(\is_array($modelInstance)){
362
-			if(\is_array(array_values($modelInstance)[0]))
363
-				$modelInstance=\json_decode(\json_encode($modelInstance), FALSE);
370
+			if(\is_array(array_values($modelInstance)[0])) {
371
+							$modelInstance=\json_decode(\json_encode($modelInstance), FALSE);
372
+			}
364 373
 		}
365 374
 		$this->_modelInstance=$modelInstance;
366 375
 	}
Please login to merge, or discard this patch.