@@ -52,10 +52,11 @@ discard block |
||
52 | 52 | $this->from=$from; |
53 | 53 | $this->to=$to; |
54 | 54 | $this->urlMask="%page%"; |
55 | - if(!isset($countVisible)) |
|
56 | - $this->countVisible=$to-$from+1; |
|
57 | - else |
|
58 | - $this->countVisible=$countVisible; |
|
55 | + if(!isset($countVisible)) { |
|
56 | + $this->countVisible=$to-$from+1; |
|
57 | + } else { |
|
58 | + $this->countVisible=$countVisible; |
|
59 | + } |
|
59 | 60 | $this->createContent(); |
60 | 61 | } |
61 | 62 | |
@@ -74,7 +75,7 @@ discard block |
||
74 | 75 | $href=new HtmlLink("a-".$this->identifier."-".$count,$url,$content); |
75 | 76 | $href->setProperty($this->attr, $url); |
76 | 77 | $elem->setContent($href); |
77 | - }else{ |
|
78 | + } else{ |
|
78 | 79 | $elem->setContent($content); |
79 | 80 | } |
80 | 81 | $this->content[]=$elem; |
@@ -107,8 +108,9 @@ discard block |
||
107 | 108 | public function _addEvent($event, $jsCode) { |
108 | 109 | foreach ($this->content as $li){ |
109 | 110 | $content=$li->getContent(); |
110 | - if($content instanceof BaseHtml) |
|
111 | - $content->_addEvent($event,$jsCode); |
|
111 | + if($content instanceof BaseHtml) { |
|
112 | + $content->_addEvent($event,$jsCode); |
|
113 | + } |
|
112 | 114 | } |
113 | 115 | } |
114 | 116 | /** |
@@ -146,8 +148,9 @@ discard block |
||
146 | 148 | if (is_int($size)) { |
147 | 149 | return $this->addToPropertyUnique("class", CssRef::sizes("pagination")[$size], CssRef::sizes("pagination")); |
148 | 150 | } |
149 | - if(!JString::startsWith($size, "pagination-") && $size!=="") |
|
150 | - $size="pagination-".$size; |
|
151 | + if(!JString::startsWith($size, "pagination-") && $size!=="") { |
|
152 | + $size="pagination-".$size; |
|
153 | + } |
|
151 | 154 | return $this->addToPropertyCtrl("class", $size, CssRef::sizes("pagination")); |
152 | 155 | } |
153 | 156 |
@@ -33,8 +33,9 @@ discard block |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | public function getProperty($name) { |
36 | - if (array_key_exists($name, $this->_self->properties)) |
|
37 | - return $this->_self->properties[$name]; |
|
36 | + if (array_key_exists($name, $this->_self->properties)) { |
|
37 | + return $this->_self->properties[$name]; |
|
38 | + } |
|
38 | 39 | } |
39 | 40 | |
40 | 41 | /** |
@@ -51,10 +52,11 @@ discard block |
||
51 | 52 | } else if ($value !== "" && $this->_self->propertyContains($name, $value) === false) { |
52 | 53 | if(isset($this->_self->properties[$name])){ |
53 | 54 | $v=$this->_self->properties[$name]; |
54 | - if (isset($v) && $v !== "") |
|
55 | - $v=$v . $separator . $value; |
|
56 | - else |
|
57 | - $v=$value; |
|
55 | + if (isset($v) && $v !== "") { |
|
56 | + $v=$v . $separator . $value; |
|
57 | + } else { |
|
58 | + $v=$value; |
|
59 | + } |
|
58 | 60 | |
59 | 61 | return $this->_self->setProperty($name, $v); |
60 | 62 | } |
@@ -78,8 +80,9 @@ discard block |
||
78 | 80 | } |
79 | 81 | |
80 | 82 | protected function addToPropertyUnique($name, $value, $typeCtrl) { |
81 | - if (is_string($typeCtrl) && @class_exists($typeCtrl, true)) |
|
82 | - $typeCtrl=$typeCtrl::getConstants(); |
|
83 | + if (is_string($typeCtrl) && @class_exists($typeCtrl, true)) { |
|
84 | + $typeCtrl=$typeCtrl::getConstants(); |
|
85 | + } |
|
83 | 86 | if (\is_array($typeCtrl)) { |
84 | 87 | $this->_self->removeOldValues($this->_self->properties[$name], $typeCtrl); |
85 | 88 | } |
@@ -98,8 +101,9 @@ discard block |
||
98 | 101 | } |
99 | 102 | |
100 | 103 | public function removeProperty($name) { |
101 | - if (\array_key_exists($name, $this->_self->properties)) |
|
102 | - unset($this->_self->properties[$name]); |
|
104 | + if (\array_key_exists($name, $this->_self->properties)) { |
|
105 | + unset($this->_self->properties[$name]); |
|
106 | + } |
|
103 | 107 | return $this; |
104 | 108 | } |
105 | 109 | |
@@ -112,8 +116,9 @@ discard block |
||
112 | 116 | } |
113 | 117 | |
114 | 118 | protected function setPropertyCtrl($name, $value, $typeCtrl) { |
115 | - if ($this->_self->ctrl($name, $value, $typeCtrl) === true) |
|
116 | - return $this->_self->setProperty($name, $value); |
|
119 | + if ($this->_self->ctrl($name, $value, $typeCtrl) === true) { |
|
120 | + return $this->_self->setProperty($name, $value); |
|
121 | + } |
|
117 | 122 | return $this; |
118 | 123 | } |
119 | 124 |
@@ -89,8 +89,9 @@ discard block |
||
89 | 89 | * @return \Ajax\bootstrap\html\HtmlPanel default : "panel-default" |
90 | 90 | */ |
91 | 91 | public function setStyle($cssStyle) { |
92 | - if (!JString::startsWith($cssStyle, "panel")) |
|
93 | - $cssStyle="panel".$cssStyle; |
|
92 | + if (!JString::startsWith($cssStyle, "panel")) { |
|
93 | + $cssStyle="panel".$cssStyle; |
|
94 | + } |
|
94 | 95 | return $this->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("panel")); |
95 | 96 | } |
96 | 97 | |
@@ -132,7 +133,8 @@ discard block |
||
132 | 133 | * @return $this default : false |
133 | 134 | */ |
134 | 135 | public function show($value) { |
135 | - if ($this->_collapsable) |
|
136 | - $this->_showOnStartup=$value; |
|
136 | + if ($this->_collapsable) { |
|
137 | + $this->_showOnStartup=$value; |
|
138 | + } |
|
137 | 139 | } |
138 | 140 | } |
@@ -250,8 +250,9 @@ discard block |
||
250 | 250 | */ |
251 | 251 | public function addItemInToolbar($caption,$icon=NULL,$callback=NULL){ |
252 | 252 | $result=$this->addInToolbar($caption,$callback); |
253 | - if(isset($icon) && method_exists($result, "addIcon")) |
|
254 | - $result->addIcon($icon); |
|
253 | + if(isset($icon) && method_exists($result, "addIcon")) { |
|
254 | + $result->addIcon($icon); |
|
255 | + } |
|
255 | 256 | return $result; |
256 | 257 | } |
257 | 258 | |
@@ -265,7 +266,7 @@ discard block |
||
265 | 266 | foreach ($items as $icon=>$item){ |
266 | 267 | $this->addItemInToolbar($item,$icon,$callback); |
267 | 268 | } |
268 | - }else{ |
|
269 | + } else{ |
|
269 | 270 | foreach ($items as $item){ |
270 | 271 | $this->addItemInToolbar($item,null,$callback); |
271 | 272 | } |
@@ -416,8 +417,9 @@ discard block |
||
416 | 417 | protected function _compileForm(){ |
417 | 418 | if(isset($this->_form)){ |
418 | 419 | $noValidate=""; |
419 | - if(\sizeof($this->_form->getValidationParams())>0) |
|
420 | - $noValidate="novalidate"; |
|
420 | + if(\sizeof($this->_form->getValidationParams())>0) { |
|
421 | + $noValidate="novalidate"; |
|
422 | + } |
|
421 | 423 | $this->wrapContent("<form class='ui form' id='frm-".$this->identifier."' name='frm-".$this->identifier."' ".$noValidate.">","</form>"); |
422 | 424 | } |
423 | 425 | } |
@@ -63,15 +63,17 @@ discard block |
||
63 | 63 | */ |
64 | 64 | private function getFieldButton($caption,$visibleHover=true){ |
65 | 65 | $bt= new HtmlButton($this->cleanIdentifier($caption),$caption); |
66 | - if($visibleHover) |
|
67 | - $this->_visibleOver($bt); |
|
66 | + if($visibleHover) { |
|
67 | + $this->_visibleOver($bt); |
|
68 | + } |
|
68 | 69 | return $bt; |
69 | 70 | } |
70 | 71 | |
71 | 72 | private function getFieldButtons($buttons,$visibleHover=true){ |
72 | 73 | $bts=new HtmlButtonGroups("",$buttons); |
73 | - if($visibleHover) |
|
74 | - $this->_visibleOver($bts); |
|
74 | + if($visibleHover) { |
|
75 | + $this->_visibleOver($bts); |
|
76 | + } |
|
75 | 77 | return $bts; |
76 | 78 | } |
77 | 79 | |
@@ -88,8 +90,9 @@ discard block |
||
88 | 90 | return $this->_fieldAs(function($id,$name,$value,$caption) use ($url,$responseElement,$cssStyle,$attributes){ |
89 | 91 | $button=new HtmlButton($id,$value,$cssStyle); |
90 | 92 | $button->postOnClick($url,"$(event.target).closest('tr').find(':input').serialize()",$responseElement,$attributes["ajax"]); |
91 | - if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"]) |
|
92 | - $this->_visibleOver($button); |
|
93 | + if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"]) { |
|
94 | + $this->_visibleOver($button); |
|
95 | + } |
|
93 | 96 | return $button; |
94 | 97 | }, $index,$attributes); |
95 | 98 | } |
@@ -160,8 +163,9 @@ discard block |
||
160 | 163 | private function getDefaultButton($icon,$class=null,$visibleHover=true){ |
161 | 164 | $bt=$this->getFieldButton("",$visibleHover); |
162 | 165 | $bt->asIcon($icon); |
163 | - if(isset($class)) |
|
164 | - $bt->addClass($class); |
|
166 | + if(isset($class)) { |
|
167 | + $bt->addClass($class); |
|
168 | + } |
|
165 | 169 | return $bt; |
166 | 170 | } |
167 | 171 |
@@ -23,8 +23,9 @@ discard block |
||
23 | 23 | $this->widgetIdentifier=$identifier; |
24 | 24 | $this->values=[]; |
25 | 25 | $this->afterCompile=[]; |
26 | - if(isset($instance)) |
|
27 | - $this->setInstance($instance); |
|
26 | + if(isset($instance)) { |
|
27 | + $this->setInstance($instance); |
|
28 | + } |
|
28 | 29 | $this->setCaptions($captions); |
29 | 30 | $this->captionCallback=NULL; |
30 | 31 | $this->defaultValueFunction=function($name,$value){return $value;}; |
@@ -62,14 +63,16 @@ discard block |
||
62 | 63 | } |
63 | 64 | |
64 | 65 | public function getIdentifier($index=NULL){ |
65 | - if(!isset($index)) |
|
66 | - $index=self::$index; |
|
66 | + if(!isset($index)) { |
|
67 | + $index=self::$index; |
|
68 | + } |
|
67 | 69 | $value=$index; |
68 | 70 | if(isset($this->values["identifier"])){ |
69 | - if(\is_string($this->values["identifier"])) |
|
70 | - $value=JReflection::callMethod($this->instance, $this->values["identifier"], []); |
|
71 | - else |
|
72 | - $value=$this->values["identifier"]($index,$this->instance); |
|
71 | + if(\is_string($this->values["identifier"])) { |
|
72 | + $value=JReflection::callMethod($this->instance, $this->values["identifier"], []); |
|
73 | + } else { |
|
74 | + $value=$this->values["identifier"]($index,$this->instance); |
|
75 | + } |
|
73 | 76 | } |
74 | 77 | return $value; |
75 | 78 | } |
@@ -99,16 +102,16 @@ discard block |
||
99 | 102 | if($property instanceof \ReflectionProperty){ |
100 | 103 | $value=$this->_getPropertyValue($property); |
101 | 104 | $propertyName=$property->getName(); |
102 | - }elseif(\is_callable($property)) |
|
103 | - $value=$property($this->instance); |
|
104 | - elseif(\is_array($property)){ |
|
105 | + } elseif(\is_callable($property)) { |
|
106 | + $value=$property($this->instance); |
|
107 | + } elseif(\is_array($property)){ |
|
105 | 108 | $values=\array_map(function($v) use ($index){return $this->_getValue($v, $index);}, $property); |
106 | 109 | $value=\implode("", $values); |
107 | - }elseif(\is_string($property)){ |
|
110 | + } elseif(\is_string($property)){ |
|
108 | 111 | $value=$property; |
109 | 112 | if(isset($this->instance->{$property})){ |
110 | 113 | $value=$this->instance->{$property}; |
111 | - }elseif(\method_exists($this->instance, $getter=JReflection::getterName($property))){ |
|
114 | + } elseif(\method_exists($this->instance, $getter=JReflection::getterName($property))){ |
|
112 | 115 | $value=JReflection::callMethod($this->instance, $getter, []); |
113 | 116 | } |
114 | 117 | } |
@@ -118,7 +121,7 @@ discard block |
||
118 | 121 | protected function _postGetValue($index,$propertyName,$value){ |
119 | 122 | if(isset($this->values[$index])){ |
120 | 123 | $value= $this->values[$index]($value,$this->instance,$index,self::$index); |
121 | - }else{ |
|
124 | + } else{ |
|
122 | 125 | $value=$this->_getDefaultValue($propertyName,$value, $index); |
123 | 126 | } |
124 | 127 | if(isset($this->afterCompile[$index])){ |
@@ -139,10 +142,10 @@ discard block |
||
139 | 142 | if(isset($vb[$index])){ |
140 | 143 | if(\is_array($vb[$index])){ |
141 | 144 | $this->visibleProperties[$index][]=$field; |
142 | - }else{ |
|
145 | + } else{ |
|
143 | 146 | $this->visibleProperties[$index]=[$vb[$index],$field]; |
144 | 147 | } |
145 | - }else{ |
|
148 | + } else{ |
|
146 | 149 | return $this->insertField($index, $field); |
147 | 150 | } |
148 | 151 | return $this; |
@@ -174,9 +177,9 @@ discard block |
||
174 | 177 | $property=$this->getProperty($index); |
175 | 178 | if($property instanceof \ReflectionProperty){ |
176 | 179 | $result=$property->getName(); |
177 | - }elseif(\is_callable($property)){ |
|
180 | + } elseif(\is_callable($property)){ |
|
178 | 181 | $result=$this->visibleProperties[$index]; |
179 | - }else{ |
|
182 | + } else{ |
|
180 | 183 | $result=$property; |
181 | 184 | } |
182 | 185 | return $result; |
@@ -196,7 +199,7 @@ discard block |
||
196 | 199 | $this->reflect=new \ReflectionClass($instance); |
197 | 200 | if(JArray::count($this->visibleProperties)===0){ |
198 | 201 | $this->properties=$this->getDefaultProperties(); |
199 | - }else{ |
|
202 | + } else{ |
|
200 | 203 | foreach ($this->visibleProperties as $property){ |
201 | 204 | $this->setInstanceProperty($property); |
202 | 205 | } |
@@ -207,22 +210,23 @@ discard block |
||
207 | 210 | private function setInstanceProperty($property){ |
208 | 211 | if(\is_callable($property)){ |
209 | 212 | $this->properties[]=$property; |
210 | - }elseif(\is_string($property)){ |
|
213 | + } elseif(\is_string($property)){ |
|
211 | 214 | try{ |
212 | 215 | $this->_beforeAddProperty(\sizeof($this->properties), $property); |
213 | 216 | $rProperty=$this->reflect->getProperty($property); |
214 | 217 | $this->properties[]=$rProperty; |
215 | - }catch(\Exception $e){ |
|
218 | + } catch(\Exception $e){ |
|
216 | 219 | $this->_beforeAddProperty(\sizeof($this->properties), $property); |
217 | 220 | $this->properties[]=$property; |
218 | 221 | } |
219 | - }elseif(\is_int($property)){ |
|
222 | + } elseif(\is_int($property)){ |
|
220 | 223 | $props=$this->getDefaultProperties(); |
221 | - if(isset($props[$property])) |
|
222 | - $this->properties[]=$props[$property]; |
|
223 | - else |
|
224 | - $this->properties[]=$property; |
|
225 | - }else{ |
|
224 | + if(isset($props[$property])) { |
|
225 | + $this->properties[]=$props[$property]; |
|
226 | + } else { |
|
227 | + $this->properties[]=$property; |
|
228 | + } |
|
229 | + } else{ |
|
226 | 230 | $this->properties[]=$property; |
227 | 231 | } |
228 | 232 | } |
@@ -266,12 +270,13 @@ discard block |
||
266 | 270 | if(isset($this->captions[$index])){ |
267 | 271 | return $this->captions[$index]; |
268 | 272 | } |
269 | - if($this->properties[$index] instanceof \ReflectionProperty) |
|
270 | - return $this->properties[$index]->getName(); |
|
271 | - elseif(\is_callable($this->properties[$index])) |
|
272 | - return ""; |
|
273 | - else |
|
274 | - return $this->properties[$index]; |
|
273 | + if($this->properties[$index] instanceof \ReflectionProperty) { |
|
274 | + return $this->properties[$index]->getName(); |
|
275 | + } elseif(\is_callable($this->properties[$index])) { |
|
276 | + return ""; |
|
277 | + } else { |
|
278 | + return $this->properties[$index]; |
|
279 | + } |
|
275 | 280 | } |
276 | 281 | |
277 | 282 | public function getCaptions(){ |
@@ -282,7 +287,7 @@ discard block |
||
282 | 287 | for($i=$captionsSize;$i<$count;$i++){ |
283 | 288 | $captions[]=""; |
284 | 289 | } |
285 | - }else{ |
|
290 | + } else{ |
|
286 | 291 | $captions=[]; |
287 | 292 | $index=0; |
288 | 293 | while($index<$count){ |
@@ -297,8 +302,9 @@ discard block |
||
297 | 302 | } |
298 | 303 | |
299 | 304 | public function setCaption($index,$caption){ |
300 | - if(isset($this->captions)===false) |
|
301 | - $this->captions=[]; |
|
305 | + if(isset($this->captions)===false) { |
|
306 | + $this->captions=[]; |
|
307 | + } |
|
302 | 308 | $this->captions[$index]=$caption; |
303 | 309 | return $this; |
304 | 310 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | if(JArray::isAssociative($content)===false){ |
18 | 18 | $icon=@$content[0]; |
19 | 19 | $title=@$content[1]; |
20 | - }else{ |
|
20 | + } else{ |
|
21 | 21 | $icon=@$content["icon"]; |
22 | 22 | $title=@$content["title"]; |
23 | 23 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | if(isset($title)){ |
28 | 28 | $this->setTitle($title); |
29 | 29 | } |
30 | - }else{ |
|
30 | + } else{ |
|
31 | 31 | $this->setContent($content); |
32 | 32 | } |
33 | 33 | } |
@@ -40,8 +40,9 @@ |
||
40 | 40 | * @return HtmlBsDoubleElement default : "list-group-item-default" |
41 | 41 | */ |
42 | 42 | public function setStyle($cssStyle) { |
43 | - if (!JString::startsWith($cssStyle, "list-group-item")) |
|
44 | - $cssStyle="list-group-item".$cssStyle; |
|
43 | + if (!JString::startsWith($cssStyle, "list-group-item")) { |
|
44 | + $cssStyle="list-group-item".$cssStyle; |
|
45 | + } |
|
45 | 46 | $this->element->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("list-group-item")); |
46 | 47 | return $this->element; |
47 | 48 | } |
@@ -58,10 +58,12 @@ discard block |
||
58 | 58 | $js->execOn("mouseover", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'visible');",["preventDefault"=>false,"stopPropagation"=>true]); |
59 | 59 | $js->execOn("mouseout", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'hidden');",["preventDefault"=>false,"stopPropagation"=>true]); |
60 | 60 | } |
61 | - if(\is_array($this->_deleteBehavior)) |
|
62 | - $this->_generateBehavior("delete",$this->_deleteBehavior, $js); |
|
63 | - if(\is_array($this->_editBehavior)) |
|
64 | - $this->_generateBehavior("edit",$this->_editBehavior,$js); |
|
61 | + if(\is_array($this->_deleteBehavior)) { |
|
62 | + $this->_generateBehavior("delete",$this->_deleteBehavior, $js); |
|
63 | + } |
|
64 | + if(\is_array($this->_editBehavior)) { |
|
65 | + $this->_generateBehavior("edit",$this->_editBehavior,$js); |
|
66 | + } |
|
65 | 67 | parent::run($js); |
66 | 68 | } |
67 | 69 | |
@@ -94,8 +96,9 @@ 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 | $this->_generateContent($table); |
101 | 104 | |
@@ -126,8 +129,9 @@ discard block |
||
126 | 129 | } |
127 | 130 | |
128 | 131 | protected function _applyStyleAttributes($table){ |
129 | - if(isset($this->_hiddenColumns)) |
|
130 | - $this->_hideColumns(); |
|
132 | + if(isset($this->_hiddenColumns)) { |
|
133 | + $this->_hideColumns(); |
|
134 | + } |
|
131 | 135 | if(isset($this->_colWidths)){ |
132 | 136 | foreach ($this->_colWidths as $colIndex=>$width){ |
133 | 137 | $table->setColWidth($colIndex,$width); |
@@ -186,8 +190,9 @@ discard block |
||
186 | 190 | $field=$ck->getField(); |
187 | 191 | $field->setProperty("value",$dataAjax); |
188 | 192 | $field->setProperty("name", "selection[]"); |
189 | - if(isset($checkedClass)) |
|
190 | - $field->setClass($checkedClass); |
|
193 | + if(isset($checkedClass)) { |
|
194 | + $field->setClass($checkedClass); |
|
195 | + } |
|
191 | 196 | \array_unshift($values, $ck); |
192 | 197 | } |
193 | 198 | $result=$table->newRow(); |
@@ -200,8 +205,9 @@ discard block |
||
200 | 205 | |
201 | 206 | protected function _generatePagination($table,$js=NULL){ |
202 | 207 | if(isset($this->_toolbar)){ |
203 | - if($this->_toolbarPosition==PositionInTable::FOOTER) |
|
204 | - $this->_toolbar->setFloated("left"); |
|
208 | + if($this->_toolbarPosition==PositionInTable::FOOTER) { |
|
209 | + $this->_toolbar->setFloated("left"); |
|
210 | + } |
|
205 | 211 | } |
206 | 212 | $footer=$table->getFooter(); |
207 | 213 | $footer->mergeCol(); |
@@ -220,8 +226,9 @@ discard block |
||
220 | 226 | |
221 | 227 | protected function _getFieldName($index){ |
222 | 228 | $fieldName=parent::_getFieldName($index); |
223 | - if(\is_object($fieldName)) |
|
224 | - $fieldName="field-".$index; |
|
229 | + if(\is_object($fieldName)) { |
|
230 | + $fieldName="field-".$index; |
|
231 | + } |
|
225 | 232 | return $fieldName."[]"; |
226 | 233 | } |
227 | 234 | |
@@ -261,7 +268,7 @@ discard block |
||
261 | 268 | $hasPart=$table->hasPart($part); |
262 | 269 | if($hasPart){ |
263 | 270 | $row=$table->getPart($part)->addRow(\sizeof($captions)); |
264 | - }else{ |
|
271 | + } else{ |
|
265 | 272 | $row=$table->getPart($part)->getRow(0); |
266 | 273 | } |
267 | 274 | $row->mergeCol(); |
@@ -292,7 +299,7 @@ discard block |
||
292 | 299 | $this->_urls["refresh"]=JArray::getValue($urls, "refresh",0); |
293 | 300 | $this->_urls["edit"]=JArray::getValue($urls, "edit",1); |
294 | 301 | $this->_urls["delete"]=JArray::getValue($urls, "delete",2); |
295 | - }else{ |
|
302 | + } else{ |
|
296 | 303 | $this->_urls=["refresh"=>$urls,"edit"=>$urls,"delete"=>$urls]; |
297 | 304 | } |
298 | 305 | return $this; |
@@ -375,8 +382,9 @@ discard block |
||
375 | 382 | |
376 | 383 | protected function getTargetSelector($op) { |
377 | 384 | $result=$this->_targetSelector; |
378 | - if(!isset($result[$op])) |
|
379 | - $result="#".$this->identifier; |
|
385 | + if(!isset($result[$op])) { |
|
386 | + $result="#".$this->identifier; |
|
387 | + } |
|
380 | 388 | return $result[$op]; |
381 | 389 | } |
382 | 390 | |
@@ -394,8 +402,9 @@ discard block |
||
394 | 402 | } |
395 | 403 | |
396 | 404 | public function getRefreshSelector() { |
397 | - if(isset($this->_refreshSelector)) |
|
398 | - return $this->_refreshSelector; |
|
405 | + if(isset($this->_refreshSelector)) { |
|
406 | + return $this->_refreshSelector; |
|
407 | + } |
|
399 | 408 | return "#".$this->identifier." tbody"; |
400 | 409 | } |
401 | 410 | |
@@ -414,8 +423,9 @@ discard block |
||
414 | 423 | */ |
415 | 424 | public function show($modelInstance){ |
416 | 425 | if(\is_array($modelInstance)){ |
417 | - if(isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0])) |
|
418 | - $modelInstance=\json_decode(\json_encode($modelInstance), FALSE); |
|
426 | + if(isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0])) { |
|
427 | + $modelInstance=\json_decode(\json_encode($modelInstance), FALSE); |
|
428 | + } |
|
419 | 429 | } |
420 | 430 | $this->_modelInstance=$modelInstance; |
421 | 431 | } |
@@ -455,8 +465,9 @@ discard block |
||
455 | 465 | } |
456 | 466 | |
457 | 467 | public function hideColumn($colIndex){ |
458 | - if(!\is_array($this->_hiddenColumns)) |
|
459 | - $this->_hiddenColumns=[]; |
|
468 | + if(!\is_array($this->_hiddenColumns)) { |
|
469 | + $this->_hiddenColumns=[]; |
|
470 | + } |
|
460 | 471 | $this->_hiddenColumns[]=$colIndex; |
461 | 472 | return $this; |
462 | 473 | } |