@@ -15,18 +15,18 @@ discard block |
||
15 | 15 | private $_hasIcon=false; |
16 | 16 | |
17 | 17 | protected abstract function addToPropertyCtrl($name, $value, $typeCtrl); |
18 | - public abstract function addContent($content,$before=false); |
|
18 | + public abstract function addContent($content, $before=false); |
|
19 | 19 | |
20 | - public function addIcon($icon,$direction=Direction::LEFT){ |
|
21 | - if($this->_hasIcon===false){ |
|
20 | + public function addIcon($icon, $direction=Direction::LEFT) { |
|
21 | + if ($this->_hasIcon===false) { |
|
22 | 22 | $iconO=$icon; |
23 | - if(\is_string($icon)){ |
|
23 | + if (\is_string($icon)) { |
|
24 | 24 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
25 | 25 | } |
26 | 26 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
27 | - $this->addContent($iconO,$direction===Direction::LEFT); |
|
27 | + $this->addContent($iconO, $direction===Direction::LEFT); |
|
28 | 28 | $this->_hasIcon=true; |
29 | - }else{ |
|
29 | + } else { |
|
30 | 30 | $iconO=$this->getIcon(); |
31 | 31 | $iconO->setIcon($icon); |
32 | 32 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | return $iconO; |
35 | 35 | } |
36 | 36 | |
37 | - public function getIcon(){ |
|
38 | - if(\is_array($this->content)){ |
|
39 | - foreach ($this->content as $item){ |
|
40 | - if($item instanceof HtmlIcon) |
|
37 | + public function getIcon() { |
|
38 | + if (\is_array($this->content)) { |
|
39 | + foreach ($this->content as $item) { |
|
40 | + if ($item instanceof HtmlIcon) |
|
41 | 41 | return $item; |
42 | 42 | } |
43 | 43 | } |
@@ -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 \Ajax\common\html\html5\HtmlImg |
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 \Ajax\semantic\html\content\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 \Ajax\semantic\html\content\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 \Ajax\semantic\html\content\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 \Ajax\semantic\html\content\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 \Ajax\semantic\html\content\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 \Ajax\semantic\html\content\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 \Ajax\semantic\html\content\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,7 +139,7 @@ discard block |
||
139 | 139 | * @param unknown $image |
140 | 140 | * @return \Ajax\semantic\html\content\HtmlDropdownItem |
141 | 141 | */ |
142 | - public static function avatar($caption,$image){ |
|
143 | - return (new HtmlDropdownItem("",$caption))->asMiniAvatar($image); |
|
142 | + public static function avatar($caption, $image) { |
|
143 | + return (new HtmlDropdownItem("", $caption))->asMiniAvatar($image); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | \ No newline at end of file |
@@ -17,19 +17,19 @@ discard block |
||
17 | 17 | class HtmlCard extends HtmlSemDoubleElement { |
18 | 18 | |
19 | 19 | public function __construct($identifier) { |
20 | - parent::__construct($identifier, "div", "ui card", array ()); |
|
20 | + parent::__construct($identifier, "div", "ui card", array()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | private function createContent($content, $baseClass="content") { |
24 | 24 | $count=\sizeof($this->content); |
25 | - $result=new HtmlCardContent("content-" . $count . "-" . $this->identifier, $content); |
|
25 | + $result=new HtmlCardContent("content-".$count."-".$this->identifier, $content); |
|
26 | 26 | $result->setClass($baseClass); |
27 | 27 | return $result; |
28 | 28 | } |
29 | 29 | |
30 | 30 | private function addElementInContent($key, $element) { |
31 | - if (\array_key_exists($key, $this->content) === false) { |
|
32 | - $this->content[$key]=array (); |
|
31 | + if (\array_key_exists($key, $this->content)===false) { |
|
32 | + $this->content[$key]=array(); |
|
33 | 33 | } |
34 | 34 | $this->content[$key][]=$element; |
35 | 35 | return $element; |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | |
47 | 47 | public function addHeader($header, $niveau=4, $type="page") { |
48 | 48 | if (!$header instanceof HtmlHeader) { |
49 | - $header=new HtmlHeader("header-" . $this->identifier, $niveau, $header, $type); |
|
49 | + $header=new HtmlHeader("header-".$this->identifier, $niveau, $header, $type); |
|
50 | 50 | } |
51 | 51 | $this->content["header"]=$this->createContent($header); |
52 | 52 | } |
53 | 53 | |
54 | 54 | public function addImage($image, $title="") { |
55 | 55 | if (!$image instanceof HtmlImage) { |
56 | - $image=new HtmlImage("image-" . $this->identifier, $image, $title); |
|
56 | + $image=new HtmlImage("image-".$this->identifier, $image, $title); |
|
57 | 57 | } |
58 | 58 | $image->setClass("image"); |
59 | 59 | return $this->addElementInContent("content", $image); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | public function addReveal($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL) { |
63 | 63 | $reveal=$visibleContent; |
64 | 64 | if (!$visibleContent instanceof HtmlReveal) { |
65 | - $reveal=new HtmlReveal("reveral-" . $this->identifier, $visibleContent, $hiddenContent, $type, $attributeType); |
|
65 | + $reveal=new HtmlReveal("reveral-".$this->identifier, $visibleContent, $hiddenContent, $type, $attributeType); |
|
66 | 66 | } |
67 | 67 | return $this->addElementInContent("content", $reveal); |
68 | 68 | } |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | * @param string $asIcons |
92 | 92 | * @return \Ajax\semantic\html\elements\HtmlButtonGroups |
93 | 93 | */ |
94 | - public function addButtons($elements=array(), $asIcons=false){ |
|
95 | - $buttons=new HtmlButtonGroups("buttons-".$this->identifier,$elements,$asIcons); |
|
94 | + public function addButtons($elements=array(), $asIcons=false) { |
|
95 | + $buttons=new HtmlButtonGroups("buttons-".$this->identifier, $elements, $asIcons); |
|
96 | 96 | $this->addElementInContent("content", $buttons); |
97 | 97 | return $buttons; |
98 | 98 | } |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | |
102 | 102 | public function addCardHeaderContent($header, $metas=array(), $description=NULL) { |
103 | 103 | $count=\sizeof($this->content); |
104 | - return $this->addElementInContent("content", new HtmlCardHeaderContent("content-" . $count . "-" . $this->identifier, $header, $metas, $description)); |
|
104 | + return $this->addElementInContent("content", new HtmlCardHeaderContent("content-".$count."-".$this->identifier, $header, $metas, $description)); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | public function addCardContent($content=array()) { |
108 | 108 | $count=\sizeof($this->content); |
109 | - return $this->addElementInContent("content", new HtmlCardContent("content-" . $count . "-" . $this->identifier, $content)); |
|
109 | + return $this->addElementInContent("content", new HtmlCardContent("content-".$count."-".$this->identifier, $content)); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | public function getCardContent($index=NULL) { |
@@ -132,13 +132,13 @@ discard block |
||
132 | 132 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
133 | 133 | */ |
134 | 134 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
135 | - $this->content=JArray::sortAssociative($this->content, [ "header","image","content","extra-content" ]); |
|
135 | + $this->content=JArray::sortAssociative($this->content, ["header", "image", "content", "extra-content"]); |
|
136 | 136 | return parent::compile($js, $view); |
137 | 137 | } |
138 | 138 | |
139 | 139 | public function asLink($href="") { |
140 | 140 | $this->addToProperty("class", "link"); |
141 | - if ($href !== "") { |
|
141 | + if ($href!=="") { |
|
142 | 142 | $this->setProperty("href", $href); |
143 | 143 | } |
144 | 144 | return $this; |
@@ -15,33 +15,33 @@ discard block |
||
15 | 15 | |
16 | 16 | public function __construct($identifier, $elements=array(), $asIcons=false) { |
17 | 17 | parent::__construct($identifier, "div", "ui buttons"); |
18 | - if ($asIcons === true) |
|
18 | + if ($asIcons===true) |
|
19 | 19 | $this->asIcons(); |
20 | 20 | $this->addElements($elements, $asIcons); |
21 | 21 | } |
22 | - protected function createItem($value){ |
|
23 | - return new HtmlButton("button-" . $this->identifier . "-" . \sizeof($this->content), $value); |
|
22 | + protected function createItem($value) { |
|
23 | + return new HtmlButton("button-".$this->identifier."-".\sizeof($this->content), $value); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | 27 | public function addElement($element, $asIcon=false) { |
28 | 28 | $item=$this->addItem($element); |
29 | - if($asIcon) |
|
29 | + if ($asIcon) |
|
30 | 30 | $item->asIcon($element); |
31 | 31 | return $item; |
32 | 32 | } |
33 | 33 | |
34 | 34 | public function addElements($elements, $asIcons=false) { |
35 | - foreach ( $elements as $element ) { |
|
35 | + foreach ($elements as $element) { |
|
36 | 36 | $this->addElement($element, $asIcons); |
37 | 37 | } |
38 | 38 | return $this; |
39 | 39 | } |
40 | 40 | |
41 | 41 | public function insertOr($aferIndex=0, $or="or") { |
42 | - $orElement=new HtmlSemDoubleElement("or-" . $this->identifier, "div", "or"); |
|
42 | + $orElement=new HtmlSemDoubleElement("or-".$this->identifier, "div", "or"); |
|
43 | 43 | $orElement->setProperty("data-text", $or); |
44 | - array_splice($this->content, $aferIndex + 1, 0, array ($orElement )); |
|
44 | + array_splice($this->content, $aferIndex+1, 0, array($orElement)); |
|
45 | 45 | return $this; |
46 | 46 | } |
47 | 47 | |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | public function asIcons() { |
57 | - foreach ( $this->content as $item ) { |
|
58 | - if($item instanceof HtmlButton) |
|
57 | + foreach ($this->content as $item) { |
|
58 | + if ($item instanceof HtmlButton) |
|
59 | 59 | $item->asIcon($item->getContent()); |
60 | 60 | } |
61 | 61 | return $this->addToProperty("class", "icons"); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @see \Ajax\bootstrap\html\base\BaseHtml::on() |
89 | 89 | */ |
90 | 90 | public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
91 | - foreach ( $this->content as $element ) { |
|
91 | + foreach ($this->content as $element) { |
|
92 | 92 | $element->on($event, $jsCode, $stopPropagation, $preventDefault); |
93 | 93 | } |
94 | 94 | return $this; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | public function addClasses($classes=array()) { |
102 | 102 | $i=0; |
103 | - foreach ( $this->content as $button ) { |
|
103 | + foreach ($this->content as $button) { |
|
104 | 104 | $button->addToProperty("class", $classes[$i++]); |
105 | 105 | } |
106 | 106 | return $this; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @return \Ajax\semantic\html\elements\HtmlDivider |
23 | 23 | */ |
24 | 24 | public function setVertical() { |
25 | - return $this->addToPropertyCtrl("class", "vertical", array ("vertical","horizontal" )); |
|
25 | + return $this->addToPropertyCtrl("class", "vertical", array("vertical", "horizontal")); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @return \Ajax\semantic\html\elements\HtmlDivider |
31 | 31 | */ |
32 | 32 | public function setHorizontal() { |
33 | - return $this->addToPropertyCtrl("class", "horizontal", array ("vertical","horizontal" )); |
|
33 | + return $this->addToPropertyCtrl("class", "horizontal", array("vertical", "horizontal")); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | return $this->addToProperty("class", "inverted"); |
66 | 66 | } |
67 | 67 | |
68 | - public function setIgnored(){ |
|
68 | + public function setIgnored() { |
|
69 | 69 | return $this->addToProperty("class", "ignored"); |
70 | 70 | } |
71 | 71 | } |
72 | 72 | \ No newline at end of file |
@@ -5,13 +5,13 @@ |
||
5 | 5 | |
6 | 6 | class HtmlShapeItem extends HtmlSemDoubleElement { |
7 | 7 | public function __construct($identifier, $content) { |
8 | - parent::__construct($identifier,"div","side",$content); |
|
8 | + parent::__construct($identifier, "div", "side", $content); |
|
9 | 9 | } |
10 | 10 | |
11 | - public function setActive($value=true){ |
|
12 | - if($value){ |
|
11 | + public function setActive($value=true) { |
|
12 | + if ($value) { |
|
13 | 13 | $this->addToPropertyCtrl("class", "active", ["active"]); |
14 | - }else{ |
|
14 | + } else { |
|
15 | 15 | $this->removePropertyValue("class", "active"); |
16 | 16 | } |
17 | 17 | return $this; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | abstract class HtmlAbsractItem extends HtmlSemDoubleElement { |
13 | 13 | |
14 | - public function __construct($identifier, $baseClass,$content=NULL) { |
|
14 | + public function __construct($identifier, $baseClass, $content=NULL) { |
|
15 | 15 | parent::__construct($identifier, "div", $baseClass); |
16 | 16 | $this->content=array(); |
17 | 17 | $this->initContent($content); |
@@ -19,53 +19,53 @@ discard block |
||
19 | 19 | |
20 | 20 | protected abstract function initContent($content); |
21 | 21 | |
22 | - public function setIcon($icon){ |
|
22 | + public function setIcon($icon) { |
|
23 | 23 | $this->content["icon"]=new HtmlIcon("icon-".$this->identifier, $icon); |
24 | 24 | } |
25 | 25 | |
26 | - public function setImage($image){ |
|
26 | + public function setImage($image) { |
|
27 | 27 | $image=new HtmlImg("icon-".$this->identifier, $image); |
28 | 28 | $image->asAvatar(); |
29 | 29 | $this->content["image"]=$image; |
30 | 30 | } |
31 | 31 | |
32 | - private function createContent(){ |
|
33 | - $this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier,"div","content"); |
|
32 | + private function createContent() { |
|
33 | + $this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content"); |
|
34 | 34 | return $this->content["content"]; |
35 | 35 | } |
36 | 36 | |
37 | - public function setTitle($title,$description=NULL,$baseClass="title"){ |
|
38 | - $title=new HtmlSemDoubleElement("","div",$baseClass,$title); |
|
39 | - if(\array_key_exists("content", $this->content)===false){ |
|
37 | + public function setTitle($title, $description=NULL, $baseClass="title") { |
|
38 | + $title=new HtmlSemDoubleElement("", "div", $baseClass, $title); |
|
39 | + if (\array_key_exists("content", $this->content)===false) { |
|
40 | 40 | $this->createContent(); |
41 | 41 | } |
42 | 42 | $this->content["content"]->addContent($title); |
43 | - if(isset($description)){ |
|
44 | - $description=new HtmlSemDoubleElement("","div","description",$description); |
|
43 | + if (isset($description)) { |
|
44 | + $description=new HtmlSemDoubleElement("", "div", "description", $description); |
|
45 | 45 | $this->content["content"]->addContent($description); |
46 | 46 | } |
47 | 47 | return $this; |
48 | 48 | } |
49 | 49 | |
50 | - public function getPart($partName="header"){ |
|
51 | - $content=\array_merge($this->content["content"]->getContent(),array(@$this->content["icon"],@$this->content["image"])); |
|
50 | + public function getPart($partName="header") { |
|
51 | + $content=\array_merge($this->content["content"]->getContent(), array(@$this->content["icon"], @$this->content["image"])); |
|
52 | 52 | return $this->getElementByPropertyValue("class", $partName, $content); |
53 | 53 | } |
54 | 54 | |
55 | - public function setActive($value=true){ |
|
56 | - if($value){ |
|
55 | + public function setActive($value=true) { |
|
56 | + if ($value) { |
|
57 | 57 | $this->setTagName("div"); |
58 | 58 | $this->removeProperty("href"); |
59 | 59 | $this->addToPropertyCtrl("class", "active", array("active")); |
60 | - }else{ |
|
60 | + } else { |
|
61 | 61 | $this->removePropertyValue("class", "active"); |
62 | 62 | } |
63 | 63 | return $this; |
64 | 64 | } |
65 | 65 | |
66 | - public function asLink($href=NULL,$part=NULL){ |
|
66 | + public function asLink($href=NULL, $part=NULL) { |
|
67 | 67 | $this->setTagName("a"); |
68 | - if(isset($href)) |
|
68 | + if (isset($href)) |
|
69 | 69 | $this->setProperty("href", $href); |
70 | 70 | return $this; |
71 | 71 | } |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
78 | 78 | */ |
79 | 79 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
80 | - if(\is_array($this->content)) |
|
81 | - $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
80 | + if (\is_array($this->content)) |
|
81 | + $this->content=JArray::sortAssociative($this->content, ["icon", "image", "content"]); |
|
82 | 82 | return parent::compile($js, $view); |
83 | 83 | } |
84 | 84 | } |
85 | 85 | \ No newline at end of file |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | * @version 1.001 |
11 | 11 | */ |
12 | 12 | abstract class BaseComponent { |
13 | - public $jquery_code_for_compile=array (); |
|
14 | - protected $params=array (); |
|
13 | + public $jquery_code_for_compile=array(); |
|
14 | + protected $params=array(); |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | public function setParams($params) { |
71 | - foreach ( $params as $k => $v ) { |
|
71 | + foreach ($params as $k => $v) { |
|
72 | 72 | $method="set".ucfirst($k); |
73 | 73 | if (method_exists($this, $method)) |
74 | 74 | $this->$method($v); |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | return $this; |
82 | 82 | } |
83 | 83 | |
84 | - public function addParams($params){ |
|
85 | - foreach ($params as $k=>$v){ |
|
84 | + public function addParams($params) { |
|
85 | + foreach ($params as $k=>$v) { |
|
86 | 86 | $this->setParam($k, $v); |
87 | 87 | } |
88 | 88 | return $this; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | use BaseTrait; |
22 | 22 | protected $_popup=NULL; |
23 | 23 | protected $_dimmer=NULL; |
24 | - protected $_params=array (); |
|
24 | + protected $_params=array(); |
|
25 | 25 | |
26 | 26 | |
27 | 27 | public function __construct($identifier, $tagName="p", $baseClass="ui", $content=NULL) { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | public function addDimmer($params=array(), $content=NULL) { |
54 | - $dimmer=new HtmlDimmer("dimmer-" . $this->identifier, $content); |
|
54 | + $dimmer=new HtmlDimmer("dimmer-".$this->identifier, $content); |
|
55 | 55 | $dimmer->setParams($params); |
56 | 56 | $dimmer->setContainer($this); |
57 | 57 | $this->addContent($dimmer); |
@@ -60,20 +60,20 @@ discard block |
||
60 | 60 | |
61 | 61 | public function addLabel($label, $before=false, $icon=NULL) { |
62 | 62 | $labelO=$label; |
63 | - if (\is_object($label) === false) { |
|
64 | - $labelO=new HtmlLabel("label-" . $this->identifier, $label); |
|
63 | + if (\is_object($label)===false) { |
|
64 | + $labelO=new HtmlLabel("label-".$this->identifier, $label); |
|
65 | 65 | if (isset($icon)) |
66 | 66 | $labelO->addIcon($icon); |
67 | 67 | } else { |
68 | - $labelO->addToPropertyCtrl("class", "label", array ("label" )); |
|
68 | + $labelO->addToPropertyCtrl("class", "label", array("label")); |
|
69 | 69 | } |
70 | 70 | $this->addContent($labelO, $before); |
71 | 71 | return $labelO; |
72 | 72 | } |
73 | 73 | |
74 | - public function attachLabel($label,$side,$direction=Direction::NONE,$icon=NULL){ |
|
75 | - $label=$this->addLabel($label,true,$icon); |
|
76 | - $label->setAttached($side,$direction); |
|
74 | + public function attachLabel($label, $side, $direction=Direction::NONE, $icon=NULL) { |
|
75 | + $label=$this->addLabel($label, true, $icon); |
|
76 | + $label->setAttached($side, $direction); |
|
77 | 77 | return $this; |
78 | 78 | } |
79 | 79 | |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | |
90 | 90 | public function jsShowDimmer($show=true) { |
91 | 91 | $status="hide"; |
92 | - if ($show === true) |
|
92 | + if ($show===true) |
|
93 | 93 | $status="show"; |
94 | - return '$("#.' . $this->identifier . ').dimmer("' . $status . '");'; |
|
94 | + return '$("#.'.$this->identifier.').dimmer("'.$status.'");'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | public function run(JsUtils $js) { |
104 | - $this->_bsComponent=$js->semantic()->generic("#" . $this->identifier); |
|
104 | + $this->_bsComponent=$js->semantic()->generic("#".$this->identifier); |
|
105 | 105 | parent::run($js); |
106 | 106 | $this->addEventsOnRun($js); |
107 | 107 | if (isset($this->_popup)) { |