@@ -21,7 +21,6 @@ |
||
21 | 21 | |
22 | 22 | /** |
23 | 23 | * @param string $identifier |
24 | - * @param array $items |
|
25 | 24 | * @return HtmlCardGroups |
26 | 25 | */ |
27 | 26 | public function htmlCardGroups($identifier, $cards=array()) { |
@@ -7,6 +7,6 @@ |
||
7 | 7 | class HtmlCard extends HtmlViewItem { |
8 | 8 | |
9 | 9 | public function __construct($identifier) { |
10 | - parent::__construct($identifier, "ui card", array ()); |
|
10 | + parent::__construct($identifier, "ui card", array()); |
|
11 | 11 | } |
12 | 12 | } |
13 | 13 | \ No newline at end of file |
@@ -9,11 +9,11 @@ |
||
9 | 9 | class HtmlItems extends HtmlViewGroups { |
10 | 10 | |
11 | 11 | public function __construct($identifier, $items=array()) { |
12 | - parent::__construct($identifier, "ui items",$items); |
|
12 | + parent::__construct($identifier, "ui items", $items); |
|
13 | 13 | } |
14 | 14 | |
15 | - protected function createElement(){ |
|
16 | - return new HtmlItem("item-" . $this->count()); |
|
15 | + protected function createElement() { |
|
16 | + return new HtmlItem("item-".$this->count()); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | public function newItem($identifier) { |
@@ -8,11 +8,11 @@ |
||
8 | 8 | class HtmlCardGroups extends HtmlViewGroups { |
9 | 9 | |
10 | 10 | public function __construct($identifier, $cards=array()) { |
11 | - parent::__construct($identifier, "ui cards",$cards); |
|
11 | + parent::__construct($identifier, "ui cards", $cards); |
|
12 | 12 | } |
13 | 13 | |
14 | - protected function createElement(){ |
|
15 | - return new HtmlCard("card-" . $this->count()); |
|
14 | + protected function createElement() { |
|
15 | + return new HtmlCard("card-".$this->count()); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | public function newItem($identifier) { |
@@ -15,16 +15,16 @@ discard block |
||
15 | 15 | |
16 | 16 | private function addElement($content, $baseClass) { |
17 | 17 | $count=\sizeof($this->content); |
18 | - $result=new HtmlSemDoubleElement("element-" . $count . "-" . $this->identifier, "div", $baseClass, $content); |
|
18 | + $result=new HtmlSemDoubleElement("element-".$count."-".$this->identifier, "div", $baseClass, $content); |
|
19 | 19 | $this->addContent($result); |
20 | 20 | return $result; |
21 | 21 | } |
22 | 22 | |
23 | 23 | public function addMeta($value, $direction=Direction::LEFT) { |
24 | - if (\array_key_exists("meta", $this->content) === false) { |
|
25 | - $this->content["meta"]=new HtmlSemDoubleElement("meta-" . $this->identifier, "div", "meta", array ()); |
|
24 | + if (\array_key_exists("meta", $this->content)===false) { |
|
25 | + $this->content["meta"]=new HtmlSemDoubleElement("meta-".$this->identifier, "div", "meta", array()); |
|
26 | 26 | } |
27 | - if ($direction === Direction::RIGHT) { |
|
27 | + if ($direction===Direction::RIGHT) { |
|
28 | 28 | $value=new HtmlSemDoubleElement("", "span", "", $value); |
29 | 29 | $value->setFloated($direction); |
30 | 30 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function addMetas($metas) { |
44 | 44 | if (\is_array($metas)) { |
45 | - foreach ( $metas as $meta ) { |
|
45 | + foreach ($metas as $meta) { |
|
46 | 46 | $this->addMeta($meta); |
47 | 47 | } |
48 | 48 | } else |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | public function addContentIcon($icon, $caption=NULL, $direction=Direction::LEFT) { |
54 | - if ($direction === Direction::RIGHT) { |
|
54 | + if ($direction===Direction::RIGHT) { |
|
55 | 55 | if (isset($caption)) { |
56 | 56 | $result=new HtmlSemDoubleElement("", "span", "", $caption); |
57 | 57 | $result->addIcon($icon); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | public function addContentText($caption, $direction=Direction::LEFT) { |
72 | - if ($direction === Direction::RIGHT) { |
|
72 | + if ($direction===Direction::RIGHT) { |
|
73 | 73 | $result=new HtmlSemDoubleElement("", "span", "", $caption); |
74 | 74 | $this->addContent($result); |
75 | 75 | $result->setFloated($direction); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | public function addContentIcons($icons, $direction=Direction::LEFT) { |
82 | - foreach ( $icons as $icon ) { |
|
82 | + foreach ($icons as $icon) { |
|
83 | 83 | $this->addContentIcon($icon, NULL, $direction); |
84 | 84 | } |
85 | 85 | return $this; |
@@ -34,8 +34,9 @@ discard block |
||
34 | 34 | |
35 | 35 | public function addImage($src="", $alt="", $size=NULL) { |
36 | 36 | $image=new HtmlImg("img-", $src, $alt); |
37 | - if (isset($size)) |
|
38 | - $image->setSize($size); |
|
37 | + if (isset($size)) { |
|
38 | + $image->setSize($size); |
|
39 | + } |
|
39 | 40 | $this->content["image"]=$image; |
40 | 41 | return $image; |
41 | 42 | } |
@@ -45,8 +46,9 @@ discard block |
||
45 | 46 | foreach ( $metas as $meta ) { |
46 | 47 | $this->addMeta($meta); |
47 | 48 | } |
48 | - } else |
|
49 | - $this->addMeta($metas); |
|
49 | + } else { |
|
50 | + $this->addMeta($metas); |
|
51 | + } |
|
50 | 52 | return $this; |
51 | 53 | } |
52 | 54 | |
@@ -73,8 +75,9 @@ discard block |
||
73 | 75 | $result=new HtmlSemDoubleElement("", "span", "", $caption); |
74 | 76 | $this->addContent($result); |
75 | 77 | $result->setFloated($direction); |
76 | - } else |
|
77 | - $result=$this->addContent($caption); |
|
78 | + } else { |
|
79 | + $result=$this->addContent($caption); |
|
80 | + } |
|
78 | 81 | return $result; |
79 | 82 | } |
80 | 83 |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | |
10 | 10 | class HtmlViewHeaderContent extends HtmlViewContent { |
11 | 11 | |
12 | - public function __construct($identifier, $header=NULL, $metas=array(), $description=NULL,$extra=null) { |
|
13 | - parent::__construct($identifier, array ()); |
|
12 | + public function __construct($identifier, $header=NULL, $metas=array(), $description=NULL, $extra=null) { |
|
13 | + parent::__construct($identifier, array()); |
|
14 | 14 | if (isset($header)) { |
15 | 15 | $this->setHeader($header); |
16 | 16 | } |
@@ -24,15 +24,15 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | public function setDescription($value) { |
27 | - $this->content["description"]=new HtmlSemDoubleElement("description-" . $this->identifier, "div", "description", $value); |
|
27 | + $this->content["description"]=new HtmlSemDoubleElement("description-".$this->identifier, "div", "description", $value); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function setHeader($value) { |
31 | - $this->content["header"]=new HtmlSemDoubleElement("header-" . $this->identifier, "a", "header", $value); |
|
31 | + $this->content["header"]=new HtmlSemDoubleElement("header-".$this->identifier, "a", "header", $value); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public function setExtra($value) { |
35 | - $this->content["extra"]=new HtmlSemDoubleElement("extra-" . $this->identifier, "a", "extra", $value); |
|
35 | + $this->content["extra"]=new HtmlSemDoubleElement("extra-".$this->identifier, "a", "extra", $value); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
43 | 43 | */ |
44 | 44 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
45 | - $this->content=JArray::sortAssociative($this->content, [ "image","header","meta","description","extra" ]); |
|
45 | + $this->content=JArray::sortAssociative($this->content, ["image", "header", "meta", "description", "extra"]); |
|
46 | 46 | return parent::compile($js, $view); |
47 | 47 | } |
48 | 48 | } |
49 | 49 | \ No newline at end of file |
@@ -6,6 +6,6 @@ |
||
6 | 6 | class HtmlItem extends HtmlViewItem { |
7 | 7 | |
8 | 8 | public function __construct($identifier) { |
9 | - parent::__construct($identifier, "item", array ()); |
|
9 | + parent::__construct($identifier, "item", array()); |
|
10 | 10 | } |
11 | 11 | } |
12 | 12 | \ No newline at end of file |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | abstract class HtmlViewGroups extends HtmlSemCollection { |
10 | 10 | |
11 | - public function __construct($identifier, $uiClass,$items=array()) { |
|
11 | + public function __construct($identifier, $uiClass, $items=array()) { |
|
12 | 12 | parent::__construct($identifier, "div", $uiClass); |
13 | 13 | $this->addItems($items); |
14 | 14 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param int $wide |
41 | 41 | */ |
42 | 42 | public function setWide($wide) { |
43 | - $wide=Wide::getConstants()["W" . $wide]; |
|
43 | + $wide=Wide::getConstants()["W".$wide]; |
|
44 | 44 | return $this->addToPropertyCtrl("class", $wide, Wide::getConstants()); |
45 | 45 | } |
46 | 46 |
@@ -30,8 +30,9 @@ |
||
30 | 30 | if (isset($extra)) { |
31 | 31 | $result->addExtraContent($extra); |
32 | 32 | } |
33 | - } else |
|
34 | - $result->addItemContent($value); |
|
33 | + } else { |
|
34 | + $result->addItemContent($value); |
|
35 | + } |
|
35 | 36 | return $result; |
36 | 37 | } |
37 | 38 |
@@ -18,20 +18,20 @@ discard block |
||
18 | 18 | |
19 | 19 | protected $_sortContentBy=[]; |
20 | 20 | |
21 | - public function __construct($identifier,$baseClass,$content=[]) { |
|
21 | + public function __construct($identifier, $baseClass, $content=[]) { |
|
22 | 22 | parent::__construct($identifier, "div", $baseClass, $content); |
23 | 23 | } |
24 | 24 | |
25 | 25 | private function createContent($content, $baseClass="content") { |
26 | 26 | $count=\sizeof($this->content); |
27 | - $result=new HtmlViewContent("content-" . $count . "-" . $this->identifier, $content); |
|
27 | + $result=new HtmlViewContent("content-".$count."-".$this->identifier, $content); |
|
28 | 28 | $result->setClass($baseClass); |
29 | 29 | return $result; |
30 | 30 | } |
31 | 31 | |
32 | 32 | private function addElementInContent($key, $element) { |
33 | - if (\array_key_exists($key, $this->content) === false) { |
|
34 | - $this->content[$key]=array (); |
|
33 | + if (\array_key_exists($key, $this->content)===false) { |
|
34 | + $this->content[$key]=array(); |
|
35 | 35 | } |
36 | 36 | $this->content[$key][]=$element; |
37 | 37 | return $element; |
@@ -48,14 +48,14 @@ discard block |
||
48 | 48 | |
49 | 49 | public function addHeader($header, $niveau=4, $type="page") { |
50 | 50 | if (!$header instanceof HtmlHeader) { |
51 | - $header=new HtmlHeader("header-" . $this->identifier, $niveau, $header, $type); |
|
51 | + $header=new HtmlHeader("header-".$this->identifier, $niveau, $header, $type); |
|
52 | 52 | } |
53 | 53 | $this->content["header"]=$this->createContent($header); |
54 | 54 | } |
55 | 55 | |
56 | 56 | public function addImage($image, $title="") { |
57 | 57 | if (!$image instanceof HtmlImage) { |
58 | - $image=new HtmlImage("image-" . $this->identifier, $image, $title); |
|
58 | + $image=new HtmlImage("image-".$this->identifier, $image, $title); |
|
59 | 59 | } |
60 | 60 | $image->setClass("ui image"); |
61 | 61 | return $this->addElementInContent("content", $image); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | public function addReveal($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL) { |
65 | 65 | $reveal=$visibleContent; |
66 | 66 | if (!$visibleContent instanceof HtmlReveal) { |
67 | - $reveal=new HtmlReveal("reveral-" . $this->identifier, $visibleContent, $hiddenContent, $type, $attributeType); |
|
67 | + $reveal=new HtmlReveal("reveral-".$this->identifier, $visibleContent, $hiddenContent, $type, $attributeType); |
|
68 | 68 | } |
69 | 69 | return $this->addElementInContent("content", $reveal); |
70 | 70 | } |
@@ -93,22 +93,22 @@ discard block |
||
93 | 93 | * @param boolean $asIcons |
94 | 94 | * @return \Ajax\semantic\html\elements\HtmlButtonGroups |
95 | 95 | */ |
96 | - public function addButtons($elements=array(), $asIcons=false){ |
|
97 | - $buttons=new HtmlButtonGroups("buttons-".$this->identifier,$elements,$asIcons); |
|
96 | + public function addButtons($elements=array(), $asIcons=false) { |
|
97 | + $buttons=new HtmlButtonGroups("buttons-".$this->identifier, $elements, $asIcons); |
|
98 | 98 | $this->addElementInContent("content", $buttons); |
99 | 99 | return $buttons; |
100 | 100 | } |
101 | 101 | |
102 | 102 | |
103 | 103 | |
104 | - public function addItemHeaderContent($header, $metas=array(), $description=NULL,$extra=NULL) { |
|
104 | + public function addItemHeaderContent($header, $metas=array(), $description=NULL, $extra=NULL) { |
|
105 | 105 | $count=\sizeof($this->content); |
106 | - return $this->addElementInContent("content", new HtmlViewHeaderContent("content-" . $count . "-" . $this->identifier, $header, $metas, $description,$extra)); |
|
106 | + return $this->addElementInContent("content", new HtmlViewHeaderContent("content-".$count."-".$this->identifier, $header, $metas, $description, $extra)); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | public function addItemContent($content=array()) { |
110 | 110 | $count=\sizeof($this->content); |
111 | - return $this->addElementInContent("content", new HtmlViewContent("content-" . $count . "-" . $this->identifier, $content)); |
|
111 | + return $this->addElementInContent("content", new HtmlViewContent("content-".$count."-".$this->identifier, $content)); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | public function getItemContent($index=NULL) { |
@@ -134,13 +134,13 @@ discard block |
||
134 | 134 | * @see HtmlSemDoubleElement::compile() |
135 | 135 | */ |
136 | 136 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
137 | - $this->content=JArray::sortAssociative($this->content, [ "header","image","content","extra-content" ]); |
|
137 | + $this->content=JArray::sortAssociative($this->content, ["header", "image", "content", "extra-content"]); |
|
138 | 138 | return parent::compile($js, $view); |
139 | 139 | } |
140 | 140 | |
141 | - public function asLink($href="",$target=NULL) { |
|
141 | + public function asLink($href="", $target=NULL) { |
|
142 | 142 | $this->addToProperty("class", "link"); |
143 | - if ($href !== "") { |
|
143 | + if ($href!=="") { |
|
144 | 144 | $this->setProperty("href", $href); |
145 | 145 | if (isset($target)) |
146 | 146 | $this->setProperty("target", $target); |