Browse Source

Default icon group for Admin Service

In addition to check key 'icon' if does not exists (#2045), we can set a default value for the icon group.
Jérôme FIX 11 years ago
parent
commit
76a7f56436
1 changed files with 2 additions and 0 deletions
  1. 2 0
      DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php

+ 2 - 0
DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php

@@ -70,11 +70,13 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
 
                 $resolvedGroupName = isset($attributes['group']) ? $parameterBag->resolveValue($attributes['group']) : 'default';
                 $labelCatalogue = isset($attributes['label_catalogue']) ? $attributes['label_catalogue'] : 'SonataAdminBundle';
+                $icon = isset($attributes['icon']) ? $attributes['icon'] : '<i class="fa fa-folder"></i>';
 
                 if (!isset($groupDefaults[$resolvedGroupName])) {
                     $groupDefaults[$resolvedGroupName] = array(
                         'label'           => $resolvedGroupName,
                         'label_catalogue' => $labelCatalogue,
+                        'icon' => $icon,
                         'roles' => array()
                     );
                 }