allow to include bundle configuration in system configuration screen (#1235)
This commit is contained in:
@@ -60,8 +60,6 @@ class AppExtension extends Extension
|
||||
$this->createThemeParameter($config['theme'], $container);
|
||||
$this->createUserParameter($config['user'], $container);
|
||||
|
||||
$container->setParameter('kimai.config', $config);
|
||||
|
||||
$container->setParameter('kimai.timesheet', $config['timesheet']);
|
||||
$container->setParameter('kimai.timesheet.rates', $config['timesheet']['rates']);
|
||||
$container->setParameter('kimai.timesheet.rounding', $config['timesheet']['rounding']);
|
||||
@@ -77,6 +75,22 @@ class AppExtension extends Extension
|
||||
$localTranslations[] = $config['industry']['translation'];
|
||||
}
|
||||
$container->setParameter('kimai.i18n_domains', $localTranslations);
|
||||
|
||||
// this should happen always at the end, so bundles do not mess with the base configuration
|
||||
if ($container->hasParameter('kimai.bundles.config')) {
|
||||
$bundleConfig = $container->getParameter('kimai.bundles.config');
|
||||
if (!is_array($bundleConfig)) {
|
||||
trigger_error('Invalid bundle configuration found, skipping all bundle configuration');
|
||||
}
|
||||
foreach ($bundleConfig as $key => $value) {
|
||||
if (array_key_exists($key, $config)) {
|
||||
trigger_error(sprintf('Invalid bundle configuration "%s" found, skipping', $key));
|
||||
continue;
|
||||
}
|
||||
$config[$key] = $value;
|
||||
}
|
||||
}
|
||||
$container->setParameter('kimai.config', $config);
|
||||
}
|
||||
|
||||
protected function setLdapParameter(array $config, ContainerBuilder $container)
|
||||
|
||||
Reference in New Issue
Block a user