Passed
Push — master ( 22d09a...cb2842 )
by Patrick
01:54
created
library/Trapdirector/Tables/TrapDirectorTable.php 1 patch
Braces   +47 added lines, -28 removed lines patch added patch discarded remove patch
@@ -88,17 +88,21 @@  discard block
 block discarded – undo
88 88
     {
89 89
         $actionURL = $this->getCurrentURL() . '?' ;
90 90
         $QSList=array();
91
-        if ($caller != 'filter' && $this->curFilterQuery() != '')
92
-            array_push($QSList , $this->curFilterQuery());
91
+        if ($caller != 'filter' && $this->curFilterQuery() != '') {
92
+                    array_push($QSList , $this->curFilterQuery());
93
+        }
93 94
         
94
-        if ($caller != 'paging' && $caller != 'filter' && $this->curPagingQuery() != '')
95
-            array_push($QSList , $this->curPagingQuery());
95
+        if ($caller != 'paging' && $caller != 'filter' && $this->curPagingQuery() != '') {
96
+                    array_push($QSList , $this->curPagingQuery());
97
+        }
96 98
  
97
-        if ($caller != 'order' && $this->curOrderQuery() != '')
98
-            array_push($QSList , $this->curOrderQuery());
99
+        if ($caller != 'order' && $this->curOrderQuery() != '') {
100
+                    array_push($QSList , $this->curOrderQuery());
101
+        }
99 102
         
100
-        if (count($QSList) != 0)
101
-            $actionURL .=  implode('&', $QSList) . '&';
103
+        if (count($QSList) != 0) {
104
+                    $actionURL .=  implode('&', $QSList) . '&';
105
+        }
102 106
         
103 107
         return $actionURL;
104 108
     }
@@ -142,7 +146,9 @@  discard block
 block discarded – undo
142 146
         $filter='';
143 147
         foreach ($this->filterColumn as $column)
144 148
         {
145
-            if ($filter != "") $filter.=' OR ';
149
+            if ($filter != "") {
150
+            	$filter.=' OR ';
151
+            }
146 152
             //$filter .= "'" . $column . "' LIKE '%" . $this->filterString. "%'";
147 153
             $filter .= $column  . " LIKE '%" . $this->filterString. "%'";
148 154
         }
@@ -185,7 +191,9 @@  discard block
 block discarded – undo
185 191
     
186 192
     protected function curFilterQuery()
187 193
     {
188
-        if ($this->filterQuery == '') return '';
194
+        if ($this->filterQuery == '') {
195
+        	return '';
196
+        }
189 197
         return 'f='.$this->filterQuery;
190 198
     }
191 199
     
@@ -200,7 +208,9 @@  discard block
 block discarded – undo
200 208
         $orderSQL='';
201 209
         foreach ($this->order as $column => $direction)
202 210
         {
203
-            if ($orderSQL != "") $orderSQL.=',';
211
+            if ($orderSQL != "") {
212
+            	$orderSQL.=',';
213
+            }
204 214
             
205 215
             $orderSQL .= $column . ' ' . $direction;
206 216
         }
@@ -217,7 +227,9 @@  discard block
 block discarded – undo
217 227
 
218 228
     public function isOrderSet()
219 229
     {
220
-        if (count($this->order) == 0) return FALSE;
230
+        if (count($this->order) == 0) {
231
+        	return FALSE;
232
+        }
221 233
         return TRUE;
222 234
     }
223 235
     
@@ -238,7 +250,9 @@  discard block
 block discarded – undo
238 250
     
239 251
     protected function curOrderQuery()
240 252
     {
241
-        if ($this->orderQuery == '') return '';
253
+        if ($this->orderQuery == '') {
254
+        	return '';
255
+        }
242 256
         return 'o='.$this->orderQuery;
243 257
     }
244 258
     
@@ -276,7 +290,9 @@  discard block
 block discarded – undo
276 290
 
277 291
     protected function curPagingQuery()
278 292
     {
279
-        if ($this->currentPage == '') return '';
293
+        if ($this->currentPage == '') {
294
+        	return '';
295
+        }
280 296
         return 'page='.$this->currentPage;
281 297
     }
282 298
     
@@ -288,10 +304,14 @@  discard block
 block discarded – undo
288 304
             return  'count : ' . $this->count() . '<br>';
289 305
         }
290 306
         
291
-        if ($this->currentPage == 0) $this->currentPage = 1;
307
+        if ($this->currentPage == 0) {
308
+        	$this->currentPage = 1;
309
+        }
292 310
         
293 311
         $numPages = intdiv($count , $this->maxPerPage);
294
-        if ($count % $this->maxPerPage != 0 ) $numPages++;
312
+        if ($count % $this->maxPerPage != 0 ) {
313
+        	$numPages++;
314
+        }
295 315
         
296 316
         $html = '<div class="pagination-control" role="navigation">';
297 317
         $html .= '<ul class="nav tab-nav">';
@@ -305,8 +325,7 @@  discard block
 block discarded – undo
305 325
                      </span>
306 326
                 </li>
307 327
                ';
308
-        }
309
-        else 
328
+        } else 
310 329
         {
311 330
             $html .= '
312 331
                 <li class="nav-item">
@@ -322,7 +341,9 @@  discard block
 block discarded – undo
322 341
             $active = ($this->currentPage == $i) ? 'active' : '';
323 342
             $first = ($i-1)*$this->maxPerPage+1;
324 343
             $last = $i * $this->maxPerPage;
325
-            if ($last > $count) $last = $count;
344
+            if ($last > $count) {
345
+            	$last = $count;
346
+            }
326 347
             $display = 'Show rows '. $first . ' to '. $last .' of '. $count;
327 348
             $html .= '<li class="' . $active . ' nav-item">
328 349
                     <a href="'. $this->getCurrentURLAndQS('paging') .'&page='. $i .'" title="' . $display . '" aria-label="' . $display . '">
@@ -341,8 +362,7 @@  discard block
 block discarded – undo
341 362
                      </span>
342 363
                 </li>
343 364
                ';
344
-        }
345
-        else
365
+        } else
346 366
         {
347 367
             $html .= '
348 368
                 <li class="nav-item">
@@ -386,7 +406,9 @@  discard block
 block discarded – undo
386 406
     
387 407
     public function groupingNextLine( $values)
388 408
     {
389
-        if ($this->grouppingActive === FALSE) return '';
409
+        if ($this->grouppingActive === FALSE) {
410
+        	return '';
411
+        }
390 412
         
391 413
         $dbcol = $this->groupingColumn;
392 414
         if ($this->groupingVal == '' || $this->groupingVal != $values->$dbcol )
@@ -419,20 +441,17 @@  discard block
 block discarded – undo
419 441
                     if ($this->order[$titleOrder] == 'ASC')
420 442
                     {
421 443
                         $titleOrder.='DESC';
422
-                    }
423
-                    else
444
+                    } else
424 445
                     {
425 446
                         $titleOrder.='ASC';
426 447
                     }
427
-                }
428
-                else 
448
+                } else 
429 449
                 {
430 450
                     $titleOrder.='ASC';
431 451
                 }
432 452
                 $actionURL = $this->getCurrentURLAndQS('order').'o='.$titleOrder;
433 453
                 $html .= '<th><a href="'.$actionURL.'">' . $values . '</a></th>';
434
-            }
435
-            else 
454
+            } else 
436 455
             {
437 456
                 $html .= '<th>' . $values . '</th>';
438 457
             }          
Please login to merge, or discard this patch.