From: Nicolas Boisselier Date: Fri, 5 Jan 2018 02:52:23 +0000 (+0000) Subject: www/dbq/dbq.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=be9b2d55419398c4b318d6362070eaf9c8d37be4;p=nb.git www/dbq/dbq.php --- diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index b32b76db..51776000 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -141,7 +141,7 @@ class DbQ extends nb { $this->page = new Page([ 'css' => $this->css, 'sep' => $this->sep_title, - 'expires' => $this->expires, +# NB 05.01.18 'expires' => $this->expires, ]); if ($run) $this->run(); @@ -212,6 +212,7 @@ class DbQ extends nb { if (empty($this->default_limit)) $this->default_limit = $this->db->limits[0]; // Write output + if ($this->expires and !preg_match('/^(dump|insert|update|replace|rm|vi)$/',$this->params['action'])) $this->page->expires = $this->expires; if (empty($this->_nopage)) { $this->page->headers_no_cache(); @@ -373,18 +374,18 @@ class DbQ extends nb { $this->vi(true); } -# NB 03.01.18 private function vi_extract_fields() { -# NB 03.01.18 $sep = $this->param_args_sep . $this->param_args_sep; -# NB 03.01.18 #$sep ='@'; -# NB 03.01.18 -# NB 03.01.18 $fields = []; -# NB 03.01.18 if (strpos($this->params['args'],$sep) !== false) { -# NB 03.01.18 list($fields,$this->params['args']) = explode($sep, $this->params['args']); -# NB 03.01.18 $fields = explode(',',$fields); -# NB 03.01.18 } -# NB 03.01.18 -# NB 03.01.18 return $fields; -# NB 03.01.18 } + private function vi_extract_fields() { + $sep = $this->param_args_sep . $this->param_args_sep; + #$sep ='@'; + + $fields = []; + if (strpos($this->params['args'],$sep) !== false) { + list($fields,$this->params['args']) = explode($sep, $this->params['args']); + $fields = explode(',',$fields); + } + + return $fields; + } public function vi($add=false) { $all = []; @@ -393,7 +394,7 @@ class DbQ extends nb { if (!$keys) $keys = $all; $keys = array_keys($keys); -# NB 03.01.18 #$fields = $this->vi_extract_fields(); + $fields = $this->vi_extract_fields(); $values = ($_SERVER['REQUEST_METHOD'] == 'POST') ? $_POST : explode($this->param_args_sep,$this->params['args']); foreach ($values as $k=>$v) {