@@ -16,18 +16,39 @@ discard block |
||
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) { |
@@ -108,7 +129,7 @@ discard block |
||
108 | 129 | /** |
109 | 130 | * show it is currently unable to be interacted with |
110 | 131 | * @param boolean $disable |
111 | - * @return \Ajax\semantic\html\elements\HtmlSemDoubleElement |
|
132 | + * @return BaseTrait |
|
112 | 133 | */ |
113 | 134 | public function setDisabled($disable=true) { |
114 | 135 | if($disable) |
@@ -45,8 +45,9 @@ discard block |
||
45 | 45 | |
46 | 46 | public function setVariations($variations) { |
47 | 47 | $this->setProperty("class", $this->_baseClass); |
48 | - if (\is_string($variations)) |
|
49 | - $variations=\explode(" ", $variations); |
|
48 | + if (\is_string($variations)) { |
|
49 | + $variations=\explode(" ", $variations); |
|
50 | + } |
|
50 | 51 | foreach ( $variations as $variation ) { |
51 | 52 | $this->addVariation($variation); |
52 | 53 | } |
@@ -59,8 +60,9 @@ discard block |
||
59 | 60 | } |
60 | 61 | |
61 | 62 | public function addVariations($variations=array()) { |
62 | - if (\is_string($variations)) |
|
63 | - $variations=\explode(" ", $variations); |
|
63 | + if (\is_string($variations)) { |
|
64 | + $variations=\explode(" ", $variations); |
|
65 | + } |
|
64 | 66 | foreach ( $variations as $variation ) { |
65 | 67 | $this->addVariation($variation); |
66 | 68 | } |
@@ -68,8 +70,9 @@ discard block |
||
68 | 70 | } |
69 | 71 | |
70 | 72 | public function addStates($states=array()) { |
71 | - if (\is_string($states)) |
|
72 | - $states=\explode(" ", $states); |
|
73 | + if (\is_string($states)) { |
|
74 | + $states=\explode(" ", $states); |
|
75 | + } |
|
73 | 76 | foreach ( $states as $state ) { |
74 | 77 | $this->addState($state); |
75 | 78 | } |
@@ -78,8 +81,9 @@ discard block |
||
78 | 81 | |
79 | 82 | public function setStates($states) { |
80 | 83 | $this->setProperty("class", $this->_baseClass); |
81 | - if (\is_string($states)) |
|
82 | - $states=\explode(" ", $states); |
|
84 | + if (\is_string($states)) { |
|
85 | + $states=\explode(" ", $states); |
|
86 | + } |
|
83 | 87 | foreach ( $states as $state ) { |
84 | 88 | $this->addState($state); |
85 | 89 | } |
@@ -111,8 +115,9 @@ discard block |
||
111 | 115 | * @return \Ajax\semantic\html\elements\HtmlSemDoubleElement |
112 | 116 | */ |
113 | 117 | public function setDisabled($disable=true) { |
114 | - if($disable) |
|
115 | - $this->addToProperty("class", "disabled"); |
|
118 | + if($disable) { |
|
119 | + $this->addToProperty("class", "disabled"); |
|
120 | + } |
|
116 | 121 | return $this; |
117 | 122 | } |
118 | 123 |
@@ -25,8 +25,9 @@ |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | public function setDisabled($disable=true) { |
28 | - if($disable) |
|
29 | - $this->addState(State::DISABLED); |
|
28 | + if($disable) { |
|
29 | + $this->addState(State::DISABLED); |
|
30 | + } |
|
30 | 31 | return $this; |
31 | 32 | } |
32 | 33 | } |
33 | 34 | \ No newline at end of file |