@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | /** |
35 | 35 | * Set the button value |
36 | 36 | * @param string $value |
37 | - * @return \Ajax\semantic\html\HtmlButton |
|
37 | + * @return HtmlButton |
|
38 | 38 | */ |
39 | 39 | public function setValue($value) { |
40 | 40 | $this->content=$value; |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | |
44 | 44 | /** |
45 | 45 | * define the button style |
46 | - * @param string|int $cssStyle |
|
47 | - * @return \Ajax\semantic\html\HtmlButton default : "" |
|
46 | + * @param string $cssStyle |
|
47 | + * @return HtmlButton default : "" |
|
48 | 48 | */ |
49 | 49 | public function setStyle($cssStyle) { |
50 | 50 | return $this->addToProperty("class",$cssStyle); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
90 | - * @param string|HtmlIcon $icon |
|
90 | + * @param string $icon |
|
91 | 91 | * @return \Ajax\semantic\html\elements\HtmlButton |
92 | 92 | */ |
93 | 93 | public function asIcon($icon){ |
@@ -47,20 +47,20 @@ discard block |
||
47 | 47 | * @return \Ajax\semantic\html\HtmlButton default : "" |
48 | 48 | */ |
49 | 49 | public function setStyle($cssStyle) { |
50 | - return $this->addToProperty("class",$cssStyle); |
|
50 | + return $this->addToProperty("class", $cssStyle); |
|
51 | 51 | } |
52 | 52 | |
53 | - public function setFocusable(){ |
|
53 | + public function setFocusable() { |
|
54 | 54 | $this->setProperty("tabindex", "0"); |
55 | 55 | } |
56 | 56 | |
57 | - public function setAnimated($content,$animation=""){ |
|
57 | + public function setAnimated($content, $animation="") { |
|
58 | 58 | $this->setTagName("div"); |
59 | 59 | $this->addToProperty("class", "animated ".$animation); |
60 | - $visible=new HtmlSemDoubleElement("visible-".$this->identifier,"div"); |
|
60 | + $visible=new HtmlSemDoubleElement("visible-".$this->identifier, "div"); |
|
61 | 61 | $visible->setClass("visible content"); |
62 | 62 | $visible->setContent($this->content); |
63 | - $hidden=new HtmlSemDoubleElement("hidden-".$this->identifier,"div"); |
|
63 | + $hidden=new HtmlSemDoubleElement("hidden-".$this->identifier, "div"); |
|
64 | 64 | $hidden->setClass("hidden content"); |
65 | 65 | $hidden->setContent($content); |
66 | 66 | $this->content=$visible.$hidden; |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | * @param string|HtmlIcon $icon |
71 | 71 | * @return \Ajax\semantic\html\elements\HtmlButton |
72 | 72 | */ |
73 | - public function asIcon($icon){ |
|
73 | + public function asIcon($icon) { |
|
74 | 74 | $iconO=$icon; |
75 | - if(\is_string($icon)){ |
|
75 | + if (\is_string($icon)) { |
|
76 | 76 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
77 | 77 | } |
78 | 78 | $this->addToProperty("class", "icon"); |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | * @param string $before |
87 | 87 | * @return \Ajax\semantic\html\elements\HtmlLabel |
88 | 88 | */ |
89 | - public function addLabel($caption,$before=false){ |
|
89 | + public function addLabel($caption, $before=false) { |
|
90 | 90 | $this->tagName="div"; |
91 | 91 | $this->addToProperty("class", "labeled"); |
92 | - $this->content=new HtmlButton("button-".$this->identifier,$this->content); |
|
92 | + $this->content=new HtmlButton("button-".$this->identifier, $this->content); |
|
93 | 93 | $this->content->setTagName("div"); |
94 | - $label=new HtmlLabel("label-".$this->identifier,$caption,"a"); |
|
94 | + $label=new HtmlLabel("label-".$this->identifier, $caption, "a"); |
|
95 | 95 | $label->setBasic(); |
96 | - $this->addContent($label,$before); |
|
96 | + $this->addContent($label, $before); |
|
97 | 97 | return $label; |
98 | 98 | } |
99 | 99 | /* |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function fromArray($array) { |
104 | 104 | $array=parent::fromArray($array); |
105 | - foreach ( $array as $key => $value ) { |
|
105 | + foreach ($array as $key => $value) { |
|
106 | 106 | $this->setProperty($key, $value); |
107 | 107 | } |
108 | 108 | return $array; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * show it is currently the active user selection |
113 | 113 | * @return \Ajax\semantic\html\elements\HtmlButton |
114 | 114 | */ |
115 | - public function setActive(){ |
|
115 | + public function setActive() { |
|
116 | 116 | return $this->addToProperty("class", "active"); |
117 | 117 | } |
118 | 118 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * hint towards a positive consequence |
121 | 121 | * @return \Ajax\semantic\html\elements\HtmlButton |
122 | 122 | */ |
123 | - public function setPositive(){ |
|
123 | + public function setPositive() { |
|
124 | 124 | return $this->addToProperty("class", "positive"); |
125 | 125 | } |
126 | 126 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * hint towards a negative consequence |
129 | 129 | * @return \Ajax\semantic\html\elements\HtmlButton |
130 | 130 | */ |
131 | - public function setNegative(){ |
|
131 | + public function setNegative() { |
|
132 | 132 | return $this->addToProperty("class", "negative"); |
133 | 133 | } |
134 | 134 | |
@@ -136,14 +136,14 @@ discard block |
||
136 | 136 | * formatted to toggle on/off |
137 | 137 | * @return \Ajax\semantic\html\elements\HtmlButton |
138 | 138 | */ |
139 | - public function setToggle(){ |
|
139 | + public function setToggle() { |
|
140 | 140 | return $this->addToProperty("class", "toggle"); |
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
144 | 144 | * @return \Ajax\semantic\html\elements\HtmlButton |
145 | 145 | */ |
146 | - public function setCircular(){ |
|
146 | + public function setCircular() { |
|
147 | 147 | return $this->addToProperty("class", "circular"); |
148 | 148 | } |
149 | 149 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * button is less pronounced |
152 | 152 | * @return \Ajax\semantic\html\elements\HtmlButton |
153 | 153 | */ |
154 | - public function setBasic(){ |
|
154 | + public function setBasic() { |
|
155 | 155 | return $this->addToProperty("class", "basic"); |
156 | 156 | } |
157 | 157 | } |
158 | 158 | \ No newline at end of file |
@@ -7,7 +7,7 @@ |
||
7 | 7 | |
8 | 8 | class HtmlImg extends HtmlSingleElement { |
9 | 9 | |
10 | - public function __construct($identifier,$src="",$alt="") { |
|
10 | + public function __construct($identifier, $src="", $alt="") { |
|
11 | 11 | parent::__construct($identifier, "img"); |
12 | 12 | $this->setSrc($src); |
13 | 13 | $this->setAlt($alt); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | protected $attributes; |
18 | 18 | protected $color; |
19 | 19 | |
20 | - public function __construct($identifier,$icon) { |
|
20 | + public function __construct($identifier, $icon) { |
|
21 | 21 | parent::__construct($identifier, "i"); |
22 | 22 | $this->icon=$icon; |
23 | 23 | $this->_template='<i class="%icon% icon %size% %attributes% %color%"></i>'; |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | * @see \Ajax\common\html\HtmlSingleElement::setSize() |
43 | 43 | */ |
44 | 44 | public function setSize($size) { |
45 | - $this->setMemberCtrl($this->size, $size,Size::getConstants()); |
|
45 | + $this->setMemberCtrl($this->size, $size, Size::getConstants()); |
|
46 | 46 | return $this; |
47 | 47 | } |
48 | 48 | |
49 | - public function setDisabled(){ |
|
49 | + public function setDisabled() { |
|
50 | 50 | return $this->addToMember($this->attributes, "disabled"); |
51 | 51 | } |
52 | 52 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * Icon used as a simple loader |
55 | 55 | * @return \Ajax\semantic\html\HtmlIcon |
56 | 56 | */ |
57 | - public function asLoader(){ |
|
57 | + public function asLoader() { |
|
58 | 58 | return $this->addToMember($this->attributes, "loading"); |
59 | 59 | } |
60 | 60 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * An icon can be fitted, without any space to the left or right of it. |
63 | 63 | * @return \Ajax\semantic\html\HtmlIcon |
64 | 64 | */ |
65 | - public function setFitted(){ |
|
65 | + public function setFitted() { |
|
66 | 66 | return $this->addToMember($this->attributes, "fitted"); |
67 | 67 | } |
68 | 68 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param string $sens horizontally or vertically |
71 | 71 | * @return \Ajax\semantic\html\HtmlIcon |
72 | 72 | */ |
73 | - public function setFlipped($sens="horizontally"){ |
|
73 | + public function setFlipped($sens="horizontally") { |
|
74 | 74 | return $this->addToMember($this->attributes, "flipped ".$sens); |
75 | 75 | } |
76 | 76 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @param string $sens clockwise or counterclockwise |
79 | 79 | * @return \Ajax\semantic\html\HtmlIcon |
80 | 80 | */ |
81 | - public function setRotated($sens="clockwise"){ |
|
81 | + public function setRotated($sens="clockwise") { |
|
82 | 82 | return $this->addToMember($this->attributes, "rotated ".$sens); |
83 | 83 | } |
84 | 84 | |
@@ -86,13 +86,13 @@ discard block |
||
86 | 86 | * icon formatted as a link |
87 | 87 | * @return \Ajax\semantic\html\HtmlIcon |
88 | 88 | */ |
89 | - public function asLink(){ |
|
89 | + public function asLink() { |
|
90 | 90 | return $this->addToMember($this->attributes, "link"); |
91 | 91 | } |
92 | 92 | |
93 | - public function setCircular($inverted=false){ |
|
93 | + public function setCircular($inverted=false) { |
|
94 | 94 | $invertedStr=""; |
95 | - if($inverted!==false) |
|
95 | + if ($inverted!==false) |
|
96 | 96 | $invertedStr=" inverted"; |
97 | 97 | return $this->addToMember($this->attributes, "circular".$invertedStr); |
98 | 98 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | /** |
101 | 101 | * @return \Ajax\semantic\html\HtmlIcon |
102 | 102 | */ |
103 | - public function setInverted(){ |
|
103 | + public function setInverted() { |
|
104 | 104 | return $this->addToMember($this->attributes, "inverted"); |
105 | 105 | } |
106 | 106 | |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | * @param string $inverted |
109 | 109 | * @return \Ajax\semantic\html\HtmlIcon |
110 | 110 | */ |
111 | - public function setBordered($inverted=false){ |
|
111 | + public function setBordered($inverted=false) { |
|
112 | 112 | $invertedStr=""; |
113 | - if($inverted!==false) |
|
113 | + if ($inverted!==false) |
|
114 | 114 | $invertedStr=" inverted"; |
115 | 115 | return $this->addToMember($this->attributes, "bordered".$invertedStr); |
116 | 116 | } |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | * @param string $color |
120 | 120 | * @return \Ajax\semantic\html\HtmlIcon |
121 | 121 | */ |
122 | - public function setColor($color){ |
|
122 | + public function setColor($color) { |
|
123 | 123 | return $this->setMemberCtrl($this->color, $color, Color::getConstants()); |
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
127 | 127 | * @return \Ajax\semantic\html\HtmlIcon |
128 | 128 | */ |
129 | - public function toCorner(){ |
|
129 | + public function toCorner() { |
|
130 | 130 | return $this->addToMember($this->attributes, "corner"); |
131 | 131 | } |
132 | 132 | } |
133 | 133 | \ No newline at end of file |
@@ -92,8 +92,9 @@ discard block |
||
92 | 92 | |
93 | 93 | public function setCircular($inverted=false){ |
94 | 94 | $invertedStr=""; |
95 | - if($inverted!==false) |
|
96 | - $invertedStr=" inverted"; |
|
95 | + if($inverted!==false) { |
|
96 | + $invertedStr=" inverted"; |
|
97 | + } |
|
97 | 98 | return $this->addToMember($this->attributes, "circular".$invertedStr); |
98 | 99 | } |
99 | 100 | |
@@ -110,8 +111,9 @@ discard block |
||
110 | 111 | */ |
111 | 112 | public function setBordered($inverted=false){ |
112 | 113 | $invertedStr=""; |
113 | - if($inverted!==false) |
|
114 | - $invertedStr=" inverted"; |
|
114 | + if($inverted!==false) { |
|
115 | + $invertedStr=" inverted"; |
|
116 | + } |
|
115 | 117 | return $this->addToMember($this->attributes, "bordered".$invertedStr); |
116 | 118 | } |
117 | 119 |
@@ -22,8 +22,9 @@ |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | public function setAlignement($value="justified"){ |
25 | - if($value!=="justified") |
|
26 | - $value.=" aligned"; |
|
25 | + if($value!=="justified") { |
|
26 | + $value.=" aligned"; |
|
27 | + } |
|
27 | 28 | return $this->addToProperty("class", $value); |
28 | 29 | } |
29 | 30 |
@@ -17,13 +17,13 @@ |
||
17 | 17 | $this->setProperty("class", "ui container"); |
18 | 18 | } |
19 | 19 | |
20 | - public function setAlignement($value="justified"){ |
|
21 | - if($value!=="justified") |
|
20 | + public function setAlignement($value="justified") { |
|
21 | + if ($value!=="justified") |
|
22 | 22 | $value.=" aligned"; |
23 | 23 | return $this->addToProperty("class", $value); |
24 | 24 | } |
25 | 25 | |
26 | - public function setTextContainer(){ |
|
26 | + public function setTextContainer() { |
|
27 | 27 | return $this->addToProperty("class", "text"); |
28 | 28 | } |
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | class HtmlDivider extends HtmlDoubleElement { |
13 | 13 | |
14 | - public function __construct($identifier, $content="",$tagName="div") { |
|
14 | + public function __construct($identifier, $content="", $tagName="div") { |
|
15 | 15 | parent::__construct($identifier, $tagName); |
16 | 16 | $this->setClass("ui divider"); |
17 | 17 | $this->content=$content; |
@@ -21,23 +21,23 @@ discard block |
||
21 | 21 | * vertical divider |
22 | 22 | * @return \Ajax\semantic\html\elements\HtmlDivider |
23 | 23 | */ |
24 | - public function setVertical(){ |
|
25 | - return $this->addToPropertyUnique("class", "vertical", array("vertical","horizontal")); |
|
24 | + public function setVertical() { |
|
25 | + return $this->addToPropertyUnique("class", "vertical", array("vertical", "horizontal")); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
29 | 29 | * horizontal divider |
30 | 30 | * @return \Ajax\semantic\html\elements\HtmlDivider |
31 | 31 | */ |
32 | - public function setHorizontal(){ |
|
33 | - return $this->addToPropertyUnique("class", "horizontal", array("vertical","horizontal")); |
|
32 | + public function setHorizontal() { |
|
33 | + return $this->addToPropertyUnique("class", "horizontal", array("vertical", "horizontal")); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * hide the divider |
38 | 38 | * @return \Ajax\semantic\html\elements\HtmlDivider |
39 | 39 | */ |
40 | - public function setHidden(){ |
|
40 | + public function setHidden() { |
|
41 | 41 | return $this->addToProperty("class", "hidden"); |
42 | 42 | } |
43 | 43 | |
@@ -45,14 +45,14 @@ discard block |
||
45 | 45 | * fitted, without any space above or below it |
46 | 46 | * @return \Ajax\semantic\html\elements\HtmlDivider |
47 | 47 | */ |
48 | - public function setFitted(){ |
|
48 | + public function setFitted() { |
|
49 | 49 | return $this->addToProperty("class", "fitted"); |
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | 53 | * @return \Ajax\semantic\html\elements\HtmlDivider |
54 | 54 | */ |
55 | - public function asHeader(){ |
|
55 | + public function asHeader() { |
|
56 | 56 | return $this->addToProperty("class", "header"); |
57 | 57 | } |
58 | 58 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * inverts the divider colors |
61 | 61 | * @return \Ajax\semantic\html\elements\HtmlDivider |
62 | 62 | */ |
63 | - public function setInverted(){ |
|
63 | + public function setInverted() { |
|
64 | 64 | return $this->addToProperty("class", "inverted"); |
65 | 65 | } |
66 | 66 | } |
67 | 67 | \ No newline at end of file |
@@ -11,36 +11,36 @@ discard block |
||
11 | 11 | */ |
12 | 12 | class HtmlButtonGroups extends HtmlSemDoubleElement { |
13 | 13 | |
14 | - public function __construct($identifier, $elements=array(),$asIcons=false) { |
|
14 | + public function __construct($identifier, $elements=array(), $asIcons=false) { |
|
15 | 15 | parent::__construct($identifier, "div"); |
16 | 16 | $this->setProperty("class", "ui buttons"); |
17 | 17 | $this->content=array(); |
18 | - if($asIcons===true) |
|
18 | + if ($asIcons===true) |
|
19 | 19 | $this->asIcons(); |
20 | - $this->addElements($elements,$asIcons); |
|
20 | + $this->addElements($elements, $asIcons); |
|
21 | 21 | } |
22 | - public function addElement($element,$asIcon=false){ |
|
22 | + public function addElement($element, $asIcon=false) { |
|
23 | 23 | $elementO=$element; |
24 | - if(\is_string($element)){ |
|
25 | - if($asIcon){ |
|
24 | + if (\is_string($element)) { |
|
25 | + if ($asIcon) { |
|
26 | 26 | $elementO=new HtmlButton("button-".\sizeof($this->content)); |
27 | 27 | $elementO->asIcon($element); |
28 | 28 | }else |
29 | - $elementO=new HtmlButton("button-".\sizeof($this->content),$element); |
|
29 | + $elementO=new HtmlButton("button-".\sizeof($this->content), $element); |
|
30 | 30 | } |
31 | 31 | $this->addContent($elementO); |
32 | 32 | } |
33 | 33 | |
34 | 34 | |
35 | - public function addElements($elements,$asIcons=false) { |
|
36 | - foreach ( $elements as $element ) { |
|
37 | - $this->addElement($element,$asIcons); |
|
35 | + public function addElements($elements, $asIcons=false) { |
|
36 | + foreach ($elements as $element) { |
|
37 | + $this->addElement($element, $asIcons); |
|
38 | 38 | } |
39 | 39 | return $this; |
40 | 40 | } |
41 | 41 | |
42 | - public function insertOr($aferIndex=0,$or="OR"){ |
|
43 | - $orElement=new HtmlSemDoubleElement("or-".$this->identifier,"div"); |
|
42 | + public function insertOr($aferIndex=0, $or="OR") { |
|
43 | + $orElement=new HtmlSemDoubleElement("or-".$this->identifier, "div"); |
|
44 | 44 | $orElement->setClass("or"); |
45 | 45 | $orElement->setProperty("data-text", $or); |
46 | 46 | array_splice($this->content, $aferIndex+1, 0, array($orElement)); |
@@ -54,15 +54,15 @@ discard block |
||
54 | 54 | $this->addElements($array); |
55 | 55 | } |
56 | 56 | |
57 | - public function asIcons(){ |
|
57 | + public function asIcons() { |
|
58 | 58 | return $this->addToProperty("class", "icons"); |
59 | 59 | } |
60 | 60 | |
61 | - public function setVertical(){ |
|
61 | + public function setVertical() { |
|
62 | 62 | return $this->addToProperty("class", "vertical"); |
63 | 63 | } |
64 | 64 | |
65 | - public function setLabeled(){ |
|
65 | + public function setLabeled() { |
|
66 | 66 | return $this->addToProperty("class", "labeled icon"); |
67 | 67 | } |
68 | 68 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @see \Ajax\bootstrap\html\base\BaseHtml::on() |
91 | 91 | */ |
92 | 92 | public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
93 | - foreach ( $this->content as $element ) { |
|
93 | + foreach ($this->content as $element) { |
|
94 | 94 | $element->on($event, $jsCode, $stopPropagation, $preventDefault); |
95 | 95 | } |
96 | 96 | return $this; |
@@ -15,8 +15,9 @@ discard block |
||
15 | 15 | parent::__construct($identifier, "div"); |
16 | 16 | $this->setProperty("class", "ui buttons"); |
17 | 17 | $this->content=array(); |
18 | - if($asIcons===true) |
|
19 | - $this->asIcons(); |
|
18 | + if($asIcons===true) { |
|
19 | + $this->asIcons(); |
|
20 | + } |
|
20 | 21 | $this->addElements($elements,$asIcons); |
21 | 22 | } |
22 | 23 | public function addElement($element,$asIcon=false){ |
@@ -25,8 +26,9 @@ discard block |
||
25 | 26 | if($asIcon){ |
26 | 27 | $elementO=new HtmlButton("button-".\sizeof($this->content)); |
27 | 28 | $elementO->asIcon($element); |
28 | - }else |
|
29 | - $elementO=new HtmlButton("button-".\sizeof($this->content),$element); |
|
29 | + } else { |
|
30 | + $elementO=new HtmlButton("button-".\sizeof($this->content),$element); |
|
31 | + } |
|
30 | 32 | } |
31 | 33 | $this->addContent($elementO); |
32 | 34 | } |
@@ -72,9 +74,9 @@ discard block |
||
72 | 74 | * @return HtmlButton |
73 | 75 | */ |
74 | 76 | public function getElement($index) { |
75 | - if (is_int($index)) |
|
76 | - return $this->content[$index]; |
|
77 | - else { |
|
77 | + if (is_int($index)) { |
|
78 | + return $this->content[$index]; |
|
79 | + } else { |
|
78 | 80 | $elm=$this->getElementById($index, $this->content); |
79 | 81 | return $elm; |
80 | 82 | } |
@@ -2,5 +2,5 @@ |
||
2 | 2 | namespace Ajax\semantic\html\base; |
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | abstract class Size extends BaseEnum { |
5 | - const MINI="mini", TINY="tiny", SMALL="small", MEDIUM="",LARGE="large", BIG="big", HUGE="huge", MASSIVE="massive"; |
|
5 | + const MINI="mini", TINY="tiny", SMALL="small", MEDIUM="", LARGE="large", BIG="big", HUGE="huge", MASSIVE="massive"; |
|
6 | 6 | } |
7 | 7 | \ No newline at end of file |
@@ -19,6 +19,7 @@ discard block |
||
19 | 19 | /** |
20 | 20 | * {@inheritDoc} |
21 | 21 | * @see \Ajax\common\html\HtmlSingleElement::setSize() |
22 | + * @param string $size |
|
22 | 23 | */ |
23 | 24 | public function setSize($size){ |
24 | 25 | return $this->addToPropertyCtrl("class", $size, Size::getConstants()); |
@@ -26,7 +27,7 @@ discard block |
||
26 | 27 | |
27 | 28 | /** |
28 | 29 | * show it is currently unable to be interacted with |
29 | - * @return \Ajax\semantic\html\elements\HtmlSemDoubleElement |
|
30 | + * @return HtmlSemDoubleElement |
|
30 | 31 | */ |
31 | 32 | public function setDisabled(){ |
32 | 33 | return $this->addToProperty("class", "disabled"); |
@@ -41,8 +41,9 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | public function setPopupAttributes($variation=NULL,$popupEvent=NULL){ |
44 | - if(isset($this->_popup)) |
|
45 | - $this->_popup->setAttributes($variation,$popupEvent); |
|
44 | + if(isset($this->_popup)) { |
|
45 | + $this->_popup->setAttributes($variation,$popupEvent); |
|
46 | + } |
|
46 | 47 | } |
47 | 48 | |
48 | 49 | public function addPopup($title="",$content="",$variation=NULL,$params=array()){ |
@@ -82,8 +83,9 @@ discard block |
||
82 | 83 | } |
83 | 84 | |
84 | 85 | public function compile(JsUtils $js=NULL, View $view=NULL){ |
85 | - if(isset($this->_popup)) |
|
86 | - $this->_popup->compile(); |
|
86 | + if(isset($this->_popup)) { |
|
87 | + $this->_popup->compile(); |
|
88 | + } |
|
87 | 89 | return parent::compile($js,$view); |
88 | 90 | } |
89 | 91 | public function run(JsUtils $js){ |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * {@inheritDoc} |
21 | 21 | * @see \Ajax\common\html\HtmlSingleElement::setSize() |
22 | 22 | */ |
23 | - public function setSize($size){ |
|
23 | + public function setSize($size) { |
|
24 | 24 | return $this->addToPropertyCtrl("class", $size, Size::getConstants()); |
25 | 25 | } |
26 | 26 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * show it is currently unable to be interacted with |
29 | 29 | * @return \Ajax\semantic\html\elements\HtmlSemDoubleElement |
30 | 30 | */ |
31 | - public function setDisabled(){ |
|
31 | + public function setDisabled() { |
|
32 | 32 | return $this->addToProperty("class", "disabled"); |
33 | 33 | } |
34 | 34 | |
@@ -36,35 +36,35 @@ discard block |
||
36 | 36 | * @param string $color |
37 | 37 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
38 | 38 | */ |
39 | - public function setColor($color){ |
|
40 | - return $this->addToPropertyCtrl("class", $color,Color::getConstants()); |
|
39 | + public function setColor($color) { |
|
40 | + return $this->addToPropertyCtrl("class", $color, Color::getConstants()); |
|
41 | 41 | } |
42 | 42 | |
43 | - public function setPopupAttributes($variation=NULL,$popupEvent=NULL){ |
|
44 | - if(isset($this->_popup)) |
|
45 | - $this->_popup->setAttributes($variation,$popupEvent); |
|
43 | + public function setPopupAttributes($variation=NULL, $popupEvent=NULL) { |
|
44 | + if (isset($this->_popup)) |
|
45 | + $this->_popup->setAttributes($variation, $popupEvent); |
|
46 | 46 | } |
47 | 47 | |
48 | - public function addPopup($title="",$content="",$variation=NULL,$params=array()){ |
|
49 | - $this->_popup=new InternalPopup($this,$title,$content,$variation,$params); |
|
48 | + public function addPopup($title="", $content="", $variation=NULL, $params=array()) { |
|
49 | + $this->_popup=new InternalPopup($this, $title, $content, $variation, $params); |
|
50 | 50 | return $this; |
51 | 51 | } |
52 | 52 | |
53 | - public function addPopupHtml($html="",$variation=NULL,$params=array()){ |
|
53 | + public function addPopupHtml($html="", $variation=NULL, $params=array()) { |
|
54 | 54 | $this->_popup=new InternalPopup($this); |
55 | 55 | $this->_popup->setHtml($html); |
56 | - $this->_popup->setAttributes($variation,$params); |
|
56 | + $this->_popup->setAttributes($variation, $params); |
|
57 | 57 | return $this; |
58 | 58 | } |
59 | 59 | |
60 | - public function setFluid(){ |
|
60 | + public function setFluid() { |
|
61 | 61 | $this->addToProperty("class", "fluid"); |
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | 65 | * can be formatted to appear on dark backgrounds |
66 | 66 | */ |
67 | - public function setInverted(){ |
|
67 | + public function setInverted() { |
|
68 | 68 | $this->addToProperty("class", "inverted"); |
69 | 69 | } |
70 | 70 | |
@@ -75,16 +75,16 @@ discard block |
||
75 | 75 | * @param boolean $labeled |
76 | 76 | * @return \Ajax\semantic\html\elements\HtmlIcon |
77 | 77 | */ |
78 | - public function addIcon($icon,$before=true,$labeled=false){ |
|
78 | + public function addIcon($icon, $before=true, $labeled=false) { |
|
79 | 79 | $iconO=$icon; |
80 | - if(\is_string($icon)){ |
|
80 | + if (\is_string($icon)) { |
|
81 | 81 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
82 | 82 | } |
83 | - if($labeled!==false){ |
|
83 | + if ($labeled!==false) { |
|
84 | 84 | $this->addToProperty("class", "labeled icon"); |
85 | 85 | $this->tagName="div"; |
86 | 86 | } |
87 | - $this->addContent($iconO,$before); |
|
87 | + $this->addContent($iconO, $before); |
|
88 | 88 | return $iconO; |
89 | 89 | } |
90 | 90 | |
@@ -92,18 +92,18 @@ discard block |
||
92 | 92 | * show a loading indicator |
93 | 93 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
94 | 94 | */ |
95 | - public function asLoader(){ |
|
95 | + public function asLoader() { |
|
96 | 96 | return $this->addToProperty("class", "loading"); |
97 | 97 | } |
98 | 98 | |
99 | - public function compile(JsUtils $js=NULL, View $view=NULL){ |
|
100 | - if(isset($this->_popup)) |
|
99 | + public function compile(JsUtils $js=NULL, View $view=NULL) { |
|
100 | + if (isset($this->_popup)) |
|
101 | 101 | $this->_popup->compile(); |
102 | - return parent::compile($js,$view); |
|
102 | + return parent::compile($js, $view); |
|
103 | 103 | } |
104 | - public function run(JsUtils $js){ |
|
104 | + public function run(JsUtils $js) { |
|
105 | 105 | parent::run($js); |
106 | - if(isset($this->_popup)){ |
|
106 | + if (isset($this->_popup)) { |
|
107 | 107 | $this->_popup->run($js); |
108 | 108 | //$this->addEventsOnRun($js); |
109 | 109 | //return $this->_bsComponent; |
@@ -20,6 +20,9 @@ |
||
20 | 20 | protected $_tabsType="tabs"; |
21 | 21 | protected $stacked=""; |
22 | 22 | |
23 | + /** |
|
24 | + * @param string $identifier |
|
25 | + */ |
|
23 | 26 | public function __construct($identifier, $tagName="ul") { |
24 | 27 | parent::__construct($identifier, $tagName); |
25 | 28 | $this->_template="<%tagName% %properties%>%tabs%</%tagName%>%content%"; |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | |
9 | 9 | class HtmlLabel extends HtmlSemDoubleElement { |
10 | 10 | |
11 | - public function __construct($identifier,$caption="",$tagName="div") { |
|
12 | - parent::__construct($identifier,$tagName); |
|
11 | + public function __construct($identifier, $caption="", $tagName="div") { |
|
12 | + parent::__construct($identifier, $tagName); |
|
13 | 13 | $this->setProperty("class", "ui label"); |
14 | 14 | $this->content=$caption; |
15 | 15 | } |
@@ -18,26 +18,26 @@ discard block |
||
18 | 18 | * @param string $side |
19 | 19 | * @return \Ajax\semantic\html\elements\HtmlLabel |
20 | 20 | */ |
21 | - public function setPointing($side=""){ |
|
22 | - return $this->addToPropertyCtrl("class", $side." pointing",array("right pointing","left pointing"," pointing")); |
|
21 | + public function setPointing($side="") { |
|
22 | + return $this->addToPropertyCtrl("class", $side." pointing", array("right pointing", "left pointing", " pointing")); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
26 | 26 | * @param string $side |
27 | 27 | * @return \Ajax\semantic\html\elements\HtmlLabel |
28 | 28 | */ |
29 | - public function toCorner($side="left"){ |
|
30 | - return $this->addToPropertyCtrl("class", $side." corner",array("right corner","left corner")); |
|
29 | + public function toCorner($side="left") { |
|
30 | + return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner")); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | 34 | * @return \Ajax\semantic\html\elements\HtmlLabel |
35 | 35 | */ |
36 | - public function asTag(){ |
|
36 | + public function asTag() { |
|
37 | 37 | return $this->addToProperty("class", "tag"); |
38 | 38 | } |
39 | 39 | |
40 | - public function setBasic(){ |
|
40 | + public function setBasic() { |
|
41 | 41 | return $this->addToProperty("class", "basic"); |
42 | 42 | } |
43 | 43 | |
@@ -48,17 +48,17 @@ discard block |
||
48 | 48 | * @param string $before |
49 | 49 | * @return \Ajax\semantic\html\elements\HtmlLabel |
50 | 50 | */ |
51 | - public function addImage($src,$alt="",$before=true){ |
|
51 | + public function addImage($src, $alt="", $before=true) { |
|
52 | 52 | $this->addToProperty("class", "image"); |
53 | - return $this->addContent(new HtmlImg("image-".$this->identifier,$src,$alt),$before); |
|
53 | + return $this->addContent(new HtmlImg("image-".$this->identifier, $src, $alt), $before); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | 57 | * @param string $detail |
58 | 58 | * @return \Ajax\common\html\HtmlDoubleElement |
59 | 59 | */ |
60 | - public function addDetail($detail){ |
|
61 | - $div=new HtmlDoubleElement("detail-".$this->identifier,$this->tagName); |
|
60 | + public function addDetail($detail) { |
|
61 | + $div=new HtmlDoubleElement("detail-".$this->identifier, $this->tagName); |
|
62 | 62 | $div->setClass("detail"); |
63 | 63 | $div->setContent($detail); |
64 | 64 | $this->addContent($div); |