diff --git a/include/functions_config.inc.php b/include/functions_config.inc.php index a71608d1..4003b74c 100644 --- a/include/functions_config.inc.php +++ b/include/functions_config.inc.php @@ -2132,11 +2132,18 @@ function serendipity_loadGlobalThemeOptions(&$template_config, &$template_loaded 'scope' => 'global' ); + // This always needs to be present, if not it could happen that the template options do have an older version of this variable + $template_config[] = $conf_amount; + if (!isset($template_loaded_config['amount']) || empty($template_loaded_config['amount'])) { - $template_config[] = $conf_amount; $template_loaded_config['amount'] = $conf_amount['default']; } - + + // Check if we are currently inside the admin interface. + if ($serendipity['POST']['adminModule'] == 'templates' && $serendipity['POST']['adminAction'] == 'configure' && !empty($serendipity['POST']['template']['amount'])) { + $template_loaded_config['amount'] = (int)$serendipity['POST']['template']['amount']; + } + for ($i = 0; $i < $template_loaded_config['amount']; $i++) { $navlinks[] = array( 'title' => $template_loaded_config['navlink' . $i . 'text'],