Completed
Push — master ( ca057c...baf19c )
by Jean-Christophe
03:05
created
Ajax/semantic/widgets/datatable/DataTable.php 1 patch
Braces   +32 added lines, -22 removed lines patch added patch discarded remove patch
@@ -50,10 +50,12 @@  discard block
 block discarded – undo
50 50
 			$js->execOn("mouseover", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'visible');",["preventDefault"=>false,"stopPropagation"=>true]);
51 51
 			$js->execOn("mouseout", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'hidden');",["preventDefault"=>false,"stopPropagation"=>true]);
52 52
 		}
53
-		if($this->_hasDelete)
54
-			$this->_generateBehavior("delete", $js);
55
-		if($this->_hasEdit)
56
-			$this->_generateBehavior("edit", $js);
53
+		if($this->_hasDelete) {
54
+					$this->_generateBehavior("delete", $js);
55
+		}
56
+		if($this->_hasEdit) {
57
+					$this->_generateBehavior("edit", $js);
58
+		}
57 59
 		return parent::run($js);
58 60
 	}
59 61
 
@@ -76,8 +78,9 @@  discard block
 block discarded – undo
76 78
 	}
77 79
 
78 80
 	protected function _generateBehavior($op,JsUtils $js){
79
-		if(isset($this->_urls[$op]))
80
-			$js->getOnClick("#".$this->identifier." .".$op, $this->_urls[$op],$this->getTargetSelector(),["preventDefault"=>false,"attr"=>"data-ajax"]);
81
+		if(isset($this->_urls[$op])) {
82
+					$js->getOnClick("#".$this->identifier." .".$op, $this->_urls[$op],$this->getTargetSelector(),["preventDefault"=>false,"attr"=>"data-ajax"]);
83
+		}
81 84
 	}
82 85
 
