@@ -52,8 +52,9 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function getSideContent($index){ |
54 | 54 | $item= $this->getItem($index); |
55 | - if(isset($item)) |
|
56 | - return $item->getContent(); |
|
55 | + if(isset($item)) { |
|
56 | + return $item->getContent(); |
|
57 | + } |
|
57 | 58 | return null; |
58 | 59 | } |
59 | 60 | |
@@ -147,15 +148,17 @@ discard block |
||
147 | 148 | * @see BaseHtml::run() |
148 | 149 | */ |
149 | 150 | public function run(JsUtils $js) { |
150 | - if (isset($this->_bsComponent) === false) |
|
151 | - $this->_bsComponent=$js->semantic()->shape("#" . $this->identifier, $this->_params); |
|
151 | + if (isset($this->_bsComponent) === false) { |
|
152 | + $this->_bsComponent=$js->semantic()->shape("#" . $this->identifier, $this->_params); |
|
153 | + } |
|
152 | 154 | $this->addEventsOnRun($js); |
153 | 155 | return $this->_bsComponent; |
154 | 156 | } |
155 | 157 | |
156 | 158 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
157 | - if($this->_autoActive) |
|
158 | - $this->setActiveSide(0); |
|
159 | + if($this->_autoActive) { |
|
160 | + $this->setActiveSide(0); |
|
161 | + } |
|
159 | 162 | return parent::compile($js,$view); |
160 | 163 | } |
161 | 164 | } |
@@ -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 | } |
@@ -31,8 +31,9 @@ discard block |
||
31 | 31 | protected function createTitleElement(){ |
32 | 32 | $element=new HtmlSemDoubleElement("title-".$this->identifier,"div","title"); |
33 | 33 | $element->setContent(array(new HtmlIcon("", $this->_icon),$this->_title)); |
34 | - if($this->_active===true) |
|
35 | - $element->addToProperty("class", "active"); |
|
34 | + if($this->_active===true) { |
|
35 | + $element->addToProperty("class", "active"); |
|
36 | + } |
|
36 | 37 | return $element; |
37 | 38 | } |
38 | 39 | |
@@ -43,10 +44,11 @@ discard block |
||
43 | 44 | |
44 | 45 | public function setActive($value=true){ |
45 | 46 | $this->_active=$value; |
46 | - if($value===true) |
|
47 | - $this->addToPropertyCtrl("class", "active", array("active")); |
|
48 | - else |
|
49 | - $this->removePropertyValue("class", "active"); |
|
47 | + if($value===true) { |
|
48 | + $this->addToPropertyCtrl("class", "active", array("active")); |
|
49 | + } else { |
|
50 | + $this->removePropertyValue("class", "active"); |
|
51 | + } |
|
50 | 52 | return $this; |
51 | 53 | } |
52 | 54 | } |
@@ -47,8 +47,9 @@ discard block |
||
47 | 47 | $actionO=$action; |
48 | 48 | if (\is_object($action) === false) { |
49 | 49 | $actionO=new HtmlButton("action-" . $this->identifier, $action); |
50 | - if (isset($icon)) |
|
51 | - $actionO->addIcon($icon, true, $labeled); |
|
50 | + if (isset($icon)) { |
|
51 | + $actionO->addIcon($icon, true, $labeled); |
|
52 | + } |
|
52 | 53 | } |
53 | 54 | $field->addToProperty("class", $direction . " action"); |
54 | 55 | $field->addContent($actionO, \strstr($direction, Direction::LEFT) !== false); |
@@ -82,8 +83,9 @@ discard block |
||
82 | 83 | |
83 | 84 | public function setDisabled($disable=true) { |
84 | 85 | $field=$this->getField(); |
85 | - if($disable) |
|
86 | - $field->addToProperty("class", "disabled"); |
|
86 | + if($disable) { |
|
87 | + $field->addToProperty("class", "disabled"); |
|
88 | + } |
|
87 | 89 | return $this; |
88 | 90 | } |
89 | 91 | } |
@@ -28,10 +28,11 @@ discard block |
||
28 | 28 | $this->setProperty("aria-describedby", $id); |
29 | 29 | $span->setContent($text); |
30 | 30 | $span->setClass("input-group-addon"); |
31 | - if (strtolower($position)==="left") |
|
32 | - $this->addonLeft=$span; |
|
33 | - else |
|
34 | - $this->addonRight=$span; |
|
31 | + if (strtolower($position)==="left") { |
|
32 | + $this->addonLeft=$span; |
|
33 | + } else { |
|
34 | + $this->addonRight=$span; |
|
35 | + } |
|
35 | 36 | return $span; |
36 | 37 | } |
37 | 38 | |
@@ -74,7 +75,7 @@ discard block |
||
74 | 75 | $bt=NULL; |
75 | 76 | if(is_string($item)){ |
76 | 77 | $bt=new HtmlButton($this->identifier."-bt-".$i++,$item); |
77 | - }elseif ($item instanceof HtmlButton){ |
|
78 | + } elseif ($item instanceof HtmlButton){ |
|
78 | 79 | $bt=$item; |
79 | 80 | } |
80 | 81 | if(isset($bt)){ |
@@ -88,10 +89,11 @@ discard block |
||
88 | 89 | $dropdown->setBtnCaption($caption); |
89 | 90 | $dropdown->fromArray($items); |
90 | 91 | |
91 | - if (strtolower($position)==="left") |
|
92 | - $this->addonLeft=$dropdown; |
|
93 | - else |
|
94 | - $this->addonRight=$dropdown; |
|
92 | + if (strtolower($position)==="left") { |
|
93 | + $this->addonLeft=$dropdown; |
|
94 | + } else { |
|
95 | + $this->addonRight=$dropdown; |
|
96 | + } |
|
95 | 97 | return $dropdown; |
96 | 98 | } |
97 | 99 | |
@@ -126,10 +128,12 @@ discard block |
||
126 | 128 | |
127 | 129 | public function run(JsUtils $js) { |
128 | 130 | parent::run($js); |
129 | - if (isset($this->addonLeft)) |
|
130 | - $this->addonLeft->run($js); |
|
131 | - if (isset($this->addonRight)) |
|
132 | - $this->addonRight->run($js); |
|
131 | + if (isset($this->addonLeft)) { |
|
132 | + $this->addonLeft->run($js); |
|
133 | + } |
|
134 | + if (isset($this->addonRight)) { |
|
135 | + $this->addonRight->run($js); |
|
136 | + } |
|
133 | 137 | } |
134 | 138 | |
135 | 139 | } |
@@ -69,7 +69,8 @@ |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | public function getPanel($index) { |
72 | - if ($index<sizeof($this->content)) |
|
73 | - return $this->content [$index]; |
|
72 | + if ($index<sizeof($this->content)) { |
|
73 | + return $this->content [$index]; |
|
74 | + } |
|
74 | 75 | } |
75 | 76 | } |
@@ -36,8 +36,9 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | public function getTab($index) { |
39 | - if ($index>0&&$index<sizeof($this->tabs)) |
|
40 | - return $this->tabs [$index]; |
|
39 | + if ($index>0&&$index<sizeof($this->tabs)) { |
|
40 | + return $this->tabs [$index]; |
|
41 | + } |
|
41 | 42 | } |
42 | 43 | |
43 | 44 | public function show($index) { |
@@ -53,8 +54,9 @@ discard block |
||
53 | 54 | */ |
54 | 55 | public function onShow($index, $jsCode) { |
55 | 56 | $tab=$this->getTab($index); |
56 | - if (isset($tab)) |
|
57 | - return $tab->onShow($jsCode); |
|
57 | + if (isset($tab)) { |
|
58 | + return $tab->onShow($jsCode); |
|
59 | + } |
|
58 | 60 | } |
59 | 61 | |
60 | 62 | /** |
@@ -65,8 +67,9 @@ discard block |
||
65 | 67 | */ |
66 | 68 | public function onShown($index, $jsCode) { |
67 | 69 | $tab=$this->getTab($index); |
68 | - if (isset($tab)) |
|
69 | - return $tab->onShown($jsCode); |
|
70 | + if (isset($tab)) { |
|
71 | + return $tab->onShown($jsCode); |
|
72 | + } |
|
70 | 73 | } |
71 | 74 | |
72 | 75 | /** |
@@ -77,8 +80,9 @@ discard block |
||
77 | 80 | */ |
78 | 81 | public function onHide($index, $jsCode) { |
79 | 82 | $tab=$this->getTab($index); |
80 | - if (isset($tab)) |
|
81 | - return $tab->onShow($jsCode); |
|
83 | + if (isset($tab)) { |
|
84 | + return $tab->onShow($jsCode); |
|
85 | + } |
|
82 | 86 | } |
83 | 87 | |
84 | 88 | /** |
@@ -89,7 +93,8 @@ discard block |
||
89 | 93 | */ |
90 | 94 | public function onHidden($index, $jsCode) { |
91 | 95 | $tab=$this->getTab($index); |
92 | - if (isset($tab)) |
|
93 | - return $tab->onShow($jsCode); |
|
96 | + if (isset($tab)) { |
|
97 | + return $tab->onShow($jsCode); |
|
98 | + } |
|
94 | 99 | } |
95 | 100 | } |
@@ -28,8 +28,9 @@ discard block |
||
28 | 28 | $callback=", function(){\n{$callback}\n}"; |
29 | 29 | } |
30 | 30 | $str="$({$element}).{$action}({$speed}{$callback});"; |
31 | - if ($immediatly) |
|
32 | - $this->jquery_code_for_compile[]=$str; |
|
31 | + if ($immediatly) { |
|
32 | + $this->jquery_code_for_compile[]=$str; |
|
33 | + } |
|
33 | 34 | return $str; |
34 | 35 | } |
35 | 36 | /** |
@@ -61,10 +62,12 @@ discard block |
||
61 | 62 | if (isset($param)) { |
62 | 63 | $param=Javascript::prep_value($param); |
63 | 64 | $str="$({$element}).{$jQueryCall}({$param});"; |
64 | - } else |
|
65 | - $str="$({$element}).{$jQueryCall}();"; |
|
66 | - if ($immediatly) |
|
67 | - $this->jquery_code_for_compile[]=$str; |
|
65 | + } else { |
|
66 | + $str="$({$element}).{$jQueryCall}();"; |
|
67 | + } |
|
68 | + if ($immediatly) { |
|
69 | + $this->jquery_code_for_compile[]=$str; |
|
70 | + } |
|
68 | 71 | return $str; |
69 | 72 | } |
70 | 73 | |
@@ -80,8 +83,9 @@ discard block |
||
80 | 83 | $to=Javascript::prep_element($to); |
81 | 84 | $element=Javascript::prep_element($element); |
82 | 85 | $str="$({$to}).{$jQueryCall}({$element});"; |
83 | - if ($immediatly) |
|
84 | - $this->jquery_code_for_compile[]=$str; |
|
86 | + if ($immediatly) { |
|
87 | + $this->jquery_code_for_compile[]=$str; |
|
88 | + } |
|
85 | 89 | return $str; |
86 | 90 | } |
87 | 91 | /** |
@@ -130,10 +134,12 @@ discard block |
||
130 | 134 | if (isset($value)) { |
131 | 135 | $value=Javascript::prep_value($value); |
132 | 136 | $str="$({$element}).attr(\"$attributeName\",{$value});"; |
133 | - } else |
|
134 | - $str="$({$element}).attr(\"$attributeName\");"; |
|
135 | - if ($immediatly) |
|
136 | - $this->jquery_code_for_compile[]=$str; |
|
137 | + } else { |
|
138 | + $str="$({$element}).attr(\"$attributeName\");"; |
|
139 | + } |
|
140 | + if ($immediatly) { |
|
141 | + $this->jquery_code_for_compile[]=$str; |
|
142 | + } |
|
137 | 143 | return $str; |
138 | 144 | } |
139 | 145 | |
@@ -189,8 +195,9 @@ discard block |
||
189 | 195 | |
190 | 196 | $str="$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");"; |
191 | 197 | |
192 | - if ($immediatly) |
|
193 | - $this->jquery_code_for_compile[]=$str; |
|
198 | + if ($immediatly) { |
|
199 | + $this->jquery_code_for_compile[]=$str; |
|
200 | + } |
|
194 | 201 | return $str; |
195 | 202 | } |
196 | 203 | |
@@ -340,8 +347,9 @@ discard block |
||
340 | 347 | $element=Javascript::prep_element($element); |
341 | 348 | $str="$({$element}).trigger(\"$event\");"; |
342 | 349 | |
343 | - if ($immediatly) |
|
344 | - $this->jquery_code_for_compile[]=$str; |
|
350 | + if ($immediatly) { |
|
351 | + $this->jquery_code_for_compile[]=$str; |
|
352 | + } |
|
345 | 353 | return $str; |
346 | 354 | } |
347 | 355 | |
@@ -403,8 +411,9 @@ discard block |
||
403 | 411 | $str.="else{".$jsCodeIfFalse."}"; |
404 | 412 | } |
405 | 413 | |
406 | - if ($immediatly) |
|
407 | - $this->jquery_code_for_compile[]=$str; |
|
414 | + if ($immediatly) { |
|
415 | + $this->jquery_code_for_compile[]=$str; |
|
416 | + } |
|
408 | 417 | return $str; |
409 | 418 | } |
410 | 419 | |
@@ -420,11 +429,13 @@ discard block |
||
420 | 429 | private function _doJQuery($element, $jqueryCall, $param="", $jsCallback="", $immediatly=false) { |
421 | 430 | $param=Javascript::prep_value($param); |
422 | 431 | $callback=""; |
423 | - if ($jsCallback!="") |
|
424 | - $callback=", function(event){\n{$jsCallback}\n}"; |
|
432 | + if ($jsCallback!="") { |
|
433 | + $callback=", function(event){\n{$jsCallback}\n}"; |
|
434 | + } |
|
425 | 435 | $script="$(".Javascript::prep_element($element).").".$jqueryCall."(".$param.$callback.");\n"; |
426 | - if ($immediatly) |
|
427 | - $this->jquery_code_for_compile[]=$script; |
|
436 | + if ($immediatly) { |
|
437 | + $this->jquery_code_for_compile[]=$script; |
|
438 | + } |
|
428 | 439 | return $script; |
429 | 440 | } |
430 | 441 | |
@@ -495,8 +506,9 @@ discard block |
||
495 | 506 | */ |
496 | 507 | public function exec($js, $immediatly=false) { |
497 | 508 | $script=$js."\n"; |
498 | - if ($immediatly) |
|
499 | - $this->jquery_code_for_compile[]=$script; |
|
509 | + if ($immediatly) { |
|
510 | + $this->jquery_code_for_compile[]=$script; |
|
511 | + } |
|
500 | 512 | return $script; |
501 | 513 | } |
502 | 514 |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | $itemSelector=JString::getValueBetween($event); |
27 | 27 | if($event=="execute"){ |
28 | 28 | $this->jquery_code_for_compile []=$jsCode; |
29 | - }else if($event=="beforeExecute"){ |
|
29 | + } else if($event=="beforeExecute"){ |
|
30 | 30 | \array_unshift($this->jquery_code_for_compile, $jsCode); |
31 | - }else{ |
|
31 | + } else{ |
|
32 | 32 | $selector=$this->_createSelector($itemSelector, $this->attachTo); |
33 | 33 | $this->jquery_code_for_compile []="$( \"".$selector."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});"; |
34 | 34 | } |
@@ -36,10 +36,12 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | protected function _createSelector($itemSelector,$selector){ |
39 | - if(!isset($itemSelector)) |
|
40 | - $itemSelector=$this->itemSelector; |
|
41 | - if(isset($itemSelector) && $itemSelector!=="") |
|
42 | - $selector.=" ".$itemSelector; |
|
39 | + if(!isset($itemSelector)) { |
|
40 | + $itemSelector=$this->itemSelector; |
|
41 | + } |
|
42 | + if(isset($itemSelector) && $itemSelector!=="") { |
|
43 | + $selector.=" ".$itemSelector; |
|
44 | + } |
|
43 | 45 | return $selector; |
44 | 46 | } |
45 | 47 | |
@@ -82,8 +84,9 @@ discard block |
||
82 | 84 | |
83 | 85 | protected function setParamCtrl($key, $value, $typeCtrl) { |
84 | 86 | if (\is_array($typeCtrl)) { |
85 | - if (array_search($value, $typeCtrl)===false) |
|
86 | - throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
87 | + if (array_search($value, $typeCtrl)===false) { |
|
88 | + throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
89 | + } |
|
87 | 90 | } else { |
88 | 91 | if (!$typeCtrl($value)) { |
89 | 92 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName); |