Skip to content

Commit

Permalink
Fix XML support
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed Jul 8, 2013
1 parent e99449c commit 2bc4b0b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
13 changes: 12 additions & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ public function getConfigTreeBuilder()
$rootNode = $treeBuilder->root('sonata_admin', 'array');

$rootNode
->fixXmlConfig('dashboard_group')
->fixXmlConfig('option')
->fixXmlConfig('admin_service')
->fixXmlConfig('template')
->fixXmlConfig('extension')
->children()
->arrayNode('security')
->addDefaultsIfNotSet()
->fixXmlConfig('admin_permission')
->fixXmlConfig('object_permission')
->children()
->scalarNode('handler')->defaultValue('sonata.admin.security.handler.noop')->end()
->arrayNode('information')
Expand Down Expand Up @@ -74,6 +78,8 @@ public function getConfigTreeBuilder()
->end()
->arrayNode('dashboard')
->addDefaultsIfNotSet()
->fixXmlConfig('group')
->fixXmlConfig('block')
->children()
->arrayNode('groups')
->useAttributeAsKey('id')
Expand All @@ -95,6 +101,7 @@ public function getConfigTreeBuilder()
->arrayNode('blocks')
->defaultValue(array(array('position' => 'left', 'settings' => array(), 'type' => 'sonata.admin.block.admin_list')))
->prototype('array')
->fixXmlConfig('setting')
->children()
->scalarNode('type')->cannotBeEmpty()->end()
->arrayNode('settings')
Expand Down Expand Up @@ -155,6 +162,10 @@ public function getConfigTreeBuilder()
->useAttributeAsKey('id')
->defaultValue(array('admins' => array(), 'excludes' => array(), 'implements' => array(), 'extends' => array(), 'instanceof' => array()))
->prototype('array')
->fixXmlConfig('admin')
->fixXmlConfig('exclude')
->fixXmlConfig('implement')
->fixXmlConfig('extend')
->children()
->arrayNode('admins')
->prototype('scalar')->end()
Expand Down
8 changes: 8 additions & 0 deletions DependencyInjection/SonataAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,12 @@ public function configureClassesToCompile()
"Sonata\\AdminBundle\\Validator\\InlineValidator",
));
}

/**
* {@inheritDoc}
*/
public function getNamespace()
{
return 'http://sonata-project.org/schema/dic/admin';
}
}

0 comments on commit 2bc4b0b

Please sign in to comment.