]> git.nbdom.net Git - nb.git/commitdiff
lib/php/db/table.php
authorDevops <sys@15gifts.com>
Thu, 6 Apr 2017 14:43:50 +0000 (15:43 +0100)
committerDevops <sys@15gifts.com>
Thu, 6 Apr 2017 14:43:50 +0000 (15:43 +0100)
lib/php/db/table.php
www/dbq/dbq.php

index 9d428d008175537a0e1efefc25b7a76b2fc3ab77..6bf45de673c78f789b69875a3c5068c501c034b8 100644 (file)
@@ -109,8 +109,8 @@ Class Table extends nb {
     #$this->pdef('header',$this->show_header);
 
     if (isset($_GET['rows.header'])) $this->show_header = $_GET['rows.header'];
-    $this->pdef('header',$this->show_header);
-    $this->show_header = (bool)$this->p('header',$this->show_header);
+    #$this->pdef('header',$this->show_header);
+    #$this->show_header = (bool)$this->p('header',$this->show_header);
     #bye($this->show_header);
     #$this->show_header = (bool)$this->show_header;
     #$this->db()->out->header($this->show_header);
index a3bd76087a385f45be1925822425beb7c796b846..1179d0bd7e4abb9f5e5243d1c1b15b30f426f4b1 100644 (file)
@@ -47,6 +47,7 @@ class DbQ extends nb {
   public $default_limit = '30';
   public $limits = ['30','100','500','1000'];
   public $formats = [ 'html','csv','xml','json','yaml','sh','sql','php' ];
+  public $is_html;
 
   # Page
   public $css = '/default'.(PRODUCTION ? '.min' : '').'.css';
@@ -321,9 +322,7 @@ class DbQ extends nb {
       'db' => $this->db,
       'show_hidden_params' => false,
       'show_buttons' => false,
-      'show_header' => ($this->params['format'] == 'html'),
-      #'params' => [],
-      #'params' => [ 'limit' ],
+      'show_header' => $this->is_html,
     ],$param));
 
     $this->table->base = $this->db->base.'/'.$this->table->name;
@@ -465,7 +464,7 @@ class DbQ extends nb {
     if ($password=='') {
       if ($password=='') $password = $this->params['table'];
       if ($password=='' and !empty($_POST['password'])) $password = $_POST['password'];
-      if ($this->db->is_html) echo <<<EOF
+      if ($this->is_html) echo <<<EOF
 <form action="$this->uri" method="post">
 <label>Password</label><input type="text" name="password" value="$password" />
 <input type="submit" />
@@ -577,7 +576,8 @@ EOF;
     if ($format == 'html') $format = $this->format_html;
     $this->params['format'] = $format;
     $this->db->format = $format;
-    $this->db->is_html = strpos($content_type,'html') ? true : false;
+    $this->is_html = strpos($content_type,'html') ? true : false;
+    $this->db->is_html = $this->is_html;
 
   }