瀏覽代碼

Tweak main catalogue

Thomas Rabaix 13 年之前
父節點
當前提交
726b00b708

+ 7 - 1
DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php

@@ -64,10 +64,12 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
                 }
 
                 $groupName = isset($attributes['group']) ? $attributes['group'] : 'default';
+                $labelCatalogue = isset($attributes['label_catalogue']) ? $attributes['label_catalogue'] : 'SonataAdminBundle';
 
                 if (!isset($groupDefaults[$groupName])) {
                     $groupDefaults[$groupName] = array(
-                        'label' => $groupName
+                        'label'           => $groupName,
+                        'label_catalogue' => $labelCatalogue
                     );
                 }
 
@@ -95,6 +97,10 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
                     $groups[$groupName]['label'] = $groupDefaults[$groupName]['label'];
                 }
 
+                if (empty($group['label_catalogue'])) {
+                    $groups[$groupName]['label_catalogue'] = 'SonataAdminBundle';
+                }
+
                 if (!empty($group['item_adds'])) {
                     $group['items'] = array_merge($groupDefaults[$groupName]['items'], $group['item_adds']);
                 }

+ 1 - 1
Resources/views/standard_layout.html.twig

@@ -87,7 +87,7 @@ file that was distributed with this source code.
                                 <ul class="nav">
                                     {% for group in admin_pool.dashboardgroups %}
                                         <li class="dropdown">
-                                            <a href="#" class="dropdown-toggle">{{ group.label|trans({}, 'SonataAdminBundle') }}</a>
+                                            <a href="#" class="dropdown-toggle">{{ group.label|trans({}, group.label_catalogue) }}</a>
                                             <ul class="dropdown-menu">
                                                 {% for admin in group.items %}
                                                     {% if admin.hasroute('create') and admin.isGranted('CREATE') or admin.hasroute('list') and admin.isGranted('LIST') %}