1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the Zikula package. |
7
|
|
|
* |
8
|
|
|
* Copyright Zikula - https://ziku.la/ |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Zikula\LegalBundle\DependencyInjection; |
15
|
|
|
|
16
|
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
17
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface; |
18
|
|
|
|
19
|
|
|
class Configuration implements ConfigurationInterface |
20
|
|
|
{ |
21
|
|
|
public function getConfigTreeBuilder(): TreeBuilder |
22
|
|
|
{ |
23
|
|
|
$treeBuilder = new TreeBuilder('zikula_legal'); |
24
|
|
|
|
25
|
|
|
$treeBuilder->getRootNode() |
26
|
|
|
->fixXmlConfig('policy') |
|
|
|
|
27
|
|
|
->children() |
28
|
|
|
->arrayNode('policies') |
29
|
|
|
->info('Configure the available policies.') |
30
|
|
|
->addDefaultsIfNotSet() |
31
|
|
|
->children() |
32
|
|
|
->arrayNode('legal_notice') |
33
|
|
|
->info('Legal notice.') |
34
|
|
|
->canBeDisabled() |
35
|
|
|
->children() |
36
|
|
|
->scalarNode('custom_url') |
37
|
|
|
->defaultNull() |
38
|
|
|
->end() |
39
|
|
|
->end() |
|
|
|
|
40
|
|
|
->end() |
41
|
|
|
->arrayNode('privacy_policy') |
42
|
|
|
->info('Privacy policy.') |
43
|
|
|
->canBeDisabled() |
44
|
|
|
->children() |
45
|
|
|
->scalarNode('custom_url') |
46
|
|
|
->defaultNull() |
47
|
|
|
->end() |
48
|
|
|
->end() |
49
|
|
|
->end() |
50
|
|
|
->arrayNode('terms_of_use') |
51
|
|
|
->info('Terms of use.') |
52
|
|
|
->canBeEnabled() |
53
|
|
|
->children() |
54
|
|
|
->scalarNode('custom_url') |
55
|
|
|
->defaultNull() |
56
|
|
|
->end() |
57
|
|
|
->end() |
58
|
|
|
->end() |
59
|
|
|
->arrayNode('trade_conditions') |
60
|
|
|
->info('General terms and conditions of trade.') |
61
|
|
|
->canBeEnabled() |
62
|
|
|
->children() |
63
|
|
|
->scalarNode('custom_url') |
64
|
|
|
->defaultNull() |
65
|
|
|
->end() |
66
|
|
|
->end() |
67
|
|
|
->end() |
68
|
|
|
->arrayNode('cancellation_right_policy') |
69
|
|
|
->info('Cancellation right policy.') |
70
|
|
|
->canBeEnabled() |
71
|
|
|
->children() |
72
|
|
|
->scalarNode('custom_url') |
73
|
|
|
->defaultNull() |
74
|
|
|
->end() |
75
|
|
|
->end() |
76
|
|
|
->end() |
77
|
|
|
->arrayNode('accessibility') |
78
|
|
|
->info('Accessibility statement.') |
79
|
|
|
->canBeEnabled() |
80
|
|
|
->children() |
81
|
|
|
->scalarNode('custom_url') |
82
|
|
|
->defaultNull() |
83
|
|
|
->end() |
84
|
|
|
->end() |
85
|
|
|
->end() |
86
|
|
|
->end() |
87
|
|
|
->end() |
88
|
|
|
->integerNode('minimum_age') |
89
|
|
|
->info('Minimum age permitted to register (0 disables the age check).') |
90
|
|
|
->defaultValue(13) |
91
|
|
|
->min(0) |
92
|
|
|
->max(99) |
93
|
|
|
->end() |
94
|
|
|
->end() |
95
|
|
|
; |
96
|
|
|
|
97
|
|
|
return $treeBuilder; |
98
|
|
|
} |
99
|
|
|
} |
100
|
|
|
|