Passed
Push — master ( 421c61...09a178 )
by Jean-Christophe
02:45
created
Ajax/semantic/html/modules/HtmlDropdown.php 1 patch
Braces   +24 added lines, -19 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 		if(isset($value)){
37 37
 			if($value instanceof HtmlSemDoubleElement){
38 38
 				$text=$value;
39
-			}else{
39
+			} else{
40 40
 				$text=new HtmlSemDoubleElement("text-".$this->identifier,"div");
41 41
 				$text->setClass("text");
42 42
 				$this->setValue($value);
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 		}
110 110
 		if(!$item instanceof HtmlDropdownItem){
111 111
 			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image,$description);
112
-		}elseif($itemO instanceof HtmlDropdownItem){
112
+		} elseif($itemO instanceof HtmlDropdownItem){
113 113
 			$this->addToProperty("class", "vertical");
114 114
 		}
115 115
 		return $itemO;
@@ -123,8 +123,9 @@  discard block
 block discarded – undo
123 123
 	}
124 124
 
125 125
 	public function addInput($name){
126
-		if(!isset($name))
127
-			$name="input-".$this->identifier;
126
+		if(!isset($name)) {
127
+					$name="input-".$this->identifier;
128
+		}
128 129
 		$this->setAction("activate");
129 130
 		$this->input=new HtmlInput($name,"hidden");
130 131
 	}
@@ -181,7 +182,7 @@  discard block
 block discarded – undo
181 182
 			foreach ($items as $k=>$v){
182 183
 				$this->addItem($v)->setData($k);
183 184
 			}
184
-		}else{
185
+		} else{
185 186
 			foreach ($items as $item){
186 187
 				$this->addItem($item);
187 188
 			}
@@ -203,8 +204,7 @@  discard block
 block discarded – undo
203 204
 			$c=$this->items[$i++];
204 205
 			if(isset($c)){
205 206
 				$c->setProperty($property,$value);
206
-			}
207
-			else{
207
+			} else{
208 208
 				return $this;
209 209
 			}
210 210
 		}
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		if($dropdown===false){
236 236
 			$this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php';
237 237
 			$dropdown="menu";
238
-		}else{
238
+		} else{
239 239
 			$dropdown="dropdown";
240 240
 			$this->mClass="menu";
241 241
 		}
@@ -256,22 +256,25 @@  discard block
 block discarded – undo
256 256
 
257 257
 	public function asButton($floating=false){
258 258
 		$this->removeArrow();
259
-		if($floating)
260
-			$this->addToProperty("class", "floating");
259
+		if($floating) {
260
+					$this->addToProperty("class", "floating");
261
+		}
261 262
 		$this->removePropertyValue("class", "selection");
262 263
 		return $this->addToProperty("class", "button");
263 264
 	}
264 265
 
265 266
 	public function asSelect($name=NULL,$multiple=false,$selection=true){
266 267
 		$this->_multiple=$multiple;
267
-		if(isset($name))
268
-			$this->addInput($name);
268
+		if(isset($name)) {
269
+					$this->addInput($name);
270
+		}
269 271
 		if($multiple){
270 272
 			$this->addToProperty("class", "multiple");
271 273
 		}
272 274
 		if ($selection){
273
-			if($this->propertyContains("class", "button")===false)
274
-				$this->addToPropertyCtrl("class", "selection",array("selection"));
275
+			if($this->propertyContains("class", "button")===false) {
276
+							$this->addToPropertyCtrl("class", "selection",array("selection"));
277
+			}
275 278
 		}
276 279
 		return $this;
277 280
 	}
@@ -282,8 +285,9 @@  discard block
 block discarded – undo
282 285
 	}
283 286
 
284 287
 	public function setSelect($name=NULL,$multiple=false){
285
-		if(!isset($name))
286
-			$name="select-".$this->identifier;
288
+		if(!isset($name)) {
289
+					$name="select-".$this->identifier;
290
+		}
287 291
 		$this->input=null;
288 292
 		if($multiple){
289 293
 			$this->setProperty("multiple", true);
@@ -319,12 +323,13 @@  discard block
 block discarded – undo
319 323
 		$value=$this->value;
320 324
 		if(isset($this->input) && isset($value)){
321 325
 			$this->input->setProperty("value", $value);
322
-		}else{
326
+		} else{
323 327
 			$this->setProperty("value", $value);
324 328
 		}
325 329
 			$textElement=$this->getElementById("text-".$this->identifier, $this->content);
326
-			if(isset($textElement) && ($textElement instanceof HtmlDoubleElement) && !$this->_multiple)
327
-				$textElement->setContent($value);
330
+			if(isset($textElement) && ($textElement instanceof HtmlDoubleElement) && !$this->_multiple) {
331
+							$textElement->setContent($value);
332
+			}
328 333
 		return $this;
329 334
 	}
330 335
 
Please login to merge, or discard this patch.