From: Nicolas Boisselier Date: Sat, 26 May 2018 00:54:40 +0000 (+0100) Subject: www/dbq/dbq.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=2f9dc42a269e12ae60786b2a5033d5421ab0b04d;p=nb.git www/dbq/dbq.php --- diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 48b56cb8..36e49855 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -152,10 +152,17 @@ class DbQ extends nb { // Page $this->page = new Page([ 'css' => $this->css, + 'js' => $this->js, 'sep' => $this->sep_title, # NB 05.01.18 'expires' => $this->expires, ]); + // Bass base preffix + if ($this->base) { + foreach( (array)$this->page->css as $k=>$v ) { $this->page->css[$k] = $this->base . $v; } + foreach( (array)$this->page->js as $k=>$v ) { $this->page->js[$k] = $this->base . $v; } + } + // Http $this->http = new Http(); @@ -261,15 +268,6 @@ class DbQ extends nb { $this->page->headers_no_cache(); if (empty($this->_nopage)) { - $this->page->js = $this->js; - - if ($this->base) { - if (!empty($this->db)) $this->db->base = $this->base . $this->db->base; - if (!empty($this->table)) $this->table->base = $this->base . $this->table->base; - foreach( (array)$this->page->css as $k=>$v ) { $this->page->css[$k] = $this->base . $v; } - foreach( (array)$this->page->js as $k=>$v ) { $this->page->js[$k] = $this->base . $v; } - } - $this->conf = [ 'db.base' => ( empty($this->db) ? '' : $this->db->base ), 'table.base' => ( empty($this->table) ? '' : $this->table->base ), @@ -393,7 +391,7 @@ class DbQ extends nb { $this->db->__construct($connect); $this->db->connect(); - $this->db->base = '/'.$this->db->id; + $this->db->base = $this->base.'/'.$this->db->id; return $this->db; } @@ -410,7 +408,7 @@ class DbQ extends nb { } $this->db = new Db(['conf'=>$DB_CONFS]); - $this->db->base = ''; + $this->db->base = $this->base; return $this->db; }