@@ -16,18 +16,39 @@ |
||
16 | 16 | protected $_states=[ ]; |
17 | 17 | protected $_baseClass; |
18 | 18 | |
19 | + /** |
|
20 | + * @param string $name |
|
21 | + */ |
|
19 | 22 | abstract protected function setPropertyCtrl($name, $value, $typeCtrl); |
20 | 23 | |
24 | + /** |
|
25 | + * @param string $name |
|
26 | + */ |
|
21 | 27 | abstract protected function addToPropertyCtrl($name, $value, $typeCtrl); |
22 | 28 | |
29 | + /** |
|
30 | + * @param string $name |
|
31 | + */ |
|
23 | 32 | abstract protected function addToPropertyCtrlCheck($name, $value, $typeCtrl); |
24 | 33 | |
34 | + /** |
|
35 | + * @param string $name |
|
36 | + */ |
|
25 | 37 | abstract public function addToProperty($name, $value, $separator=" "); |
26 | 38 | |
39 | + /** |
|
40 | + * @param string $name |
|
41 | + */ |
|
27 | 42 | abstract public function setProperty($name, $value); |
28 | 43 | |
44 | + /** |
|
45 | + * @param HtmlIcon $content |
|
46 | + */ |
|
29 | 47 | abstract public function addContent($content,$before=false); |
30 | 48 | |
49 | + /** |
|
50 | + * @param string $jsCode |
|
51 | + */ |
|
31 | 52 | abstract public function onCreate($jsCode); |
32 | 53 | |
33 | 54 | public function addVariation($variation) { |
@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | * @property string $identifier |
13 | 13 | */ |
14 | 14 | trait BaseTrait { |
15 | - protected $_variations=[ ]; |
|
16 | - protected $_states=[ ]; |
|
15 | + protected $_variations=[]; |
|
16 | + protected $_states=[]; |
|
17 | 17 | protected $_baseClass; |
18 | 18 | |
19 | 19 | abstract protected function setPropertyCtrl($name, $value, $typeCtrl); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | abstract public function setProperty($name, $value); |
28 | 28 | |
29 | - abstract public function addContent($content,$before=false); |
|
29 | + abstract public function addContent($content, $before=false); |
|
30 | 30 | |
31 | 31 | abstract public function onCreate($jsCode); |
32 | 32 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $this->setProperty("class", $this->_baseClass); |
48 | 48 | if (\is_string($variations)) |
49 | 49 | $variations=\explode(" ", $variations); |
50 | - foreach ( $variations as $variation ) { |
|
50 | + foreach ($variations as $variation) { |
|
51 | 51 | $this->addVariation($variation); |
52 | 52 | } |
53 | 53 | return $this; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function addVariations($variations=array()) { |
62 | 62 | if (\is_string($variations)) |
63 | 63 | $variations=\explode(" ", $variations); |
64 | - foreach ( $variations as $variation ) { |
|
64 | + foreach ($variations as $variation) { |
|
65 | 65 | $this->addVariation($variation); |
66 | 66 | } |
67 | 67 | return $this; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | public function addStates($states=array()) { |
71 | 71 | if (\is_string($states)) |
72 | 72 | $states=\explode(" ", $states); |
73 | - foreach ( $states as $state ) { |
|
73 | + foreach ($states as $state) { |
|
74 | 74 | $this->addState($state); |
75 | 75 | } |
76 | 76 | return $this; |
@@ -80,17 +80,17 @@ discard block |
||
80 | 80 | $this->setProperty("class", $this->_baseClass); |
81 | 81 | if (\is_string($states)) |
82 | 82 | $states=\explode(" ", $states); |
83 | - foreach ( $states as $state ) { |
|
83 | + foreach ($states as $state) { |
|
84 | 84 | $this->addState($state); |
85 | 85 | } |
86 | 86 | return $this; |
87 | 87 | } |
88 | 88 | |
89 | 89 | public function addIcon($icon, $before=true) { |
90 | - return $this->addContent(new HtmlIcon("icon-" . $this->identifier, $icon), $before); |
|
90 | + return $this->addContent(new HtmlIcon("icon-".$this->identifier, $icon), $before); |
|
91 | 91 | } |
92 | 92 | |
93 | - public function addSticky($context="body"){ |
|
93 | + public function addSticky($context="body") { |
|
94 | 94 | $this->onCreate("$('#".$this->identifier."').sticky({ context: '".$context."'});"); |
95 | 95 | return $this; |
96 | 96 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * |
135 | 135 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
136 | 136 | */ |
137 | - public function asHeader(){ |
|
137 | + public function asHeader() { |
|
138 | 138 | return $this->addToProperty("class", "header"); |
139 | 139 | } |
140 | 140 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * show it is currently the active user selection |
143 | 143 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
144 | 144 | */ |
145 | - public function setActive($value=true){ |
|
145 | + public function setActive($value=true) { |
|
146 | 146 | return $this->addToProperty("class", "active"); |
147 | 147 | } |
148 | 148 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | public function setFloated($direction="right") { |
161 | - return $this->addToPropertyCtrl("class", $direction . " floated", Direction::getConstantValues("floated")); |
|
161 | + return $this->addToPropertyCtrl("class", $direction." floated", Direction::getConstantValues("floated")); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | public function floatRight() { |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | trait HtmlLinkTrait { |
6 | 6 | |
7 | - abstract public function setProperty($name,$value); |
|
7 | + abstract public function setProperty($name, $value); |
|
8 | 8 | abstract public function getProperty($name); |
9 | 9 | |
10 | 10 | public function setHref($value) { |
@@ -14,8 +14,8 @@ |
||
14 | 14 | */ |
15 | 15 | public function setAttachment($toElement, $side=Side::BOTH) { |
16 | 16 | if (isset($toElement)) { |
17 | - $toElement->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
17 | + $toElement->addToPropertyCtrl("class", "attached", array("attached")); |
|
18 | 18 | } |
19 | - return $this->addToPropertyCtrl("class", $side . " attached", Side::getConstantValues("attached")); |
|
19 | + return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached")); |
|
20 | 20 | } |
21 | 21 | } |
22 | 22 | \ No newline at end of file |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | trait LabeledIconTrait { |
14 | 14 | |
15 | 15 | abstract public function addToProperty($name, $value, $separator=" "); |
16 | - abstract public function addContent($content,$before=false); |
|
16 | + abstract public function addContent($content, $before=false); |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Adds an icon before or after |
@@ -22,17 +22,17 @@ discard block |
||
22 | 22 | * @param boolean $labeled |
23 | 23 | * @return \Ajax\semantic\html\elements\HtmlIcon |
24 | 24 | */ |
25 | - public function addIcon($icon,$before=true,$labeled=false){ |
|
25 | + public function addIcon($icon, $before=true, $labeled=false) { |
|
26 | 26 | $iconO=$icon; |
27 | - if(\is_string($icon)){ |
|
27 | + if (\is_string($icon)) { |
|
28 | 28 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
29 | 29 | } |
30 | - if($labeled!==false){ |
|
31 | - $direction=($before===true)?Direction::LEFT:Direction::RIGHT; |
|
30 | + if ($labeled!==false) { |
|
31 | + $direction=($before===true) ? Direction::LEFT : Direction::RIGHT; |
|
32 | 32 | $this->addToProperty("class", $direction." labeled icon"); |
33 | 33 | $this->tagName="div"; |
34 | 34 | } |
35 | - $this->addContent($iconO,$before); |
|
35 | + $this->addContent($iconO, $before); |
|
36 | 36 | return $iconO; |
37 | 37 | } |
38 | 38 | } |
39 | 39 | \ No newline at end of file |