From 1a501e3c6c640314197522c126df13ef78ae824d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Wed, 17 Apr 2013 13:36:19 +0200 Subject: [PATCH] Fix database title with multiple database. re #40 --- base.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/base.php b/base.php index 575eefc..a1273c1 100644 --- a/base.php +++ b/base.php @@ -380,6 +380,8 @@ class Page } } $this->entryArray = array_merge ($this->entryArray, Book::getCount()); + + if (!is_null ($database)) $this->title = Base::getDbName (); } } @@ -625,7 +627,17 @@ abstract class Base return array ("" => $config['calibre_directory']); } } - + + public static function getDbName ($database = NULL) { + global $config; + if (is_array ($config['calibre_directory'])) { + if (is_null ($database)) $database = GetUrlParam (DB, 0); + $array = array_keys ($config['calibre_directory']); + return $array[$database]; + } + return ""; + } + public static function getDbDirectory ($database = NULL) { global $config; if (is_array ($config['calibre_directory'])) {