@@ -26,8 +26,9 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) { |
28 | 28 | parent::__construct($identifier, $tagName, ""); |
29 | - if (isset($rowCount) && isset($colCount)) |
|
30 | - $this->setRowCount($rowCount, $colCount); |
|
29 | + if (isset($rowCount) && isset($colCount)) { |
|
30 | + $this->setRowCount($rowCount, $colCount); |
|
31 | + } |
|
31 | 32 | } |
32 | 33 | |
33 | 34 | /** |
@@ -112,7 +113,7 @@ discard block |
||
112 | 113 | $row=$this->getItem($row); |
113 | 114 | if (isset($row) && $row instanceof HtmlCollection) { |
114 | 115 | $col=$row->getItem($col); |
115 | - }else{ |
|
116 | + } else{ |
|
116 | 117 | $col=$row; |
117 | 118 | } |
118 | 119 | return $col; |
@@ -170,8 +171,9 @@ discard block |
||
170 | 171 | $values=\array_fill(0, $count, $values); |
171 | 172 | $isArray=false; |
172 | 173 | } |
173 | - if (JArray::dimension($values) == 1 && $isArray) |
|
174 | - $values=[ $values ]; |
|
174 | + if (JArray::dimension($values) == 1 && $isArray) { |
|
175 | + $values=[ $values ]; |
|
176 | + } |
|
175 | 177 | |
176 | 178 | $count=\min(\sizeof($values), $count); |
177 | 179 | |
@@ -198,8 +200,9 @@ discard block |
||
198 | 200 | $count=$this->count(); |
199 | 201 | for($i=0; $i < $count; $i++) { |
200 | 202 | $cell=$this->getCell($i, $colIndex); |
201 | - if($cell instanceof BaseTrait) |
|
202 | - $cell->addVariations($variations); |
|
203 | + if($cell instanceof BaseTrait) { |
|
204 | + $cell->addVariations($variations); |
|
205 | + } |
|
203 | 206 | } |
204 | 207 | return $this; |
205 | 208 | } |
@@ -217,8 +220,9 @@ discard block |
||
217 | 220 | $count=$this->count(); |
218 | 221 | for($i=0; $i < $count; $i++) { |
219 | 222 | $index=$this->content[$i]->getColPosition($colIndex); |
220 | - if ($index !== NULL) |
|
221 | - $this->getCell($i, $index)->$function(); |
|
223 | + if ($index !== NULL) { |
|
224 | + $this->getCell($i, $index)->$function(); |
|
225 | + } |
|
222 | 226 | } |
223 | 227 | return $this; |
224 | 228 | } |
@@ -229,8 +233,9 @@ discard block |
||
229 | 233 | $maxRow=$this->content[$i]->count(); |
230 | 234 | $index=$maxRow-$colIndex-1; |
231 | 235 | if (($cell=$this->getCell($i, $index))!== NULL){ |
232 | - if($cell->getColspan()==1) |
|
233 | - $cell->$function(); |
|
236 | + if($cell->getColspan()==1) { |
|
237 | + $cell->$function(); |
|
238 | + } |
|
234 | 239 | } |
235 | 240 | } |
236 | 241 | return $this; |
@@ -274,8 +279,9 @@ discard block |
||
274 | 279 | */ |
275 | 280 | public function getColCount() { |
276 | 281 | $result=0; |
277 | - if ($this->count() > 0) |
|
278 | - $result=$this->getItem(0)->count(); |
|
282 | + if ($this->count() > 0) { |
|
283 | + $result=$this->getItem(0)->count(); |
|
284 | + } |
|
279 | 285 | return $result; |
280 | 286 | } |
281 | 287 | |
@@ -299,8 +305,9 @@ discard block |
||
299 | 305 | |
300 | 306 | public function toDelete($rowIndex, $colIndex){ |
301 | 307 | $row=$this->getItem($rowIndex); |
302 | - if (isset($row) === true) |
|
303 | - $row->toDelete($colIndex); |
|
308 | + if (isset($row) === true) { |
|
309 | + $row->toDelete($colIndex); |
|
310 | + } |
|
304 | 311 | return $this; |
305 | 312 | } |
306 | 313 | |
@@ -398,8 +405,9 @@ discard block |
||
398 | 405 | foreach ( $rows as $row ) { |
399 | 406 | $cell=$row->getItem($colIndex); |
400 | 407 | $value=$cell->getContent(); |
401 | - if($functionExists) |
|
402 | - $value=\call_user_func($function,$value); |
|
408 | + if($functionExists) { |
|
409 | + $value=\call_user_func($function,$value); |
|
410 | + } |
|
403 | 411 | if($value!==$identiqual){ |
404 | 412 | if($counter>0 && isset($cellToMerge)){ |
405 | 413 | $cellToMerge->setRowspan($counter); |
@@ -59,8 +59,9 @@ |
||
59 | 59 | $callback.=$js->trigger("#".$id." [name='selection[]']","change",false)."$('#".$id." tbody .ui.checkbox').checkbox();".$js->execOn("change", "#".$id." [name='selection[]']", $this->_getCheckedChange($js)); |
60 | 60 | $callback.=$this->_generatePaginationScript($id); |
61 | 61 | if(isset($this->_urls["refresh"])){ |
62 | - if(isset($menu)) |
|
63 | - $js->jsonArrayOn("click", "#".$menu->getIdentifier()." a","#".$this->_identifier." tr.".$this->_modelClass, $this->_urls["refresh"],"post",["params"=>"{'p':$(this).attr('data-page'),'_model':'".JString::doubleBackSlashes($this->_model)."'}","jsCallback"=>$callback]); |
|
62 | + if(isset($menu)) { |
|
63 | + $js->jsonArrayOn("click", "#".$menu->getIdentifier()." a","#".$this->_identifier." tr.".$this->_modelClass, $this->_urls["refresh"],"post",["params"=>"{'p':$(this).attr('data-page'),'_model':'".JString::doubleBackSlashes($this->_model)."'}","jsCallback"=>$callback]); |
|
64 | + } |
|
64 | 65 | } |
65 | 66 | } |
66 | 67 |
@@ -24,8 +24,9 @@ discard block |
||
24 | 24 | $this->widgetIdentifier=$identifier; |
25 | 25 | $this->values=[]; |
26 | 26 | $this->afterCompile=[]; |
27 | - if(isset($instance)) |
|
28 | - $this->setInstance($instance); |
|
27 | + if(isset($instance)) { |
|
28 | + $this->setInstance($instance); |
|
29 | + } |
|
29 | 30 | $this->setCaptions($captions); |
30 | 31 | $this->captionCallback=NULL; |
31 | 32 | $this->defaultValueFunction=function($name,$value){return $value;}; |
@@ -61,7 +62,7 @@ discard block |
||
61 | 62 | while($index<$count){ |
62 | 63 | $values[]=$this->getValue($index++); |
63 | 64 | } |
64 | - }else{ |
|
65 | + } else{ |
|
65 | 66 | while($index<$count){ |
66 | 67 | if(array_search($index, $this->groupByFields)===false){ |
67 | 68 | $values[]=$this->getValue($index); |
@@ -73,14 +74,16 @@ discard block |
||
73 | 74 | } |
74 | 75 | |
75 | 76 | public function getIdentifier($index=NULL){ |
76 | - if(!isset($index)) |
|
77 | - $index=self::$index; |
|
77 | + if(!isset($index)) { |
|
78 | + $index=self::$index; |
|
79 | + } |
|
78 | 80 | $value=$index; |
79 | 81 | if(isset($this->values["identifier"])){ |
80 | - if(\is_string($this->values["identifier"])) |
|
81 | - $value=JReflection::callMethod($this->instance, $this->values["identifier"], []); |
|
82 | - else |
|
83 | - $value=$this->values["identifier"]($index,$this->instance); |
|
82 | + if(\is_string($this->values["identifier"])) { |
|
83 | + $value=JReflection::callMethod($this->instance, $this->values["identifier"], []); |
|
84 | + } else { |
|
85 | + $value=$this->values["identifier"]($index,$this->instance); |
|
86 | + } |
|
84 | 87 | } |
85 | 88 | return $value; |
86 | 89 | } |
@@ -110,16 +113,16 @@ discard block |
||
110 | 113 | if($property instanceof \ReflectionProperty){ |
111 | 114 | $value=$this->_getPropertyValue($property); |
112 | 115 | $propertyName=$property->getName(); |
113 | - }elseif(\is_callable($property) && array_search($property, ["system"])===false) |
|
114 | - $value=$property($this->instance); |
|
115 | - elseif(\is_array($property)){ |
|
116 | + } elseif(\is_callable($property) && array_search($property, ["system"])===false) { |
|
117 | + $value=$property($this->instance); |
|
118 | + } elseif(\is_array($property)){ |
|
116 | 119 | $values=\array_map(function($v) use ($index){return $this->_getValue($v, $index);}, $property); |
117 | 120 | $value=\implode("", $values); |
118 | - }elseif(\is_string($property)){ |
|
121 | + } elseif(\is_string($property)){ |
|
119 | 122 | $value=$property; |
120 | 123 | if(isset($this->instance->{$property})){ |
121 | 124 | $value=$this->instance->{$property}; |
122 | - }elseif(\method_exists($this->instance, $getter=JReflection::getterName($property))){ |
|
125 | + } elseif(\method_exists($this->instance, $getter=JReflection::getterName($property))){ |
|
123 | 126 | $value=JReflection::callMethod($this->instance, $getter, []); |
124 | 127 | } |
125 | 128 | } |
@@ -129,7 +132,7 @@ discard block |
||
129 | 132 | protected function _postGetValue($index,$propertyName,$value){ |
130 | 133 | if(isset($this->values[$index])){ |
131 | 134 | $value= $this->values[$index]($value,$this->instance,$index,self::$index); |
132 | - }else{ |
|
135 | + } else{ |
|
133 | 136 | $value=$this->_getDefaultValue($propertyName,$value, $index); |
134 | 137 | } |
135 | 138 | if(isset($this->afterCompile[$index])){ |
@@ -143,7 +146,7 @@ discard block |
||
143 | 146 | public function insertField($index,$field,$key=null){ |
144 | 147 | if(isset($key)){ |
145 | 148 | array_splice( $this->visibleProperties, $index, 0, [$key=>$field] ); |
146 | - }else{ |
|
149 | + } else{ |
|
147 | 150 | array_splice( $this->visibleProperties, $index, 0, $field ); |
148 | 151 | } |
149 | 152 | return $this; |
@@ -164,17 +167,17 @@ discard block |
||
164 | 167 | if(isset($key)){ |
165 | 168 | if(\is_array($vb[$index])){ |
166 | 169 | $this->visibleProperties[$index][$key]=$field; |
167 | - }else{ |
|
170 | + } else{ |
|
168 | 171 | $this->visibleProperties[$index]=[$vb[$index],$key=>$field]; |
169 | 172 | } |
170 | - }else{ |
|
173 | + } else{ |
|
171 | 174 | if(\is_array($vb[$index])){ |
172 | 175 | $this->visibleProperties[$index][]=$field; |
173 | - }else{ |
|
176 | + } else{ |
|
174 | 177 | $this->visibleProperties[$index]=[$vb[$index],$field]; |
175 | 178 | } |
176 | 179 | } |
177 | - }else{ |
|
180 | + } else{ |
|
178 | 181 | return $this->insertField($index, $field); |
179 | 182 | } |
180 | 183 | return $this; |
@@ -183,7 +186,7 @@ discard block |
||
183 | 186 | public function addField($field,$key=null){ |
184 | 187 | if(isset($key)){ |
185 | 188 | $this->visibleProperties[]=[$key=>$field]; |
186 | - }else{ |
|
189 | + } else{ |
|
187 | 190 | $this->visibleProperties[]=$field; |
188 | 191 | } |
189 | 192 | return $this; |
@@ -210,9 +213,9 @@ discard block |
||
210 | 213 | $property=$this->getProperty($index); |
211 | 214 | if($property instanceof \ReflectionProperty){ |
212 | 215 | $result=$property->getName(); |
213 | - }elseif(\is_callable($property)){ |
|
216 | + } elseif(\is_callable($property)){ |
|
214 | 217 | $result=$this->visibleProperties[$index]; |
215 | - }else{ |
|
218 | + } else{ |
|
216 | 219 | $result=$property; |
217 | 220 | } |
218 | 221 | return $result; |
@@ -232,7 +235,7 @@ discard block |
||
232 | 235 | $this->reflect=new \ReflectionClass($instance); |
233 | 236 | if(JArray::count($this->visibleProperties)===0){ |
234 | 237 | $this->properties=$this->getDefaultProperties(); |
235 | - }else{ |
|
238 | + } else{ |
|
236 | 239 | foreach ($this->visibleProperties as $property){ |
237 | 240 | $this->setInstanceProperty($property); |
238 | 241 | } |
@@ -243,22 +246,23 @@ discard block |
||
243 | 246 | private function setInstanceProperty($property){ |
244 | 247 | if(\is_callable($property)){ |
245 | 248 | $this->properties[]=$property; |
246 | - }elseif(\is_string($property)){ |
|
249 | + } elseif(\is_string($property)){ |
|
247 | 250 | try{ |
248 | 251 | $this->_beforeAddProperty(\sizeof($this->properties), $property); |
249 | 252 | $rProperty=$this->reflect->getProperty($property); |
250 | 253 | $this->properties[]=$rProperty; |
251 | - }catch(\Exception $e){ |
|
254 | + } catch(\Exception $e){ |
|
252 | 255 | $this->_beforeAddProperty(\sizeof($this->properties), $property); |
253 | 256 | $this->properties[]=$property; |
254 | 257 | } |
255 | - }elseif(\is_int($property)){ |
|
258 | + } elseif(\is_int($property)){ |
|
256 | 259 | $props=$this->getDefaultProperties(); |
257 | - if(isset($props[$property])) |
|
258 | - $this->properties[]=$props[$property]; |
|
259 | - else |
|
260 | - $this->properties[]=$property; |
|
261 | - }else{ |
|
260 | + if(isset($props[$property])) { |
|
261 | + $this->properties[]=$props[$property]; |
|
262 | + } else { |
|
263 | + $this->properties[]=$property; |
|
264 | + } |
|
265 | + } else{ |
|
262 | 266 | $this->properties[]=$property; |
263 | 267 | } |
264 | 268 | } |
@@ -302,12 +306,13 @@ discard block |
||
302 | 306 | if(isset($this->captions[$index])){ |
303 | 307 | return $this->captions[$index]; |
304 | 308 | } |
305 | - if($this->properties[$index] instanceof \ReflectionProperty) |
|
306 | - return $this->properties[$index]->getName(); |
|
307 | - elseif(\is_callable($this->properties[$index])) |
|
308 | - return ""; |
|
309 | - else |
|
310 | - return $this->properties[$index]; |
|
309 | + if($this->properties[$index] instanceof \ReflectionProperty) { |
|
310 | + return $this->properties[$index]->getName(); |
|
311 | + } elseif(\is_callable($this->properties[$index])) { |
|
312 | + return ""; |
|
313 | + } else { |
|
314 | + return $this->properties[$index]; |
|
315 | + } |
|
311 | 316 | } |
312 | 317 | |
313 | 318 | public function getCaptions(){ |
@@ -319,14 +324,14 @@ discard block |
||
319 | 324 | for($i=$captionsSize;$i<$count;$i++){ |
320 | 325 | $captions[]=""; |
321 | 326 | } |
322 | - }else{ |
|
327 | + } else{ |
|
323 | 328 | $captions=[]; |
324 | 329 | $index=0; |
325 | 330 | if(!$hasGroupby){ |
326 | 331 | while($index<$count){ |
327 | 332 | $captions[]=$this->getCaption($index++); |
328 | 333 | } |
329 | - }else{ |
|
334 | + } else{ |
|
330 | 335 | while($index<$count){ |
331 | 336 | if($hasGroupby && array_search($index, $this->groupByFields)===false){ |
332 | 337 | $captions[]=$this->getCaption($index); |
@@ -343,8 +348,9 @@ discard block |
||
343 | 348 | } |
344 | 349 | |
345 | 350 | public function setCaption($index,$caption){ |
346 | - if(isset($this->captions)===false) |
|
347 | - $this->captions=[]; |
|
351 | + if(isset($this->captions)===false) { |
|
352 | + $this->captions=[]; |
|
353 | + } |
|
348 | 354 | $this->captions[$index]=$caption; |
349 | 355 | return $this; |
350 | 356 | } |
@@ -29,15 +29,17 @@ discard block |
||
29 | 29 | |
30 | 30 | public function addContent($content,$before=false) { |
31 | 31 | if (!\is_array($this->content)) { |
32 | - if(isset($this->content)) |
|
33 | - $this->content=array ($this->content); |
|
34 | - else |
|
35 | - $this->content=array(); |
|
32 | + if(isset($this->content)) { |
|
33 | + $this->content=array ($this->content); |
|
34 | + } else { |
|
35 | + $this->content=array(); |
|
36 | + } |
|
37 | + } |
|
38 | + if($before) { |
|
39 | + array_unshift($this->content,$content); |
|
40 | + } else { |
|
41 | + $this->content []=$content; |
|
36 | 42 | } |
37 | - if($before) |
|
38 | - array_unshift($this->content,$content); |
|
39 | - else |
|
40 | - $this->content []=$content; |
|
41 | 43 | return $this; |
42 | 44 | } |
43 | 45 | |
@@ -75,9 +77,9 @@ discard block |
||
75 | 77 | $instances=[]; |
76 | 78 | if($content instanceof $class){ |
77 | 79 | $instances[]=$content; |
78 | - }elseif($content instanceof HtmlDoubleElement){ |
|
80 | + } elseif($content instanceof HtmlDoubleElement){ |
|
79 | 81 | $instances=\array_merge($instances,$content->getContentInstances($class)); |
80 | - }elseif (\is_array($content)){ |
|
82 | + } elseif (\is_array($content)){ |
|
81 | 83 | foreach ($content as $element){ |
82 | 84 | $instances=\array_merge($instances,$this->_getContentInstances($class, $element)); |
83 | 85 | } |
@@ -90,10 +92,12 @@ discard block |
||
90 | 92 | * @return HtmlDoubleElement |
91 | 93 | */ |
92 | 94 | public function asLink($href=NULL,$target=NULL) { |
93 | - if (isset($href)) |
|
94 | - $this->setProperty("href", $href); |
|
95 | - if(isset($target)) |
|
96 | - $this->setProperty("target", $target); |
|
95 | + if (isset($href)) { |
|
96 | + $this->setProperty("href", $href); |
|
97 | + } |
|
98 | + if(isset($target)) { |
|
99 | + $this->setProperty("target", $target); |
|
100 | + } |
|
97 | 101 | return $this->setTagName("a"); |
98 | 102 | } |
99 | 103 |
@@ -61,16 +61,19 @@ discard block |
||
61 | 61 | $js->execOn("mouseover", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'visible');",["preventDefault"=>false,"stopPropagation"=>true]); |
62 | 62 | $js->execOn("mouseout", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'hidden');",["preventDefault"=>false,"stopPropagation"=>true]); |
63 | 63 | } |
64 | - if(\is_array($this->_deleteBehavior)) |
|
65 | - $this->_generateBehavior("delete",$this->_deleteBehavior, $js); |
|
66 | - if(\is_array($this->_editBehavior)) |
|
67 | - $this->_generateBehavior("edit",$this->_editBehavior,$js); |
|
64 | + if(\is_array($this->_deleteBehavior)) { |
|
65 | + $this->_generateBehavior("delete",$this->_deleteBehavior, $js); |
|
66 | + } |
|
67 | + if(\is_array($this->_editBehavior)) { |
|
68 | + $this->_generateBehavior("edit",$this->_editBehavior,$js); |
|
69 | + } |
|
68 | 70 | if(\is_array($this->_displayBehavior)){ |
69 | 71 | $this->_generateBehavior("display",$this->_displayBehavior,$js); |
70 | 72 | } |
71 | 73 | parent::run($js); |
72 | - if(isset($this->_pagination)) |
|
73 | - $this->_associatePaginationBehavior($js,$offset); |
|
74 | + if(isset($this->_pagination)) { |
|
75 | + $this->_associatePaginationBehavior($js,$offset); |
|
76 | + } |
|
74 | 77 | $this->_associateSearchFieldBehavior($js,$offset); |
75 | 78 | |
76 | 79 | } |
@@ -105,8 +108,9 @@ discard block |
||
105 | 108 | $table->setRowCount(0, \sizeof($captions)); |
106 | 109 | $this->_generateHeader($table,$captions); |
107 | 110 | |
108 | - if(isset($this->_compileParts)) |
|
109 | - $table->setCompileParts($this->_compileParts); |
|
111 | + if(isset($this->_compileParts)) { |
|
112 | + $table->setCompileParts($this->_compileParts); |
|
113 | + } |
|
110 | 114 | |
111 | 115 | $this->_generateContent($table); |
112 | 116 | |
@@ -136,8 +140,9 @@ discard block |
||
136 | 140 | } |
137 | 141 | |
138 | 142 | protected function _applyStyleAttributes($table){ |
139 | - if(isset($this->_hiddenColumns)) |
|
140 | - $this->_hideColumns(); |
|
143 | + if(isset($this->_hiddenColumns)) { |
|
144 | + $this->_hideColumns(); |
|
145 | + } |
|
141 | 146 | if(isset($this->_colWidths)){ |
142 | 147 | foreach ($this->_colWidths as $colIndex=>$width){ |
143 | 148 | $table->setColWidth($colIndex,$width); |
@@ -173,7 +178,7 @@ discard block |
||
173 | 178 | $table->fromDatabaseObjects($objects, function($instance) use($table,$fields){ |
174 | 179 | return $this->_generateRow($instance, $fields,$table); |
175 | 180 | }); |
176 | - }else{ |
|
181 | + } else{ |
|
177 | 182 | $activeValues=array_combine($groupByFields, array_fill(0, sizeof($groupByFields), null)); |
178 | 183 | $uuids=[]; |
179 | 184 | $table->fromDatabaseObjects($objects, function($instance) use($table,$fields,&$activeValues,$groupByFields,&$uuids){ |
@@ -235,8 +240,9 @@ discard block |
||
235 | 240 | $field=$ck->getField(); |
236 | 241 | $field->setProperty("value",$dataAjax); |
237 | 242 | $field->setProperty("name", "selection[]"); |
238 | - if(isset($checkedClass)) |
|
239 | - $field->setClass($checkedClass); |
|
243 | + if(isset($checkedClass)) { |
|
244 | + $field->setClass($checkedClass); |
|
245 | + } |
|
240 | 246 | \array_unshift($values, $ck); |
241 | 247 | } |
242 | 248 | $result=$table->newRow(); |
@@ -253,8 +259,9 @@ discard block |
||
253 | 259 | |
254 | 260 | protected function _generatePagination($table){ |
255 | 261 | if(isset($this->_toolbar)){ |
256 | - if($this->_toolbarPosition==PositionInTable::FOOTER) |
|
257 | - $this->_toolbar->setFloated("left"); |
|
262 | + if($this->_toolbarPosition==PositionInTable::FOOTER) { |
|
263 | + $this->_toolbar->setFloated("left"); |
|
264 | + } |
|
258 | 265 | } |
259 | 266 | $footer=$table->getFooter(); |
260 | 267 | $footer->mergeCol(); |
@@ -286,8 +293,9 @@ discard block |
||
286 | 293 | |
287 | 294 | protected function _getFieldName($index){ |
288 | 295 | $fieldName=parent::_getFieldName($index); |
289 | - if(\is_object($fieldName)) |
|
290 | - $fieldName="field-".$index; |
|
296 | + if(\is_object($fieldName)) { |
|
297 | + $fieldName="field-".$index; |
|
298 | + } |
|
291 | 299 | return $fieldName."[]"; |
292 | 300 | } |
293 | 301 | |
@@ -327,7 +335,7 @@ discard block |
||
327 | 335 | $hasPart=$table->hasPart($part); |
328 | 336 | if($hasPart){ |
329 | 337 | $row=$table->getPart($part)->addRow(\sizeof($captions)); |
330 | - }else{ |
|
338 | + } else{ |
|
331 | 339 | $row=$table->getPart($part)->getRow(0); |
332 | 340 | } |
333 | 341 | $row->mergeCol(); |
@@ -359,7 +367,7 @@ discard block |
||
359 | 367 | $this->_urls["edit"]=JArray::getValue($urls, "edit",1); |
360 | 368 | $this->_urls["delete"]=JArray::getValue($urls, "delete",2); |
361 | 369 | $this->_urls["display"]=JArray::getValue($urls, "display",3); |
362 | - }else{ |
|
370 | + } else{ |
|
363 | 371 | $this->_urls=["refresh"=>$urls,"edit"=>$urls,"delete"=>$urls,"display"=>$urls]; |
364 | 372 | } |
365 | 373 | return $this; |
@@ -442,8 +450,9 @@ discard block |
||
442 | 450 | |
443 | 451 | protected function getTargetSelector($op) { |
444 | 452 | $result=$this->_targetSelector; |
445 | - if(!isset($result[$op])) |
|
446 | - $result="#".$this->identifier; |
|
453 | + if(!isset($result[$op])) { |
|
454 | + $result="#".$this->identifier; |
|
455 | + } |
|
447 | 456 | return $result[$op]; |
448 | 457 | } |
449 | 458 | |
@@ -461,8 +470,9 @@ discard block |
||
461 | 470 | } |
462 | 471 | |
463 | 472 | public function getRefreshSelector() { |
464 | - if(isset($this->_refreshSelector)) |
|
465 | - return $this->_refreshSelector; |
|
473 | + if(isset($this->_refreshSelector)) { |
|
474 | + return $this->_refreshSelector; |
|
475 | + } |
|
466 | 476 | return "#".$this->identifier." tbody"; |
467 | 477 | } |
468 | 478 | |
@@ -481,8 +491,9 @@ discard block |
||
481 | 491 | */ |
482 | 492 | public function show($modelInstance){ |
483 | 493 | if(\is_array($modelInstance)){ |
484 | - if(isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0])) |
|
485 | - $modelInstance=\json_decode(\json_encode($modelInstance), FALSE); |
|
494 | + if(isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0])) { |
|
495 | + $modelInstance=\json_decode(\json_encode($modelInstance), FALSE); |
|
496 | + } |
|
486 | 497 | } |
487 | 498 | $this->_modelInstance=$modelInstance; |
488 | 499 | } |
@@ -522,8 +533,9 @@ discard block |
||
522 | 533 | } |
523 | 534 | |
524 | 535 | public function hideColumn($colIndex){ |
525 | - if(!\is_array($this->_hiddenColumns)) |
|
526 | - $this->_hiddenColumns=[]; |
|
536 | + if(!\is_array($this->_hiddenColumns)) { |
|
537 | + $this->_hiddenColumns=[]; |
|
538 | + } |
|
527 | 539 | $this->_hiddenColumns[]=$colIndex; |
528 | 540 | return $this; |
529 | 541 | } |