dsfdsf
This commit is contained in:
@@ -359,15 +359,25 @@ function module_shell_header(string $module, array $options = []): string
|
||||
if (!is_array($tab)) {
|
||||
continue;
|
||||
}
|
||||
$label = trim((string) ($tab['label'] ?? ''));
|
||||
$href = trim((string) ($tab['href'] ?? ''));
|
||||
if ($label === '' || $href === '') {
|
||||
continue;
|
||||
}
|
||||
$isActive = !empty($tab['active']) || $href === $requestPath;
|
||||
$class = $isActive ? 'module-button module-button--tab-active' : 'module-button module-button--tab';
|
||||
$html .= '<a class="' . e($class) . '" href="' . e($href) . '">' . e($label) . '</a>';
|
||||
$label = trim((string) ($tab['label'] ?? ''));
|
||||
$href = trim((string) ($tab['href'] ?? ''));
|
||||
if ($label === '' || $href === '') {
|
||||
continue;
|
||||
}
|
||||
$matchPrefixes = is_array($tab['match_prefixes'] ?? null) ? $tab['match_prefixes'] : [];
|
||||
$isActive = !empty($tab['active']) || $href === $requestPath;
|
||||
if (!$isActive) {
|
||||
foreach ($matchPrefixes as $prefix) {
|
||||
$prefix = is_string($prefix) ? trim($prefix) : '';
|
||||
if ($prefix !== '' && str_starts_with($requestPath, $prefix)) {
|
||||
$isActive = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$class = $isActive ? 'module-button module-button--tab-active' : 'module-button module-button--tab';
|
||||
$html .= '<a class="' . e($class) . '" href="' . e($href) . '">' . e($label) . '</a>';
|
||||
}
|
||||
$html .= '</nav>';
|
||||
}
|
||||
if ($actions !== []) {
|
||||
|
||||
Reference in New Issue
Block a user