@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $this->startIndex=$startIndex; |
53 | 53 | $this->autoActive=$autoActive; |
54 | 54 | $this->_contentSeparator="<div class='divider'> / </div>"; |
55 | - $this->_hrefFunction=function (HtmlSemDoubleElement $e) { |
|
55 | + $this->_hrefFunction=function(HtmlSemDoubleElement $e) { |
|
56 | 56 | return $e->getContent(); |
57 | 57 | }; |
58 | 58 | if (isset($hrefFunction)) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @return HtmlBreadcrumb |
69 | 69 | */ |
70 | 70 | public function autoGetOnClick($targetSelector) { |
71 | - return $this->getOnClick($this->root, $targetSelector, array ("attr" => $this->attr )); |
|
71 | + return $this->getOnClick($this->root, $targetSelector, array("attr" => $this->attr)); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public function contentAsString() { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function setActive($index=null) { |
85 | 85 | if (!isset($index)) { |
86 | - $index=sizeof($this->content) - 1; |
|
86 | + $index=sizeof($this->content)-1; |
|
87 | 87 | } |
88 | 88 | $activeItem=$this->content[$index]; |
89 | 89 | $activeItem->addToProperty("class", "active"); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @param object $dispatcher the request dispatcher |
97 | 97 | * @return HtmlBreadcrumb |
98 | 98 | */ |
99 | - public function fromDispatcher(JsUtils $js,$dispatcher, $startIndex=0) { |
|
99 | + public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0) { |
|
100 | 100 | $this->startIndex=$startIndex; |
101 | 101 | return $this->addItems($js->fromDispatcher($dispatcher)); |
102 | 102 | } |
@@ -111,12 +111,12 @@ discard block |
||
111 | 111 | if (!isset($index)) { |
112 | 112 | $index=sizeof($this->content); |
113 | 113 | } |
114 | - if ($this->absolutePaths === true) { |
|
114 | + if ($this->absolutePaths===true) { |
|
115 | 115 | return $this->_hrefFunction($this->content[$index]); |
116 | 116 | } else { |
117 | - return $this->root . implode($separator, array_slice(array_map(function ($e) { |
|
117 | + return $this->root.implode($separator, array_slice(array_map(function($e) { |
|
118 | 118 | return $this->_hrefFunction($e); |
119 | - }, $this->content), $this->startIndex, $index + 1)); |
|
119 | + }, $this->content), $this->startIndex, $index+1)); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | $this->setActive(); |
151 | 151 | } |
152 | 152 | $count=$this->count(); |
153 | - for($i=1; $i < $count; $i++) { |
|
154 | - $this->content[$i]->wrap($this->getContentDivider($i - 1)); |
|
153 | + for ($i=1; $i<$count; $i++) { |
|
154 | + $this->content[$i]->wrap($this->getContentDivider($i-1)); |
|
155 | 155 | } |
156 | 156 | return parent::compile($js, $view); |
157 | 157 | } |
@@ -161,15 +161,15 @@ discard block |
||
161 | 161 | * @see \Ajax\bootstrap\html\base\BaseHtml::on() |
162 | 162 | */ |
163 | 163 | public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
164 | - foreach ( $this->content as $element ) { |
|
164 | + foreach ($this->content as $element) { |
|
165 | 165 | $element->on($event, $jsCode, $stopPropagation, $preventDefault); |
166 | 166 | } |
167 | 167 | return $this; |
168 | 168 | } |
169 | 169 | |
170 | 170 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
171 | - foreach ( $this->content as $element ) { |
|
172 | - if ($element->getProperty($this->attr) != NULL){ |
|
171 | + foreach ($this->content as $element) { |
|
172 | + if ($element->getProperty($this->attr)!=NULL) { |
|
173 | 173 | $element->_ajaxOn($operation, $event, $url, $responseElement, $parameters); |
174 | 174 | } |
175 | 175 | } |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | protected function createItem($value) { |
186 | 186 | $count=$this->count(); |
187 | - $itemO=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "a", "section"); |
|
187 | + $itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "a", "section"); |
|
188 | 188 | if (\is_array($value)) |
189 | 189 | $itemO->fromArray($value); |
190 | 190 | else { |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | public function addIconAt($icon, $index) { |
197 | 197 | $item=$this->getItem($index); |
198 | 198 | if (isset($item)) { |
199 | - $icon=new HtmlIcon("icon-" . $this->identifier, $icon); |
|
199 | + $icon=new HtmlIcon("icon-".$this->identifier, $icon); |
|
200 | 200 | $item->wrapContent($icon); |
201 | 201 | } |
202 | 202 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | public function addItem($item) { |
205 | 205 | $count=$this->count(); |
206 | 206 | $itemO=parent::addItem($item); |
207 | - $this->addToPropertyCtrl("class", "section", array ("section" )); |
|
207 | + $this->addToPropertyCtrl("class", "section", array("section")); |
|
208 | 208 | $itemO->setProperty($this->attr, $this->getHref($count)); |
209 | 209 | return $itemO; |
210 | 210 | } |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | public function setAbsolutePaths($absolutePaths) { |
221 | 221 | $this->absolutePaths=$absolutePaths; |
222 | 222 | $size=\sizeof($this->content); |
223 | - for($i=0;$i<$size;$i++){ |
|
223 | + for ($i=0; $i<$size; $i++) { |
|
224 | 224 | $this->content[$i]->setProperty($this->attr, $this->getHref($i)); |
225 | 225 | } |
226 | 226 | return $this; |
@@ -16,14 +16,14 @@ discard block |
||
16 | 16 | abstract class HtmlViewItem extends HtmlSemDoubleElement { |
17 | 17 | use ContentPartTrait; |
18 | 18 | |
19 | - public function __construct($identifier,$baseClass,$content=NULL) { |
|
19 | + public function __construct($identifier, $baseClass, $content=NULL) { |
|
20 | 20 | parent::__construct($identifier, "div", $baseClass); |
21 | 21 | $this->content=["content"=>new HtmlViewContent("content-".$this->identifier)]; |
22 | - if(isset($content)) |
|
22 | + if (isset($content)) |
|
23 | 23 | $this->setContent($content); |
24 | 24 | } |
25 | 25 | |
26 | - public function setContent($value){ |
|
26 | + public function setContent($value) { |
|
27 | 27 | if (\is_array($value)) { |
28 | 28 | $image=JArray::getValue($value, "image", 0); |
29 | 29 | $content=JArray::getValue($value, "content", 1); |
@@ -31,57 +31,57 @@ discard block |
||
31 | 31 | if (isset($image)) { |
32 | 32 | $this->addImage($image); |
33 | 33 | } |
34 | - if(isset($content)) |
|
34 | + if (isset($content)) |
|
35 | 35 | $this->content["content"]->setContent($content); |
36 | - if(isset($extra)) |
|
36 | + if (isset($extra)) |
|
37 | 37 | $this->addExtraContent($extra); |
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
41 | 41 | private function createContent($content, $baseClass="content") { |
42 | 42 | $count=\sizeof($this->content); |
43 | - $result=new HtmlViewContent("content-" . $count . "-" . $this->identifier, $content); |
|
43 | + $result=new HtmlViewContent("content-".$count."-".$this->identifier, $content); |
|
44 | 44 | $result->setClass($baseClass); |
45 | 45 | return $result; |
46 | 46 | } |
47 | 47 | |
48 | 48 | private function addElementIn($key, $element) { |
49 | - if (\array_key_exists($key, $this->content) === false) { |
|
49 | + if (\array_key_exists($key, $this->content)===false) { |
|
50 | 50 | $this->content[$key]=[]; |
51 | 51 | } |
52 | - if($this->content[$key] instanceof HtmlViewContent) |
|
52 | + if ($this->content[$key] instanceof HtmlViewContent) |
|
53 | 53 | $this->content[$key]->addElement($element); |
54 | 54 | else |
55 | 55 | $this->content[$key][]=$element; |
56 | 56 | return $element; |
57 | 57 | } |
58 | 58 | |
59 | - public function addIcon($icon,$before=true){ |
|
60 | - return $this->addElementIn("icon",new HtmlIcon("icon-" . $this->identifier, $icon)); |
|
59 | + public function addIcon($icon, $before=true) { |
|
60 | + return $this->addElementIn("icon", new HtmlIcon("icon-".$this->identifier, $icon)); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | public function addHeader($header, $niveau=4, $type="page") { |
65 | 65 | if (!$header instanceof HtmlHeader) { |
66 | - $header=new HtmlHeader("header-" . $this->identifier, $niveau, $header, $type); |
|
66 | + $header=new HtmlHeader("header-".$this->identifier, $niveau, $header, $type); |
|
67 | 67 | } |
68 | - return $this->addElementIn("header",$this->createContent($header)); |
|
68 | + return $this->addElementIn("header", $this->createContent($header)); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | public function addImage($image, $title="") { |
72 | 72 | if (!$image instanceof HtmlImage) { |
73 | - $image=new HtmlImage("image-" . $this->identifier, $image, $title); |
|
73 | + $image=new HtmlImage("image-".$this->identifier, $image, $title); |
|
74 | 74 | } |
75 | 75 | $image->setClass("ui image"); |
76 | - return $this->content["image"]= $image; |
|
76 | + return $this->content["image"]=$image; |
|
77 | 77 | } |
78 | 78 | |
79 | - public function addReveal($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL,$key="extra-content") { |
|
79 | + public function addReveal($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL, $key="extra-content") { |
|
80 | 80 | $reveal=$visibleContent; |
81 | 81 | if (!$visibleContent instanceof HtmlReveal) { |
82 | - $reveal=new HtmlReveal("reveral-" . $this->identifier, $visibleContent, $hiddenContent, $type, $attributeType); |
|
82 | + $reveal=new HtmlReveal("reveral-".$this->identifier, $visibleContent, $hiddenContent, $type, $attributeType); |
|
83 | 83 | } |
84 | - return $this->content[$key]= $reveal; |
|
84 | + return $this->content[$key]=$reveal; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | public function addRevealImage($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL) { |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | if (!$visibleContent instanceof HtmlReveal) { |
90 | 90 | return $this->addReveal(new HtmlImage("", $visibleContent), new HtmlImage("", $hiddenContent), $type, $attributeType); |
91 | 91 | } |
92 | - return $this->content["image"]= $reveal; |
|
92 | + return $this->content["image"]=$reveal; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | public function addExtraContent($content=array()) { |
96 | - return $this->content["extra-content"]= $this->createContent($content, "extra content"); |
|
96 | + return $this->content["extra-content"]=$this->createContent($content, "extra content"); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -103,23 +103,23 @@ discard block |
||
103 | 103 | * @param boolean $before |
104 | 104 | * @return HtmlButtonGroups |
105 | 105 | */ |
106 | - public function addContentButtons($elements=array(), $asIcons=false,$part="extra",$before=false){ |
|
107 | - return $this->content["content"]->addContentButtons($elements,$asIcons,$part, $before); |
|
106 | + public function addContentButtons($elements=array(), $asIcons=false, $part="extra", $before=false) { |
|
107 | + return $this->content["content"]->addContentButtons($elements, $asIcons, $part, $before); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | |
111 | 111 | |
112 | - public function addItemHeaderContent($header, $metas=array(), $description=NULL,$extra=NULL) { |
|
113 | - return $this->content["content"]->addHeaderContent($header, $metas, $description,$extra); |
|
112 | + public function addItemHeaderContent($header, $metas=array(), $description=NULL, $extra=NULL) { |
|
113 | + return $this->content["content"]->addHeaderContent($header, $metas, $description, $extra); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | public function addItemContent($content=array()) { |
117 | 117 | $count=\sizeof($this->content); |
118 | - return $this->addElementIn("content", new HtmlViewContent("content-" . $count . "-" . $this->identifier, $content)); |
|
118 | + return $this->addElementIn("content", new HtmlViewContent("content-".$count."-".$this->identifier, $content)); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | public function getItemContent() { |
122 | - return $this->getPart("content",null,true); |
|
122 | + return $this->getPart("content", null, true); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | public function getItemExtraContent() { |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | * @see HtmlSemDoubleElement::compile() |
142 | 142 | */ |
143 | 143 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
144 | - $this->content=JArray::sortAssociative($this->content, ["header","image","icon","content","extra-content"]); |
|
144 | + $this->content=JArray::sortAssociative($this->content, ["header", "image", "icon", "content", "extra-content"]); |
|
145 | 145 | return parent::compile($js, $view); |
146 | 146 | } |
147 | 147 | |
148 | - public function asLink($href="",$target=NULL) { |
|
148 | + public function asLink($href="", $target=NULL) { |
|
149 | 149 | $this->addToProperty("class", "link"); |
150 | - if ($href !== "") { |
|
150 | + if ($href!=="") { |
|
151 | 151 | $this->setProperty("href", $href); |
152 | 152 | if (isset($target)) |
153 | 153 | $this->setProperty("target", $target); |
@@ -12,34 +12,34 @@ discard block |
||
12 | 12 | use Ajax\semantic\html\base\traits\MenuItemTrait; |
13 | 13 | |
14 | 14 | class HtmlDropdownItem extends HtmlSemDoubleElement { |
15 | - use IconTrait,MenuItemTrait; |
|
16 | - public function __construct($identifier, $content="",$value=NULL,$image=NULL,$description=NULL) { |
|
15 | + use IconTrait, MenuItemTrait; |
|
16 | + public function __construct($identifier, $content="", $value=NULL, $image=NULL, $description=NULL) { |
|
17 | 17 | parent::__construct($identifier, "a"); |
18 | 18 | $this->setClass("item"); |
19 | 19 | $this->setContent($content); |
20 | - if($value!==NULL) |
|
20 | + if ($value!==NULL) |
|
21 | 21 | $this->setData($value); |
22 | - if($image!==NULL) |
|
22 | + if ($image!==NULL) |
|
23 | 23 | $this->asMiniAvatar($image); |
24 | - if($description!==NULL) |
|
24 | + if ($description!==NULL) |
|
25 | 25 | $this->setDescription($description); |
26 | 26 | } |
27 | 27 | |
28 | - public function setDescription($description){ |
|
29 | - $descO=new HtmlDoubleElement("desc-".$this->identifier,"span"); |
|
28 | + public function setDescription($description) { |
|
29 | + $descO=new HtmlDoubleElement("desc-".$this->identifier, "span"); |
|
30 | 30 | $descO->setClass("description"); |
31 | 31 | $descO->setContent($description); |
32 | - return $this->addContent($descO,true); |
|
32 | + return $this->addContent($descO, true); |
|
33 | 33 | } |
34 | 34 | |
35 | - public function setData($value){ |
|
35 | + public function setData($value) { |
|
36 | 36 | $this->setProperty("data-value", $value); |
37 | 37 | return $this; |
38 | 38 | } |
39 | 39 | |
40 | - public function asOption(){ |
|
40 | + public function asOption() { |
|
41 | 41 | $this->tagName="option"; |
42 | - if($this->getProperty("data-value")!==null) |
|
42 | + if ($this->getProperty("data-value")!==null) |
|
43 | 43 | $this->setProperty("value", $this->getProperty("data-value")); |
44 | 44 | } |
45 | 45 | |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | * @param string $image the image src |
48 | 48 | * @return $this |
49 | 49 | */ |
50 | - public function asMiniAvatar($image){ |
|
50 | + public function asMiniAvatar($image) { |
|
51 | 51 | $this->tagName="div"; |
52 | - $img=new HtmlImg("image-".$this->identifier,$image); |
|
52 | + $img=new HtmlImg("image-".$this->identifier, $image); |
|
53 | 53 | $img->setClass("ui mini avatar image"); |
54 | - $this->addContent($img,true); |
|
54 | + $this->addContent($img, true); |
|
55 | 55 | return $this; |
56 | 56 | } |
57 | 57 | |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | * @param string $icon |
61 | 61 | * @return HtmlDropdownItem |
62 | 62 | */ |
63 | - public function asIcon($caption,$icon){ |
|
63 | + public function asIcon($caption, $icon) { |
|
64 | 64 | $this->setContent($caption); |
65 | - $this->addContent(new HtmlIcon("", $icon),true); |
|
65 | + $this->addContent(new HtmlIcon("", $icon), true); |
|
66 | 66 | return $this; |
67 | 67 | } |
68 | 68 | |
@@ -71,23 +71,23 @@ discard block |
||
71 | 71 | * @param string $color |
72 | 72 | * @return HtmlDropdownItem |
73 | 73 | */ |
74 | - public function asCircularLabel($caption,$color){ |
|
74 | + public function asCircularLabel($caption, $color) { |
|
75 | 75 | $this->setContent($caption); |
76 | 76 | $lbl=new HtmlLabel(""); |
77 | 77 | $lbl->setCircular()->setColor($color)->setEmpty(); |
78 | - $this->addContent($lbl,true); |
|
78 | + $this->addContent($lbl, true); |
|
79 | 79 | return $this; |
80 | 80 | } |
81 | 81 | |
82 | 82 | |
83 | 83 | |
84 | 84 | public function addMenuItem($items) { |
85 | - $menu=new HtmlMenu("menu-" . $this->identifier, $items); |
|
85 | + $menu=new HtmlMenu("menu-".$this->identifier, $items); |
|
86 | 86 | $content=$this->content; |
87 | 87 | $this->setTagName("div"); |
88 | 88 | $this->setProperty("class", "item"); |
89 | 89 | $icon=new HtmlIcon("", "dropdown"); |
90 | - $this->content=[$icon,new HtmlSemDoubleElement("","span","text",$content),$menu]; |
|
90 | + $this->content=[$icon, new HtmlSemDoubleElement("", "span", "text", $content), $menu]; |
|
91 | 91 | return $menu; |
92 | 92 | } |
93 | 93 | |
@@ -96,14 +96,14 @@ discard block |
||
96 | 96 | * @param string $icon |
97 | 97 | * @return HtmlDropdownItem |
98 | 98 | */ |
99 | - public static function searchInput($placeholder=NULL,$icon=NULL){ |
|
100 | - return (new HtmlDropdownItem(""))->asSearchInput($placeholder,$icon); |
|
99 | + public static function searchInput($placeholder=NULL, $icon=NULL) { |
|
100 | + return (new HtmlDropdownItem(""))->asSearchInput($placeholder, $icon); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
104 | 104 | * @return HtmlDropdownItem |
105 | 105 | */ |
106 | - public static function divider(){ |
|
106 | + public static function divider() { |
|
107 | 107 | return (new HtmlDropdownItem(""))->asDivider(); |
108 | 108 | } |
109 | 109 | |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | * @param string $icon |
113 | 113 | * @return HtmlDropdownItem |
114 | 114 | */ |
115 | - public static function header($caption=NULL,$icon=NULL){ |
|
116 | - return (new HtmlDropdownItem(""))->asHeader($caption,$icon); |
|
115 | + public static function header($caption=NULL, $icon=NULL) { |
|
116 | + return (new HtmlDropdownItem(""))->asHeader($caption, $icon); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | * @param string $color |
122 | 122 | * @return HtmlDropdownItem |
123 | 123 | */ |
124 | - public static function circular($caption,$color){ |
|
125 | - return (new HtmlDropdownItem(""))->asCircularLabel($caption,$color); |
|
124 | + public static function circular($caption, $color) { |
|
125 | + return (new HtmlDropdownItem(""))->asCircularLabel($caption, $color); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -130,8 +130,8 @@ discard block |
||
130 | 130 | * @param string $icon |
131 | 131 | * @return HtmlDropdownItem |
132 | 132 | */ |
133 | - public static function icon($caption,$icon){ |
|
134 | - return (new HtmlDropdownItem(""))->asIcon($caption,$icon); |
|
133 | + public static function icon($caption, $icon) { |
|
134 | + return (new HtmlDropdownItem(""))->asIcon($caption, $icon); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | * @param string $image |
140 | 140 | * @return HtmlDropdownItem |
141 | 141 | */ |
142 | - public static function avatar($caption,$image){ |
|
143 | - $dd=new HtmlDropdownItem("",$caption); |
|
142 | + public static function avatar($caption, $image) { |
|
143 | + $dd=new HtmlDropdownItem("", $caption); |
|
144 | 144 | $dd->asMiniAvatar($image); |
145 | 145 | return $dd; |
146 | 146 | } |
@@ -38,22 +38,22 @@ discard block |
||
38 | 38 | return $this->getHtmlCk()->attachEvents($events); |
39 | 39 | } |
40 | 40 | |
41 | - public function getField(){ |
|
41 | + public function getField() { |
|
42 | 42 | return $this->content["field"]; |
43 | 43 | } |
44 | 44 | |
45 | - public function getHtmlCk(){ |
|
45 | + public function getHtmlCk() { |
|
46 | 46 | return $this->content["field"]; |
47 | 47 | } |
48 | 48 | |
49 | - public function setName($name){ |
|
49 | + public function setName($name) { |
|
50 | 50 | $this->getDataField()->setProperty("name", $name); |
51 | 51 | return $this; |
52 | 52 | } |
53 | 53 | |
54 | - public function getDataField(){ |
|
55 | - $field= $this->getField(); |
|
56 | - if($field instanceof AbstractCheckbox) |
|
54 | + public function getDataField() { |
|
55 | + $field=$this->getField(); |
|
56 | + if ($field instanceof AbstractCheckbox) |
|
57 | 57 | $field=$field->getField(); |
58 | 58 | return $field; |
59 | 59 | } |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | * @param boolean $value |
64 | 64 | * @return $this |
65 | 65 | */ |
66 | - public function setChecked($value=true){ |
|
67 | - if($value===true){ |
|
66 | + public function setChecked($value=true) { |
|
67 | + if ($value===true) { |
|
68 | 68 | $this->getDataField()->setProperty("checked", "checked"); |
69 | - }else{ |
|
69 | + } else { |
|
70 | 70 | $this->getDataField()->removeProperty("checked"); |
71 | 71 | } |
72 | 72 | return $this; |
@@ -9,25 +9,25 @@ |
||
9 | 9 | class HtmlMenuItem extends HtmlSemDoubleElement { |
10 | 10 | use MenuItemTrait; |
11 | 11 | public function __construct($identifier, $content) { |
12 | - parent::__construct($identifier,"div","item",$content); |
|
12 | + parent::__construct($identifier, "div", "item", $content); |
|
13 | 13 | } |
14 | 14 | |
15 | - protected function initContent($content){ |
|
16 | - if(\is_array($content)){ |
|
17 | - if(JArray::isAssociative($content)===false){ |
|
15 | + protected function initContent($content) { |
|
16 | + if (\is_array($content)) { |
|
17 | + if (JArray::isAssociative($content)===false) { |
|
18 | 18 | $icon=@$content[0]; |
19 | 19 | $title=@$content[1]; |
20 | - }else{ |
|
20 | + } else { |
|
21 | 21 | $icon=@$content["icon"]; |
22 | 22 | $title=@$content["title"]; |
23 | 23 | } |
24 | - if(isset($icon)){ |
|
24 | + if (isset($icon)) { |
|
25 | 25 | $this->addIcon($icon); |
26 | 26 | } |
27 | - if(isset($title)){ |
|
27 | + if (isset($title)) { |
|
28 | 28 | $this->setTitle($title); |
29 | 29 | } |
30 | - }else{ |
|
30 | + } else { |
|
31 | 31 | $this->setContent($content); |
32 | 32 | } |
33 | 33 | } |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | protected $_contentSeparator=""; |
28 | 28 | |
29 | 29 | |
30 | - public function __construct($identifier,$tagName,$baseClass){ |
|
31 | - parent::__construct($identifier,$tagName,$baseClass); |
|
30 | + public function __construct($identifier, $tagName, $baseClass) { |
|
31 | + parent::__construct($identifier, $tagName, $baseClass); |
|
32 | 32 | $this->root=""; |
33 | 33 | $this->attr="data-ajax"; |
34 | 34 | } |
@@ -38,37 +38,37 @@ discard block |
||
38 | 38 | * @param string $targetSelector the target of the get |
39 | 39 | * @return HtmlSemNavElement |
40 | 40 | */ |
41 | - public function autoGetOnClick($targetSelector){ |
|
42 | - return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); |
|
41 | + public function autoGetOnClick($targetSelector) { |
|
42 | + return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr)); |
|
43 | 43 | } |
44 | 44 | |
45 | - public function contentAsString(){ |
|
45 | + public function contentAsString() { |
|
46 | 46 | return JArray::implode($this->_contentSeparator, $this->content); |
47 | 47 | } |
48 | 48 | |
49 | - public function setContentDivider($divider,$index=NULL) { |
|
49 | + public function setContentDivider($divider, $index=NULL) { |
|
50 | 50 | $divider="<div class='divider'> {$divider} </div>"; |
51 | 51 | return $this->setDivider($divider, $index); |
52 | 52 | } |
53 | 53 | |
54 | - public function setIconContentDivider($iconContentDivider,$index=NULL) { |
|
54 | + public function setIconContentDivider($iconContentDivider, $index=NULL) { |
|
55 | 55 | $contentDivider="<i class='".$iconContentDivider." icon divider'></i>"; |
56 | 56 | return $this->setDivider($contentDivider, $index); |
57 | 57 | } |
58 | 58 | |
59 | - protected function setDivider($divider,$index){ |
|
60 | - if(isset($index)){ |
|
61 | - if(!\is_array($this->_contentSeparator)) |
|
62 | - $this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator); |
|
59 | + protected function setDivider($divider, $index) { |
|
60 | + if (isset($index)) { |
|
61 | + if (!\is_array($this->_contentSeparator)) |
|
62 | + $this->_contentSeparator=array_fill(0, $this->count()-1, $this->_contentSeparator); |
|
63 | 63 | $this->_contentSeparator[$index]=$divider; |
64 | - }else{ |
|
64 | + } else { |
|
65 | 65 | $this->_contentSeparator=$divider; |
66 | 66 | } |
67 | 67 | return $this; |
68 | 68 | } |
69 | 69 | |
70 | - protected function getContentDivider($index){ |
|
71 | - if(\is_array($this->_contentSeparator)){ |
|
70 | + protected function getContentDivider($index) { |
|
71 | + if (\is_array($this->_contentSeparator)) { |
|
72 | 72 | return @$this->_contentSeparator[$index]; |
73 | 73 | } |
74 | 74 | return $this->_contentSeparator; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * @return HtmlIcon |
26 | 26 | */ |
27 | - public function getItem($index){ |
|
27 | + public function getItem($index) { |
|
28 | 28 | return parent::getItem($index); |
29 | 29 | } |
30 | 30 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $icon=JArray::getValue($value, "icon", 0); |
35 | 35 | $size=JArray::getValue($value, "size", 1); |
36 | 36 | } |
37 | - $iconO=new HtmlIcon("icon-" . $this->identifier, $icon); |
|
37 | + $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
|
38 | 38 | if (isset($size)) { |
39 | 39 | $iconO->setSize($size); |
40 | 40 | } |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | protected function createCondition($value) { |
45 | - return ($value instanceof HtmlIcon) === false; |
|
45 | + return ($value instanceof HtmlIcon)===false; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | public function getIcon($index) { |
49 | 49 | return $this->content[$index]; |
50 | 50 | } |
51 | 51 | |
52 | - public function run(JsUtils $js){ |
|
53 | - $result= parent::run($js); |
|
52 | + public function run(JsUtils $js) { |
|
53 | + $result=parent::run($js); |
|
54 | 54 | return $result->setItemSelector("i"); |
55 | 55 | } |
56 | 56 | |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | return $this; |
60 | 60 | } |
61 | 61 | |
62 | - public static function corner($mainIcon,$cornerIcon,$size="huge"){ |
|
63 | - $icons=new HtmlIconGroups("icons",[$mainIcon,$cornerIcon],$size); |
|
62 | + public static function corner($mainIcon, $cornerIcon, $size="huge") { |
|
63 | + $icons=new HtmlIconGroups("icons", [$mainIcon, $cornerIcon], $size); |
|
64 | 64 | return $icons->toCorner(1); |
65 | 65 | } |
66 | 66 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @return HtmlIcon |
70 | 70 | */ |
71 | 71 | public function setFlipped($sens="horizontally") { |
72 | - return $this->addToProperty("class", "flipped " . $sens); |
|
72 | + return $this->addToProperty("class", "flipped ".$sens); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @return HtmlIcon |
79 | 79 | */ |
80 | 80 | public function setRotated($sens="clockwise") { |
81 | - return $this->addToProperty("class", "rotated " . $sens); |
|
81 | + return $this->addToProperty("class", "rotated ".$sens); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -87,12 +87,12 @@ discard block |
||
87 | 87 | * @param string $target |
88 | 88 | * @return HtmlIcon |
89 | 89 | */ |
90 | - public function asLink($href=NULL,$target=NULL) { |
|
90 | + public function asLink($href=NULL, $target=NULL) { |
|
91 | 91 | if (isset($href)) { |
92 | 92 | $_target=""; |
93 | - if(isset($target)) |
|
93 | + if (isset($target)) |
|
94 | 94 | $_target="target='{$target}'"; |
95 | - $this->wrap("<a href='" . $href . "' {$_target}>", "</a>"); |
|
95 | + $this->wrap("<a href='".$href."' {$_target}>", "</a>"); |
|
96 | 96 | } |
97 | 97 | return $this->addToProperty("class", "link"); |
98 | 98 | } |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function setBordered($inverted=false) { |
110 | 110 | $invertedStr=""; |
111 | - if ($inverted !== false) |
|
111 | + if ($inverted!==false) |
|
112 | 112 | $invertedStr=" inverted"; |
113 | - return $this->addToProperty("class", "bordered" . $invertedStr); |
|
113 | + return $this->addToProperty("class", "bordered".$invertedStr); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -122,11 +122,11 @@ discard block |
||
122 | 122 | } |
123 | 123 | |
124 | 124 | public function addLabel($label, $before=false, $icon=NULL) { |
125 | - if($before) |
|
125 | + if ($before) |
|
126 | 126 | $this->wrap($label); |
127 | 127 | else |
128 | 128 | $this->wrap("", $label); |
129 | - if(isset($icon)) |
|
129 | + if (isset($icon)) |
|
130 | 130 | $this->addToIcon($icon); |
131 | 131 | return $this; |
132 | 132 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | abstract class HtmlViewGroups extends HtmlSemCollection { |
11 | 11 | |
12 | - public function __construct($identifier, $uiClass,$items=array()) { |
|
12 | + public function __construct($identifier, $uiClass, $items=array()) { |
|
13 | 13 | parent::__construct($identifier, "div", $uiClass); |
14 | 14 | $this->addItems($items); |
15 | 15 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param int $wide |
42 | 42 | */ |
43 | 43 | public function setWide($wide) { |
44 | - $wide=Wide::getConstants()["W" . $wide]; |
|
44 | + $wide=Wide::getConstants()["W".$wide]; |
|
45 | 45 | return $this->addToPropertyCtrl("class", $wide, Wide::getConstants()); |
46 | 46 | } |
47 | 47 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * @return HtmlViewGroups |
52 | 52 | */ |
53 | - public function getItem($index){ |
|
53 | + public function getItem($index) { |
|
54 | 54 | return parent::getItem($index); |
55 | 55 | } |
56 | 56 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | return $this->addItem($function($object)); |
66 | 66 | } |
67 | 67 | |
68 | - public function run(JsUtils $js){ |
|
68 | + public function run(JsUtils $js) { |
|
69 | 69 | $result=parent::run($js); |
70 | 70 | return $result->setItemSelector(".item"); |
71 | 71 | } |