diff --git a/bundle/Debug/DataCollector/LayoutUrlGenerator.php b/bundle/Debug/DataCollector/LayoutUrlGenerator.php index d0a819c1..bc4ddafe 100644 --- a/bundle/Debug/DataCollector/LayoutUrlGenerator.php +++ b/bundle/Debug/DataCollector/LayoutUrlGenerator.php @@ -15,11 +15,13 @@ final class LayoutUrlGenerator implements LayoutUrlGeneratorInterface public function __construct( private LayoutUrlGeneratorInterface $innerGenerator, private array $siteAccessGroups, + private string $siteAccessGroupName, + private string $defaultSiteAccessName, ) {} public function generateLayoutUrl(UuidInterface $layoutId, array $parameters = []): string { - $adminSiteAccess = $this->siteAccessGroups['admin_group'][0] ?? 'admin'; + $adminSiteAccess = $this->siteAccessGroups[$this->siteAccessGroupName][0] ?? $this->defaultSiteAccessName; return $this->innerGenerator->generateLayoutUrl($layoutId, ['siteaccess' => $adminSiteAccess]); } diff --git a/bundle/Resources/config/debug/services.yaml b/bundle/Resources/config/debug/services.yaml index 54a507cb..92d95392 100644 --- a/bundle/Resources/config/debug/services.yaml +++ b/bundle/Resources/config/debug/services.yaml @@ -1,3 +1,7 @@ +parameters: + netgen_layouts.ibexa.data_collector.site_access_group_name: 'admin_group' + netgen_layouts.ibexa.data_collector.default_site_access_name: 'admin' + services: netgen_layouts.ibexa.debug.data_collector.layout_url_generator: class: Netgen\Bundle\LayoutsIbexaBundle\Debug\DataCollector\LayoutUrlGenerator @@ -5,3 +9,5 @@ services: arguments: - "@.inner" - "%ibexa.site_access.groups%" + - "%netgen_layouts.ibexa.data_collector.site_access_group_name%" + - "%netgen_layouts.ibexa.data_collector.default_site_access_name%"