From e07626b7264bee222f555acf85b0f135733c9b49 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 20 Jun 2018 15:59:43 +0100 Subject: [PATCH] lib/php/db.php --- lib/php/db.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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]); } } -- 2.47.3