@@ -16,10 +16,12 @@ discard block |
||
16 | 16 | if (isset($value)) { |
17 | 17 | $value=$this->_prep_value($value); |
18 | 18 | $str="$({$element}).attr(\"$attributeName\",{$value});"; |
19 | - } else |
|
20 | - $str="$({$element}).attr(\"$attributeName\");"; |
|
21 | - if ($immediatly) |
|
22 | - $this->jquery_code_for_compile[]=$str; |
|
19 | + } else { |
|
20 | + $str="$({$element}).attr(\"$attributeName\");"; |
|
21 | + } |
|
22 | + if ($immediatly) { |
|
23 | + $this->jquery_code_for_compile[]=$str; |
|
24 | + } |
|
23 | 25 | return $str; |
24 | 26 | } |
25 | 27 | |
@@ -34,8 +36,9 @@ discard block |
||
34 | 36 | $element=$this->_prep_element($element); |
35 | 37 | $value=$this->_prep_value($value); |
36 | 38 | $str="$({$element}).after({$value});"; |
37 | - if ($immediatly) |
|
38 | - $this->jquery_code_for_compile[]=$str; |
|
39 | + if ($immediatly) { |
|
40 | + $this->jquery_code_for_compile[]=$str; |
|
41 | + } |
|
39 | 42 | return $str; |
40 | 43 | } |
41 | 44 | |
@@ -71,8 +74,9 @@ discard block |
||
71 | 74 | |
72 | 75 | $str="$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");"; |
73 | 76 | |
74 | - if ($immediatly) |
|
75 | - $this->jquery_code_for_compile[]=$str; |
|
77 | + if ($immediatly) { |
|
78 | + $this->jquery_code_for_compile[]=$str; |
|
79 | + } |
|
76 | 80 | return $str; |
77 | 81 | } |
78 | 82 | |
@@ -97,8 +101,9 @@ discard block |
||
97 | 101 | |
98 | 102 | $str="$({$element}).fadeIn({$speed}{$callback});"; |
99 | 103 | |
100 | - if ($immediatly) |
|
101 | - $this->jquery_code_for_compile[]=$str; |
|
104 | + if ($immediatly) { |
|
105 | + $this->jquery_code_for_compile[]=$str; |
|
106 | + } |
|
102 | 107 | return $str; |
103 | 108 | } |
104 | 109 | |
@@ -123,8 +128,9 @@ discard block |
||
123 | 128 | |
124 | 129 | $str="$({$element}).fadeOut({$speed}{$callback});"; |
125 | 130 | |
126 | - if ($immediatly) |
|
127 | - $this->jquery_code_for_compile[]=$str; |
|
131 | + if ($immediatly) { |
|
132 | + $this->jquery_code_for_compile[]=$str; |
|
133 | + } |
|
128 | 134 | return $str; |
129 | 135 | } |
130 | 136 | |
@@ -149,8 +155,9 @@ discard block |
||
149 | 155 | |
150 | 156 | $str="$({$element}).hide({$speed}{$callback});"; |
151 | 157 | |
152 | - if ($immediatly) |
|
153 | - $this->jquery_code_for_compile[]=$str; |
|
158 | + if ($immediatly) { |
|
159 | + $this->jquery_code_for_compile[]=$str; |
|
160 | + } |
|
154 | 161 | return $str; |
155 | 162 | } |
156 | 163 | |
@@ -177,8 +184,9 @@ discard block |
||
177 | 184 | |
178 | 185 | $str="$({$element}).slideUp({$speed}{$callback});"; |
179 | 186 | |
180 | - if ($immediatly) |
|
181 | - $this->jquery_code_for_compile[]=$str; |
|
187 | + if ($immediatly) { |
|
188 | + $this->jquery_code_for_compile[]=$str; |
|
189 | + } |
|
182 | 190 | return $str; |
183 | 191 | } |
184 | 192 | |
@@ -203,8 +211,9 @@ discard block |
||
203 | 211 | |
204 | 212 | $str="$({$element}).slideDown({$speed}{$callback});"; |
205 | 213 | |
206 | - if ($immediatly) |
|
207 | - $this->jquery_code_for_compile[]=$str; |
|
214 | + if ($immediatly) { |
|
215 | + $this->jquery_code_for_compile[]=$str; |
|
216 | + } |
|
208 | 217 | return $str; |
209 | 218 | } |
210 | 219 | |
@@ -229,8 +238,9 @@ discard block |
||
229 | 238 | |
230 | 239 | $str="$({$element}).slideToggle({$speed}{$callback});"; |
231 | 240 | |
232 | - if ($immediatly) |
|
233 | - $this->jquery_code_for_compile[]=$str; |
|
241 | + if ($immediatly) { |
|
242 | + $this->jquery_code_for_compile[]=$str; |
|
243 | + } |
|
234 | 244 | return $str; |
235 | 245 | } |
236 | 246 | |
@@ -247,8 +257,9 @@ discard block |
||
247 | 257 | $element=$this->_prep_element($element); |
248 | 258 | $str="$({$element}).toggle();"; |
249 | 259 | |
250 | - if ($immediatly) |
|
251 | - $this->jquery_code_for_compile[]=$str; |
|
260 | + if ($immediatly) { |
|
261 | + $this->jquery_code_for_compile[]=$str; |
|
262 | + } |
|
252 | 263 | return $str; |
253 | 264 | } |
254 | 265 | |
@@ -264,8 +275,9 @@ discard block |
||
264 | 275 | $element=$this->_prep_element($element); |
265 | 276 | $str="$({$element}).trigger(\"$event\");"; |
266 | 277 | |
267 | - if ($immediatly) |
|
268 | - $this->jquery_code_for_compile[]=$str; |
|
278 | + if ($immediatly) { |
|
279 | + $this->jquery_code_for_compile[]=$str; |
|
280 | + } |
|
269 | 281 | return $str; |
270 | 282 | } |
271 | 283 | |
@@ -290,8 +302,9 @@ discard block |
||
290 | 302 | |
291 | 303 | $str="$({$element}).show({$speed}{$callback});"; |
292 | 304 | |
293 | - if ($immediatly) |
|
294 | - $this->jquery_code_for_compile[]=$str; |
|
305 | + if ($immediatly) { |
|
306 | + $this->jquery_code_for_compile[]=$str; |
|
307 | + } |
|
295 | 308 | return $str; |
296 | 309 | } |
297 | 310 | |
@@ -309,8 +322,9 @@ discard block |
||
309 | 322 | $str.="else{".$jsCodeIfFalse."}"; |
310 | 323 | } |
311 | 324 | |
312 | - if ($immediatly) |
|
313 | - $this->jquery_code_for_compile[]=$str; |
|
325 | + if ($immediatly) { |
|
326 | + $this->jquery_code_for_compile[]=$str; |
|
327 | + } |
|
314 | 328 | return $str; |
315 | 329 | } |
316 | 330 | |
@@ -327,11 +341,13 @@ discard block |
||
327 | 341 | public function _doJQuery($element, $jqueryCall, $param="", $jsCallback="", $immediatly=false) { |
328 | 342 | $param=$this->_prep_value($param); |
329 | 343 | $callback=""; |
330 | - if ($jsCallback!="") |
|
331 | - $callback=", function(event){\n{$jsCallback}\n}"; |
|
344 | + if ($jsCallback!="") { |
|
345 | + $callback=", function(event){\n{$jsCallback}\n}"; |
|
346 | + } |
|
332 | 347 | $script="$(".$this->_prep_element($element).").".$jqueryCall."(".$param.$callback.");\n"; |
333 | - if ($immediatly) |
|
334 | - $this->jquery_code_for_compile[]=$script; |
|
348 | + if ($immediatly) { |
|
349 | + $this->jquery_code_for_compile[]=$script; |
|
350 | + } |
|
335 | 351 | return $script; |
336 | 352 | } |
337 | 353 | |
@@ -360,8 +376,9 @@ discard block |
||
360 | 376 | */ |
361 | 377 | public function _exec($js, $immediatly=false) { |
362 | 378 | $script=$js."\n"; |
363 | - if ($immediatly) |
|
364 | - $this->jquery_code_for_compile[]=$script; |
|
379 | + if ($immediatly) { |
|
380 | + $this->jquery_code_for_compile[]=$script; |
|
381 | + } |
|
365 | 382 | return $script; |
366 | 383 | } |
367 | 384 |
@@ -35,8 +35,9 @@ discard block |
||
35 | 35 | } |
36 | 36 | $retour.="$.".$method."(url,".$params.").done(function( data ) {\n"; |
37 | 37 | $retour.=$this->_getOnAjaxDone($responseElement, $jsCallback)."});\n"; |
38 | - if ($immediatly) |
|
39 | - $this->jquery_code_for_compile[]=$retour; |
|
38 | + if ($immediatly) { |
|
39 | + $this->jquery_code_for_compile[]=$retour; |
|
40 | + } |
|
40 | 41 | return $retour; |
41 | 42 | } |
42 | 43 | |
@@ -44,13 +45,15 @@ discard block |
||
44 | 45 | $url=$this->_correctAjaxUrl($url); |
45 | 46 | $retour="url='".$url."';\n"; |
46 | 47 | $slash="/"; |
47 | - if(PhalconUtils::endsWith($url, "/")) |
|
48 | - $slash=""; |
|
48 | + if(PhalconUtils::endsWith($url, "/")) { |
|
49 | + $slash=""; |
|
50 | + } |
|
49 | 51 | if(JString::isNotNull($attr)){ |
50 | - if ($attr=="value") |
|
51 | - $retour.="url=url+'".$slash."'+$(this).val();\n"; |
|
52 | - else if($attr!=null && $attr!=="") |
|
53 | - $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
52 | + if ($attr=="value") { |
|
53 | + $retour.="url=url+'".$slash."'+$(this).val();\n"; |
|
54 | + } else if($attr!=null && $attr!=="") { |
|
55 | + $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
56 | + } |
|
54 | 57 | } |
55 | 58 | return $retour; |
56 | 59 | } |
@@ -72,8 +75,9 @@ discard block |
||
72 | 75 | } |
73 | 76 | |
74 | 77 | protected function _correctAjaxUrl($url) { |
75 | - if (PhalconUtils::endsWith($url, "/")) |
|
76 | - $url=substr($url, 0, strlen($url)-1); |
|
78 | + if (PhalconUtils::endsWith($url, "/")) { |
|
79 | + $url=substr($url, 0, strlen($url)-1); |
|
80 | + } |
|
77 | 81 | if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) { |
78 | 82 | $url=$this->_di->get("url")->get($url); |
79 | 83 | } |
@@ -97,8 +101,9 @@ discard block |
||
97 | 101 | $retour.="\t".$jsCallback."\n". |
98 | 102 | "\t$(document).trigger('jsonReady',[data]);\n". |
99 | 103 | "});\n"; |
100 | - if ($immediatly) |
|
101 | - $this->jquery_code_for_compile[]=$retour; |
|
104 | + if ($immediatly) { |
|
105 | + $this->jquery_code_for_compile[]=$retour; |
|
106 | + } |
|
102 | 107 | return $retour; |
103 | 108 | } |
104 | 109 | |
@@ -137,7 +142,7 @@ discard block |
||
137 | 142 | if($context===null){ |
138 | 143 | $appendTo="\t\tnewElm.appendTo($('".$maskSelector."').parent());\n"; |
139 | 144 | $newElm = "$('#'+newId)"; |
140 | - }else{ |
|
145 | + } else{ |
|
141 | 146 | $appendTo="\t\tnewElm.appendTo(".$context.");\n"; |
142 | 147 | $newElm = $context.".find('#'+newId)"; |
143 | 148 | } |
@@ -147,8 +152,9 @@ discard block |
||
147 | 152 | $retour.="\t}\n"."\tfor(var key in value){\n"."\t\t\tvar html = $('<div />').append($(newElm).clone()).html();\n"."\t\t\tif(html.indexOf('[['+key+']]')>-1){\n"."\t\t\t\tcontent=$(html.split('[['+key+']]').join(value[key]));\n"."\t\t\t\t$(newElm).replaceWith(content);newElm=content;\n"."\t\t\t}\n"."\t\tvar sel='[data-id=\"'+key+'\"]';if($(sel,newElm).length){\n"."\t\t\tvar selElm=$(sel,newElm);\n"."\t\t\t if(selElm.is('[value]')) { selElm.attr('value',value[key]);selElm.val(value[key]);} else { selElm.html(value[key]); }\n"."\t\t}\n"."}\n"."\t$(newElm).show(true);"."\n"."\t$(newElm).removeClass('hide');"."});\n"; |
148 | 153 | $retour.="\t$(document).trigger('jsonReady',[data]);\n"; |
149 | 154 | $retour.="\t".$jsCallback."\n"."});\n"; |
150 | - if ($immediatly) |
|
151 | - $this->jquery_code_for_compile[]=$retour; |
|
155 | + if ($immediatly) { |
|
156 | + $this->jquery_code_for_compile[]=$retour; |
|
157 | + } |
|
152 | 158 | return $retour; |
153 | 159 | } |
154 | 160 | /** |
@@ -189,8 +195,9 @@ discard block |
||
189 | 195 | }});\n"; |
190 | 196 | $retour.="$('#".$form."').submit();\n"; |
191 | 197 | } |
192 | - if ($immediatly) |
|
193 | - $this->jquery_code_for_compile[]=$retour; |
|
198 | + if ($immediatly) { |
|
199 | + $this->jquery_code_for_compile[]=$retour; |
|
200 | + } |
|
194 | 201 | return $retour; |
195 | 202 | } |
196 | 203 |
@@ -13,8 +13,9 @@ |
||
13 | 13 | if(\is_array($value)){ |
14 | 14 | $itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id",""),JArray::getDefaultValue($value, "label",null),JArray::getDefaultValue($value, "type", "text"),JArray::getDefaultValue($value, "value",""),JArray::getDefaultValue($value, "placeholder",JArray::getDefaultValue($value, "label",null))); |
15 | 15 | return $itemO; |
16 | - }else |
|
17 | - return new HtmlFormInput($value); |
|
16 | + } else { |
|
17 | + return new HtmlFormInput($value); |
|
18 | + } |
|
18 | 19 | } |
19 | 20 | |
20 | 21 | public function addInputs($inputs,$fieldslabel=null){ |
@@ -173,10 +173,12 @@ discard block |
||
173 | 173 | if (isset($param)) { |
174 | 174 | $param=$this->_prep_value($param); |
175 | 175 | $str="$({$element}).{$jQueryCall}({$param});"; |
176 | - } else |
|
177 | - $str="$({$element}).{$jQueryCall}();"; |
|
178 | - if ($immediatly) |
|
179 | - $this->jquery_code_for_compile[]=$str; |
|
176 | + } else { |
|
177 | + $str="$({$element}).{$jQueryCall}();"; |
|
178 | + } |
|
179 | + if ($immediatly) { |
|
180 | + $this->jquery_code_for_compile[]=$str; |
|
181 | + } |
|
180 | 182 | return $str; |
181 | 183 | } |
182 | 184 | /** |
@@ -191,8 +193,9 @@ discard block |
||
191 | 193 | $to=$this->_prep_element($to); |
192 | 194 | $element=$this->_prep_element($element); |
193 | 195 | $str="$({$to}).{$jQueryCall}({$element});"; |
194 | - if ($immediatly) |
|
195 | - $this->jquery_code_for_compile[]=$str; |
|
196 | + if ($immediatly) { |
|
197 | + $this->jquery_code_for_compile[]=$str; |
|
198 | + } |
|
196 | 199 | return $str; |
197 | 200 | } |
198 | 201 | // -------------------------------------------------------------------- |
@@ -260,12 +263,14 @@ discard block |
||
260 | 263 | if ($stopPropagation===true) { |
261 | 264 | $js="event.stopPropagation();\n".$js; |
262 | 265 | } |
263 | - if (array_search($event, $this->jquery_events)===false) |
|
264 | - $event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
265 | - else |
|
266 | - $event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
267 | - if($immediatly) |
|
268 | - $this->jquery_code_for_compile[]=$event; |
|
266 | + if (array_search($event, $this->jquery_events)===false) { |
|
267 | + $event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
268 | + } else { |
|
269 | + $event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
270 | + } |
|
271 | + if($immediatly) { |
|
272 | + $this->jquery_code_for_compile[]=$event; |
|
273 | + } |
|
269 | 274 | return $event; |
270 | 275 | } |
271 | 276 | |
@@ -326,8 +331,9 @@ discard block |
||
326 | 331 | } |
327 | 332 | $output=($script_tags===FALSE) ? $script : $this->inline($script); |
328 | 333 | |
329 | - if ($view!=NULL) |
|
330 | - $view->setVar($view_var, $output); |
|
334 | + if ($view!=NULL) { |
|
335 | + $view->setVar($view_var, $output); |
|
336 | + } |
|
331 | 337 | return $output; |
332 | 338 | } |
333 | 339 | |
@@ -421,7 +427,9 @@ discard block |
||
421 | 427 | } |
422 | 428 | |
423 | 429 | private function minify($input) { |
424 | - if(trim($input) === "") return $input; |
|
430 | + if(trim($input) === "") { |
|
431 | + return $input; |
|
432 | + } |
|
425 | 433 | return preg_replace( |
426 | 434 | array( |
427 | 435 | // Remove comment(s) |
@@ -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){ |
@@ -49,8 +49,9 @@ discard block |
||
49 | 49 | public function addCol($width=NULL){ |
50 | 50 | $colCount=$this->colCount()+1; |
51 | 51 | $this->setColsCount($colCount,true,$width); |
52 | - if($this->hasOnlyCols($this->count())) |
|
53 | - return $this->content[$colCount-1]; |
|
52 | + if($this->hasOnlyCols($this->count())) { |
|
53 | + return $this->content[$colCount-1]; |
|
54 | + } |
|
54 | 55 | return $this; |
55 | 56 | } |
56 | 57 | |
@@ -73,7 +74,7 @@ discard block |
||
73 | 74 | for($i=$count;$i<$colsCount;$i++){ |
74 | 75 | $this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i)); |
75 | 76 | } |
76 | - }else{ |
|
77 | + } else{ |
|
77 | 78 | if($this->hasOnlyCols($count)){ |
78 | 79 | $tmpContent=$this->content; |
79 | 80 | $item=$this->addItem($colsCount); |
@@ -93,15 +94,16 @@ discard block |
||
93 | 94 | } |
94 | 95 | |
95 | 96 | public function setColsCount($numCols,$toCreate=true,$width=NULL){ |
96 | - if(isset($width)===false) |
|
97 | - $this->setWide($numCols); |
|
97 | + if(isset($width)===false) { |
|
98 | + $this->setWide($numCols); |
|
99 | + } |
|
98 | 100 | if($toCreate==true){ |
99 | 101 | $count=$this->count(); |
100 | 102 | if($count==0 || $this->hasOnlyCols($count)){ |
101 | 103 | for($i=$count;$i<$numCols;$i++){ |
102 | 104 | $this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i,$width)); |
103 | 105 | } |
104 | - }else{ |
|
106 | + } else{ |
|
105 | 107 | for($i=0;$i<$count;$i++){ |
106 | 108 | $this->getItem($i)->setColsCount($numCols); |
107 | 109 | } |
@@ -121,17 +123,20 @@ discard block |
||
121 | 123 | |
122 | 124 | public function rowCount(){ |
123 | 125 | $count=$this->count(); |
124 | - if($this->hasOnlyCols($count)) |
|
125 | - return 0; |
|
126 | + if($this->hasOnlyCols($count)) { |
|
127 | + return 0; |
|
128 | + } |
|
126 | 129 | return $count; |
127 | 130 | } |
128 | 131 | |
129 | 132 | public function colCount(){ |
130 | 133 | $count=$this->count(); |
131 | - if($this->hasOnlyCols($count)) |
|
132 | - return $count; |
|
133 | - if($count>0) |
|
134 | - return $this->getItem(0)->count(); |
|
134 | + if($this->hasOnlyCols($count)) { |
|
135 | + return $count; |
|
136 | + } |
|
137 | + if($count>0) { |
|
138 | + return $this->getItem(0)->count(); |
|
139 | + } |
|
135 | 140 | return 0; |
136 | 141 | } |
137 | 142 | |
@@ -141,8 +146,9 @@ discard block |
||
141 | 146 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
142 | 147 | */ |
143 | 148 | public function getCell($row,$col){ |
144 | - if($row<2 && $this->hasOnlyCols($this->count())) |
|
145 | - return $this->getItem($col); |
|
149 | + if($row<2 && $this->hasOnlyCols($this->count())) { |
|
150 | + return $this->getItem($col); |
|
151 | + } |
|
146 | 152 | $row=$this->getItem($row); |
147 | 153 | if(isset($row)){ |
148 | 154 | $col=$row->getItem($col); |
@@ -191,8 +197,9 @@ discard block |
||
191 | 197 | * @return \Ajax\semantic\html\collections\HtmlGrid |
192 | 198 | */ |
193 | 199 | public function setPadded($value=NULL){ |
194 | - if(isset($value)) |
|
195 | - $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
200 | + if(isset($value)) { |
|
201 | + $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
202 | + } |
|
196 | 203 | return $this->addToProperty("class", "padded"); |
197 | 204 | } |
198 | 205 | |
@@ -214,8 +221,9 @@ discard block |
||
214 | 221 | * @see \Ajax\common\html\HtmlCollection::createItem() |
215 | 222 | */ |
216 | 223 | protected function createItem($value){ |
217 | - if($this->_createCols===false) |
|
218 | - $value=null; |
|
224 | + if($this->_createCols===false) { |
|
225 | + $value=null; |
|
226 | + } |
|
219 | 227 | $item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing,$this->_implicitRows); |
220 | 228 | return $item; |
221 | 229 | } |
@@ -9,8 +9,9 @@ |
||
9 | 9 | use TextFieldsTrait; |
10 | 10 | |
11 | 11 | public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) { |
12 | - if(!isset($placeholder) && $type==="text") |
|
13 | - $placeholder=$label; |
|
12 | + if(!isset($placeholder) && $type==="text") { |
|
13 | + $placeholder=$label; |
|
14 | + } |
|
14 | 15 | parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label); |
15 | 16 | } |
16 | 17 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $itemO=$item; |
64 | 64 | if(!$item instanceof HtmlDropdownItem){ |
65 | 65 | $itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image); |
66 | - }elseif($itemO instanceof HtmlDropdownItem){ |
|
66 | + } elseif($itemO instanceof HtmlDropdownItem){ |
|
67 | 67 | $this->addToProperty("class", "vertical"); |
68 | 68 | } |
69 | 69 | return $itemO; |
@@ -77,8 +77,9 @@ discard block |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | public function addInput($name){ |
80 | - if(!isset($name)) |
|
81 | - $name="input-".$this->identifier; |
|
80 | + if(!isset($name)) { |
|
81 | + $name="input-".$this->identifier; |
|
82 | + } |
|
82 | 83 | $this->setAction("activate"); |
83 | 84 | $this->input=new HtmlInput($name,"hidden"); |
84 | 85 | } |
@@ -88,7 +89,7 @@ discard block |
||
88 | 89 | foreach ($items as $k=>$v){ |
89 | 90 | $this->addItem($v)->setData($k); |
90 | 91 | } |
91 | - }else{ |
|
92 | + } else{ |
|
92 | 93 | foreach ($items as $item){ |
93 | 94 | $this->addItem($item); |
94 | 95 | } |
@@ -105,7 +106,7 @@ discard block |
||
105 | 106 | if($dropdown===false){ |
106 | 107 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php'; |
107 | 108 | $dropdown="menu"; |
108 | - }else{ |
|
109 | + } else{ |
|
109 | 110 | $dropdown="dropdown"; |
110 | 111 | $this->mClass="menu"; |
111 | 112 | } |
@@ -121,18 +122,22 @@ discard block |
||
121 | 122 | } |
122 | 123 | |
123 | 124 | public function asButton($floating=false){ |
124 | - if($floating) |
|
125 | - $this->addToProperty("class", "floating"); |
|
125 | + if($floating) { |
|
126 | + $this->addToProperty("class", "floating"); |
|
127 | + } |
|
126 | 128 | return $this->addToProperty("class", "button"); |
127 | 129 | } |
128 | 130 | |
129 | 131 | public function asSelect($name=NULL,$multiple=false,$selection=true){ |
130 | - if(isset($name)) |
|
131 | - $this->addInput($name); |
|
132 | - if($multiple) |
|
133 | - $this->addToProperty("class", "multiple"); |
|
134 | - if ($selection) |
|
135 | - $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
132 | + if(isset($name)) { |
|
133 | + $this->addInput($name); |
|
134 | + } |
|
135 | + if($multiple) { |
|
136 | + $this->addToProperty("class", "multiple"); |
|
137 | + } |
|
138 | + if ($selection) { |
|
139 | + $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
140 | + } |
|
136 | 141 | return $this; |
137 | 142 | } |
138 | 143 | |
@@ -142,8 +147,9 @@ discard block |
||
142 | 147 | } |
143 | 148 | |
144 | 149 | public function setSelect($name=NULL,$multiple=false){ |
145 | - if(!isset($name)) |
|
146 | - $name="select-".$this->identifier; |
|
150 | + if(!isset($name)) { |
|
151 | + $name="select-".$this->identifier; |
|
152 | + } |
|
147 | 153 | $this->input=null; |
148 | 154 | if($multiple){ |
149 | 155 | $this->setProperty("multiple", true); |
@@ -174,12 +180,13 @@ discard block |
||
174 | 180 | public function setValue($value){ |
175 | 181 | if(isset($this->input)){ |
176 | 182 | $this->input->setProperty("value", $value); |
177 | - }else{ |
|
183 | + } else{ |
|
178 | 184 | $this->setProperty("value", $value); |
179 | 185 | } |
180 | 186 | $textElement=$this->getElementById("text-".$this->identifier, $this->content); |
181 | - if(isset($textElement)) |
|
182 | - $textElement->setContent($value); |
|
187 | + if(isset($textElement)) { |
|
188 | + $textElement->setContent($value); |
|
189 | + } |
|
183 | 190 | return $this; |
184 | 191 | } |
185 | 192 | |
@@ -189,8 +196,9 @@ discard block |
||
189 | 196 | */ |
190 | 197 | public function run(JsUtils $js) { |
191 | 198 | if($this->propertyContains("class", "simple")===false){ |
192 | - if(isset($this->_bsComponent)===false) |
|
193 | - $this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params); |
|
199 | + if(isset($this->_bsComponent)===false) { |
|
200 | + $this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params); |
|
201 | + } |
|
194 | 202 | $this->addEventsOnRun($js); |
195 | 203 | return $this->_bsComponent; |
196 | 204 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | } |
24 | 24 | if($content instanceof HtmlSemDoubleElement){ |
25 | 25 | $content=new HtmlSemDoubleElement($this->identifier."-".$index,"div","",$content); |
26 | - }elseif ($content instanceof HtmlImg){ |
|
26 | + } elseif ($content instanceof HtmlImg){ |
|
27 | 27 | $this->addToPropertyCtrl("class", "image", array("image")); |
28 | 28 | } |
29 | 29 | $content->addToProperty("class",(($index===0)?"visible":"hidden")." content"); |