From b385e0e93a3caa85ae591d2b263d3c4bc37ceb37 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 21 Dec 2016 11:20:43 +0000 Subject: [PATCH] dbq --- www/dbq/dbq.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index ff176027..c594beb9 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -33,12 +33,21 @@ class DbQ extends nb { public $perm = DBQ_PERM; public $run = false; + public $sep = ' / '; public $title = DBQ_TITLE; const PARAM_ARGS_SEP = '|'; const PARAM_EXP = '[\w\._:-]{2,100}'; const PARAM_DB_DEFAULT = DBQ_PARAM_DEFAULT; + public $formats = [ + 'table', + 'csv', + 'json', + 'yaml', + 'sh', + ]; + public $params = [ 'format' => DBQ_PARAM_FORMAT, 'db' => self::PARAM_DB_DEFAULT, @@ -95,13 +104,9 @@ class DbQ extends nb { // Page require_once(NB_ROOT.'/lib/php/page.php'); - list($title,$nav) = $this->title_nav(); - $this->page = new Page([ 'css' => $this->css, - 'title' => join(', ',$title), - 'nav' => $nav, - 'sep' => ', ', + 'sep' => $this->sep, ]); if ($this->run) $this->run(); @@ -501,15 +506,13 @@ document.addEventListener("DOMContentLoaded", function() { // Post defaults values if (empty($this->ext)) $this->ext = $format; + list($title,$nav) = $this->title_nav(); + $this->page->title = join($this->sep,$title); + $this->page->nav = $nav; + if ($format == 'html') $format = 'table'; $this->params['format'] = $format; - $this->db->formats = [ - 'table', - 'csv', - 'json', - 'yaml', - 'sh', - ]; + $this->db->formats = $this->formats; $this->db->format = $format; // Then content type -- 2.47.3