dynamic branding options (#1205)

This commit is contained in:
Kevin Papst
2019-10-30 14:22:34 +01:00
committed by GitHub
parent 48aefb1862
commit f4fcfeba9d
11 changed files with 135 additions and 7 deletions

View File

@@ -33,6 +33,10 @@ final class Configuration
* @var string
*/
private $type;
/**
* @var array
*/
private $options = [];
/**
* @var bool
*/
@@ -155,4 +159,16 @@ final class Configuration
return $this;
}
public function getOptions(): array
{
return $this->options;
}
public function setOptions(array $options): Configuration
{
$this->options = $options;
return $this;
}
}

View File

@@ -16,6 +16,7 @@ class SystemConfiguration
public const SECTION_FORM_USER = 'form_user';
public const SECTION_THEME = 'theme';
public const SECTION_CALENDAR = 'calendar';
public const SECTION_BRANDING = 'branding';
/**
* @var string

View File

@@ -54,13 +54,15 @@ class SystemConfigurationType extends AbstractType
$type = HiddenType::class;
}
$event->getForm()->add('value', $type, [
$options = [
'label' => 'label.' . ($preference->getLabel() ?? $preference->getName()),
'constraints' => $preference->getConstraints(),
'required' => $required,
'disabled' => !$preference->isEnabled(),
'translation_domain' => $preference->getTranslationDomain(),
]);
];
$event->getForm()->add('value', $type, array_merge($options, $preference->getOptions()));
}
);
$builder->add('name', HiddenType::class);