From: Nicolas Boisselier Date: Mon, 18 Feb 2019 02:41:20 +0000 (+0000) Subject: www/dbq/dbq.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=0244143fd06c8eed1ee8ec5f6a09f4652e7b4082;p=nb.git www/dbq/dbq.php --- diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 79cb3a53..0e5ada16 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -254,10 +254,15 @@ class DbQ extends nb { return $rows; } - public function page_table_ls($args=null) { + public function page_table_ls($fields=null) { $this->deniedUnless($this->perm >= self::READ); - $fields_only = (string)$args === '' ? [] : explode(',',$args); + $fields_only = (string)$fields === '' ? [] : explode(',',$fields); + $table_fields = array_keys($this->table->fields()); + foreach ($fields_only as $k=>$v) { + if (preg_match('/^(\d+)$/',$v,$m)) $fields_only[$k] = $table_fields[$v]; + } + if (!empty($fields_only)) $this->table->fields_only = $fields_only; $this->page($this,'table_rows');