forked from ezsystems/repository-forms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EzSystemsRepositoryFormsBundle.php
43 lines (39 loc) · 2.25 KB
/
EzSystemsRepositoryFormsBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* This file is part of the eZ RepositoryForms package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace EzSystems\RepositoryFormsBundle;
use EzSystems\RepositoryForms\Security\UserRegisterPolicyProvider;
use EzSystems\RepositoryFormsBundle\DependencyInjection\Compiler\FieldTypeFormMapperDispatcherPass;
use EzSystems\RepositoryFormsBundle\DependencyInjection\Compiler\LimitationFormMapperPass;
use EzSystems\RepositoryFormsBundle\DependencyInjection\Compiler\LimitationValueMapperPass;
use EzSystems\RepositoryFormsBundle\DependencyInjection\Compiler\ViewBuilderRegistryPass;
use EzSystems\RepositoryFormsBundle\DependencyInjection\Configuration\Parser\ContentEdit;
use EzSystems\RepositoryFormsBundle\DependencyInjection\Configuration\Parser\ContentEditView;
use EzSystems\RepositoryFormsBundle\DependencyInjection\Configuration\Parser\LimitationValueTemplates;
use EzSystems\RepositoryFormsBundle\DependencyInjection\Configuration\Parser\UserEdit;
use EzSystems\RepositoryFormsBundle\DependencyInjection\Configuration\Parser\UserRegistration;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class EzSystemsRepositoryFormsBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new FieldTypeFormMapperDispatcherPass());
$container->addCompilerPass(new LimitationFormMapperPass());
$container->addCompilerPass(new LimitationValueMapperPass());
$container->addCompilerPass(new ViewBuilderRegistryPass());
$eZExtension = $container->getExtension('ezpublish');
$eZExtension->addPolicyProvider(new UserRegisterPolicyProvider());
$eZExtension->addConfigParser(new UserRegistration());
$eZExtension->addConfigParser(new ContentEdit());
$eZExtension->addConfigParser(new UserEdit());
$eZExtension->addConfigParser(new LimitationValueTemplates());
$eZExtension->addConfigParser(new ContentEditView());
$eZExtension->addDefaultSettings(__DIR__ . '/Resources/config', ['ezpublish_default_settings.yml']);
}
}