From: Nicolas Boisselier Date: Sat, 7 Jan 2017 17:32:13 +0000 (+0000) Subject: fix bug limit X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=96a9168dc94b35634f4b652a44700c216d4e155e;p=nb.git fix bug limit --- diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 5ac0e19d..4eddb031 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -107,10 +107,11 @@ class DbQ extends nb { public function page($obj,$meth=null,$head=[],$fct=null) { - // Write output - + // Defaults if (empty($this->default_limit)) $this->default_limit = $this->db->limits[0]; + $this->db->limit = $this->limit(); + // Write output if (empty($this->_nopage)) { $this->page->headers_no_cache(); @@ -149,15 +150,9 @@ class DbQ extends nb { } elseif(is_array($meth)) { $this->db->out($meth,$head,$conf); - } else { - # Objects Method + } else { # Objects Method $out = $obj->$meth(); - if (!empty($out)) { - # bye([$this->params['format'],$this->page->content_type()]); - #bye($out); array_shift($out); - - $this->db->out($out,$head,$conf); - } + if (!empty($out)) $this->db->out($out,$head,$conf); } @@ -231,7 +226,6 @@ class DbQ extends nb { } public function table_rows($fct=null) { - $this->db->limit = $this->limit(); $opt = ($this->page->is('html') and ($this->perm >= self::VIEW) @@ -568,13 +562,12 @@ class DbQ extends nb { } - return $this->page($rows); return $rows; - exit; + #return $this->page($rows); } - #return $this->page->phpinfo(); - return $this->page($this->page->phpinfo($txt)); + return $this->page->phpinfo(); + #return $this->page($this->page->phpinfo($txt)); } public function run_root() { @@ -617,8 +610,8 @@ class DbQ extends nb { } elseif ($action == 'phpinfo') { #$this->page(['phpinfo'=>$this->page->phpinfo(true)]); #$this->page($this->page->phpinfo()); - #$this->page($this,'phpinfo'); - $this->page_phpinfo(); + $this->page($this,'page_phpinfo'); + #$this->page_phpinfo(); } elseif (0 or $action == '_SERVER'