@@ -55,10 +55,11 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | public function setDismissable($dismiss=true){ |
58 | - if($dismiss===true) |
|
59 | - $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
60 | - else |
|
61 | - $this->close=NULL; |
|
58 | + if($dismiss===true) { |
|
59 | + $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
60 | + } else { |
|
61 | + $this->close=NULL; |
|
62 | + } |
|
62 | 63 | return $this; |
63 | 64 | } |
64 | 65 |
@@ -81,8 +81,9 @@ discard block |
||
81 | 81 | public function addCol($width=NULL) { |
82 | 82 | $colCount=$this->colCount() + 1; |
83 | 83 | $this->setColsCount($colCount, true, $width); |
84 | - if ($this->hasOnlyCols($this->count())) |
|
85 | - return $this->content[$colCount - 1]; |
|
84 | + if ($this->hasOnlyCols($this->count())) { |
|
85 | + return $this->content[$colCount - 1]; |
|
86 | + } |
|
86 | 87 | return $this; |
87 | 88 | } |
88 | 89 | |
@@ -170,8 +171,9 @@ discard block |
||
170 | 171 | */ |
171 | 172 | public function rowCount() { |
172 | 173 | $count=$this->count(); |
173 | - if ($this->hasOnlyCols($count)) |
|
174 | - return 0; |
|
174 | + if ($this->hasOnlyCols($count)) { |
|
175 | + return 0; |
|
176 | + } |
|
175 | 177 | return $count; |
176 | 178 | } |
177 | 179 | |
@@ -181,10 +183,12 @@ discard block |
||
181 | 183 | */ |
182 | 184 | public function colCount() { |
183 | 185 | $count=$this->count(); |
184 | - if ($this->hasOnlyCols($count)) |
|
185 | - return $count; |
|
186 | - if ($count > 0) |
|
187 | - return $this->getItem(0)->count(); |
|
186 | + if ($this->hasOnlyCols($count)) { |
|
187 | + return $count; |
|
188 | + } |
|
189 | + if ($count > 0) { |
|
190 | + return $this->getItem(0)->count(); |
|
191 | + } |
|
188 | 192 | return 0; |
189 | 193 | } |
190 | 194 | |
@@ -195,8 +199,9 @@ discard block |
||
195 | 199 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
196 | 200 | */ |
197 | 201 | public function getCell($row, $col) { |
198 | - if ($row < 2 && $this->hasOnlyCols($this->count())) |
|
199 | - return $this->getItem($col); |
|
202 | + if ($row < 2 && $this->hasOnlyCols($this->count())) { |
|
203 | + return $this->getItem($col); |
|
204 | + } |
|
200 | 205 | $row=$this->getItem($row); |
201 | 206 | if (isset($row)) { |
202 | 207 | $col=$row->getItem($col); |
@@ -245,8 +250,9 @@ discard block |
||
245 | 250 | * @return \Ajax\semantic\html\collections\HtmlGrid |
246 | 251 | */ |
247 | 252 | public function setPadded($value=NULL) { |
248 | - if (isset($value)) |
|
249 | - $this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" )); |
|
253 | + if (isset($value)) { |
|
254 | + $this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" )); |
|
255 | + } |
|
250 | 256 | return $this->addToProperty("class", "padded"); |
251 | 257 | } |
252 | 258 | |
@@ -271,8 +277,9 @@ discard block |
||
271 | 277 | * @see \Ajax\common\html\HtmlCollection::createItem() |
272 | 278 | */ |
273 | 279 | protected function createItem($value) { |
274 | - if ($this->_createCols === false) |
|
275 | - $value=null; |
|
280 | + if ($this->_createCols === false) { |
|
281 | + $value=null; |
|
282 | + } |
|
276 | 283 | $item=new HtmlGridRow($this->identifier . "-row-" . ($this->count() + 1), $value, $this->_colSizing, $this->_implicitRows); |
277 | 284 | return $item; |
278 | 285 | } |
@@ -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; |
@@ -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){ |