From: Nicolas Boisselier Date: Tue, 26 Apr 2016 15:52:47 +0000 (+0100) Subject: filter for db.tables X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=e58ec7a66050ea0e18fe89f81d413e5df559d97b;p=nb.git filter for db.tables --- diff --git a/lib/php/db.php b/lib/php/db.php index ba41429c..c6d98203 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -426,7 +426,14 @@ EOF; $return = true; } elseif ($action == 'db.tables' or $action == 'tables') { - foreach ($this->tables() as $t) { $rows[] = $t->infos(); } + # Filters + $name = self::p('name',''); + $type = self::p('type',''); + foreach ($this->tables() as $t) { + if (!empty($name) and strpos($t->name,$name) === false) continue; + if (!empty($type) and strpos($t->type,$type) === false) continue; + $rows[] = $t->infos(); + } $return = $this->out2($rows); } elseif ($action == 'db.conf') {