@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
20 | 20 | $this->addContent($iconO,false); |
21 | 21 | $this->_hasIcon=true; |
22 | - }else{ |
|
22 | + } else{ |
|
23 | 23 | $iconO=$this->getIcon(); |
24 | 24 | $iconO->setIcon($icon); |
25 | 25 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
@@ -30,8 +30,9 @@ discard block |
||
30 | 30 | public function getIcon(){ |
31 | 31 | if(\is_array($this->content)){ |
32 | 32 | foreach ($this->content as $item){ |
33 | - if($item instanceof HtmlIcon) |
|
34 | - return $item; |
|
33 | + if($item instanceof HtmlIcon) { |
|
34 | + return $item; |
|
35 | + } |
|
35 | 36 | } |
36 | 37 | } |
37 | 38 | } |
@@ -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; |
@@ -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 | } |
@@ -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){ |
@@ -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 |
@@ -14,8 +14,9 @@ discard block |
||
14 | 14 | public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") { |
15 | 15 | parent::__construct($identifier, $tagName, "ui label"); |
16 | 16 | $this->content=$caption; |
17 | - if (isset($icon)===true) |
|
18 | - $this->addIcon($icon); |
|
17 | + if (isset($icon)===true) { |
|
18 | + $this->addIcon($icon); |
|
19 | + } |
|
19 | 20 | } |
20 | 21 | |
21 | 22 | /** |
@@ -24,10 +25,11 @@ discard block |
||
24 | 25 | * @return \Ajax\semantic\html\elements\HtmlLabel |
25 | 26 | */ |
26 | 27 | public function setPointing($value=Direction::NONE) { |
27 | - if($value==="left" || $value==="right") |
|
28 | - return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
29 | - else |
|
30 | - return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
28 | + if($value==="left" || $value==="right") { |
|
29 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
30 | + } else { |
|
31 | + return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
32 | + } |
|
31 | 33 | } |
32 | 34 | |
33 | 35 | /** |
@@ -121,10 +123,11 @@ discard block |
||
121 | 123 | } |
122 | 124 | |
123 | 125 | public function setAttached($side=Side::TOP,$direction=Direction::NONE){ |
124 | - if($direction!==Direction::NONE) |
|
125 | - return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
126 | - else |
|
127 | - return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
126 | + if($direction!==Direction::NONE) { |
|
127 | + return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
128 | + } else { |
|
129 | + return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
130 | + } |
|
128 | 131 | } |
129 | 132 | |
130 | 133 | public static function ribbon($identifier, $caption) { |
@@ -102,8 +102,9 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function setBordered($inverted=false) { |
104 | 104 | $invertedStr=""; |
105 | - if ($inverted !== false) |
|
106 | - $invertedStr=" inverted"; |
|
105 | + if ($inverted !== false) { |
|
106 | + $invertedStr=" inverted"; |
|
107 | + } |
|
107 | 108 | return $this->addToProperty("class", "bordered" . $invertedStr); |
108 | 109 | } |
109 | 110 | |
@@ -116,12 +117,14 @@ discard block |
||
116 | 117 | } |
117 | 118 | |
118 | 119 | public function addLabel($label, $before=false, $icon=NULL) { |
119 | - if($before) |
|
120 | - $this->wrap($label); |
|
121 | - else |
|
122 | - $this->wrap("", $label); |
|
123 | - if(isset($icon)) |
|
124 | - $this->addToIcon($icon); |
|
120 | + if($before) { |
|
121 | + $this->wrap($label); |
|
122 | + } else { |
|
123 | + $this->wrap("", $label); |
|
124 | + } |
|
125 | + if(isset($icon)) { |
|
126 | + $this->addToIcon($icon); |
|
127 | + } |
|
125 | 128 | return $this; |
126 | 129 | } |
127 | 130 |