@@ -35,8 +35,9 @@ discard block |
||
35 | 35 | |
36 | 36 | public function setVariations($variations) { |
37 | 37 | $this->setProperty("class", $this->_baseClass); |
38 | - if (\is_string($variations)) |
|
39 | - $variations=\explode(" ", $variations); |
|
38 | + if (\is_string($variations)) { |
|
39 | + $variations=\explode(" ", $variations); |
|
40 | + } |
|
40 | 41 | foreach ( $variations as $variation ) { |
41 | 42 | $this->addVariation($variation); |
42 | 43 | } |
@@ -49,8 +50,9 @@ discard block |
||
49 | 50 | } |
50 | 51 | |
51 | 52 | public function addVariations($variations=array()) { |
52 | - if (\is_string($variations)) |
|
53 | - $variations=\explode(" ", $variations); |
|
53 | + if (\is_string($variations)) { |
|
54 | + $variations=\explode(" ", $variations); |
|
55 | + } |
|
54 | 56 | foreach ( $variations as $variation ) { |
55 | 57 | $this->addVariation($variation); |
56 | 58 | } |
@@ -58,8 +60,9 @@ discard block |
||
58 | 60 | } |
59 | 61 | |
60 | 62 | public function addStates($states=array()) { |
61 | - if (\is_string($states)) |
|
62 | - $states=\explode(" ", $states); |
|
63 | + if (\is_string($states)) { |
|
64 | + $states=\explode(" ", $states); |
|
65 | + } |
|
63 | 66 | foreach ( $states as $state ) { |
64 | 67 | $this->addState($state); |
65 | 68 | } |
@@ -68,8 +71,9 @@ discard block |
||
68 | 71 | |
69 | 72 | public function setStates($states) { |
70 | 73 | $this->setProperty("class", $this->_baseClass); |
71 | - if (\is_string($states)) |
|
72 | - $states=\explode(" ", $states); |
|
74 | + if (\is_string($states)) { |
|
75 | + $states=\explode(" ", $states); |
|
76 | + } |
|
73 | 77 | foreach ( $states as $state ) { |
74 | 78 | $this->addState($state); |
75 | 79 | } |
@@ -94,10 +94,11 @@ |
||
94 | 94 | |
95 | 95 | protected function setDivider($divider,$index){ |
96 | 96 | if(isset($index)){ |
97 | - if(\is_array($this->_contentSeparator)===false) |
|
98 | - $this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator); |
|
97 | + if(\is_array($this->_contentSeparator)===false) { |
|
98 | + $this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator); |
|
99 | + } |
|
99 | 100 | $this->_contentSeparator[$index]=$divider; |
100 | - }else{ |
|
101 | + } else{ |
|
101 | 102 | $this->_contentSeparator=$divider; |
102 | 103 | } |
103 | 104 | return $this; |
@@ -13,11 +13,13 @@ discard block |
||
13 | 13 | |
14 | 14 | public function __construct($identifier, $value=NULL, $label=NULL, $attributes=array()) { |
15 | 15 | parent::__construct($identifier, "div", "ui progress"); |
16 | - if (isset($value) === true) |
|
17 | - $this->setProperty("data-percent", $value); |
|
16 | + if (isset($value) === true) { |
|
17 | + $this->setProperty("data-percent", $value); |
|
18 | + } |
|
18 | 19 | $this->createBar(); |
19 | - if (isset($label) === true) |
|
20 | - $this->setLabel($label); |
|
20 | + if (isset($label) === true) { |
|
21 | + $this->setLabel($label); |
|
22 | + } |
|
21 | 23 | $this->_states=[ State::SUCCESS,State::WARNING,State::ERROR,State::ACTIVE,State::DISABLED ]; |
22 | 24 | $this->addToProperty("class", $attributes); |
23 | 25 | } |
@@ -116,8 +118,9 @@ discard block |
||
116 | 118 | * @see BaseHtml::run() |
117 | 119 | */ |
118 | 120 | public function run(JsUtils $js) { |
119 | - if (isset($this->_bsComponent) === false) |
|
120 | - $this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params); |
|
121 | + if (isset($this->_bsComponent) === false) { |
|
122 | + $this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params); |
|
123 | + } |
|
121 | 124 | $this->addEventsOnRun($js); |
122 | 125 | return $this->_bsComponent; |
123 | 126 | } |
@@ -43,8 +43,7 @@ discard block |
||
43 | 43 | foreach ($actions as $action){ |
44 | 44 | $this->addAction($action); |
45 | 45 | } |
46 | - } |
|
47 | - else{ |
|
46 | + } else{ |
|
48 | 47 | $this->addAction($actions); |
49 | 48 | } |
50 | 49 | return $this; |
@@ -60,8 +59,9 @@ discard block |
||
60 | 59 | $class="cancel"; |
61 | 60 | } |
62 | 61 | $action=new HtmlButton("action-".$this->identifier,$action); |
63 | - if($class!=="") |
|
64 | - $action->addToProperty("class", $class); |
|
62 | + if($class!=="") { |
|
63 | + $action->addToProperty("class", $class); |
|
64 | + } |
|
65 | 65 | } |
66 | 66 | return $this->addElementInPart($action, "actions"); |
67 | 67 | } |
@@ -169,8 +169,9 @@ discard block |
||
169 | 169 | * @see BaseHtml::run() |
170 | 170 | */ |
171 | 171 | public function run(JsUtils $js) { |
172 | - if(isset($this->_bsComponent)===false) |
|
173 | - $this->_bsComponent=$js->semantic()->modal("#".$this->identifier,$this->_params,$this->_paramParts); |
|
172 | + if(isset($this->_bsComponent)===false) { |
|
173 | + $this->_bsComponent=$js->semantic()->modal("#".$this->identifier,$this->_params,$this->_paramParts); |
|
174 | + } |
|
174 | 175 | $this->addEventsOnRun($js); |
175 | 176 | return $this->_bsComponent; |
176 | 177 | } |
@@ -26,8 +26,9 @@ discard block |
||
26 | 26 | public function asIcon($icon, $title, $subHeader=NULL) { |
27 | 27 | $header=new HtmlHeader("header-" . $this->identifier); |
28 | 28 | $header->asIcon($icon, $title, $subHeader); |
29 | - if ($this->_inverted === false) |
|
30 | - $header->setInverted(); |
|
29 | + if ($this->_inverted === false) { |
|
30 | + $header->setInverted(); |
|
31 | + } |
|
31 | 32 | return $this->setContent($header); |
32 | 33 | } |
33 | 34 | |
@@ -42,14 +43,16 @@ discard block |
||
42 | 43 | } |
43 | 44 | |
44 | 45 | public function run(JsUtils $js) { |
45 | - if ($this->_container instanceof HtmlSingleElement) |
|
46 | - $this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); |
|
46 | + if ($this->_container instanceof HtmlSingleElement) { |
|
47 | + $this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); |
|
48 | + } |
|
47 | 49 | return parent::run($js); |
48 | 50 | } |
49 | 51 | |
50 | 52 | public function jsShow() { |
51 | - if (isset($this->_container) === true) |
|
52 | - return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
53 | + if (isset($this->_container) === true) { |
|
54 | + return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
55 | + } |
|
53 | 56 | } |
54 | 57 | |
55 | 58 | public function setBlurring() { |
@@ -10,8 +10,9 @@ |
||
10 | 10 | |
11 | 11 | public function __construct($identifier,$context=NULL,$content=NULL) { |
12 | 12 | parent::__construct($identifier, "div", "ui sticky", $content); |
13 | - if(isset($content)) |
|
14 | - $this->setContext($context); |
|
13 | + if(isset($content)) { |
|
14 | + $this->setContext($context); |
|
15 | + } |
|
15 | 16 | } |
16 | 17 | |
17 | 18 | public function setContext($context){ |
@@ -22,10 +22,12 @@ |
||
22 | 22 | |
23 | 23 | private function createField($placeholder=NULL, $icon=NULL) { |
24 | 24 | $field=new HtmlInput($this->identifier); |
25 | - if (isset($placeholder) === true) |
|
26 | - $field->setPlaceholder($placeholder); |
|
27 | - if (isset($icon) === true) |
|
28 | - $field->addIcon($icon, Direction::RIGHT); |
|
25 | + if (isset($placeholder) === true) { |
|
26 | + $field->setPlaceholder($placeholder); |
|
27 | + } |
|
28 | + if (isset($icon) === true) { |
|
29 | + $field->addIcon($icon, Direction::RIGHT); |
|
30 | + } |
|
29 | 31 | $field->getField()->setClass("prompt"); |
30 | 32 | $this->content["field"]=$field; |
31 | 33 | return $field; |
@@ -62,8 +62,9 @@ |
||
62 | 62 | * @see BaseHtml::run() |
63 | 63 | */ |
64 | 64 | public function run(JsUtils $js) { |
65 | - if(isset($this->_bsComponent)===false) |
|
66 | - $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params); |
|
65 | + if(isset($this->_bsComponent)===false) { |
|
66 | + $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params); |
|
67 | + } |
|
67 | 68 | $this->addEventsOnRun($js); |
68 | 69 | return $this->_bsComponent; |
69 | 70 | } |
@@ -12,8 +12,9 @@ discard block |
||
12 | 12 | $image=new HtmlImg("img-", $src, $alt); |
13 | 13 | $image->setClass(""); |
14 | 14 | parent::__construct($identifier, "div", "ui image", $image); |
15 | - if (isset($size)) |
|
16 | - $this->setSize($size); |
|
15 | + if (isset($size)) { |
|
16 | + $this->setSize($size); |
|
17 | + } |
|
17 | 18 | } |
18 | 19 | |
19 | 20 | public function setCircular() { |
@@ -21,8 +22,9 @@ discard block |
||
21 | 22 | } |
22 | 23 | |
23 | 24 | public function asAvatar($caption=NULL) { |
24 | - if (isset($caption)) |
|
25 | - $this->wrap("", $caption); |
|
25 | + if (isset($caption)) { |
|
26 | + $this->wrap("", $caption); |
|
27 | + } |
|
26 | 28 | return $this->addToProperty("class", "avatar"); |
27 | 29 | } |
28 | 30 |