1
0

Issue #165 - allow to set configuration of children to their parents config, but on their own names.

Global options (navigation) are even carried through so that they use the central part.
This falls back in place rather nicely, I hope it REALLY works. My first tests showed no issues.
This commit is contained in:
Garvin Hicking
2014-05-28 11:48:56 +02:00
parent 71e4a6c1a9
commit 1b37e41e00
3 changed files with 24 additions and 3 deletions

View File

@ -260,6 +260,22 @@ function serendipity_fetchTemplateInfo($theme, $abspath = null) {
if (@is_file($serendipity['templatePath'] . $theme . '/config.inc.php')) {
$data['custom_config'] = YES;
$data['custom_config_engine'] = $theme;
}
// Templates can depend on a possible "Engine" (i.e. "Engine: 2k11").
// We support the fallback chain also of a template's configuration, so let's check each engine for a config file.
if (!empty($data['engine'])) {
$engines = explode(',', $data['engine']);
foreach($engines AS $engine) {
$engine = trim($engine);
if (empty($engine)) continue;
if (@is_file($serendipity['templatePath'] . $engine . '/config.inc.php')) {
$data['custom_config'] = YES;
$data['custom_config_engine'] = $engine;
}
}
}
if ( $theme != 'default' && $theme != 'default-rtl'