|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file has been created by developers from BitBag. |
|
5
|
|
|
* Feel free to contact us once you face any issues or want to start |
|
6
|
|
|
* You can find more information about us on https://bitbag.io and write us |
|
7
|
|
|
* an email on [email protected]. |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
declare(strict_types=1); |
|
11
|
|
|
|
|
12
|
|
|
namespace BitBag\SyliusMolliePlugin\Form\Type; |
|
13
|
|
|
|
|
14
|
|
|
use BitBag\SyliusMolliePlugin\Form\Type\Translation\TemplateMollieEmailTranslationType; |
|
15
|
|
|
use BitBag\SyliusMolliePlugin\TemplateEmailTerms\Options; |
|
16
|
|
|
use Sylius\Bundle\ResourceBundle\Form\Type\ResourceTranslationsType; |
|
17
|
|
|
use Symfony\Component\Form\AbstractType; |
|
18
|
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
|
19
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType; |
|
20
|
|
|
use Symfony\Component\Form\FormBuilderInterface; |
|
21
|
|
|
|
|
22
|
|
|
final class TemplateMollieEmailType extends AbstractType |
|
23
|
|
|
{ |
|
24
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options): void |
|
25
|
|
|
{ |
|
26
|
|
|
$builder |
|
27
|
|
|
->add('type', ChoiceType::class, [ |
|
28
|
|
|
'label' => 'bitbag_sylius_mollie_plugin.ui.template_type', |
|
29
|
|
|
'choices' => Options::getAvailableEmailTemplate(), |
|
30
|
|
|
]) |
|
31
|
|
|
->add('styleCss', TextareaType::class, [ |
|
32
|
|
|
'label' => 'bitbag_sylius_mollie_plugin.ui.style_css', |
|
33
|
|
|
]) |
|
34
|
|
|
->add('translations', ResourceTranslationsType::class, [ |
|
35
|
|
|
'label' => 'bitbag_sylius_mollie_plugin.ui.template_contents', |
|
36
|
|
|
'entry_type' => TemplateMollieEmailTranslationType::class, |
|
37
|
|
|
]) |
|
38
|
|
|
; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function getBlockPrefix(): string |
|
42
|
|
|
{ |
|
43
|
|
|
return 'bitbag_sylius_mollie_plugin_template_mollie_email'; |
|
44
|
|
|
} |
|
45
|
|
|
} |
|
46
|
|
|
|