|
@@ -31,6 +31,7 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
|
|
|
*/
|
|
|
public function process(ContainerBuilder $container)
|
|
|
{
|
|
|
+ $parameterBag = $container->getParameterBag();
|
|
|
$groupDefaults = $admins = $classes = array();
|
|
|
|
|
|
$pool = $container->getDefinition('sonata.admin.pool');
|
|
@@ -62,18 +63,18 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- $groupName = isset($attributes['group']) ? $attributes['group'] : 'default';
|
|
|
+ $resolvedGroupName = isset($attributes['group']) ? $parameterBag->resolveValue($attributes['group']) : 'default';
|
|
|
$labelCatalogue = isset($attributes['label_catalogue']) ? $attributes['label_catalogue'] : 'SonataAdminBundle';
|
|
|
|
|
|
- if (!isset($groupDefaults[$groupName])) {
|
|
|
- $groupDefaults[$groupName] = array(
|
|
|
- 'label' => $groupName,
|
|
|
+ if (!isset($groupDefaults[$resolvedGroupName])) {
|
|
|
+ $groupDefaults[$resolvedGroupName] = array(
|
|
|
+ 'label' => $resolvedGroupName,
|
|
|
'label_catalogue' => $labelCatalogue,
|
|
|
'roles' => array()
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- $groupDefaults[$groupName]['items'][] = $id;
|
|
|
+ $groupDefaults[$resolvedGroupName]['items'][] = $id;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -82,32 +83,33 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
|
|
|
$groups = $dashboardGroupsSettings;
|
|
|
|
|
|
foreach ($dashboardGroupsSettings as $groupName => $group) {
|
|
|
- if (!isset($groupDefaults[$groupName])) {
|
|
|
- $groupDefaults[$groupName] = array(
|
|
|
+ $resolvedGroupName = $parameterBag->resolveValue($groupName);
|
|
|
+ if (!isset($groupDefaults[$resolvedGroupName])) {
|
|
|
+ $groupDefaults[$resolvedGroupName] = array(
|
|
|
'items' => array(),
|
|
|
- 'label' => $groupName,
|
|
|
+ 'label' => $resolvedGroupName,
|
|
|
'roles' => array()
|
|
|
);
|
|
|
}
|
|
|
|
|
|
if (empty($group['items'])) {
|
|
|
- $groups[$groupName]['items'] = $groupDefaults[$groupName]['items'];
|
|
|
+ $groups[$resolvedGroupName]['items'] = $groupDefaults[$resolvedGroupName]['items'];
|
|
|
}
|
|
|
|
|
|
if (empty($group['label'])) {
|
|
|
- $groups[$groupName]['label'] = $groupDefaults[$groupName]['label'];
|
|
|
+ $groups[$resolvedGroupName]['label'] = $groupDefaults[$resolvedGroupName]['label'];
|
|
|
}
|
|
|
|
|
|
if (empty($group['label_catalogue'])) {
|
|
|
- $groups[$groupName]['label_catalogue'] = 'SonataAdminBundle';
|
|
|
+ $groups[$resolvedGroupName]['label_catalogue'] = 'SonataAdminBundle';
|
|
|
}
|
|
|
|
|
|
if (!empty($group['item_adds'])) {
|
|
|
- $groups[$groupName]['items'] = array_merge($groups[$groupName]['items'], $group['item_adds']);
|
|
|
+ $groups[$resolvedGroupName]['items'] = array_merge($groups[$resolvedGroupName]['items'], $group['item_adds']);
|
|
|
}
|
|
|
|
|
|
if (empty($group['roles'])) {
|
|
|
- $groups[$groupName]['roles'] = $groupDefaults[$groupName]['roles'];
|
|
|
+ $groups[$resolvedGroupName]['roles'] = $groupDefaults[$resolvedGroupName]['roles'];
|
|
|
}
|
|
|
}
|
|
|
} else {
|