Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Dec 8, 2023
2 parents 7f3c83a + accb3d9 commit 9188832
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bundle/Debug/DataCollector/LayoutUrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down
6 changes: 6 additions & 0 deletions bundle/Resources/config/debug/services.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
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
decorates: netgen_layouts.debug.data_collector.layout_url_generator
arguments:
- "@.inner"
- "%ibexa.site_access.groups%"
- "%netgen_layouts.ibexa.data_collector.site_access_group_name%"
- "%netgen_layouts.ibexa.data_collector.default_site_access_name%"

0 comments on commit 9188832

Please sign in to comment.