]> git.nbdom.net Git - nb.git/commitdiff
fix bug limit
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 7 Jan 2017 17:32:13 +0000 (17:32 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 7 Jan 2017 17:32:13 +0000 (17:32 +0000)
www/dbq/dbq.php

index 5ac0e19d4b70ef47de0965d3072d885d7af122b4..4eddb0318bfda4b26d6fd9f5e9c8f4974de61a2f 100644 (file)
@@ -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'