From 29d36ffdc36bf20ab43840df9272fac160cbc476 Mon Sep 17 00:00:00 2001 From: patdenice Date: Mon, 29 Mar 2010 13:30:02 +0000 Subject: feature 1502: Allow to have configuration page for each theme.css. About string for theme has to be saved in language theme directory (about.html) git-svn-id: http://piwigo.org/svn/trunk@5446 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/template.class.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/template.class.php b/include/template.class.php index 2307d9fe2..3a13adf47 100644 --- a/include/template.class.php +++ b/include/template.class.php @@ -94,7 +94,7 @@ class Template { { $this->set_template_dir($root.'/'.$theme.'/'.$path); - include($root.'/'.$theme.'/themeconf.inc.php'); + $themeconf = $this->load_themeconf($root.'/'.$theme); if (isset($themeconf['parent']) and $themeconf['parent'] != $theme) { @@ -573,6 +573,21 @@ class Template { return $source; } + + function load_themeconf($dir) + { + global $themeconfs, $conf, $page; + + $dir = realpath($dir); + if (!isset($themeconfs[$dir])) + { + $themeconf = array(); + include($dir.'/themeconf.inc.php'); + // Put themeconf in cache + $themeconfs[$dir] = $themeconf; + } + return $themeconfs[$dir]; + } } -- cgit v1.2.3