- public function buildForm(FormBuilderInterface $builder, array $options) {
- return $builder
- ->add('calendar', TextType::class, ['label' => 'Calendar id', 'attr' => ['placeholder' => 'Your calendar id'], 'constraints' => [new NotBlank(['message' => 'Please provide your calendar id'])]])
- //TODO: validate prefix against [a-v0-9]{5,}
- //XXX: see https://developers.google.com/calendar/api/v3/reference/events/insert#id
- ->add('prefix', TextType::class, ['label' => 'Prefix', 'attr' => ['placeholder' => 'Your prefix'], 'constraints' => [new NotBlank(['message' => 'Please provide your prefix'])]])
- ->add('project', TextType::class, ['label' => 'Project id', 'attr' => ['placeholder' => 'Your project id'], 'required' => false])
- ->add('client', TextType::class, ['label' => 'Client id', 'attr' => ['placeholder' => 'Your client id'], 'required' => false])
- ->add('secret', TextType::class, ['label' => 'Client secret', 'attr' => ['placeholder' => 'Your client secret'], 'required' => false])
- ->add('submit', SubmitType::class, ['label' => 'Send', 'attr' => ['class' => 'submit']]);
+ public function buildForm(FormBuilderInterface $builder, array $options): void {
+ //Build form
+ $builder
+ ->add('calendar', ChoiceType::class, ['attr' => ['placeholder' => 'Your calendar'], 'choice_translation_domain' => false, 'expanded' => true, 'multiple' => true, 'choices' => $options['calendar_choices']/*, 'data' => $options['calendar_default']*/, 'choice_attr' => ['class' => 'row']])
+ ->add('submit', SubmitType::class, ['label' => 'Send', 'attr' => ['class' => 'submit']])
+ ->add('refresh', SubmitType::class, ['label' => 'Refresh', 'attr' => ['class' => 'submit']])
+ ->add('add', SubmitType::class, ['label' => 'Add', 'attr' => ['class' => 'submit']])
+ ->add('delete', SubmitType::class, ['label' => 'Delete', 'attr' => ['class' => 'submit']])
+ ->add('unlink', SubmitType::class, ['label' => 'Unlink', 'attr' => ['class' => 'submit']]);