@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | class Style extends BaseEnum { |
8 | - const INFO="info",SUCCESS="success",POSITIVE="positive",WARNING="warning",ERROR="error",NEGATIVE="negative"; |
|
8 | + const INFO="info", SUCCESS="success", POSITIVE="positive", WARNING="warning", ERROR="error", NEGATIVE="negative"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -24,38 +24,38 @@ discard block |
||
24 | 24 | $this->setContent($content); |
25 | 25 | } |
26 | 26 | |
27 | - public function addHeader($header){ |
|
27 | + public function addHeader($header) { |
|
28 | 28 | $headerO=$header; |
29 | - if(\is_string($header)){ |
|
30 | - $headerO=new HtmlSemDoubleElement("header-".$this->identifier,"div"); |
|
29 | + if (\is_string($header)) { |
|
30 | + $headerO=new HtmlSemDoubleElement("header-".$this->identifier, "div"); |
|
31 | 31 | $headerO->setClass("header"); |
32 | 32 | $headerO->setContent($header); |
33 | 33 | } |
34 | - return $this->addContent($headerO,true); |
|
34 | + return $this->addContent($headerO, true); |
|
35 | 35 | } |
36 | 36 | |
37 | - public function addList($elements,$ordered=false){ |
|
38 | - $list=new HtmlList("list-".$this->identifier,$elements); |
|
37 | + public function addList($elements, $ordered=false) { |
|
38 | + $list=new HtmlList("list-".$this->identifier, $elements); |
|
39 | 39 | $list->setOrdered($ordered); |
40 | 40 | $list->setClass("ui list"); |
41 | 41 | $this->addContent($list); |
42 | 42 | } |
43 | 43 | |
44 | - public function setIcon($icon){ |
|
44 | + public function setIcon($icon) { |
|
45 | 45 | $this->addToProperty("class", "icon"); |
46 | - $this->wrapContent("<div class='content'>","</div>"); |
|
46 | + $this->wrapContent("<div class='content'>", "</div>"); |
|
47 | 47 | $this->icon=new HtmlIcon("icon-".$this->identifier, $icon); |
48 | 48 | return $this; |
49 | 49 | } |
50 | 50 | |
51 | - public function addLoader($loaderIcon="notched circle"){ |
|
51 | + public function addLoader($loaderIcon="notched circle") { |
|
52 | 52 | $this->setIcon($loaderIcon); |
53 | 53 | $this->icon->addToIcon("loading"); |
54 | 54 | return $this; |
55 | 55 | } |
56 | 56 | |
57 | - public function setDismissable($dismiss=true){ |
|
58 | - if($dismiss===true) |
|
57 | + public function setDismissable($dismiss=true) { |
|
58 | + if ($dismiss===true) |
|
59 | 59 | $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
60 | 60 | else |
61 | 61 | $this->close=NULL; |
@@ -66,28 +66,28 @@ discard block |
||
66 | 66 | * {@inheritDoc} |
67 | 67 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
68 | 68 | */ |
69 | - public function run(JsUtils $js){ |
|
69 | + public function run(JsUtils $js) { |
|
70 | 70 | parent::run($js); |
71 | - if(isset($this->close)){ |
|
71 | + if (isset($this->close)) { |
|
72 | 72 | $js->execOn("click", "#".$this->identifier." .close", "$(this).closest('.message').transition('fade')"); |
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | - public function setState($visible=true){ |
|
77 | - $visible=($visible===true)?"visible":"hidden"; |
|
78 | - return $this->addToPropertyCtrl("class", $visible, array("visible","hidden")); |
|
76 | + public function setState($visible=true) { |
|
77 | + $visible=($visible===true) ? "visible" : "hidden"; |
|
78 | + return $this->addToPropertyCtrl("class", $visible, array("visible", "hidden")); |
|
79 | 79 | } |
80 | 80 | |
81 | - public function setVariation($value="floating"){ |
|
82 | - return $this->addToPropertyCtrl("class", $value, array("floating","compact")); |
|
81 | + public function setVariation($value="floating") { |
|
82 | + return $this->addToPropertyCtrl("class", $value, array("floating", "compact")); |
|
83 | 83 | } |
84 | 84 | |
85 | - public function setStyle($style){ |
|
85 | + public function setStyle($style) { |
|
86 | 86 | return $this->addToPropertyCtrl("class", $style, Style::getConstants()); |
87 | 87 | } |
88 | 88 | |
89 | - public function setAttached(HtmlDoubleElement $toElement=NULL){ |
|
90 | - if(isset($toElement)){ |
|
89 | + public function setAttached(HtmlDoubleElement $toElement=NULL) { |
|
90 | + if (isset($toElement)) { |
|
91 | 91 | $toElement->addToProperty("class", "attached"); |
92 | 92 | } |
93 | 93 | return $this->addToProperty("class", "attached"); |
@@ -55,10 +55,11 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | public function setDismissable($dismiss=true){ |
58 | - if($dismiss===true) |
|
59 | - $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
60 | - else |
|
61 | - $this->close=NULL; |
|
58 | + if($dismiss===true) { |
|
59 | + $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
60 | + } else { |
|
61 | + $this->close=NULL; |
|
62 | + } |
|
62 | 63 | return $this; |
63 | 64 | } |
64 | 65 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @param string $identifier |
54 | 54 | * @param string $icon |
55 | 55 | */ |
56 | - public function htmlIcon($identifier,$icon){ |
|
56 | + public function htmlIcon($identifier, $icon) { |
|
57 | 57 | return $this->addHtmlComponent(new HtmlIcon($identifier, $icon)); |
58 | 58 | } |
59 | 59 | |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | * @param string $size |
63 | 63 | * @param array $icons |
64 | 64 | */ |
65 | - public function htmlIconGroups($identifier,$size="",$icons=array()){ |
|
66 | - $group=new HtmlIconGroups($identifier,$size); |
|
67 | - if(JArray::isAssociative($icons)){ |
|
68 | - foreach ($icons as $icon=>$size){ |
|
69 | - $group->add($icon,$size); |
|
65 | + public function htmlIconGroups($identifier, $size="", $icons=array()) { |
|
66 | + $group=new HtmlIconGroups($identifier, $size); |
|
67 | + if (JArray::isAssociative($icons)) { |
|
68 | + foreach ($icons as $icon=>$size) { |
|
69 | + $group->add($icon, $size); |
|
70 | 70 | } |
71 | - }else{ |
|
72 | - foreach ($icons as $icon){ |
|
71 | + }else { |
|
72 | + foreach ($icons as $icon) { |
|
73 | 73 | $group->add($icon); |
74 | 74 | } |
75 | 75 | } |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | * @param array $elements |
82 | 82 | * @param boolean $asIcons |
83 | 83 | */ |
84 | - public function htmlButtonGroups($identifier,$elements=array(),$asIcons=false){ |
|
85 | - return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements,$asIcons)); |
|
84 | + public function htmlButtonGroups($identifier, $elements=array(), $asIcons=false) { |
|
85 | + return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements, $asIcons)); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @param string $identifier |
91 | 91 | * @param string $content |
92 | 92 | */ |
93 | - public function htmlContainer($identifier,$content=""){ |
|
93 | + public function htmlContainer($identifier, $content="") { |
|
94 | 94 | return $this->addHtmlComponent(new HtmlContainer($identifier, $content)); |
95 | 95 | } |
96 | 96 | |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | * @param string $identifier |
99 | 99 | * @param string $content |
100 | 100 | */ |
101 | - public function htmlDivider($identifier,$content="",$tagName="div"){ |
|
102 | - return $this->addHtmlComponent(new HtmlDivider($identifier, $content,$tagName)); |
|
101 | + public function htmlDivider($identifier, $content="", $tagName="div") { |
|
102 | + return $this->addHtmlComponent(new HtmlDivider($identifier, $content, $tagName)); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -107,16 +107,16 @@ discard block |
||
107 | 107 | * @param string $content |
108 | 108 | * @param string $tagName |
109 | 109 | */ |
110 | - public function htmlLabel($identifier,$content="",$tagName="div"){ |
|
111 | - return $this->addHtmlComponent(new HtmlLabel($identifier, $content,$tagName)); |
|
110 | + public function htmlLabel($identifier, $content="", $tagName="div") { |
|
111 | + return $this->addHtmlComponent(new HtmlLabel($identifier, $content, $tagName)); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
115 | 115 | * @param string $identifier |
116 | 116 | * @param array $items |
117 | 117 | */ |
118 | - public function htmlMenu($identifier,$items=array()){ |
|
119 | - return $this->addHtmlComponent(new HtmlMenu($identifier,$items)); |
|
118 | + public function htmlMenu($identifier, $items=array()) { |
|
119 | + return $this->addHtmlComponent(new HtmlMenu($identifier, $items)); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -124,15 +124,15 @@ discard block |
||
124 | 124 | * @param string $value |
125 | 125 | * @param array $items |
126 | 126 | */ |
127 | - public function htmlDropdown($identifier, $value="", $items=array()){ |
|
128 | - return $this->addHtmlComponent(new HtmlDropdown($identifier,$value,$items)); |
|
127 | + public function htmlDropdown($identifier, $value="", $items=array()) { |
|
128 | + return $this->addHtmlComponent(new HtmlDropdown($identifier, $value, $items)); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
132 | 132 | * @param string $identifier |
133 | 133 | * @param string $content |
134 | 134 | */ |
135 | - public function htmlMessage($identifier, $content=""){ |
|
136 | - return $this->addHtmlComponent(new HtmlMessage($identifier,$content)); |
|
135 | + public function htmlMessage($identifier, $content="") { |
|
136 | + return $this->addHtmlComponent(new HtmlMessage($identifier, $content)); |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | \ No newline at end of file |
@@ -5,23 +5,23 @@ discard block |
||
5 | 5 | use Ajax\common\html\HtmlDoubleElement; |
6 | 6 | |
7 | 7 | abstract class HtmlCollection extends HtmlDoubleElement { |
8 | - public function __construct($identifier,$tagName="div"){ |
|
9 | - parent::__construct($identifier,$tagName); |
|
8 | + public function __construct($identifier, $tagName="div") { |
|
9 | + parent::__construct($identifier, $tagName); |
|
10 | 10 | $this->content=array(); |
11 | 11 | } |
12 | 12 | |
13 | - public function addItems($items){ |
|
14 | - foreach ($items as $item){ |
|
13 | + public function addItems($items) { |
|
14 | + foreach ($items as $item) { |
|
15 | 15 | $this->addItem($item); |
16 | 16 | } |
17 | 17 | } |
18 | 18 | |
19 | - public function setItems($items){ |
|
19 | + public function setItems($items) { |
|
20 | 20 | $this->content=$items; |
21 | 21 | return $this; |
22 | 22 | } |
23 | 23 | |
24 | - public function getItems(){ |
|
24 | + public function getItems() { |
|
25 | 25 | return $this->content; |
26 | 26 | } |
27 | 27 | |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | * @param HtmlDoubleElement|string $item |
31 | 31 | * @return \Ajax\common\html\HtmlDoubleElement |
32 | 32 | */ |
33 | - public function addItem($item){ |
|
33 | + public function addItem($item) { |
|
34 | 34 | $itemO=$item; |
35 | - if(\is_string($item)){ |
|
35 | + if (\is_string($item)) { |
|
36 | 36 | $itemO=$this->createItem($item); |
37 | 37 | } |
38 | 38 | $this->addContent($itemO); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | return $this; |
59 | 59 | } |
60 | 60 | |
61 | - public function count(){ |
|
61 | + public function count() { |
|
62 | 62 | return \sizeof($this->content); |
63 | 63 | } |
64 | 64 | /** |
@@ -45,9 +45,9 @@ |
||
45 | 45 | * @return \Ajax\common\html\HtmlDoubleElement |
46 | 46 | */ |
47 | 47 | public function getItem($index) { |
48 | - if (is_int($index)) |
|
49 | - return $this->content[$index]; |
|
50 | - else { |
|
48 | + if (is_int($index)) { |
|
49 | + return $this->content[$index]; |
|
50 | + } else { |
|
51 | 51 | $elm=$this->getElementById($index, $this->content); |
52 | 52 | return $elm; |
53 | 53 | } |
@@ -13,8 +13,8 @@ |
||
13 | 13 | parent::__construct($identifier, "ul"); |
14 | 14 | $this->addItems($items); |
15 | 15 | } |
16 | - public function setOrdered($ordered=true){ |
|
17 | - $this->tagName=($ordered===true)?"ol":"ul"; |
|
16 | + public function setOrdered($ordered=true) { |
|
17 | + $this->tagName=($ordered===true) ? "ol" : "ul"; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |