@@ -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 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | public function addDimmer($params=array(), $content=NULL) { |
51 | - $dimmer=new HtmlDimmer("dimmer-" . $this->identifier, $content); |
|
51 | + $dimmer=new HtmlDimmer("dimmer-".$this->identifier, $content); |
|
52 | 52 | $dimmer->setParams($params); |
53 | 53 | $dimmer->setContainer($this); |
54 | 54 | $this->addContent($dimmer); |
@@ -57,20 +57,20 @@ discard block |
||
57 | 57 | |
58 | 58 | public function addLabel($label, $before=false, $icon=NULL) { |
59 | 59 | $labelO=$label; |
60 | - if (\is_object($label) === false) { |
|
61 | - $labelO=new HtmlLabel("label-" . $this->identifier, $label); |
|
60 | + if (\is_object($label)===false) { |
|
61 | + $labelO=new HtmlLabel("label-".$this->identifier, $label); |
|
62 | 62 | if (isset($icon)) |
63 | 63 | $labelO->addIcon($icon); |
64 | - } else { |
|
65 | - $labelO->addToPropertyCtrl("class", "label", array ("label" )); |
|
64 | + }else { |
|
65 | + $labelO->addToPropertyCtrl("class", "label", array("label")); |
|
66 | 66 | } |
67 | 67 | $this->addContent($labelO, $before); |
68 | 68 | return $labelO; |
69 | 69 | } |
70 | 70 | |
71 | - public function attachLabel($label,$side,$direction=Direction::NONE,$icon=NULL){ |
|
72 | - $label=$this->addLabel($label,true,$icon); |
|
73 | - $label->setAttached($side,$direction); |
|
71 | + public function attachLabel($label, $side, $direction=Direction::NONE, $icon=NULL) { |
|
72 | + $label=$this->addLabel($label, true, $icon); |
|
73 | + $label->setAttached($side, $direction); |
|
74 | 74 | return $this; |
75 | 75 | } |
76 | 76 | |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | |
87 | 87 | public function jsShowDimmer($show=true) { |
88 | 88 | $status="hide"; |
89 | - if ($show === true) |
|
89 | + if ($show===true) |
|
90 | 90 | $status="show"; |
91 | - return '$("#.' . $this->identifier . ').dimmer("' . $status . '");'; |
|
91 | + return '$("#.'.$this->identifier.').dimmer("'.$status.'");'; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | public function compile(JsUtils $js=NULL, $view=NULL) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | public function run(JsUtils $js) { |
101 | - $this->_bsComponent=$js->semantic()->generic("#" . $this->identifier); |
|
101 | + $this->_bsComponent=$js->semantic()->generic("#".$this->identifier); |
|
102 | 102 | parent::run($js); |
103 | 103 | $this->addEventsOnRun($js); |
104 | 104 | if (isset($this->_popup)) { |
@@ -2,5 +2,5 @@ |
||
2 | 2 | namespace Ajax\semantic\html\base\constants; |
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | abstract class Size extends BaseEnum { |
5 | - const MASSIVE="massive",HUGE="huge",BIG="big",LARGE="large",MEDIUM="",SMALL="small",TINY="tiny",MINI="mini"; |
|
5 | + const MASSIVE="massive", HUGE="huge", BIG="big", LARGE="large", MEDIUM="", SMALL="small", TINY="tiny", MINI="mini"; |
|
6 | 6 | } |
7 | 7 | \ No newline at end of file |
@@ -2,5 +2,5 @@ |
||
2 | 2 | namespace Ajax\semantic\html\base\constants; |
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | abstract class Direction extends BaseEnum { |
5 | - const RIGHT="right", LEFT="left",DOWN="down",UP="up",NONE="",BELOW="below"; |
|
5 | + const RIGHT="right", LEFT="left", DOWN="down", UP="up", NONE="", BELOW="below"; |
|
6 | 6 | } |
7 | 7 | \ No newline at end of file |
@@ -9,27 +9,27 @@ |
||
9 | 9 | class HtmlMenuItem extends HtmlAbsractItem { |
10 | 10 | |
11 | 11 | public function __construct($identifier, $content) { |
12 | - parent::__construct($identifier,"item",$content); |
|
12 | + parent::__construct($identifier, "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 | 20 | $desc=@$content[2]; |
21 | - }else{ |
|
21 | + }else { |
|
22 | 22 | $icon=@$content["icon"]; |
23 | 23 | $title=@$content["title"]; |
24 | 24 | $desc=@$content["description"]; |
25 | 25 | } |
26 | - if(isset($icon)===true){ |
|
26 | + if (isset($icon)===true) { |
|
27 | 27 | $this->setIcon($icon); |
28 | 28 | } |
29 | - if(isset($title)===true){ |
|
30 | - $this->setTitle($title,$desc); |
|
29 | + if (isset($title)===true) { |
|
30 | + $this->setTitle($title, $desc); |
|
31 | 31 | } |
32 | - }else{ |
|
32 | + }else { |
|
33 | 33 | $this->setContent($content); |
34 | 34 | } |
35 | 35 | } |
@@ -8,48 +8,48 @@ |
||
8 | 8 | class HtmlStepItem extends HtmlAbsractItem { |
9 | 9 | |
10 | 10 | public function __construct($identifier, $content) { |
11 | - parent::__construct($identifier,"step",$content); |
|
11 | + parent::__construct($identifier, "step", $content); |
|
12 | 12 | } |
13 | - protected function initContent($content){ |
|
14 | - if(\is_array($content)){ |
|
15 | - if(JArray::isAssociative($content)===false){ |
|
13 | + protected function initContent($content) { |
|
14 | + if (\is_array($content)) { |
|
15 | + if (JArray::isAssociative($content)===false) { |
|
16 | 16 | $icon=@$content[0]; |
17 | 17 | $title=@$content[1]; |
18 | 18 | $desc=@$content[2]; |
19 | 19 | $status=@$content[3]; |
20 | - }else{ |
|
20 | + }else { |
|
21 | 21 | $icon=@$content["icon"]; |
22 | 22 | $title=@$content["title"]; |
23 | 23 | $desc=@$content["description"]; |
24 | 24 | $status=@$content["status"]; |
25 | 25 | } |
26 | - if(isset($icon)===true){ |
|
26 | + if (isset($icon)===true) { |
|
27 | 27 | $this->setIcon($icon); |
28 | 28 | } |
29 | - if(isset($status)===true){ |
|
29 | + if (isset($status)===true) { |
|
30 | 30 | $this->setStatus($status); |
31 | 31 | } |
32 | - if(isset($title)===true){ |
|
33 | - $this->setTitle($title,$desc); |
|
32 | + if (isset($title)===true) { |
|
33 | + $this->setTitle($title, $desc); |
|
34 | 34 | } |
35 | - }else{ |
|
35 | + }else { |
|
36 | 36 | $this->setContent($content); |
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
40 | - public function setActive(){ |
|
40 | + public function setActive() { |
|
41 | 41 | return $this->setStatus(StepStatus::ACTIVE); |
42 | 42 | } |
43 | 43 | |
44 | - public function setCompleted(){ |
|
44 | + public function setCompleted() { |
|
45 | 45 | return $this->setStatus(StepStatus::COMPLETED); |
46 | 46 | } |
47 | 47 | |
48 | - public function setStatus($status){ |
|
48 | + public function setStatus($status) { |
|
49 | 49 | return $this->addToPropertyCtrl("class", $status, StepStatus::getConstants()); |
50 | 50 | } |
51 | 51 | |
52 | - public function removeStatus(){ |
|
52 | + public function removeStatus() { |
|
53 | 53 | $this->removePropertyValues("class", StepStatus::getConstants()); |
54 | 54 | } |
55 | 55 | } |
56 | 56 | \ No newline at end of file |
@@ -9,15 +9,15 @@ discard block |
||
9 | 9 | protected $image; |
10 | 10 | |
11 | 11 | public function __construct($identifier, $content=NULL) { |
12 | - parent::__construct($identifier,"item",$content); |
|
12 | + parent::__construct($identifier, "item", $content); |
|
13 | 13 | } |
14 | - protected function initContent($content){ |
|
15 | - if(\is_array($content)){ |
|
16 | - if(JArray::isAssociative($content)===false){ |
|
14 | + protected function initContent($content) { |
|
15 | + if (\is_array($content)) { |
|
16 | + if (JArray::isAssociative($content)===false) { |
|
17 | 17 | $icon=@$content[0]; |
18 | 18 | $title=@$content[1]; |
19 | 19 | $desc=@$content[2]; |
20 | - }else{ |
|
20 | + }else { |
|
21 | 21 | $icon=@$content["icon"]; |
22 | 22 | $image=@$content["image"]; |
23 | 23 | $title=@$content["title"]; |
@@ -25,21 +25,21 @@ discard block |
||
25 | 25 | $desc=@$content["description"]; |
26 | 26 | $items=@$content["items"]; |
27 | 27 | } |
28 | - if(isset($icon)===true){ |
|
28 | + if (isset($icon)===true) { |
|
29 | 29 | $this->setIcon($icon); |
30 | 30 | } |
31 | - if(isset($image)===true){ |
|
31 | + if (isset($image)===true) { |
|
32 | 32 | $this->setImage($image); |
33 | 33 | } |
34 | - if(isset($title)===true){ |
|
35 | - $this->setTitle($title,$desc); |
|
36 | - }elseif (isset($header)===true){ |
|
37 | - $this->setTitle($header,$desc,"header"); |
|
34 | + if (isset($title)===true) { |
|
35 | + $this->setTitle($title, $desc); |
|
36 | + }elseif (isset($header)===true) { |
|
37 | + $this->setTitle($header, $desc, "header"); |
|
38 | 38 | } |
39 | - if(isset($items)===true){ |
|
39 | + if (isset($items)===true) { |
|
40 | 40 | $this->addList($items); |
41 | 41 | } |
42 | - }else{ |
|
42 | + }else { |
|
43 | 43 | $this->setContent($content); |
44 | 44 | } |
45 | 45 | } |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | return $list; |
51 | 51 | } |
52 | 52 | |
53 | - public function getList(){ |
|
53 | + public function getList() { |
|
54 | 54 | return $this->content["list"]; |
55 | 55 | } |
56 | 56 | |
57 | - public function getItem($index){ |
|
57 | + public function getItem($index) { |
|
58 | 58 | return $this->getList()->getItem($index); |
59 | 59 | } |
60 | 60 | } |
61 | 61 | \ No newline at end of file |
@@ -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 |
@@ -20,30 +20,30 @@ |
||
20 | 20 | $this->_title=$title; |
21 | 21 | } |
22 | 22 | |
23 | - public function setTitle($title){ |
|
23 | + public function setTitle($title) { |
|
24 | 24 | $this->_title=$title; |
25 | 25 | } |
26 | 26 | |
27 | - public function setIcon($icon){ |
|
27 | + public function setIcon($icon) { |
|
28 | 28 | $this->_icon=$icon; |
29 | 29 | } |
30 | 30 | |
31 | - protected function createTitleElement(){ |
|
32 | - $element=new HtmlSemDoubleElement("title-".$this->identifier,"div","title"); |
|
33 | - $element->setContent(array(new HtmlIcon("", $this->_icon),$this->_title)); |
|
34 | - if($this->_active===true) |
|
31 | + protected function createTitleElement() { |
|
32 | + $element=new HtmlSemDoubleElement("title-".$this->identifier, "div", "title"); |
|
33 | + $element->setContent(array(new HtmlIcon("", $this->_icon), $this->_title)); |
|
34 | + if ($this->_active===true) |
|
35 | 35 | $element->addToProperty("class", "active"); |
36 | 36 | return $element; |
37 | 37 | } |
38 | 38 | |
39 | - public function compile(JsUtils $js=NULL, $view=NULL){ |
|
39 | + public function compile(JsUtils $js=NULL, $view=NULL) { |
|
40 | 40 | $this->titleElement=$this->createTitleElement(); |
41 | - return parent::compile($js,$view); |
|
41 | + return parent::compile($js, $view); |
|
42 | 42 | } |
43 | 43 | |
44 | - public function setActive($value=true){ |
|
44 | + public function setActive($value=true) { |
|
45 | 45 | $this->_active=$value; |
46 | - if($value===true) |
|
46 | + if ($value===true) |
|
47 | 47 | $this->addToPropertyCtrl("class", "active", array("active")); |
48 | 48 | else |
49 | 49 | $this->removePropertyValue("class", "active"); |