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 7, 2023
2 parents d3474cb + ab8ca63 commit 9d6f0b5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
27 changes: 27 additions & 0 deletions bundle/Debug/DataCollector/LayoutUrlGenerator.php
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]);
}
}
4 changes: 4 additions & 0 deletions bundle/DependencyInjection/NetgenLayoutsIbexaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public function load(array $configs, ContainerBuilder $container): void
if (array_key_exists('NetgenTagsBundle', $activatedBundles)) {
$loader->load('netgen_tags/services.yaml');
}

if (array_key_exists('NetgenLayoutsDebugBundle', $activatedBundles)) {
$loader->load('debug/services.yaml');
}
}

public function prepend(ContainerBuilder $container): void
Expand Down
7 changes: 7 additions & 0 deletions bundle/Resources/config/debug/services.yaml
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%"
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"require": {
"php": "^8.1",
"netgen/layouts-core": "~1.4.6",
"netgen/layouts-core": "~1.4.9",
"netgen/content-browser-ibexa": "^1.4",
"ibexa/core": "^4.4",
"ibexa/admin-ui": "^4.4",
Expand Down

0 comments on commit 9d6f0b5

Please sign in to comment.