nav amount fix

This commit is contained in:
Garvin Hicking 2011-09-28 10:29:15 +00:00
parent ebaa8afe04
commit 7d7a1aadee

View File

@ -2132,11 +2132,18 @@ function serendipity_loadGlobalThemeOptions(&$template_config, &$template_loaded
'scope' => 'global' 'scope' => 'global'
); );
if (!isset($template_loaded_config['amount']) || empty($template_loaded_config['amount'])) { // 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; $template_config[] = $conf_amount;
if (!isset($template_loaded_config['amount']) || empty($template_loaded_config['amount'])) {
$template_loaded_config['amount'] = $conf_amount['default']; $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++) { for ($i = 0; $i < $template_loaded_config['amount']; $i++) {
$navlinks[] = array( $navlinks[] = array(
'title' => $template_loaded_config['navlink' . $i . 'text'], 'title' => $template_loaded_config['navlink' . $i . 'text'],