@@ -14,10 +14,11 @@ |
||
14 | 14 | if(isset($numCols)){ |
15 | 15 | $numCols=min(16,$numCols); |
16 | 16 | $numCols=max(1,$numCols); |
17 | - if($colSizing) |
|
18 | - $width=(int)(16/$numCols); |
|
19 | - else |
|
20 | - $this->_colSize=16/$numCols; |
|
17 | + if($colSizing) { |
|
18 | + $width=(int)(16/$numCols); |
|
19 | + } else { |
|
20 | + $this->_colSize=16/$numCols; |
|
21 | + } |
|
21 | 22 | for ($i=0;$i<$numCols;$i++){ |
22 | 23 | $this->addItem($width); |
23 | 24 | } |
@@ -101,8 +101,9 @@ discard block |
||
101 | 101 | * @return \Ajax\semantic\html\collections\HtmlGrid |
102 | 102 | */ |
103 | 103 | public function setPadded($value=NULL){ |
104 | - if(isset($value)) |
|
105 | - $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
104 | + if(isset($value)) { |
|
105 | + $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
106 | + } |
|
106 | 107 | return $this->addToProperty("class", "padded"); |
107 | 108 | } |
108 | 109 | |
@@ -124,8 +125,9 @@ discard block |
||
124 | 125 | * @see \Ajax\common\html\HtmlCollection::createItem() |
125 | 126 | */ |
126 | 127 | protected function createItem($value){ |
127 | - if($this->_createCols===false) |
|
128 | - $value=null; |
|
128 | + if($this->_createCols===false) { |
|
129 | + $value=null; |
|
130 | + } |
|
129 | 131 | $item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing); |
130 | 132 | return $item; |
131 | 133 | } |
@@ -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 | } |
@@ -15,8 +15,9 @@ discard block |
||
15 | 15 | if(isset($type)){ |
16 | 16 | if($type=="page"){ |
17 | 17 | $this->asPageHeader($niveau); |
18 | - }else |
|
19 | - $this->asContentHeader($niveau); |
|
18 | + } else { |
|
19 | + $this->asContentHeader($niveau); |
|
20 | + } |
|
20 | 21 | } |
21 | 22 | $this->content=$content; |
22 | 23 | } |
@@ -48,7 +49,7 @@ discard block |
||
48 | 49 | if(!\is_object($title)){ |
49 | 50 | $this->content=new HtmlDoubleElement("content-".$this->identifier,"div"); |
50 | 51 | $this->content->setContent($title); |
51 | - }else{ |
|
52 | + } else{ |
|
52 | 53 | $this->content=$title; |
53 | 54 | } |
54 | 55 | $this->content->setClass("content"); |