@@ -55,10 +55,12 @@ discard block |
||
55 | 55 | $js->execOn("mouseover", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'visible');",["preventDefault"=>false,"stopPropagation"=>true]); |
56 | 56 | $js->execOn("mouseout", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'hidden');",["preventDefault"=>false,"stopPropagation"=>true]); |
57 | 57 | } |
58 | - if(\is_array($this->_deleteBehavior)) |
|
59 | - $this->_generateBehavior("delete",$this->_deleteBehavior, $js); |
|
60 | - if(\is_array($this->_editBehavior)) |
|
61 | - $this->_generateBehavior("edit",$this->_editBehavior,$js); |
|
58 | + if(\is_array($this->_deleteBehavior)) { |
|
59 | + $this->_generateBehavior("delete",$this->_deleteBehavior, $js); |
|
60 | + } |
|
61 | + if(\is_array($this->_editBehavior)) { |
|
62 | + $this->_generateBehavior("edit",$this->_editBehavior,$js); |
|
63 | + } |
|
62 | 64 | return parent::run($js); |
63 | 65 | } |
64 | 66 | |
@@ -94,12 +96,14 @@ discard block |
||
94 | 96 | $table->setRowCount(0, \sizeof($captions)); |
95 | 97 | $this->_generateHeader($table,$captions); |
96 | 98 | |
97 | - if(isset($this->_compileParts)) |
|
98 | - $table->setCompileParts($this->_compileParts); |
|
99 | + if(isset($this->_compileParts)) { |
|
100 | + $table->setCompileParts($this->_compileParts); |
|
101 | + } |
|
99 | 102 | |
100 | 103 | if(isset($this->_searchField) && isset($js)){ |
101 | - if(isset($this->_urls["refresh"])) |
|
102 | - $this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]); |
|
104 | + if(isset($this->_urls["refresh"])) { |
|
105 | + $this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]); |
|
106 | + } |
|
103 | 107 | } |
104 | 108 | |
105 | 109 | $this->_generateContent($table); |
@@ -159,8 +163,9 @@ discard block |
||
159 | 163 | $field=$ck->getField(); |
160 | 164 | $field->setProperty("value",$id); |
161 | 165 | $field->setProperty("name", "selection[]"); |
162 | - if(isset($checkedClass)) |
|
163 | - $field->setClass($checkedClass); |
|
166 | + if(isset($checkedClass)) { |
|
167 | + $field->setClass($checkedClass); |
|
168 | + } |
|
164 | 169 | \array_unshift($values, $ck); |
165 | 170 | } |
166 | 171 | $result=$table->newRow(); |
@@ -173,8 +178,9 @@ discard block |
||
173 | 178 | |
174 | 179 | protected function _generatePagination($table,$js=NULL){ |
175 | 180 | if(isset($this->_toolbar)){ |
176 | - if($this->_toolbarPosition==PositionInTable::FOOTER) |
|
177 | - $this->_toolbar->setFloated("left"); |
|
181 | + if($this->_toolbarPosition==PositionInTable::FOOTER) { |
|
182 | + $this->_toolbar->setFloated("left"); |
|
183 | + } |
|
178 | 184 | } |
179 | 185 | $footer=$table->getFooter(); |
180 | 186 | $footer->mergeCol(); |
@@ -231,7 +237,7 @@ discard block |
||
231 | 237 | $hasPart=$table->hasPart($part); |
232 | 238 | if($hasPart){ |
233 | 239 | $row=$table->getPart($part)->addRow(\sizeof($captions)); |
234 | - }else{ |
|
240 | + } else{ |
|
235 | 241 | $row=$table->getPart($part)->getRow(0); |
236 | 242 | } |
237 | 243 | $row->mergeCol(); |
@@ -256,7 +262,7 @@ discard block |
||
256 | 262 | $this->_urls["refresh"]=JArray::getValue($urls, "refresh",0); |
257 | 263 | $this->_urls["edit"]=JArray::getValue($urls, "edit",1); |
258 | 264 | $this->_urls["delete"]=JArray::getValue($urls, "delete",2); |
259 | - }else{ |
|
265 | + } else{ |
|
260 | 266 | $this->_urls=["refresh"=>$urls,"edit"=>$urls,"delete"=>$urls]; |
261 | 267 | } |
262 | 268 | return $this; |
@@ -330,8 +336,9 @@ discard block |
||
330 | 336 | |
331 | 337 | protected function getTargetSelector() { |
332 | 338 | $result=$this->_targetSelector; |
333 | - if(!isset($result)) |
|
334 | - $result="#".$this->identifier; |
|
339 | + if(!isset($result)) { |
|
340 | + $result="#".$this->identifier; |
|
341 | + } |
|
335 | 342 | return $result; |
336 | 343 | } |
337 | 344 | |
@@ -346,8 +353,9 @@ discard block |
||
346 | 353 | } |
347 | 354 | |
348 | 355 | public function getRefreshSelector() { |
349 | - if(isset($this->_refreshSelector)) |
|
350 | - return $this->_refreshSelector; |
|
356 | + if(isset($this->_refreshSelector)) { |
|
357 | + return $this->_refreshSelector; |
|
358 | + } |
|
351 | 359 | return "#".$this->identifier." tbody"; |
352 | 360 | } |
353 | 361 | |
@@ -362,8 +370,9 @@ discard block |
||
362 | 370 | */ |
363 | 371 | public function show($modelInstance){ |
364 | 372 | if(\is_array($modelInstance)){ |
365 | - if(\is_array(array_values($modelInstance)[0])) |
|
366 | - $modelInstance=\json_decode(\json_encode($modelInstance), FALSE); |
|
373 | + if(\is_array(array_values($modelInstance)[0])) { |
|
374 | + $modelInstance=\json_decode(\json_encode($modelInstance), FALSE); |
|
375 | + } |
|
367 | 376 | } |
368 | 377 | $this->_modelInstance=$modelInstance; |
369 | 378 | } |
@@ -271,8 +271,9 @@ discard block |
||
271 | 271 | $result= $this->getBody()->_addRow($result); |
272 | 272 | } |
273 | 273 | if(isset($this->_afterCompileEvents["onNewRow"])){ |
274 | - if(\is_callable($this->_afterCompileEvents["onNewRow"])) |
|
275 | - $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
274 | + if(\is_callable($this->_afterCompileEvents["onNewRow"])) { |
|
275 | + $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
276 | + } |
|
276 | 277 | } |
277 | 278 | return $result; |
278 | 279 | } |
@@ -293,8 +294,9 @@ discard block |
||
293 | 294 | |
294 | 295 | public function run(JsUtils $js){ |
295 | 296 | $result= parent::run($js); |
296 | - if(isset($this->_footer)) |
|
297 | - $this->_footer->run($js); |
|
297 | + if(isset($this->_footer)) { |
|
298 | + $this->_footer->run($js); |
|
299 | + } |
|
298 | 300 | return $result; |
299 | 301 | } |
300 | 302 |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | //echo $itemSelector.":::".$jsCode."<br>"; |
29 | 29 | if($event=="execute"){ |
30 | 30 | $this->jquery_code_for_compile []=$jsCode; |
31 | - }else if($event=="beforeExecute"){ |
|
31 | + } else if($event=="beforeExecute"){ |
|
32 | 32 | \array_unshift($this->jquery_code_for_compile, $jsCode); |
33 | - }else{ |
|
33 | + } else{ |
|
34 | 34 | $selector=$this->_createSelector($itemSelector, $this->attachTo); |
35 | 35 | $this->jquery_code_for_compile []="$( \"".$selector."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});"; |
36 | 36 | } |
@@ -38,10 +38,12 @@ discard block |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | protected function _createSelector($itemSelector,$selector){ |
41 | - if(!isset($itemSelector)) |
|
42 | - $itemSelector=$this->itemSelector; |
|
43 | - if(isset($itemSelector) && $itemSelector!=="") |
|
44 | - $selector.=" ".$itemSelector; |
|
41 | + if(!isset($itemSelector)) { |
|
42 | + $itemSelector=$this->itemSelector; |
|
43 | + } |
|
44 | + if(isset($itemSelector) && $itemSelector!=="") { |
|
45 | + $selector.=" ".$itemSelector; |
|
46 | + } |
|
45 | 47 | return $selector; |
46 | 48 | } |
47 | 49 | |
@@ -84,8 +86,9 @@ discard block |
||
84 | 86 | |
85 | 87 | protected function setParamCtrl($key, $value, $typeCtrl) { |
86 | 88 | if (\is_array($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 | + if (array_search($value, $typeCtrl)===false) { |
|
90 | + 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)."}"); |
|
91 | + } |
|
89 | 92 | } else { |
90 | 93 | if (!$typeCtrl($value)) { |
91 | 94 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName); |
@@ -54,8 +54,9 @@ discard block |
||
54 | 54 | |
55 | 55 | public function setAttached($value=true){ |
56 | 56 | $form=$this->getForm(); |
57 | - if($value) |
|
58 | - $form->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
57 | + if($value) { |
|
58 | + $form->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
59 | + } |
|
59 | 60 | return $form; |
60 | 61 | } |
61 | 62 | |
@@ -77,10 +78,11 @@ discard block |
||
77 | 78 | */ |
78 | 79 | public function submitOn($event,$identifierOrElement,$url,$responseElement,$parameters=NULL){ |
79 | 80 | $form=$this->getForm(); |
80 | - if($identifierOrElement instanceof BaseHtml) |
|
81 | - $elem=$identifierOrElement; |
|
82 | - else |
|
83 | - $elem=$form->getElementById($identifierOrElement, $form->getContent()); |
|
81 | + if($identifierOrElement instanceof BaseHtml) { |
|
82 | + $elem=$identifierOrElement; |
|
83 | + } else { |
|
84 | + $elem=$form->getElementById($identifierOrElement, $form->getContent()); |
|
85 | + } |
|
84 | 86 | if(isset($elem)){ |
85 | 87 | $this->_buttonAsSubmit($elem, $event,$url,$responseElement,$parameters); |
86 | 88 | } |
@@ -101,8 +103,9 @@ discard block |
||
101 | 103 | if(isset($url) && isset($responseElement)){ |
102 | 104 | $button->addEvent($event, "$('#".$form->getIdentifier()."').form('validate form');",true,true); |
103 | 105 | $params=["form"=>$form->getIdentifier(),"responseElement"=>$responseElement,"url"=>$url,"stopPropagation"=>true]; |
104 | - if(\is_array($parameters)) |
|
105 | - $params=\array_merge($params,$parameters); |
|
106 | + if(\is_array($parameters)) { |
|
107 | + $params=\array_merge($params,$parameters); |
|
108 | + } |
|
106 | 109 | $form->addValidationParam("_ajaxSubmit", new AjaxCall("postForm", $params)); |
107 | 110 | } |
108 | 111 | return $button; |
@@ -9,8 +9,9 @@ discard block |
||
9 | 9 | |
10 | 10 | public function __construct($identifier,$context=NULL,$content=NULL) { |
11 | 11 | parent::__construct($identifier, "div", "ui sticky", $content); |
12 | - if(isset($content)) |
|
13 | - $this->setContext($context); |
|
12 | + if(isset($content)) { |
|
13 | + $this->setContext($context); |
|
14 | + } |
|
14 | 15 | } |
15 | 16 | |
16 | 17 | public function setContext($context){ |
@@ -20,15 +21,17 @@ discard block |
||
20 | 21 | |
21 | 22 | public function setFixed($value=NULL){ |
22 | 23 | $fixed="fixed"; |
23 | - if(isset($value)) |
|
24 | - $fixed.=" ".$value; |
|
24 | + if(isset($value)) { |
|
25 | + $fixed.=" ".$value; |
|
26 | + } |
|
25 | 27 | return $this->addToProperty("class",$fixed); |
26 | 28 | } |
27 | 29 | |
28 | 30 | public function setBound($value=NULL){ |
29 | 31 | $bound="bound"; |
30 | - if(isset($value)) |
|
31 | - $bound.=" ".$value; |
|
32 | + if(isset($value)) { |
|
33 | + $bound.=" ".$value; |
|
34 | + } |
|
32 | 35 | return $this->addToProperty("class",$bound); |
33 | 36 | } |
34 | 37 | |
@@ -50,8 +53,9 @@ discard block |
||
50 | 53 | |
51 | 54 | public function setDebug($verbose=NULL){ |
52 | 55 | $this->_params["debug"]=true; |
53 | - if(isset($verbose)) |
|
54 | - $this->_params["verbose"]=true; |
|
56 | + if(isset($verbose)) { |
|
57 | + $this->_params["verbose"]=true; |
|
58 | + } |
|
55 | 59 | return $this; |
56 | 60 | } |
57 | 61 | } |
58 | 62 | \ No newline at end of file |
@@ -15,14 +15,15 @@ discard block |
||
15 | 15 | $field=new \Ajax\common\html\html5\HtmlInput($identifier, $inputType, $value); |
16 | 16 | $field->setProperty("name", $name); |
17 | 17 | $this->setField($field); |
18 | - if (isset($label)) |
|
19 | - $this->setLabel($label); |
|
18 | + if (isset($label)) { |
|
19 | + $this->setLabel($label); |
|
20 | + } |
|
20 | 21 | } |
21 | 22 | |
22 | 23 | public function setChecked($value=true){ |
23 | 24 | if($value===true){ |
24 | 25 | $this->getField()->setProperty("checked", "checked"); |
25 | - }else{ |
|
26 | + } else{ |
|
26 | 27 | $this->getField()->removeProperty("checked"); |
27 | 28 | } |
28 | 29 | return $this; |
@@ -51,8 +52,9 @@ discard block |
||
51 | 52 | * @return mixed |
52 | 53 | */ |
53 | 54 | public function getLabel() { |
54 | - if (\array_key_exists("label", $this->content)) |
|
55 | - return $this->content["label"]; |
|
55 | + if (\array_key_exists("label", $this->content)) { |
|
56 | + return $this->content["label"]; |
|
57 | + } |
|
56 | 58 | } |
57 | 59 | |
58 | 60 | /** |
@@ -127,8 +129,9 @@ discard block |
||
127 | 129 | } |
128 | 130 | |
129 | 131 | public function run(JsUtils $js) { |
130 | - if(!isset($this->_bsComponent)) |
|
131 | - $this->_bsComponent=$js->semantic()->checkbox("#" . $this->identifier, $this->_params); |
|
132 | + if(!isset($this->_bsComponent)) { |
|
133 | + $this->_bsComponent=$js->semantic()->checkbox("#" . $this->identifier, $this->_params); |
|
134 | + } |
|
132 | 135 | return parent::run($js); |
133 | 136 | } |
134 | 137 | } |
135 | 138 | \ No newline at end of file |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | private function afterInsert($item) { |
63 | - if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) |
|
64 | - $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
65 | - else { |
|
63 | + if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) { |
|
64 | + $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
65 | + } else { |
|
66 | 66 | $this->setSecondary(); |
67 | 67 | } |
68 | 68 | return $item; |
@@ -77,8 +77,9 @@ discard block |
||
77 | 77 | public function addItem($item) { |
78 | 78 | $number=$item; |
79 | 79 | $item=parent::addItem($this->getItemToInsert($item)); |
80 | - if(\is_int($number)) |
|
81 | - $item->setProperty("data-page", $number); |
|
80 | + if(\is_int($number)) { |
|
81 | + $item->setProperty("data-page", $number); |
|
82 | + } |
|
82 | 83 | return $this->afterInsert($item); |
83 | 84 | } |
84 | 85 | |
@@ -151,10 +152,11 @@ discard block |
||
151 | 152 | } |
152 | 153 | |
153 | 154 | public function setSecondary($value=true) { |
154 | - if($value) |
|
155 | - $this->addToProperty("class", "secondary"); |
|
156 | - else |
|
157 | - $this->removePropertyValue("class", "secondary"); |
|
155 | + if($value) { |
|
156 | + $this->addToProperty("class", "secondary"); |
|
157 | + } else { |
|
158 | + $this->removePropertyValue("class", "secondary"); |
|
159 | + } |
|
158 | 160 | return $this; |
159 | 161 | } |
160 | 162 | |
@@ -174,8 +176,9 @@ discard block |
||
174 | 176 | $this->apply(function (HtmlDoubleElement &$item) { |
175 | 177 | $item->setTagName("a"); |
176 | 178 | }); |
177 | - if ($vertical === true) |
|
178 | - $this->setVertical(); |
|
179 | + if ($vertical === true) { |
|
180 | + $this->setVertical(); |
|
181 | + } |
|
179 | 182 | return $this->addToProperty("class", "tabular"); |
180 | 183 | } |
181 | 184 | |
@@ -204,10 +207,11 @@ discard block |
||
204 | 207 | */ |
205 | 208 | public function fromDatabaseObject($object, $function) { |
206 | 209 | $return=$function($object); |
207 | - if (\is_array($return)) |
|
208 | - $this->addItems($return); |
|
209 | - else |
|
210 | - $this->addItem($return); |
|
210 | + if (\is_array($return)) { |
|
211 | + $this->addItems($return); |
|
212 | + } else { |
|
213 | + $this->addItem($return); |
|
214 | + } |
|
211 | 215 | } |
212 | 216 | |
213 | 217 | /** |
@@ -240,8 +244,9 @@ discard block |
||
240 | 244 | } |
241 | 245 | |
242 | 246 | public function run(JsUtils $js){ |
243 | - if($this->identifier!=="" && !isset($this->_bsComponent)) |
|
244 | - $this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false); |
|
247 | + if($this->identifier!=="" && !isset($this->_bsComponent)) { |
|
248 | + $this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false); |
|
249 | + } |
|
245 | 250 | $result= parent::run($js); |
246 | 251 | return $result->setItemSelector(".item"); |
247 | 252 | } |