@@ -54,10 +54,12 @@ discard block |
||
54 | 54 | $js->execOn("mouseover", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'visible');",["preventDefault"=>false,"stopPropagation"=>true]); |
55 | 55 | $js->execOn("mouseout", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'hidden');",["preventDefault"=>false,"stopPropagation"=>true]); |
56 | 56 | } |
57 | - if(\is_array($this->_deleteBehavior)) |
|
58 | - $this->_generateBehavior("delete",$this->_deleteBehavior, $js); |
|
59 | - if(\is_array($this->_editBehavior)) |
|
60 | - $this->_generateBehavior("edit",$this->_editBehavior,$js); |
|
57 | + if(\is_array($this->_deleteBehavior)) { |
|
58 | + $this->_generateBehavior("delete",$this->_deleteBehavior, $js); |
|
59 | + } |
|
60 | + if(\is_array($this->_editBehavior)) { |
|
61 | + $this->_generateBehavior("edit",$this->_editBehavior,$js); |
|
62 | + } |
|
61 | 63 | return parent::run($js); |
62 | 64 | } |
63 | 65 | |
@@ -92,12 +94,14 @@ discard block |
||
92 | 94 | |
93 | 95 | $table->setRowCount(0, \sizeof($captions)); |
94 | 96 | $table->setHeaderValues($captions); |
95 | - if(isset($this->_compileParts)) |
|
96 | - $table->setCompileParts($this->_compileParts); |
|
97 | + if(isset($this->_compileParts)) { |
|
98 | + $table->setCompileParts($this->_compileParts); |
|
99 | + } |
|
97 | 100 | |
98 | 101 | if(isset($this->_searchField) && isset($js)){ |
99 | - if(isset($this->_urls["refresh"])) |
|
100 | - $this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]); |
|
102 | + if(isset($this->_urls["refresh"])) { |
|
103 | + $this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]); |
|
104 | + } |
|
101 | 105 | } |
102 | 106 | |
103 | 107 | $this->_generateContent($table); |
@@ -148,8 +152,9 @@ discard block |
||
148 | 152 | $field=$ck->getField(); |
149 | 153 | $field->setProperty("value",$this->_instanceViewer->getIdentifier()); |
150 | 154 | $field->setProperty("name", "selection[]"); |
151 | - if(isset($checkedClass)) |
|
152 | - $field->setClass($checkedClass); |
|
155 | + if(isset($checkedClass)) { |
|
156 | + $field->setClass($checkedClass); |
|
157 | + } |
|
153 | 158 | \array_unshift($values, $ck); |
154 | 159 | } |
155 | 160 | $result=$table->newRow(); |
@@ -161,8 +166,9 @@ discard block |
||
161 | 166 | |
162 | 167 | protected function _generatePagination($table,$js=NULL){ |
163 | 168 | if(isset($this->_toolbar)){ |
164 | - if($this->_toolbarPosition==PositionInTable::FOOTER) |
|
165 | - $this->_toolbar->setFloated("left"); |
|
169 | + if($this->_toolbarPosition==PositionInTable::FOOTER) { |
|
170 | + $this->_toolbar->setFloated("left"); |
|
171 | + } |
|
166 | 172 | } |
167 | 173 | $footer=$table->getFooter(); |
168 | 174 | $footer->mergeCol(); |
@@ -219,7 +225,7 @@ discard block |
||
219 | 225 | $hasPart=$table->hasPart($part); |
220 | 226 | if($hasPart){ |
221 | 227 | $row=$table->getPart($part)->addRow(\sizeof($captions)); |
222 | - }else{ |
|
228 | + } else{ |
|
223 | 229 | $row=$table->getPart($part)->getRow(0); |
224 | 230 | } |
225 | 231 | $row->mergeCol(); |
@@ -244,7 +250,7 @@ discard block |
||
244 | 250 | $this->_urls["refresh"]=JArray::getValue($urls, "refresh",0); |
245 | 251 | $this->_urls["edit"]=JArray::getValue($urls, "edit",1); |
246 | 252 | $this->_urls["delete"]=JArray::getValue($urls, "delete",2); |
247 | - }else{ |
|
253 | + } else{ |
|
248 | 254 | $this->_urls=["refresh"=>$urls,"edit"=>$urls,"delete"=>$urls]; |
249 | 255 | } |
250 | 256 | return $this; |
@@ -318,8 +324,9 @@ discard block |
||
318 | 324 | |
319 | 325 | protected function getTargetSelector() { |
320 | 326 | $result=$this->_targetSelector; |
321 | - if(!isset($result)) |
|
322 | - $result="#".$this->identifier; |
|
327 | + if(!isset($result)) { |
|
328 | + $result="#".$this->identifier; |
|
329 | + } |
|
323 | 330 | return $result; |
324 | 331 | } |
325 | 332 | |
@@ -334,8 +341,9 @@ discard block |
||
334 | 341 | } |
335 | 342 | |
336 | 343 | public function getRefreshSelector() { |
337 | - if(isset($this->_refreshSelector)) |
|
338 | - return $this->_refreshSelector; |
|
344 | + if(isset($this->_refreshSelector)) { |
|
345 | + return $this->_refreshSelector; |
|
346 | + } |
|
339 | 347 | return "#".$this->identifier." tbody"; |
340 | 348 | } |
341 | 349 | |
@@ -346,8 +354,9 @@ discard block |
||
346 | 354 | |
347 | 355 | public function show($modelInstance){ |
348 | 356 | if(\is_array($modelInstance)){ |
349 | - if(\is_array(array_values($modelInstance)[0])) |
|
350 | - $modelInstance=\json_decode(\json_encode($modelInstance), FALSE); |
|
357 | + if(\is_array(array_values($modelInstance)[0])) { |
|
358 | + $modelInstance=\json_decode(\json_encode($modelInstance), FALSE); |
|
359 | + } |
|
351 | 360 | } |
352 | 361 | $this->_modelInstance=$modelInstance; |
353 | 362 | } |
@@ -89,8 +89,9 @@ |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | public function setPagesVisibles($pages_visibles) { |
92 | - if(!isset($pages_visibles)) |
|
93 | - $pages_visibles=(int)ceil($this->row_count / $this->items_per_page)+1; |
|
92 | + if(!isset($pages_visibles)) { |
|
93 | + $pages_visibles=(int)ceil($this->row_count / $this->items_per_page)+1; |
|
94 | + } |
|
94 | 95 | $this->pages_visibles=$pages_visibles; |
95 | 96 | return $this; |
96 | 97 | } |
@@ -48,8 +48,9 @@ |
||
48 | 48 | $('#pagination-{$id} ._firstPage').attr('data-page',Math.max(1,page-1)); |
49 | 49 | var lastPage=$('#pagination-{$id} ._lastPage');lastPage.attr('data-page',Math.min(lastPage.attr('data-max'),page+1));"; |
50 | 50 | } |
51 | - if(isset($this->_urls["refresh"])) |
|
52 | - $this->jsonArrayOnClick($menu, $this->_urls["refresh"],"post","{'p':$(this).attr('data-page')}",$callback); |
|
51 | + if(isset($this->_urls["refresh"])) { |
|
52 | + $this->jsonArrayOnClick($menu, $this->_urls["refresh"],"post","{'p':$(this).attr('data-page')}",$callback); |
|
53 | + } |
|
53 | 54 | } |
54 | 55 | |
55 | 56 | /** |
@@ -21,7 +21,7 @@ |
||
21 | 21 | if($class->getProperty($property)!==null){ |
22 | 22 | \call_user_func_array([$object,$name],[$value]); |
23 | 23 | } |
24 | - }catch(\Exception $e){ |
|
24 | + } catch(\Exception $e){ |
|
25 | 25 | //Nothing to do |
26 | 26 | } |
27 | 27 | } |
@@ -13,8 +13,9 @@ |
||
13 | 13 | public function __construct($identifier, $href="#", $content="Link",$target=NULL) { |
14 | 14 | parent::__construct($identifier, "a", ""); |
15 | 15 | $this->setHref($href); |
16 | - if(isset($target)) |
|
17 | - $this->setTarget($target); |
|
16 | + if(isset($target)) { |
|
17 | + $this->setTarget($target); |
|
18 | + } |
|
18 | 19 | $this->content=$content; |
19 | 20 | } |
20 | 21 |
@@ -35,8 +35,9 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | public function setPopupAttributes($variation=NULL, $popupEvent=NULL) { |
38 | - if (isset($this->_popup)) |
|
39 | - $this->_popup->setAttributes($variation, $popupEvent); |
|
38 | + if (isset($this->_popup)) { |
|
39 | + $this->_popup->setAttributes($variation, $popupEvent); |
|
40 | + } |
|
40 | 41 | } |
41 | 42 | |
42 | 43 | public function addPopup($title="", $content="", $variation=NULL, $params=array()) { |
@@ -63,8 +64,9 @@ discard block |
||
63 | 64 | $labelO=$label; |
64 | 65 | if (\is_object($label) === false) { |
65 | 66 | $labelO=new HtmlLabel("label-" . $this->identifier, $label); |
66 | - if (isset($icon)) |
|
67 | - $labelO->addIcon($icon); |
|
67 | + if (isset($icon)) { |
|
68 | + $labelO->addIcon($icon); |
|
69 | + } |
|
68 | 70 | } else { |
69 | 71 | $labelO->addToPropertyCtrl("class", "label", array ("label" )); |
70 | 72 | } |
@@ -83,23 +85,27 @@ discard block |
||
83 | 85 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
84 | 86 | */ |
85 | 87 | public function asLink($href=NULL,$target=NULL) { |
86 | - if (isset($href)) |
|
87 | - $this->setProperty("href", $href); |
|
88 | - if(isset($target)) |
|
89 | - $this->setProperty("target", $target); |
|
88 | + if (isset($href)) { |
|
89 | + $this->setProperty("href", $href); |
|
90 | + } |
|
91 | + if(isset($target)) { |
|
92 | + $this->setProperty("target", $target); |
|
93 | + } |
|
90 | 94 | return $this->setTagName("a"); |
91 | 95 | } |
92 | 96 | |
93 | 97 | public function jsShowDimmer($show=true) { |
94 | 98 | $status="hide"; |
95 | - if ($show === true) |
|
96 | - $status="show"; |
|
99 | + if ($show === true) { |
|
100 | + $status="show"; |
|
101 | + } |
|
97 | 102 | return '$("#.' . $this->identifier . ').dimmer("' . $status . '");'; |
98 | 103 | } |
99 | 104 | |
100 | 105 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
101 | - if (isset($this->_popup)) |
|
102 | - $this->_popup->compile($js); |
|
106 | + if (isset($this->_popup)) { |
|
107 | + $this->_popup->compile($js); |
|
108 | + } |
|
103 | 109 | return parent::compile($js, $view); |
104 | 110 | } |
105 | 111 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | foreach ($values as $v){ |
60 | 60 | $form->addField($v); |
61 | 61 | } |
62 | - }else{ |
|
62 | + } else{ |
|
63 | 63 | $separators[]=$count; |
64 | 64 | for($i=0;$i<$size;$i++){ |
65 | 65 | $this->_generateFields($form, $values, $headers, $separators[$i], $separators[$i+1], $wrappers); |
@@ -70,19 +70,21 @@ discard block |
||
70 | 70 | protected function _generateFields($form,$values,$headers,$sepFirst,$sepLast,$wrappers){ |
71 | 71 | $wrapper=null; |
72 | 72 | $fields=\array_slice($values, $sepFirst+1,$sepLast-$sepFirst); |
73 | - if(isset($headers[$sepFirst+1])) |
|
74 | - $form->addHeader($headers[$sepFirst+1],4,true); |
|
73 | + if(isset($headers[$sepFirst+1])) { |
|
74 | + $form->addHeader($headers[$sepFirst+1],4,true); |
|
75 | + } |
|
75 | 76 | if(isset($wrappers[$sepFirst+1])){ |
76 | 77 | $wrapper=$wrappers[$sepFirst+1]; |
77 | 78 | } |
78 | 79 | //TODO check why $fields is empty |
79 | 80 | if(\sizeof($fields)===1){ |
80 | 81 | $added=$form->addField($fields[0]); |
81 | - }elseif(\sizeof($fields)>1){ |
|
82 | + } elseif(\sizeof($fields)>1){ |
|
82 | 83 | $added=$form->addFields($fields); |
83 | 84 | } |
84 | - if(isset($wrapper)) |
|
85 | - $added->wrap($wrapper[0],$wrapper[1]); |
|
85 | + if(isset($wrapper)) { |
|
86 | + $added->wrap($wrapper[0],$wrapper[1]); |
|
87 | + } |
|
86 | 88 | } |
87 | 89 | |
88 | 90 | /** |