@@ -6,7 +6,6 @@ |
||
6 | 6 | use Ajax\semantic\html\content\table\HtmlTableContent; |
7 | 7 | use Ajax\semantic\html\base\constants\Variation; |
8 | 8 | use Ajax\JsUtils; |
9 | - |
|
10 | 9 | use Ajax\service\JArray; |
11 | 10 | |
12 | 11 | /** |
@@ -11,6 +11,9 @@ |
||
11 | 11 | |
12 | 12 | abstract class HtmlAbsractItem extends HtmlSemDoubleElement { |
13 | 13 | |
14 | + /** |
|
15 | + * @param string $baseClass |
|
16 | + */ |
|
14 | 17 | public function __construct($identifier, $baseClass,$content=NULL) { |
15 | 18 | parent::__construct($identifier, "div", $baseClass); |
16 | 19 | $this->content=array(); |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ajax\semantic\html\base\HtmlSemDoubleElement; |
6 | 6 | use Ajax\semantic\html\elements\HtmlIcon; |
7 | 7 | use Ajax\JsUtils; |
8 | - |
|
9 | 8 | use Ajax\service\JArray; |
10 | 9 | use Ajax\semantic\html\elements\html5\HtmlImg; |
11 | 10 |
@@ -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,48 +19,48 @@ 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(){ |
|
55 | + public function setActive() { |
|
56 | 56 | $this->setTagName("div"); |
57 | 57 | $this->removeProperty("href"); |
58 | 58 | return $this->addToPropertyCtrl("class", "active", array("active")); |
59 | 59 | } |
60 | 60 | |
61 | - public function asLink($href=NULL,$part=NULL){ |
|
61 | + public function asLink($href=NULL, $part=NULL) { |
|
62 | 62 | $this->setTagName("a"); |
63 | - if(isset($href)) |
|
63 | + if (isset($href)) |
|
64 | 64 | $this->setProperty("href", $href); |
65 | 65 | return $this; |
66 | 66 | } |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
73 | 73 | */ |
74 | 74 | public function compile(JsUtils $js=NULL, $view=NULL) { |
75 | - if(\is_array($this->content)) |
|
76 | - $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
75 | + if (\is_array($this->content)) |
|
76 | + $this->content=JArray::sortAssociative($this->content, ["icon", "image", "content"]); |
|
77 | 77 | return parent::compile($js, $view); |
78 | 78 | } |
79 | 79 | } |
80 | 80 | \ No newline at end of file |
@@ -60,8 +60,9 @@ discard block |
||
60 | 60 | |
61 | 61 | public function asLink($href=NULL,$part=NULL){ |
62 | 62 | $this->setTagName("a"); |
63 | - if(isset($href)) |
|
64 | - $this->setProperty("href", $href); |
|
63 | + if(isset($href)) { |
|
64 | + $this->setProperty("href", $href); |
|
65 | + } |
|
65 | 66 | return $this; |
66 | 67 | } |
67 | 68 | |
@@ -72,8 +73,9 @@ discard block |
||
72 | 73 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
73 | 74 | */ |
74 | 75 | public function compile(JsUtils $js=NULL, $view=NULL) { |
75 | - if(\is_array($this->content)) |
|
76 | - $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
76 | + if(\is_array($this->content)) { |
|
77 | + $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
78 | + } |
|
77 | 79 | return parent::compile($js, $view); |
78 | 80 | } |
79 | 81 | } |
80 | 82 | \ No newline at end of file |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ajax\semantic\html\base\constants\Wide; |
6 | 6 | use Ajax\semantic\html\base\constants\Color; |
7 | 7 | use Ajax\JsUtils; |
8 | - |
|
9 | 8 | use Ajax\semantic\html\base\HtmlSemCollection; |
10 | 9 | use Ajax\semantic\html\base\traits\TextAlignmentTrait; |
11 | 10 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * Set the button value |
40 | 40 | * @param string $value |
41 | - * @return \Ajax\semantic\html\HtmlButton |
|
41 | + * @return HtmlButton |
|
42 | 42 | */ |
43 | 43 | public function setValue($value) { |
44 | 44 | $this->content=$value; |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | |
48 | 48 | /** |
49 | 49 | * define the button style |
50 | - * @param string|int $cssStyle |
|
51 | - * @return \Ajax\semantic\html\HtmlButton default : "" |
|
50 | + * @param string $cssStyle |
|
51 | + * @return HtmlButton default : "" |
|
52 | 52 | */ |
53 | 53 | public function setStyle($cssStyle) { |
54 | 54 | return $this->addToProperty("class", $cssStyle); |
@@ -98,7 +98,6 @@ discard block |
||
98 | 98 | |
99 | 99 | /** |
100 | 100 | * Add and return a button label |
101 | - * @param string $caption |
|
102 | 101 | * @param string $before |
103 | 102 | * @param string $icon |
104 | 103 | * @return \Ajax\semantic\html\elements\HtmlLabel |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | public function setFocusable($value=true) { |
58 | - if ($value === true) |
|
58 | + if ($value===true) |
|
59 | 59 | $this->setProperty("tabindex", "0"); |
60 | 60 | else { |
61 | 61 | $this->removeProperty("tabindex"); |
@@ -65,14 +65,14 @@ discard block |
||
65 | 65 | |
66 | 66 | public function setAnimated($content, $animation="") { |
67 | 67 | $this->setTagName("div"); |
68 | - $this->addToProperty("class", "animated " . $animation); |
|
69 | - $visible=new HtmlSemDoubleElement("visible-" . $this->identifier, "div"); |
|
68 | + $this->addToProperty("class", "animated ".$animation); |
|
69 | + $visible=new HtmlSemDoubleElement("visible-".$this->identifier, "div"); |
|
70 | 70 | $visible->setClass("visible content"); |
71 | 71 | $visible->setContent($this->content); |
72 | - $hidden=new HtmlSemDoubleElement("hidden-" . $this->identifier, "div"); |
|
72 | + $hidden=new HtmlSemDoubleElement("hidden-".$this->identifier, "div"); |
|
73 | 73 | $hidden->setClass("hidden content"); |
74 | 74 | $hidden->setContent($content); |
75 | - $this->content=array ($visible,$hidden ); |
|
75 | + $this->content=array($visible, $hidden); |
|
76 | 76 | return $hidden; |
77 | 77 | } |
78 | 78 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | public function asIcon($icon) { |
85 | 85 | $iconO=$icon; |
86 | 86 | if (\is_string($icon)) { |
87 | - $iconO=new HtmlIcon("icon-" . $this->identifier, $icon); |
|
87 | + $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
|
88 | 88 | } |
89 | 89 | $this->addToProperty("class", "icon"); |
90 | 90 | $this->content=$iconO; |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | public function addLabel($label, $before=false, $icon=NULL) { |
107 | 107 | $this->tagName="div"; |
108 | 108 | $this->addToProperty("class", "labeled"); |
109 | - $this->content=new HtmlButton("button-" . $this->identifier, $this->content); |
|
109 | + $this->content=new HtmlButton("button-".$this->identifier, $this->content); |
|
110 | 110 | $this->content->setTagName("div"); |
111 | - $label=new HtmlLabel("label-" . $this->identifier, $label, "a"); |
|
112 | - if(isset($icon)) |
|
111 | + $label=new HtmlLabel("label-".$this->identifier, $label, "a"); |
|
112 | + if (isset($icon)) |
|
113 | 113 | $label->addIcon($icon); |
114 | 114 | $label->setBasic(); |
115 | 115 | $this->addContent($label, $before); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function fromArray($array) { |
124 | 124 | $array=parent::fromArray($array); |
125 | - foreach ( $array as $key => $value ) { |
|
125 | + foreach ($array as $key => $value) { |
|
126 | 126 | $this->setProperty($key, $value); |
127 | 127 | } |
128 | 128 | return $array; |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | public static function social($identifier, $social, $value=NULL) { |
188 | - if ($value === NULL) |
|
188 | + if ($value===NULL) |
|
189 | 189 | $value=\ucfirst($social); |
190 | 190 | $return=new HtmlButton($identifier, $value); |
191 | 191 | $return->addIcon($social); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | } |
206 | 206 | |
207 | 207 | public function asLink($href=NULL) { |
208 | - $lnk=new HtmlLink("lnk-".$this->identifier,$href,$this->content); |
|
208 | + $lnk=new HtmlLink("lnk-".$this->identifier, $href, $this->content); |
|
209 | 209 | $this->content=$lnk; |
210 | 210 | return $this; |
211 | 211 | } |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | public function setFocusable($value=true) { |
58 | - if ($value === true) |
|
59 | - $this->setProperty("tabindex", "0"); |
|
60 | - else { |
|
58 | + if ($value === true) { |
|
59 | + $this->setProperty("tabindex", "0"); |
|
60 | + } else { |
|
61 | 61 | $this->removeProperty("tabindex"); |
62 | 62 | } |
63 | 63 | return $this; |
@@ -109,8 +109,9 @@ discard block |
||
109 | 109 | $this->content=new HtmlButton("button-" . $this->identifier, $this->content); |
110 | 110 | $this->content->setTagName("div"); |
111 | 111 | $label=new HtmlLabel("label-" . $this->identifier, $label, "a"); |
112 | - if(isset($icon)) |
|
113 | - $label->addIcon($icon); |
|
112 | + if(isset($icon)) { |
|
113 | + $label->addIcon($icon); |
|
114 | + } |
|
114 | 115 | $label->setBasic(); |
115 | 116 | $this->addContent($label, $before); |
116 | 117 | return $label; |
@@ -185,8 +186,9 @@ discard block |
||
185 | 186 | } |
186 | 187 | |
187 | 188 | public static function social($identifier, $social, $value=NULL) { |
188 | - if ($value === NULL) |
|
189 | - $value=\ucfirst($social); |
|
189 | + if ($value === NULL) { |
|
190 | + $value=\ucfirst($social); |
|
191 | + } |
|
190 | 192 | $return=new HtmlButton($identifier, $value); |
191 | 193 | $return->addIcon($social); |
192 | 194 | return $return->addToPropertyCtrl("class", $social, Social::getConstants()); |
@@ -4,7 +4,6 @@ |
||
4 | 4 | use Ajax\semantic\html\base\constants\Side; |
5 | 5 | trait AttachedTrait { |
6 | 6 | /** |
7 | - * @param string $side |
|
8 | 7 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
9 | 8 | */ |
10 | 9 | public function setAttachment($value=Side::BOTH){ |
@@ -91,12 +91,12 @@ |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | - * Adds an image |
|
95 | - * @param string $src |
|
96 | - * @param string $alt |
|
97 | - * @param string $before |
|
98 | - * @return \Ajax\semantic\html\elements\html5\HtmlImg |
|
99 | - */ |
|
94 | + * Adds an image |
|
95 | + * @param string $src |
|
96 | + * @param string $alt |
|
97 | + * @param string $before |
|
98 | + * @return \Ajax\semantic\html\elements\html5\HtmlImg |
|
99 | + */ |
|
100 | 100 | public function addImage($src, $alt="", $before=true) { |
101 | 101 | $img=new HtmlImg("image-" . $this->identifier, $src, $alt); |
102 | 102 | $img->setClass(""); |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | * @return \Ajax\semantic\html\elements\HtmlLabel |
25 | 25 | */ |
26 | 26 | public function setPointing($value=Direction::NONE) { |
27 | - if($value==="left" || $value==="right") |
|
27 | + if ($value==="left" || $value==="right") |
|
28 | 28 | return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
29 | 29 | else |
30 | - return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
30 | + return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing", true)); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -36,15 +36,15 @@ discard block |
||
36 | 36 | * @return \Ajax\semantic\html\elements\HtmlLabel |
37 | 37 | */ |
38 | 38 | public function toCorner($side="left") { |
39 | - return $this->addToPropertyCtrl("class", $side . " corner", array ("right corner","left corner" )); |
|
39 | + return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner")); |
|
40 | 40 | } |
41 | 41 | |
42 | - public function setHorizontal(){ |
|
43 | - return $this->addToPropertyCtrl("class", "hozizontal",array("horizontal")); |
|
42 | + public function setHorizontal() { |
|
43 | + return $this->addToPropertyCtrl("class", "hozizontal", array("horizontal")); |
|
44 | 44 | } |
45 | 45 | |
46 | - public function setFloating(){ |
|
47 | - return $this->addToPropertyCtrl("class", "floating",array("floating")); |
|
46 | + public function setFloating() { |
|
47 | + return $this->addToPropertyCtrl("class", "floating", array("floating")); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | return $this->addToProperty("class", "tag"); |
56 | 56 | } |
57 | 57 | |
58 | - public function setEmpty(){ |
|
58 | + public function setEmpty() { |
|
59 | 59 | $this->content=NULL; |
60 | - return $this->addToPropertyCtrl("class", "empty",array("empty")); |
|
60 | + return $this->addToPropertyCtrl("class", "empty", array("empty")); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | public function setBasic() { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function addEmphasisImage($src, $alt="", $before=true) { |
75 | 75 | $this->addToProperty("class", "image"); |
76 | - return $this->addImage($src,$alt,$before); |
|
76 | + return $this->addImage($src, $alt, $before); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @return \Ajax\semantic\html\elements\html5\HtmlImg |
85 | 85 | */ |
86 | 86 | public function addAvatarImage($src, $alt="", $before=true) { |
87 | - $img=$this->addImage($src,$alt,$before); |
|
87 | + $img=$this->addImage($src, $alt, $before); |
|
88 | 88 | $img->setClass("ui image"); |
89 | 89 | $img->asAvatar(); |
90 | 90 | return $img; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @return \Ajax\semantic\html\elements\html5\HtmlImg |
99 | 99 | */ |
100 | 100 | public function addImage($src, $alt="", $before=true) { |
101 | - $img=new HtmlImg("image-" . $this->identifier, $src, $alt); |
|
101 | + $img=new HtmlImg("image-".$this->identifier, $src, $alt); |
|
102 | 102 | $img->setClass(""); |
103 | 103 | $this->addContent($img, $before); |
104 | 104 | return $img; |
@@ -110,21 +110,21 @@ discard block |
||
110 | 110 | * @return \Ajax\common\html\HtmlDoubleElement |
111 | 111 | */ |
112 | 112 | public function addDetail($detail) { |
113 | - $div=new HtmlSemDoubleElement("detail-" . $this->identifier, $this->tagName,"detail"); |
|
113 | + $div=new HtmlSemDoubleElement("detail-".$this->identifier, $this->tagName, "detail"); |
|
114 | 114 | $div->setContent($detail); |
115 | 115 | $this->addContent($div); |
116 | 116 | return $div; |
117 | 117 | } |
118 | 118 | |
119 | 119 | public function asRibbon($direction=Direction::NONE) { |
120 | - return $this->addToPropertyCtrl("class", $direction." ribbon", array ("ribbon","right ribbon","left ribbon" )); |
|
120 | + return $this->addToPropertyCtrl("class", $direction." ribbon", array("ribbon", "right ribbon", "left ribbon")); |
|
121 | 121 | } |
122 | 122 | |
123 | - public function setAttached($side=Side::TOP,$direction=Direction::NONE){ |
|
124 | - if($direction!==Direction::NONE) |
|
125 | - return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
123 | + public function setAttached($side=Side::TOP, $direction=Direction::NONE) { |
|
124 | + if ($direction!==Direction::NONE) |
|
125 | + return $this->addToPropertyCtrl("class", $side." ".$direction." attached", Side::getConstantValues($direction." attached")); |
|
126 | 126 | else |
127 | - return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
127 | + return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached")); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | public static function ribbon($identifier, $caption) { |
@@ -14,8 +14,9 @@ discard block |
||
14 | 14 | public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") { |
15 | 15 | parent::__construct($identifier, $tagName, "ui label"); |
16 | 16 | $this->content=$caption; |
17 | - if (isset($icon)===true) |
|
18 | - $this->addIcon($icon); |
|
17 | + if (isset($icon)===true) { |
|
18 | + $this->addIcon($icon); |
|
19 | + } |
|
19 | 20 | } |
20 | 21 | |
21 | 22 | /** |
@@ -24,10 +25,11 @@ discard block |
||
24 | 25 | * @return \Ajax\semantic\html\elements\HtmlLabel |
25 | 26 | */ |
26 | 27 | public function setPointing($value=Direction::NONE) { |
27 | - if($value==="left" || $value==="right") |
|
28 | - return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
29 | - else |
|
30 | - return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
28 | + if($value==="left" || $value==="right") { |
|
29 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
30 | + } else { |
|
31 | + return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
32 | + } |
|
31 | 33 | } |
32 | 34 | |
33 | 35 | /** |
@@ -121,10 +123,11 @@ discard block |
||
121 | 123 | } |
122 | 124 | |
123 | 125 | public function setAttached($side=Side::TOP,$direction=Direction::NONE){ |
124 | - if($direction!==Direction::NONE) |
|
125 | - return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
126 | - else |
|
127 | - return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
126 | + if($direction!==Direction::NONE) { |
|
127 | + return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
128 | + } else { |
|
129 | + return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
130 | + } |
|
128 | 131 | } |
129 | 132 | |
130 | 133 | public static function ribbon($identifier, $caption) { |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ajax\semantic\html\base\HtmlSemCollection; |
6 | 6 | use Ajax\semantic\html\content\HtmlStepItem; |
7 | 7 | use Ajax\JsUtils; |
8 | - |
|
9 | 8 | use Ajax\common\html\HtmlDoubleElement; |
10 | 9 | use Ajax\semantic\html\base\constants\Side; |
11 | 10 |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ajax\semantic\html\base\HtmlSemDoubleElement; |
6 | 6 | use Ajax\JsUtils; |
7 | 7 | use Ajax\service\JArray; |
8 | - |
|
9 | 8 | use Ajax\semantic\html\base\constants\State; |
10 | 9 | |
11 | 10 | class HtmlProgress extends HtmlSemDoubleElement { |
@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | private static $constCacheArray=NULL; |
13 | 13 | |
14 | 14 | public static function getConstants() { |
15 | - if (self::$constCacheArray == NULL) { |
|
16 | - self::$constCacheArray=[ ]; |
|
15 | + if (self::$constCacheArray==NULL) { |
|
16 | + self::$constCacheArray=[]; |
|
17 | 17 | } |
18 | 18 | $calledClass=get_called_class(); |
19 | 19 | if (!array_key_exists($calledClass, self::$constCacheArray)) { |
@@ -23,16 +23,16 @@ discard block |
||
23 | 23 | return self::$constCacheArray[$calledClass]; |
24 | 24 | } |
25 | 25 | |
26 | - public static function getConstantValues($postFix="",$prefixBefore=false) { |
|
27 | - if ($postFix == "") |
|
26 | + public static function getConstantValues($postFix="", $prefixBefore=false) { |
|
27 | + if ($postFix=="") |
|
28 | 28 | return \array_values(self::getConstants()); |
29 | 29 | else { |
30 | - if($prefixBefore===false){ |
|
31 | - return \array_map(function ($elem) use($postFix) { |
|
32 | - return $elem . " " . $postFix; |
|
30 | + if ($prefixBefore===false) { |
|
31 | + return \array_map(function($elem) use($postFix) { |
|
32 | + return $elem." ".$postFix; |
|
33 | 33 | }, \array_values(self::getConstants())); |
34 | - }else{ |
|
35 | - return \array_map(function ($elem) use($postFix) { |
|
34 | + }else { |
|
35 | + return \array_map(function($elem) use($postFix) { |
|
36 | 36 | return $postFix." ".$elem; |
37 | 37 | }, \array_values(self::getConstants())); |
38 | 38 | } |
@@ -24,14 +24,14 @@ |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | public static function getConstantValues($postFix="",$prefixBefore=false) { |
27 | - if ($postFix == "") |
|
28 | - return \array_values(self::getConstants()); |
|
29 | - else { |
|
27 | + if ($postFix == "") { |
|
28 | + return \array_values(self::getConstants()); |
|
29 | + } else { |
|
30 | 30 | if($prefixBefore===false){ |
31 | 31 | return \array_map(function ($elem) use($postFix) { |
32 | 32 | return $elem . " " . $postFix; |
33 | 33 | }, \array_values(self::getConstants())); |
34 | - }else{ |
|
34 | + } else{ |
|
35 | 35 | return \array_map(function ($elem) use($postFix) { |
36 | 36 | return $postFix." ".$elem; |
37 | 37 | }, \array_values(self::getConstants())); |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | class HtmlInput extends HtmlSingleElement { |
9 | 9 | |
10 | - public function __construct($identifier,$type="text",$value=NULL,$placeholder=NULL) { |
|
10 | + public function __construct($identifier, $type="text", $value=NULL, $placeholder=NULL) { |
|
11 | 11 | parent::__construct($identifier, "input"); |
12 | 12 | $this->setProperty("name", $identifier); |
13 | 13 | $this->setValue($value); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | } |
17 | 17 | |
18 | 18 | public function setValue($value) { |
19 | - if(isset($value)) |
|
19 | + if (isset($value)) |
|
20 | 20 | $this->setProperty("value", $value); |
21 | 21 | return $this; |
22 | 22 | } |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | return $this->setProperty("type", $value); |
26 | 26 | } |
27 | 27 | |
28 | - public function setPlaceholder($value){ |
|
29 | - if(JString::isNull($value)){ |
|
30 | - if(JString::isNotNull($this->identifier)) |
|
28 | + public function setPlaceholder($value) { |
|
29 | + if (JString::isNull($value)) { |
|
30 | + if (JString::isNotNull($this->identifier)) |
|
31 | 31 | $value=\ucfirst($this->identifier); |
32 | 32 | } |
33 | - if(JString::isNotNull($value)) |
|
33 | + if (JString::isNotNull($value)) |
|
34 | 34 | $this->setProperty("placeholder", $value); |
35 | 35 | return $this; |
36 | 36 | } |
@@ -16,8 +16,9 @@ discard block |
||
16 | 16 | } |
17 | 17 | |
18 | 18 | public function setValue($value) { |
19 | - if(isset($value)) |
|
20 | - $this->setProperty("value", $value); |
|
19 | + if(isset($value)) { |
|
20 | + $this->setProperty("value", $value); |
|
21 | + } |
|
21 | 22 | return $this; |
22 | 23 | } |
23 | 24 | |
@@ -27,11 +28,13 @@ discard block |
||
27 | 28 | |
28 | 29 | public function setPlaceholder($value){ |
29 | 30 | if(JString::isNull($value)){ |
30 | - if(JString::isNotNull($this->identifier)) |
|
31 | - $value=\ucfirst($this->identifier); |
|
31 | + if(JString::isNotNull($this->identifier)) { |
|
32 | + $value=\ucfirst($this->identifier); |
|
33 | + } |
|
34 | + } |
|
35 | + if(JString::isNotNull($value)) { |
|
36 | + $this->setProperty("placeholder", $value); |
|
32 | 37 | } |
33 | - if(JString::isNotNull($value)) |
|
34 | - $this->setProperty("placeholder", $value); |
|
35 | 38 | return $this; |
36 | 39 | } |
37 | 40 | } |
38 | 41 | \ No newline at end of file |