element('Settings/fieldGroup', [ 'panelName' => $panelName, 'panelSettings' => $panelSettings, 'settingName' => $panelName, 'setting' => $panelSettings, ]); $panelHTML = "
{$singleSetting}
"; } else { $panelID = getResolvableID($sectionName, $panelName); $panelHTML .= sprintf('

%s%s

', $panelID, $panelID, !empty($panelSettings['_icon']) ? $this->Bootstrap->icon($panelSettings['_icon'], ['class' => 'me-1']) : '', h($panelName) ); if (!empty($panelSettings['_description'])) { $panelHTML .= $this->Bootstrap->node('div', [ 'class' => ['mb-1',], ], h($panelSettings['_description'])); } $groupIssueSeverity = false; foreach ($panelSettings as $singleSettingName => $singleSetting) { if (substr($singleSettingName, 0, 1) == '_') { continue; } $singleSettingHTML = $this->element('Settings/fieldGroup', [ 'panelName' => $panelName, 'panelSettings' => $panelSettings, 'settingName' => $singleSettingName, 'setting' => $singleSetting, ]); $panelHTML .= sprintf('
%s
', $singleSettingHTML); if (!empty($singleSetting['error'])) { $settingVariant = $this->get('variantFromSeverity')[$singleSetting['severity']]; if ($groupIssueSeverity != 'danger') { if ($groupIssueSeverity != 'warning') { $groupIssueSeverity = $settingVariant; } } } } $panelHTML = $this->Bootstrap->node('div', [ 'class' => [ 'shadow', 'p-2', 'mb-4', 'rounded', 'settings-group', 'callout', (!empty($groupIssueSeverity) ? "callout-${groupIssueSeverity}" : ''), ], ], $panelHTML); } echo $panelHTML;