]> git.nbdom.net Git - nb.git/commitdiff
www/dbq/dbq.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 18 Feb 2019 02:41:20 +0000 (02:41 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 18 Feb 2019 02:41:20 +0000 (02:41 +0000)
www/dbq/dbq.php

index 79cb3a530d3d4583259c8cbec57b0767e205c9e5..0e5ada16343ab54d16c2b264795d2fc074475c41 100644 (file)
@@ -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');