]> git.nbdom.net Git - nb.git/commitdiff
lib/php/db.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 20 Jun 2018 14:59:43 +0000 (15:59 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 20 Jun 2018 14:59:43 +0000 (15:59 +0100)
lib/php/db.php

index 60295d78ff3adc8892d7c7cbb6c22603df3ddce5..2f664eb59dec159de508674a4643395652b99cfb 100644 (file)
@@ -526,11 +526,19 @@ class Db extends nb {
                        $sql = $this->method('tables');
 
                        if ($sql and !empty($this->conn)) {
+                               # Filters
+                               $type = self::p('table-type',''); $type = $type ? explode(',',$type) : $type;
+                               $name = self::p('table-name',''); $name = $name ? explode(',',$name) : $name;
+
                                foreach ($this->conn->query($sql,PDO::FETCH_ASSOC) as $row) {
-                                       $name = current($row);
+                                       $tname = current($row);
+
+                                       # Filters
+                                       if (!empty($name) and !$this->str_match($row['name'],$name)) continue;
+                                       if (!empty($type) and !$this->str_match($row['type'],$type)) continue;
 
                                        # add to this->tables !!!
-                                       $t = $this->table($name,$row+['status'=>$row]);
+                                       $t = $this->table($tname,$row+['status'=>$row]);
                                }
                        }