]> git.nbdom.net Git - nb.git/commitdiff
dbq
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 21 Dec 2016 11:20:43 +0000 (11:20 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 21 Dec 2016 11:20:43 +0000 (11:20 +0000)
www/dbq/dbq.php

index ff17602713f27ba65f0e47a7696873235778add4..c594beb97af69bcc6814f8d4b792909c4fe9b5f4 100644 (file)
@@ -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