@@ -14,8 +14,9 @@ |
||
14 | 14 | if(isset($type)){ |
15 | 15 | if($type=="page"){ |
16 | 16 | $this->asPageHeader($niveau); |
17 | - }else |
|
18 | - $this->asContentHeader($niveau); |
|
17 | + } else { |
|
18 | + $this->asContentHeader($niveau); |
|
19 | + } |
|
19 | 20 | } |
20 | 21 | $this->content=$content; |
21 | 22 | } |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function addItem($item){ |
46 | 46 | $item=parent::addItem($item); |
47 | - if(!$item instanceof HtmlMenu) |
|
48 | - $item->addToPropertyCtrl("class", "item",array("item")); |
|
49 | - else{ |
|
47 | + if(!$item instanceof HtmlMenu) { |
|
48 | + $item->addToPropertyCtrl("class", "item",array("item")); |
|
49 | + } else{ |
|
50 | 50 | $this->setSecondary(); |
51 | 51 | } |
52 | 52 | } |
@@ -81,8 +81,9 @@ discard block |
||
81 | 81 | |
82 | 82 | public function asTab($vertical=false){ |
83 | 83 | $this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");}); |
84 | - if($vertical===true) |
|
85 | - $this->setVertical(); |
|
84 | + if($vertical===true) { |
|
85 | + $this->setVertical(); |
|
86 | + } |
|
86 | 87 | return $this->addToProperty("class", "tabular"); |
87 | 88 | } |
88 | 89 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $itemO=$item; |
36 | 36 | if(\is_object($item)===false){ |
37 | 37 | $itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image); |
38 | - }elseif($itemO instanceof HtmlDropdownItem){ |
|
38 | + } elseif($itemO instanceof HtmlDropdownItem){ |
|
39 | 39 | $this->addToProperty("class", "vertical"); |
40 | 40 | } |
41 | 41 | $this->items[]=$itemO; |
@@ -43,8 +43,9 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | public function addInput($name){ |
46 | - if(!isset($name)) |
|
47 | - $name="input-".$this->identifier; |
|
46 | + if(!isset($name)) { |
|
47 | + $name="input-".$this->identifier; |
|
48 | + } |
|
48 | 49 | $this->setAction("activate"); |
49 | 50 | $this->input=new HtmlInput($name,"hidden"); |
50 | 51 | } |
@@ -54,7 +55,7 @@ discard block |
||
54 | 55 | foreach ($items as $k=>$v){ |
55 | 56 | $this->addItem($v)->setData($k); |
56 | 57 | } |
57 | - }else{ |
|
58 | + } else{ |
|
58 | 59 | foreach ($items as $item){ |
59 | 60 | $this->addItem($item); |
60 | 61 | } |
@@ -68,7 +69,7 @@ discard block |
||
68 | 69 | if($dropdown===false){ |
69 | 70 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php'; |
70 | 71 | $dropdown="menu"; |
71 | - }else{ |
|
72 | + } else{ |
|
72 | 73 | $dropdown="dropdown"; |
73 | 74 | $this->mClass="menu"; |
74 | 75 | } |
@@ -84,18 +85,22 @@ discard block |
||
84 | 85 | } |
85 | 86 | |
86 | 87 | public function asButton($floating=false){ |
87 | - if($floating) |
|
88 | - $this->addToProperty("class", "floating"); |
|
88 | + if($floating) { |
|
89 | + $this->addToProperty("class", "floating"); |
|
90 | + } |
|
89 | 91 | return $this->addToProperty("class", "button"); |
90 | 92 | } |
91 | 93 | |
92 | 94 | public function asSelect($name=NULL,$multiple=false,$selection=true){ |
93 | - if(isset($name)) |
|
94 | - $this->addInput($name); |
|
95 | - if($multiple) |
|
96 | - $this->addToProperty("class", "multiple"); |
|
97 | - if ($selection) |
|
98 | - $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
95 | + if(isset($name)) { |
|
96 | + $this->addInput($name); |
|
97 | + } |
|
98 | + if($multiple) { |
|
99 | + $this->addToProperty("class", "multiple"); |
|
100 | + } |
|
101 | + if ($selection) { |
|
102 | + $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
103 | + } |
|
99 | 104 | return $this; |
100 | 105 | } |
101 | 106 | |
@@ -105,8 +110,9 @@ discard block |
||
105 | 110 | } |
106 | 111 | |
107 | 112 | public function setSelect($name=NULL,$multiple=false){ |
108 | - if(!isset($name)) |
|
109 | - $name="select-".$this->identifier; |
|
113 | + if(!isset($name)) { |
|
114 | + $name="select-".$this->identifier; |
|
115 | + } |
|
110 | 116 | $this->input=null; |
111 | 117 | if($multiple){ |
112 | 118 | $this->setProperty("multiple", true); |
@@ -137,7 +143,7 @@ discard block |
||
137 | 143 | public function setValue($value){ |
138 | 144 | if(isset($this->input)){ |
139 | 145 | $this->input->setProperty("value", $value); |
140 | - }else{ |
|
146 | + } else{ |
|
141 | 147 | $this->setProperty("value", $value); |
142 | 148 | } |
143 | 149 | return $this; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | foreach ($items as $k=>$v){ |
18 | 18 | $this->addItem([$k,$v]); |
19 | 19 | } |
20 | - }else{ |
|
20 | + } else{ |
|
21 | 21 | foreach ($items as $item){ |
22 | 22 | $this->addItem($item); |
23 | 23 | } |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @return \Ajax\common\html\HtmlDoubleElement |
54 | 54 | */ |
55 | 55 | public function getItem($index) { |
56 | - if (is_int($index)) |
|
57 | - return $this->content[$index]; |
|
58 | - else { |
|
56 | + if (is_int($index)) { |
|
57 | + return $this->content[$index]; |
|
58 | + } else { |
|
59 | 59 | $elm=$this->getElementById($index, $this->content); |
60 | 60 | return $elm; |
61 | 61 | } |