@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | if(isset($value)){ |
35 | 35 | if($value instanceof HtmlSemDoubleElement){ |
36 | 36 | $text=$value; |
37 | - }else{ |
|
37 | + } else{ |
|
38 | 38 | $text=new HtmlSemDoubleElement("text-".$this->identifier,"div"); |
39 | 39 | $text->setClass("text"); |
40 | 40 | $this->setValue($value); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | if(!$item instanceof HtmlDropdownItem){ |
109 | 109 | $itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image,$description); |
110 | - }elseif($itemO instanceof HtmlDropdownItem){ |
|
110 | + } elseif($itemO instanceof HtmlDropdownItem){ |
|
111 | 111 | $this->addToProperty("class", "vertical"); |
112 | 112 | } |
113 | 113 | return $itemO; |
@@ -121,8 +121,9 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | public function addInput($name){ |
124 | - if(!isset($name)) |
|
125 | - $name="input-".$this->identifier; |
|
124 | + if(!isset($name)) { |
|
125 | + $name="input-".$this->identifier; |
|
126 | + } |
|
126 | 127 | $this->setAction("activate"); |
127 | 128 | $this->input=new HtmlInput($name,"hidden"); |
128 | 129 | } |
@@ -179,7 +180,7 @@ discard block |
||
179 | 180 | foreach ($items as $k=>$v){ |
180 | 181 | $this->addItem($v)->setData($k); |
181 | 182 | } |
182 | - }else{ |
|
183 | + } else{ |
|
183 | 184 | foreach ($items as $item){ |
184 | 185 | $this->addItem($item); |
185 | 186 | } |
@@ -203,7 +204,7 @@ discard block |
||
203 | 204 | if($dropdown===false){ |
204 | 205 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php'; |
205 | 206 | $dropdown="menu"; |
206 | - }else{ |
|
207 | + } else{ |
|
207 | 208 | $dropdown="dropdown"; |
208 | 209 | $this->mClass="menu"; |
209 | 210 | } |
@@ -224,22 +225,25 @@ discard block |
||
224 | 225 | |
225 | 226 | public function asButton($floating=false){ |
226 | 227 | $this->removeArrow(); |
227 | - if($floating) |
|
228 | - $this->addToProperty("class", "floating"); |
|
228 | + if($floating) { |
|
229 | + $this->addToProperty("class", "floating"); |
|
230 | + } |
|
229 | 231 | $this->removePropertyValue("class", "selection"); |
230 | 232 | return $this->addToProperty("class", "button"); |
231 | 233 | } |
232 | 234 | |
233 | 235 | public function asSelect($name=NULL,$multiple=false,$selection=true){ |
234 | 236 | $this->_multiple=$multiple; |
235 | - if(isset($name)) |
|
236 | - $this->addInput($name); |
|
237 | + if(isset($name)) { |
|
238 | + $this->addInput($name); |
|
239 | + } |
|
237 | 240 | if($multiple){ |
238 | 241 | $this->addToProperty("class", "multiple"); |
239 | 242 | } |
240 | 243 | if ($selection){ |
241 | - if($this->propertyContains("class", "button")===false) |
|
242 | - $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
244 | + if($this->propertyContains("class", "button")===false) { |
|
245 | + $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
246 | + } |
|
243 | 247 | } |
244 | 248 | return $this; |
245 | 249 | } |
@@ -250,8 +254,9 @@ discard block |
||
250 | 254 | } |
251 | 255 | |
252 | 256 | public function setSelect($name=NULL,$multiple=false){ |
253 | - if(!isset($name)) |
|
254 | - $name="select-".$this->identifier; |
|
257 | + if(!isset($name)) { |
|
258 | + $name="select-".$this->identifier; |
|
259 | + } |
|
255 | 260 | $this->input=null; |
256 | 261 | if($multiple){ |
257 | 262 | $this->setProperty("multiple", true); |
@@ -287,12 +292,13 @@ discard block |
||
287 | 292 | $value=$this->value; |
288 | 293 | if(isset($this->input) && isset($value)){ |
289 | 294 | $this->input->setProperty("value", $value); |
290 | - }else{ |
|
295 | + } else{ |
|
291 | 296 | $this->setProperty("value", $value); |
292 | 297 | } |
293 | 298 | $textElement=$this->getElementById("text-".$this->identifier, $this->content); |
294 | - if(isset($textElement) && !$this->_multiple) |
|
295 | - $textElement->setContent($value); |
|
299 | + if(isset($textElement) && !$this->_multiple) { |
|
300 | + $textElement->setContent($value); |
|
301 | + } |
|
296 | 302 | return $this; |
297 | 303 | } |
298 | 304 |