Completed
Push — master ( acbd35...e1ce60 )
by Jean-Christophe
03:14
created
Ajax/semantic/html/collections/menus/HtmlMenu.php 1 patch
Braces   +22 added lines, -17 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	}
61 61
 
62 62
 	private function afterInsert($item) {
63
-		if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false)
64
-			$item->addToPropertyCtrl("class", "item", array ("item" ));
65
-		else {
63
+		if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) {
64
+					$item->addToPropertyCtrl("class", "item", array ("item" ));
65
+		} else {
66 66
 			$this->setSecondary();
67 67
 		}
68 68
 		return $item;
@@ -77,8 +77,9 @@  discard block
 block discarded – undo
77 77
 	public function addItem($item) {
78 78
 		$number=$item;
79 79
 		$item=parent::addItem($this->getItemToInsert($item));
80
-		if(\is_int($number))
81
-			$item->setProperty("data-page", $number);
80
+		if(\is_int($number)) {
81
+					$item->setProperty("data-page", $number);
82
+		}
82 83
 		return $this->afterInsert($item);
83 84
 	}
84 85
 
@@ -151,10 +152,11 @@  discard block
 block discarded – undo
151 152
 	}
152 153
 
153 154
 	public function setSecondary($value=true) {
154
-		if($value)
155
-			$this->addToProperty("class", "secondary");
156
-		else
157
-			$this->removePropertyValue("class", "secondary");
155
+		if($value) {
156
+					$this->addToProperty("class", "secondary");
157
+		} else {
158
+					$this->removePropertyValue("class", "secondary");
159
+		}
158 160
 		return $this;
159 161
 	}
160 162
 
@@ -174,8 +176,9 @@  discard block
 block discarded – undo
174 176
 		$this->apply(function (HtmlDoubleElement &$item) {
175 177
 			$item->setTagName("a");
176 178
 		});
177
-		if ($vertical === true)
178
-			$this->setVertical();
179
+		if ($vertical === true) {
180
+					$this->setVertical();
181
+		}
179 182
 		return $this->addToProperty("class", "tabular");
180 183
 	}
181 184
 
@@ -204,10 +207,11 @@  discard block
 block discarded – undo
204 207
 	 */
205 208
 	public function fromDatabaseObject($object, $function) {
206 209
 		$return=$function($object);
207
-		if (\is_array($return))
208
-			$this->addItems($return);
209
-		else
210
-			$this->addItem($return);
210
+		if (\is_array($return)) {
211
+					$this->addItems($return);
212
+		} else {
213
+					$this->addItem($return);
214
+		}
211 215
 	}
212 216
 
213 217
 	/**
@@ -240,8 +244,9 @@  discard block
 block discarded – undo
240 244
 	}
241 245
 
242 246
 	public function run(JsUtils $js){
243
-		if($this->identifier!=="" && !isset($this->_bsComponent))
244
-			$this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false);
247
+		if($this->identifier!=="" && !isset($this->_bsComponent)) {
248
+					$this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false);
249
+		}
245 250
 		$result= parent::run($js);
246 251
 		return $result->setItemSelector(".item");
247 252
 	}
Please login to merge, or discard this patch.