Skip to content

Commit

Permalink
Merge branch 'feature/adjustConfig' into 'main'
Browse files Browse the repository at this point in the history
adjust config

See merge request trilobit/trilobit-gmbh/bundles/contao-constants-bundle!10
  • Loading branch information
trilobit-gmbh committed Apr 11, 2024
2 parents da86b30 + a87f0fd commit b1b4c95
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public function getConfigTreeBuilder(): TreeBuilder

$rootNode
->children()
->arrayNode('constants')
->info('constants vars')
->children()
->booleanNode('allow_html')
->defaultValue(false)
->end()
->end()
->end()
->booleanNode('allow_html')
->defaultValue(false)
->end()
Expand Down
10 changes: 10 additions & 0 deletions src/EventListener/DataContainer/ConstantsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ public function modifyDca(DataContainer $dc)
$dca = &$GLOBALS['TL_DCA']['tl_constants'];
$bundleConfig = System::getContainer()->getParameter('trilobit_constants');

if (!isset($bundleConfig['constants'])) {
$bundleConfig['constants'] = [];

if (isset($bundleConfig['allow_html'])) {
$bundleConfig['constants']['allow_html'] = $bundleConfig['allow_html'];
}
}

$bundleConfig = $bundleConfig['constants'];

if ($constant->useWysiwygEditor) {
$dca['fields']['value']['eval']['rte'] = 'tinyMCE';
}
Expand Down

0 comments on commit b1b4c95

Please sign in to comment.