From 7d7a1aadeec55033f19488da61ab301098e18e6d Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Wed, 28 Sep 2011 10:29:15 +0000 Subject: [PATCH] nav amount fix --- include/functions_config.inc.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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'],