@@ -36,7 +36,7 @@ discard block |
||
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 |
||
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 |
||
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 | $this->input->setIdentifier("input-".$this->identifier); |
@@ -183,7 +184,7 @@ discard block |
||
183 | 184 | foreach ($items as $k=>$v){ |
184 | 185 | $this->addItem($v)->setData($k); |
185 | 186 | } |
186 | - }else{ |
|
187 | + } else{ |
|
187 | 188 | foreach ($items as $item){ |
188 | 189 | $this->addItem($item); |
189 | 190 | } |
@@ -205,8 +206,7 @@ discard block |
||
205 | 206 | $c=$this->items[$i++]; |
206 | 207 | if(isset($c)){ |
207 | 208 | $c->setProperty($property,$value); |
208 | - } |
|
209 | - else{ |
|
209 | + } else{ |
|
210 | 210 | return $this; |
211 | 211 | } |
212 | 212 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | if($dropdown===false){ |
238 | 238 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php'; |
239 | 239 | $dropdown="menu"; |
240 | - }else{ |
|
240 | + } else{ |
|
241 | 241 | $dropdown="dropdown"; |
242 | 242 | $this->mClass="menu"; |
243 | 243 | } |
@@ -258,22 +258,25 @@ discard block |
||
258 | 258 | |
259 | 259 | public function asButton($floating=false){ |
260 | 260 | $this->removeArrow(); |
261 | - if($floating) |
|
262 | - $this->addToProperty("class", "floating"); |
|
261 | + if($floating) { |
|
262 | + $this->addToProperty("class", "floating"); |
|
263 | + } |
|
263 | 264 | $this->removePropertyValue("class", "selection"); |
264 | 265 | return $this->addToProperty("class", "button"); |
265 | 266 | } |
266 | 267 | |
267 | 268 | public function asSelect($name=NULL,$multiple=false,$selection=true){ |
268 | 269 | $this->_multiple=$multiple; |
269 | - if(isset($name)) |
|
270 | - $this->addInput($name); |
|
270 | + if(isset($name)) { |
|
271 | + $this->addInput($name); |
|
272 | + } |
|
271 | 273 | if($multiple){ |
272 | 274 | $this->addToProperty("class", "multiple"); |
273 | 275 | } |
274 | 276 | if ($selection){ |
275 | - if($this->propertyContains("class", "button")===false) |
|
276 | - $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
277 | + if($this->propertyContains("class", "button")===false) { |
|
278 | + $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
279 | + } |
|
277 | 280 | } |
278 | 281 | return $this; |
279 | 282 | } |
@@ -284,8 +287,9 @@ discard block |
||
284 | 287 | } |
285 | 288 | |
286 | 289 | public function setSelect($name=NULL,$multiple=false){ |
287 | - if(!isset($name)) |
|
288 | - $name="select-".$this->identifier; |
|
290 | + if(!isset($name)) { |
|
291 | + $name="select-".$this->identifier; |
|
292 | + } |
|
289 | 293 | $this->input=null; |
290 | 294 | if($multiple){ |
291 | 295 | $this->setProperty("multiple", true); |
@@ -321,12 +325,13 @@ discard block |
||
321 | 325 | $value=$this->value; |
322 | 326 | if(isset($this->input) && isset($value)){ |
323 | 327 | $this->input->setProperty("value", $value); |
324 | - }else{ |
|
328 | + } else{ |
|
325 | 329 | $this->setProperty("value", $value); |
326 | 330 | } |
327 | 331 | $textElement=$this->getElementById("text-".$this->identifier, $this->content); |
328 | - if(isset($textElement) && ($textElement instanceof HtmlDoubleElement) && !$this->_multiple) |
|
329 | - $textElement->setContent($value); |
|
332 | + if(isset($textElement) && ($textElement instanceof HtmlDoubleElement) && !$this->_multiple) { |
|
333 | + $textElement->setContent($value); |
|
334 | + } |
|
330 | 335 | return $this; |
331 | 336 | } |
332 | 337 |