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');