]> git.nbdom.net Git - nb.git/commitdiff
www/dbq/dbq.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 5 Jan 2018 02:52:23 +0000 (02:52 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 5 Jan 2018 02:52:23 +0000 (02:52 +0000)
www/dbq/dbq.php

index b32b76db5feb06ec77f21c9071c7b10c91615c98..51776000d1001bf15d91bb9140cdc019678c6f36 100644 (file)
@@ -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) {