diff --git a/templates/Instance/settings.php b/templates/Instance/settings.php
index 1df0f1e..fb7c46b 100644
--- a/templates/Instance/settings.php
+++ b/templates/Instance/settings.php
@@ -92,7 +92,6 @@ function genSection($sectionName, $subSectionSettings, $appView)
{
$sectionContent = [];
$sectionContent[] = '
';
- $sectionContent[] = sprintf('
%s
', getResolvableID($sectionName), h($sectionName));
if (isLeaf($subSectionSettings)) {
$panelHTML = $appView->element('Settings/panel', [
'sectionName' => $sectionName,
@@ -101,6 +100,9 @@ function genSection($sectionName, $subSectionSettings, $appView)
]);
$sectionContent[] = $panelHTML;
} else {
+ if (count($subSectionSettings) > 1) {
+ $sectionContent[] = sprintf('%s
', getResolvableID($sectionName), h($sectionName));
+ }
foreach ($subSectionSettings as $panelName => $panelSettings) {
if (!empty($panelSettings)) {
$panelHTML = $appView->element('Settings/panel', [
@@ -125,9 +127,9 @@ function isLeaf($setting)
function getResolvableID($sectionName, $panelName=false)
{
- $id = sprintf('sp-%s', h($sectionName));
+ $id = sprintf('sp-%s', preg_replace('/(\.|\W)/', '_', h($sectionName)));
if (!empty($panelName)) {
- $id .= '-' . preg_replace('/(\.|\s)/', '_', h($panelName));
+ $id .= '-' . preg_replace('/(\.|\W)/', '_', h($panelName));
}
return $id;
}