@@ -23,10 +23,11 @@ discard block |
||
23 | 23 | foreach ( $this->events as $event => $jsCode ) { |
24 | 24 | if($event=="execute"){ |
25 | 25 | $this->jquery_code_for_compile []=$jsCode; |
26 | - }else if($event=="beforeExecute"){ |
|
26 | + } else if($event=="beforeExecute"){ |
|
27 | 27 | \array_unshift($this->jquery_code_for_compile, $jsCode); |
28 | - }else |
|
29 | - $this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});"; |
|
28 | + } else { |
|
29 | + $this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});"; |
|
30 | + } |
|
30 | 31 | } |
31 | 32 | } |
32 | 33 | |
@@ -69,8 +70,9 @@ discard block |
||
69 | 70 | |
70 | 71 | protected function setParamCtrl($key, $value, $typeCtrl) { |
71 | 72 | if (is_array($typeCtrl)) { |
72 | - if (array_search($value, $typeCtrl)===false) |
|
73 | - 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)."}"); |
|
73 | + if (array_search($value, $typeCtrl)===false) { |
|
74 | + 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)."}"); |
|
75 | + } |
|
74 | 76 | } else { |
75 | 77 | if (!$typeCtrl($value)) { |
76 | 78 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName); |
@@ -28,8 +28,9 @@ |
||
28 | 28 | foreach ( $objects as $object ) { |
29 | 29 | $this->addResult([ "title" => $object ]); |
30 | 30 | } |
31 | - } else |
|
32 | - $this->elements=\array_merge($this->elements, $objects); |
|
31 | + } else { |
|
32 | + $this->elements=\array_merge($this->elements, $objects); |
|
33 | + } |
|
33 | 34 | return $this; |
34 | 35 | } |
35 | 36 |
@@ -20,8 +20,9 @@ |
||
20 | 20 | $result=array (); |
21 | 21 | foreach ( $this->categories as $category ) { |
22 | 22 | $r=$category->search($query, $field); |
23 | - if ($r !== false) |
|
24 | - $result[]=$r; |
|
23 | + if ($r !== false) { |
|
24 | + $result[]=$r; |
|
25 | + } |
|
25 | 26 | } |
26 | 27 | $this->categories=$result; |
27 | 28 | return $this; |
@@ -21,10 +21,12 @@ discard block |
||
21 | 21 | |
22 | 22 | private function createField($placeholder=NULL, $icon=NULL) { |
23 | 23 | $field=new HtmlInput($this->identifier); |
24 | - if (isset($placeholder) === true) |
|
25 | - $field->setPlaceholder($placeholder); |
|
26 | - if (isset($icon) === true) |
|
27 | - $field->addIcon($icon, Direction::RIGHT); |
|
24 | + if (isset($placeholder) === true) { |
|
25 | + $field->setPlaceholder($placeholder); |
|
26 | + } |
|
27 | + if (isset($icon) === true) { |
|
28 | + $field->addIcon($icon, Direction::RIGHT); |
|
29 | + } |
|
28 | 30 | $field->getField()->setClass("prompt"); |
29 | 31 | $this->content["field"]=$field; |
30 | 32 | return $field; |
@@ -68,8 +70,9 @@ discard block |
||
68 | 70 | $searchFields=\json_encode($this->_searchFields); |
69 | 71 | $searchFields=str_ireplace("\"", "%quote%", $searchFields); |
70 | 72 | $this->_params["searchFields"]="%" . $searchFields . "%"; |
71 | - if ($this->getType() === "standard") |
|
72 | - $this->_params["source"]="%content%"; |
|
73 | + if ($this->getType() === "standard") { |
|
74 | + $this->_params["source"]="%content%"; |
|
75 | + } |
|
73 | 76 | $this->addEvent("beforeExecute", "var content=" . $this->resultsToJson() . ";"); |
74 | 77 | if (isset($this->_bsComponent) === false) { |
75 | 78 | $this->_bsComponent=$js->semantic()->search("#" . $this->identifier, $this->_params); |