dynamic branding options (#1205)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user