forked from netgen-layouts/layouts-ibexa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
4 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Netgen\Bundle\LayoutsIbexaBundle\Debug\DataCollector; | ||
|
||
use Netgen\Bundle\LayoutsDebugBundle\DataCollector\LayoutUrlGeneratorInterface; | ||
use Ramsey\Uuid\UuidInterface; | ||
|
||
final class LayoutUrlGenerator implements LayoutUrlGeneratorInterface | ||
{ | ||
/** | ||
* @param array<string, string[]> $siteAccessGroups | ||
*/ | ||
public function __construct( | ||
private LayoutUrlGeneratorInterface $innerGenerator, | ||
private array $siteAccessGroups, | ||
) { | ||
} | ||
|
||
public function generateLayoutUrl(UuidInterface $layoutId, array $parameters = []): string | ||
{ | ||
$adminSiteAccess = $this->siteAccessGroups['admin_group'][0] ?? 'admin'; | ||
|
||
return $this->innerGenerator->generateLayoutUrl($layoutId, ['siteaccess' => $adminSiteAccess]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
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%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters