<?php
namespace Sogec\BOBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* Class Configuration.
*/
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('crud_generic');
$rootNode
->children()
->scalarNode('date_format')
->defaultValue('Y-m-d')
->end()
->scalarNode('datetime_format')
->defaultValue('Y-m-d H:i:s')
->end()
->arrayNode('entities')
->normalizeKeys(false)
->useAttributeAsKey('name', false)
->defaultValue(array())
->info('The list of entities to manage in the administration zone.')
->prototype('variable')
->end()
->end()
;
$rootNode
->children()
->arrayNode('list')
->addDefaultsIfNotSet()
->children()
->scalarNode('title')
->info('The visible page title displayed in the list view.')
->end()
->arrayNode('actions')
->prototype('variable')->end()
->info('The list of actions enabled in the "list" view.')
->end()
->integerNode('max_results')
->defaultValue(15)
->info('The maximum number of items to show on listing and search pages.')
->end()
->end()
->end()
->arrayNode('edit')
->addDefaultsIfNotSet()
->children()
->scalarNode('title')
->info('The visible page title displayed in the edit view.')
->end()
->arrayNode('actions')
->prototype('variable')->end()
->info('The list of actions enabled in the "edit" view.')
->end()
->end()
->end()
->arrayNode('new')
->addDefaultsIfNotSet()
->children()
->scalarNode('title')
->info('The visible page title displayed in the new view.')
->end()
->arrayNode('actions')
->prototype('variable')->end()
->info('The list of actions enabled in the "new" view.')
->end()
->end()
->end()
->arrayNode('show')
->addDefaultsIfNotSet()
->children()
->scalarNode('title')
->info('The visible page title displayed in the show view.')
->end()
->arrayNode('actions')
->prototype('variable')->end()
->info('The list of actions enabled in the "show" view.')
->end()
->integerNode('max_results')
->defaultValue(10)
->info('The maximum number of items displayed for related fields in the show page and for autocomplete fields in the new/edit pages.')
->end()
->end()
->end()
->end()
;
return $treeBuilder;
}
}