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:
@ -4,6 +4,9 @@
|
|||||||
Version 2.0-beta3 ()
|
Version 2.0-beta3 ()
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
* Themes using Engines are now able to use the parent's
|
||||||
|
configuration
|
||||||
|
|
||||||
* Prevent "new" plugin api to install double instances of plugins
|
* Prevent "new" plugin api to install double instances of plugins
|
||||||
that are not stackable (issue #45)
|
that are not stackable (issue #45)
|
||||||
|
|
||||||
@ -49,7 +52,7 @@ Version 2.0-beta3 ()
|
|||||||
a backend theme would reference to.
|
a backend theme would reference to.
|
||||||
|
|
||||||
* Changed 2k11's config.inc.php file to provide a more stable
|
* Changed 2k11's config.inc.php file to provide a more stable
|
||||||
call of event hooks so that other templates can also hook
|
call of event hooks so that other themes can also hook
|
||||||
their own events.
|
their own events.
|
||||||
|
|
||||||
* Changed JS for category filtering and its reset button to be a
|
* Changed JS for category filtering and its reset button to be a
|
||||||
|
@ -96,11 +96,13 @@ if ( @file_exists($serendipity['serendipityPath'] . $serendipity['templatePath']
|
|||||||
|
|
||||||
$data["cur_template"] = $serendipity['template'];
|
$data["cur_template"] = $serendipity['template'];
|
||||||
$data["cur_template_backend"] = $serendipity['template_backend'];
|
$data["cur_template_backend"] = $serendipity['template_backend'];
|
||||||
|
$data['cur_template_info'] = serendipity_fetchTemplateInfo($serendipity['template']);
|
||||||
|
|
||||||
if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template'] . '/config.inc.php')) {
|
// NOTE: config.inc.php currently only applies to frontend configuration. Backend configuration is not planned yet, and would preferrably use a "config_backend.inc.php" file!
|
||||||
|
if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $data['cur_template_info']['custom_config_engine'] . '/config.inc.php')) {
|
||||||
serendipity_smarty_init();
|
serendipity_smarty_init();
|
||||||
$old_template_config_groups = $template_config_groups;
|
$old_template_config_groups = $template_config_groups;
|
||||||
include_once $serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template'] . '/config.inc.php';
|
include_once $serendipity['serendipityPath'] . $serendipity['templatePath'] . $data['cur_template_info']['custom_config_engine'] . '/config.inc.php';
|
||||||
// in case of theme switch, check to unset config_group array
|
// in case of theme switch, check to unset config_group array
|
||||||
if ($serendipity['GET']['adminAction'] == 'install' && $serendipity['GET']['adminModule'] == 'templates') {
|
if ($serendipity['GET']['adminAction'] == 'install' && $serendipity['GET']['adminModule'] == 'templates') {
|
||||||
// array diff - but do not do this for bulletproof, as this is the only one which needs them in case of reloads (temporary)
|
// array diff - but do not do this for bulletproof, as this is the only one which needs them in case of reloads (temporary)
|
||||||
|
@ -260,6 +260,22 @@ function serendipity_fetchTemplateInfo($theme, $abspath = null) {
|
|||||||
|
|
||||||
if (@is_file($serendipity['templatePath'] . $theme . '/config.inc.php')) {
|
if (@is_file($serendipity['templatePath'] . $theme . '/config.inc.php')) {
|
||||||
$data['custom_config'] = YES;
|
$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'
|
if ( $theme != 'default' && $theme != 'default-rtl'
|
||||||
|
Reference in New Issue
Block a user