diff --git a/backend/config/products-config.php b/backend/config/products-config.php index 34e96f9..5528db9 100644 --- a/backend/config/products-config.php +++ b/backend/config/products-config.php @@ -443,10 +443,43 @@ $PRODUCTS['webhosting'] = [ ], ]; +// Sichtbarkeit in Navigation, Footer und auf der Startseite (Seiten bleiben per URL erreichbar) +$PRODUCT_VISIBILITY = [ + 'vpc' => false, + 'vps' => false, + 'mail-gateway' => false, + 'webhosting' => true, +]; + // ============================================================================ // HILFSFUNKTIONEN // ============================================================================ +/** + * Prüft, ob eine Produktkategorie in der Navigation angezeigt wird + */ +function isProductVisible(string $productId): bool { + global $PRODUCT_VISIBILITY; + return $PRODUCT_VISIBILITY[$productId] ?? true; +} + +/** + * HTML hidden-Attribut für ausgeblendete Produktkategorien + */ +function productHiddenAttr(string $productId): string { + return isProductVisible($productId) ? '' : ' hidden'; +} + +/** + * Aktive Navigationsseiten für sichtbare Produktkategorien + * + * @return string[] + */ +function getVisibleProductPageIds(): array { + global $PRODUCT_VISIBILITY; + return array_keys(array_filter($PRODUCT_VISIBILITY, static fn(bool $visible): bool => $visible)); +} + /** * Alle Produkte abrufen */ diff --git a/backend/includes/footer.php b/backend/includes/footer.php index 03118f4..6e85e76 100644 --- a/backend/includes/footer.php +++ b/backend/includes/footer.php @@ -15,10 +15,10 @@