From 12d4b73226fddc7fae45eab24da408f1d740379c Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 20 Dec 2016 10:30:19 +0000 Subject: [PATCH] dbq fix ext bug --- www/dbq/dbq.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 16dd16c2..7e01fd26 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -91,9 +91,6 @@ class DbQ extends nb { parent::__construct($opt); if (!$this->params['db']) $this->not_implemented('Db missing'); - // Post defaults values - if (empty($this->ext)) $this->ext = $this->params['format']; - // // Page require_once(NB_ROOT.'/lib/php/page.php'); @@ -143,7 +140,10 @@ table.rows th, table.rows td { border-color: '.$this->colors['body-border'].'; } public function page($obj,$meth=null,$head=[],$fct=null) { if (empty($this->_nopage)) { - $this->init(); + // Write output + $this->page_colors(); + $this->page->headers_no_cache(); + $this->page->begin(); } #die($obj); @@ -464,6 +464,9 @@ table.rows th, table.rows td { border-color: '.$this->colors['body-border'].'; } } + // Post defaults values + if (empty($this->ext)) $this->ext = $format; + if ($format == 'html') $format = 'table'; $this->params['format'] = $format; $this->db->format = $format; @@ -472,10 +475,6 @@ table.rows th, table.rows td { border-color: '.$this->colors['body-border'].'; } if (empty($content_type)) $content_type = Mime::fromExt($format=='human' ? 'txt' : $format); if ($content_type) $this->page->content_type($content_type); - // Write output - $this->page_colors(); - $this->page->headers_no_cache(); - $this->page->begin(); } public function run() { @@ -484,6 +483,7 @@ table.rows th, table.rows td { border-color: '.$this->colors['body-border'].'; } # Db Init # $this->db(); + $this->init(); # # Root actions pre conn -- 2.47.3