From: Nicolas Boisselier Date: Wed, 20 Jun 2018 14:59:43 +0000 (+0100) Subject: lib/php/db.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=e07626b7264bee222f555acf85b0f135733c9b49;p=nb.git lib/php/db.php --- diff --git a/lib/php/db.php b/lib/php/db.php index 60295d78..2f664eb5 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -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]); } }