@@ -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"); |
@@ -24,9 +24,9 @@ |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | public static function getConstantValues($postFix=""){ |
27 | - if($postFix!=="") |
|
28 | - return \array_values(self::getConstants()); |
|
29 | - else{ |
|
27 | + if($postFix!=="") { |
|
28 | + return \array_values(self::getConstants()); |
|
29 | + } else{ |
|
30 | 30 | return \array_map(function ($elem) use ($postFix) {return $elem." ".$postFix;},\array_values(self::getConstants())); |
31 | 31 | } |
32 | 32 | } |
@@ -19,8 +19,9 @@ |
||
19 | 19 | } |
20 | 20 | |
21 | 21 | public function asAvatar($caption=NULL){ |
22 | - if(isset($caption)) |
|
23 | - $this->wrap("",$caption); |
|
22 | + if(isset($caption)) { |
|
23 | + $this->wrap("",$caption); |
|
24 | + } |
|
24 | 25 | return $this->addToProperty("class", "avatar"); |
25 | 26 | } |
26 | 27 | } |
27 | 28 | \ No newline at end of file |
@@ -11,8 +11,9 @@ |
||
11 | 11 | parent::__construct($identifier, "input"); |
12 | 12 | $this->setProperty("name", $identifier); |
13 | 13 | $this->setProperty("value", $value); |
14 | - if(JString::isNotNull($placeholder)) |
|
15 | - $this->setProperty("placeholder", $placeholder); |
|
14 | + if(JString::isNotNull($placeholder)) { |
|
15 | + $this->setProperty("placeholder", $placeholder); |
|
16 | + } |
|
16 | 17 | $this->setProperty("type", $type); |
17 | 18 | } |
18 | 19 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
30 | 30 | $this->addContent($iconO,false); |
31 | 31 | $this->_hasIcon=true; |
32 | - }else{ |
|
32 | + } else{ |
|
33 | 33 | $iconO=$this->getIcon(); |
34 | 34 | $iconO->setIcon($icon); |
35 | 35 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
@@ -40,8 +40,9 @@ discard block |
||
40 | 40 | public function getIcon(){ |
41 | 41 | if(\is_array($this->content)){ |
42 | 42 | foreach ($this->content as $item){ |
43 | - if($item instanceof HtmlIcon) |
|
44 | - return $item; |
|
43 | + if($item instanceof HtmlIcon) { |
|
44 | + return $item; |
|
45 | + } |
|
45 | 46 | } |
46 | 47 | } |
47 | 48 | } |
@@ -57,9 +58,10 @@ discard block |
||
57 | 58 | $labelO=$label; |
58 | 59 | if(\is_object($label)===false){ |
59 | 60 | $labelO=new HtmlLabel("label-".$this->identifier,$label); |
60 | - if(isset($icon)) |
|
61 | - $labelO->addIcon($icon); |
|
62 | - }else{ |
|
61 | + if(isset($icon)) { |
|
62 | + $labelO->addIcon($icon); |
|
63 | + } |
|
64 | + } else{ |
|
63 | 65 | $labelO->addToPropertyCtrl("class", "label", array("label")); |
64 | 66 | } |
65 | 67 | $this->addToProperty("class", $direction." labeled"); |
@@ -75,8 +77,9 @@ discard block |
||
75 | 77 | $actionO=$action; |
76 | 78 | if(\is_object($action)===false){ |
77 | 79 | $actionO=new HtmlButton("action-".$this->identifier,$action); |
78 | - if(isset($icon)) |
|
79 | - $actionO->addIcon($icon,true,$labeled); |
|
80 | + if(isset($icon)) { |
|
81 | + $actionO->addIcon($icon,true,$labeled); |
|
82 | + } |
|
80 | 83 | } |
81 | 84 | $this->addToProperty("class", $direction." action"); |
82 | 85 | $this->addContent($actionO,\strstr($direction,Direction::LEFT)!==false); |