-
Notifications
You must be signed in to change notification settings - Fork 13
/
Configuration.php
63 lines (57 loc) · 2.81 KB
/
Configuration.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
namespace Emmedy\H5PBundle\DependencyInjection;
use RuntimeException;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\NodeInterface;
class Configuration implements ConfigurationInterface
{
/**
* version of Symfony H5P bundle
* @return string
*/
const H5P_VERSION = '3.0.0';
/**
* Generates the configuration tree.
* @return TreeBuilder
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('emmedy_h5_p');
$rootNode = $treeBuilder->getRootNode();
if (!method_exists($rootNode, 'children')) {
throw new RuntimeException(
'Your Symfony version does not support the children() method to define the root node in' .
' the H5P bundle configuration.'
);
}
$rootNode
->children()
->scalarNode('storage_dir')->defaultValue("h5p")->end()
->scalarNode('web_dir')->defaultValue("public")->end()
->booleanNode('hub_is_enabled')->defaultTrue()->end()
->booleanNode('send_usage_statistics')->defaultTrue()->end()
->booleanNode('save_content_state')->defaultFalse()->end()
->integerNode('save_content_frequency')->defaultValue(30)->end()
->scalarNode('whitelist')->defaultValue(\H5PCore::$defaultContentWhitelist)->end()
->scalarNode('library_whitelist_extras')->defaultValue(\H5PCore::$defaultLibraryWhitelistExtras)->end()
->booleanNode('dev_mode')->defaultFalse()->end()
->booleanNode('first_runnable_saved')->defaultFalse()->end()
->scalarNode('site_type')->defaultValue('local')->end()
->scalarNode('site_uuid')->defaultValue('')->end()
->booleanNode('send_usage_statistics')->defaultTrue()->end()
->booleanNode(\H5PCore::DISPLAY_OPTION_ABOUT)->defaultTrue()->end()
->booleanNode(\H5PCore::DISPLAY_OPTION_FRAME)->defaultTrue()->end()
->integerNode(\H5PCore::DISPLAY_OPTION_DOWNLOAD)
->defaultValue(\H5PDisplayOptionBehaviour::NEVER_SHOW)
->end()
->integerNode(\H5PCore::DISPLAY_OPTION_EMBED)->defaultValue(\H5PDisplayOptionBehaviour::NEVER_SHOW)->end()
->booleanNode(\H5PCore::DISPLAY_OPTION_COPY)->defaultValue(\H5PDisplayOptionBehaviour::NEVER_SHOW)->end()
->booleanNode(\H5PCore::DISPLAY_OPTION_COPYRIGHT)->defaultTrue()->end()
->integerNode('content_type_cache_updated_at')->defaultValue(0)->end()
->booleanNode('enable_lrs_content_types')->defaultFalse()->end()
->booleanNode('use_permission')->defaultFalse()->end()
->end();
return $treeBuilder;
}
}