Allow to specify which label profiles are shown in dropdown.

This commit is contained in:
Jan Böhmer 2020-05-02 19:47:31 +02:00
parent 3804e2534d
commit 8b372a3443
8 changed files with 64 additions and 80 deletions

View file

@ -24,6 +24,7 @@ namespace App\Form\AdminPages;
use App\Entity\Base\AbstractNamedDBElement;
use App\Entity\LabelSystem\LabelProfile;
use App\Form\LabelOptionsType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@ -31,6 +32,14 @@ class LabelProfileAdminForm extends BaseEntityAdminForm
{
protected function additionalFormElements(FormBuilderInterface $builder, array $options, AbstractNamedDBElement $entity): void
{
$builder->add('show_in_dropdown', CheckboxType::class, [
'required' => false,
'label' => 'label_profile.showInDropdown',
'label_attr' => [
'class' => 'checkbox-custom',
],
]);
$builder->add('options', LabelOptionsType::class);
}