83 86
 	/**
@@ -102,12 +105,14 @@  discard block
 block discarded – undo
102 105
 
103 106
 			$table->setRowCount(0, \sizeof($captions));
104 107
 			$table->setHeaderValues($captions);
105
-			if(isset($this->_compileParts))
106
-				$table->setCompileParts($this->_compileParts);
108
+			if(isset($this->_compileParts)) {
109
+							$table->setCompileParts($this->_compileParts);
110
+			}
107 111
 
108 112
 			if(isset($this->_searchField) && isset($js)){
109
-				if(isset($this->_urls["refresh"]))
110
-					$this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]);
113
+				if(isset($this->_urls["refresh"])) {
114
+									$this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]);
115
+				}
111 116
 			}
112 117
 
113 118
 			$this->_generateContent($table);
@@ -132,8 +137,9 @@  discard block
 block discarded – undo
132 137
 	private function _generateMainCheckbox(&$captions){
133 138
 		$ck=new HtmlCheckbox("main-ck-".$this->identifier,"");
134 139
 		$checkedMessageCall="";
135
-		if($this->_hasCheckedMessage)
136
-			$checkedMessageCall="updateChecked();";
140
+		if($this->_hasCheckedMessage) {
141
+					$checkedMessageCall="updateChecked();";
142
+		}
137 143
 		$ck->setOnChecked("$('#".$this->identifier." [name=%quote%selection[]%quote%]').prop('checked',true);".$checkedMessageCall);
138 144
 		$ck->setOnUnchecked("$('#".$this->identifier." [name=%quote%selection[]%quote%]').prop('checked',false);".$checkedMessageCall);
139 145
 		\array_unshift($captions, $ck);
@@ -170,8 +176,9 @@  discard block
 block discarded – undo
170 176
 		$menu->floatRight();
171 177
 		$menu->setActiveItem($this->_pagination->getPage()-1);
172 178
 		$footer->setValues($menu);
173
-		if(isset($this->_urls["refresh"]))
174
-			$menu->postOnClick($this->_urls["refresh"],"{'p':$(this).attr('data-page')}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]);
179
+		if(isset($this->_urls["refresh"])) {
180
+					$menu->postOnClick($this->_urls["refresh"],"{'p':$(this).attr('data-page')}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]);
181
+		}
175 182
 	}
176 183
 
177 184
 	protected function _getFieldName($index){
@@ -214,7 +221,7 @@  discard block
 block discarded – undo
214 221
 		$hasPart=$table->hasPart($part);
215 222
 		if($hasPart){
216 223
 			$row=$table->getPart($part)->addRow(\sizeof($captions));
217
-		}else{
224
+		} else{
218 225
 			$row=$table->getPart($part)->getRow(0);
219 226
 		}
220 227
 		$row->mergeCol();
@@ -239,7 +246,7 @@  discard block
 block discarded – undo
239 246
 			$this->_urls["refresh"]=JArray::getValue($urls, "refresh",0);
240 247
 			$this->_urls["edit"]=JArray::getValue($urls, "edit",1);
241 248
 			$this->_urls["delete"]=JArray::getValue($urls, "delete",2);
242
-		}else{
249
+		} else{
243 250
 			$this->_urls=["refresh"=>$urls,"edit"=>$urls,"delete"=>$urls];
244 251
 		}
245 252
 		return $this;
@@ -304,8 +311,9 @@  discard block
 block discarded – undo
304 311
 		return $this->_fieldAs(function($id,$name,$value,$caption) use ($url,$responseElement,$cssStyle,$index,$attributes){
305 312
 			$button=new HtmlButton($id,$value,$cssStyle);
306 313
 			$button->postOnClick($url,"$(event.target).closest('tr').find(':input').serialize()",$responseElement,$attributes["ajax"]);
307
-			if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"])
308
-				$this->_visibleOver($button);
314
+			if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"]) {
315
+							$this->_visibleOver($button);
316
+			}
309 317
 			return $button;
310 318
 		}, $index,$attributes);
311 319
 	}
@@ -317,8 +325,9 @@  discard block
 block discarded – undo
317 325
 
318 326
 	protected function getTargetSelector() {
319 327
 		$result=$this->_targetSelector;
320
-		if(!isset($result))
321
-			$result="#".$this->identifier;
328
+		if(!isset($result)) {
329
+					$result="#".$this->identifier;
330
+		}
322 331
 		return $result;
323 332
 	}
324 333
 
@@ -356,8 +365,9 @@  discard block
 block discarded – undo
356 365
 	 * @param callable $callback
357 366
 	 */
358 367
 	public function addCountCheckedInToolbar(array $checkedMessage=null,$callback=null){
359
-		if(isset($checkedMessage))
360
-			$this->_checkedMessage=$checkedMessage;
368
+		if(isset($checkedMessage)) {
369
+					$this->_checkedMessage=$checkedMessage;
370
+		}
361 371
 		$checkedMessage=$this->getCheckedMessage();
362 372
 		$this->_hasCheckboxes=true;
363 373
 		$this->_hasCheckedMessage=true;
Please login to merge, or discard this patch.
Ajax/semantic/widgets/datatable/DataTableFieldAsTrait.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,8 +56,9 @@  discard block
 block discarded – undo
56 56
 	 */
57 57
 	private function getFieldButton($caption,$visibleHover=true){
58 58
 		$bt= new HtmlButton("",$caption);
59
-		if($visibleHover)
60
-			$this->_visibleOver($bt);
59
+		if($visibleHover) {
60
+					$this->_visibleOver($bt);
61
+		}
61 62
 			return $bt;
62 63
 	}
63 64
 
@@ -110,8 +111,9 @@  discard block
 block discarded – undo
110 111
 	private function getDefaultButton($icon,$class=null,$visibleHover=true){
111 112
 		$bt=$this->getFieldButton("",$visibleHover);
112 113
 		$bt->asIcon($icon);
113
-		if(isset($class))
114
-			$bt->addClass($class);
114
+		if(isset($class)) {
115
+					$bt->addClass($class);
116
+		}
115 117
 			return $bt;
116 118
 	}
117 119
 
Please login to merge, or discard this patch.