@@ -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 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $item=$this->getItem($itemIndex); |
59 | 59 | if (isset($item)) { |
60 | 60 | $content=$item->getContent(); |
61 | - if(isset($content[$contentIndex])) |
|
61 | + if (isset($content[$contentIndex])) |
|
62 | 62 | return $content[$contentIndex]; |
63 | 63 | } |
64 | 64 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | return $this->addItem($function($object)); |
68 | 68 | } |
69 | 69 | |
70 | - public function run(JsUtils $js){ |
|
70 | + public function run(JsUtils $js) { |
|
71 | 71 | $result=parent::run($js); |
72 | 72 | return $result->setItemSelector(".item"); |
73 | 73 | } |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | class HtmlViewContent extends HtmlSemDoubleElement { |
14 | 14 | use ContentPartTrait; |
15 | 15 | public function __construct($identifier, $content=array()) { |
16 | - parent::__construct($identifier, "div", "content",[]); |
|
16 | + parent::__construct($identifier, "div", "content", []); |
|
17 | 17 | $this->setContent($content); |
18 | 18 | } |
19 | 19 | |
20 | - public function setContent($value){ |
|
20 | + public function setContent($value) { |
|
21 | 21 | if (\is_array($value)) { |
22 | 22 | $header=JArray::getValue($value, "header", 0); |
23 | 23 | $metas=JArray::getValue($value, "metas", 1); |
@@ -27,24 +27,24 @@ discard block |
||
27 | 27 | if (isset($image)) { |
28 | 28 | $this->addImage($image); |
29 | 29 | } |
30 | - $this->addHeaderContent($header, $metas, $description,$extra); |
|
30 | + $this->addHeaderContent($header, $metas, $description, $extra); |
|
31 | 31 | } else |
32 | 32 | $this->addContent($value); |
33 | 33 | } |
34 | 34 | |
35 | 35 | public function addElement($content, $baseClass="") { |
36 | 36 | $count=\sizeof($this->content); |
37 | - $result=new HtmlViewContent("element-" . $count . "-" . $this->identifier, $content); |
|
37 | + $result=new HtmlViewContent("element-".$count."-".$this->identifier, $content); |
|
38 | 38 | $result->setClass($baseClass); |
39 | 39 | $this->addContent($result); |
40 | 40 | return $result; |
41 | 41 | } |
42 | 42 | |
43 | 43 | public function addMeta($value, $direction=Direction::LEFT) { |
44 | - if (\array_key_exists("meta", $this->content) === false) { |
|
45 | - $this->content["meta"]=new HtmlSemDoubleElement("meta-" . $this->identifier, "div", "meta", array ()); |
|
44 | + if (\array_key_exists("meta", $this->content)===false) { |
|
45 | + $this->content["meta"]=new HtmlSemDoubleElement("meta-".$this->identifier, "div", "meta", array()); |
|
46 | 46 | } |
47 | - if ($direction === Direction::RIGHT) { |
|
47 | + if ($direction===Direction::RIGHT) { |
|
48 | 48 | $value=new HtmlSemDoubleElement("", "span", "", $value); |
49 | 49 | $value->setFloated($direction); |
50 | 50 | } |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | public function addExtra($value) { |
56 | - if (\array_key_exists("extra", $this->content) === false) { |
|
57 | - $this->content["extra"]=new HtmlSemDoubleElement("extra-" . $this->identifier, "div", "extra", array ()); |
|
56 | + if (\array_key_exists("extra", $this->content)===false) { |
|
57 | + $this->content["extra"]=new HtmlSemDoubleElement("extra-".$this->identifier, "div", "extra", array()); |
|
58 | 58 | } |
59 | 59 | $this->content["extra"]->addContent($value); |
60 | 60 | return $this->content["extra"]; |
@@ -75,15 +75,15 @@ discard block |
||
75 | 75 | * @param boolean $before |
76 | 76 | * @return HtmlButtonGroups |
77 | 77 | */ |
78 | - public function addContentButtons($elements=array(), $asIcons=false,$part="extra",$before=false){ |
|
79 | - $buttons=new HtmlButtonGroups("buttons-".$this->identifier,$elements,$asIcons); |
|
80 | - $this->addElementInPart($buttons,$part, $before,true); |
|
78 | + public function addContentButtons($elements=array(), $asIcons=false, $part="extra", $before=false) { |
|
79 | + $buttons=new HtmlButtonGroups("buttons-".$this->identifier, $elements, $asIcons); |
|
80 | + $this->addElementInPart($buttons, $part, $before, true); |
|
81 | 81 | return $buttons; |
82 | 82 | } |
83 | 83 | |
84 | 84 | public function addMetas($metas) { |
85 | 85 | if (\is_array($metas)) { |
86 | - foreach ( $metas as $meta ) { |
|
86 | + foreach ($metas as $meta) { |
|
87 | 87 | $this->addMeta($meta); |
88 | 88 | } |
89 | 89 | } else |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | public function addContentIcon($icon, $caption=NULL, $direction=Direction::LEFT) { |
95 | - if ($direction === Direction::RIGHT) { |
|
95 | + if ($direction===Direction::RIGHT) { |
|
96 | 96 | if (isset($caption)) { |
97 | 97 | $result=new HtmlSemDoubleElement("", "span", "", $caption); |
98 | 98 | $result->addIcon($icon); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | public function addContentText($caption, $direction=Direction::LEFT) { |
113 | - if ($direction === Direction::RIGHT) { |
|
113 | + if ($direction===Direction::RIGHT) { |
|
114 | 114 | $result=new HtmlSemDoubleElement("", "span", "", $caption); |
115 | 115 | $this->addContent($result); |
116 | 116 | $result->setFloated($direction); |
@@ -120,20 +120,20 @@ discard block |
||
120 | 120 | } |
121 | 121 | |
122 | 122 | public function addContentIcons($icons, $direction=Direction::LEFT) { |
123 | - foreach ( $icons as $icon ) { |
|
123 | + foreach ($icons as $icon) { |
|
124 | 124 | $this->addContentIcon($icon, NULL, $direction); |
125 | 125 | } |
126 | 126 | return $this; |
127 | 127 | } |
128 | 128 | |
129 | - public function addHeaderContent($header, $metas=array(), $description=NULL,$extra=NULL) { |
|
130 | - if(isset($header)) |
|
129 | + public function addHeaderContent($header, $metas=array(), $description=NULL, $extra=NULL) { |
|
130 | + if (isset($header)) |
|
131 | 131 | $this->addElement($header, "header"); |
132 | 132 | $this->addMetas($metas); |
133 | 133 | if (isset($description)) { |
134 | 134 | $this->addElement($description, "description"); |
135 | 135 | } |
136 | - if(isset($extra)){ |
|
136 | + if (isset($extra)) { |
|
137 | 137 | $this->addExtra($extra); |
138 | 138 | } |
139 | 139 | return $this; |