Procházet zdrojové kódy

add functionalities : extend dashboard & modify admin dependency injection in the config.yml

Charley Maillot před 13 roky
rodič
revize
f7853f0cdf

+ 3 - 5
DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php

@@ -164,11 +164,9 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
 
 
         if (isset($service['label'])) {
         if (isset($service['label'])) {
             $label = $service['label'];
             $label = $service['label'];
-        }
-        elseif (isset($attributes[0]['label'])) {
+        } elseif (isset($attributes[0]['label'])) {
             $label = $attributes[0]['label'];
             $label = $attributes[0]['label'];
-        }
-        else {
+        } else {
             $label = '-';
             $label = '-';
         }
         }
         $definition->addMethodCall('setLabel', array($label));
         $definition->addMethodCall('setLabel', array($label));
@@ -186,6 +184,6 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
      */
      */
     protected function camelize($property)
     protected function camelize($property)
     {
     {
-       return preg_replace(array('/(^|_)+(.)/e', '/\.(.)/e'), array("strtoupper('\\2')", "'_'.strtoupper('\\1')"), $property);
+         return preg_replace(array('/(^|_)+(.)/e', '/\.(.)/e'), array("strtoupper('\\2')", "'_'.strtoupper('\\1')"), $property);
     }
     }
 }
 }

+ 1 - 1
DependencyInjection/Configuration.php

@@ -59,7 +59,7 @@ class Configuration implements ConfigurationInterface
                 ->end()
                 ->end()
 
 
                 ->arrayNode('admin_services')
                 ->arrayNode('admin_services')
-                    ->useAttributeAsKey('__')
+                    ->useAttributeAsKey('id')
                     ->prototype('array')
                     ->prototype('array')
                         ->children()
                         ->children()
                             ->scalarNode('id')->end()
                             ->scalarNode('id')->end()

+ 1 - 1
DependencyInjection/SonataAdminExtension.php

@@ -83,7 +83,7 @@ class SonataAdminExtension extends Extension
             }
             }
 
 
             foreach ($config[$ns] as $type => $template) {
             foreach ($config[$ns] as $type => $template) {
-                if (!isset($configs[$ns][$type])) {
+                if (!isset($config[$ns][$type])) {
                     continue;
                     continue;
                 }
                 }