]> git.nbdom.net Git - nb.git/commitdiff
www/dbq/dbq.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 26 May 2018 00:54:40 +0000 (01:54 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 26 May 2018 00:54:40 +0000 (01:54 +0100)
www/dbq/dbq.php

index 48b56cb808c7c5a493fa44c53b87583600da695e..36e49855c2c873edb07f7460a0abca084e9b97a5 100644 (file)
@@ -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;
        }