|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file was created by developers working at BitBag |
|
5
|
|
|
* Do you need more information about us and what we do? Visit our https://bitbag.io website! |
|
6
|
|
|
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
declare(strict_types=1); |
|
10
|
|
|
|
|
11
|
|
|
namespace BitBag\SyliusCmsPlugin\Form\Type\Translation; |
|
12
|
|
|
|
|
13
|
|
|
use BitBag\SyliusCmsPlugin\Entity\MediaInterface; |
|
14
|
|
|
use BitBag\SyliusCmsPlugin\Form\Type\MediaAutocompleteChoiceType; |
|
15
|
|
|
use BitBag\SyliusCmsPlugin\Form\Type\WysiwygType; |
|
16
|
|
|
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType; |
|
17
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType; |
|
18
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType; |
|
19
|
|
|
use Symfony\Component\Form\FormBuilderInterface; |
|
20
|
|
|
|
|
21
|
|
|
final class PageTranslationType extends AbstractResourceType |
|
22
|
|
|
{ |
|
23
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options): void |
|
24
|
|
|
{ |
|
25
|
|
|
$builder |
|
26
|
|
|
->add('name', TextType::class, [ |
|
27
|
|
|
'label' => 'bitbag_sylius_cms_plugin.ui.name', |
|
28
|
|
|
]) |
|
29
|
|
|
->add('slug', TextType::class, [ |
|
30
|
|
|
'label' => 'bitbag_sylius_cms_plugin.ui.slug', |
|
31
|
|
|
]) |
|
32
|
|
|
->add('breadcrumb', TextType::class, [ |
|
33
|
|
|
'label' => 'bitbag_sylius_cms_plugin.ui.breadcrumb', |
|
34
|
|
|
'required' => false, |
|
35
|
|
|
]) |
|
36
|
|
|
->add('nameWhenLinked', TextType::class, [ |
|
37
|
|
|
'label' => 'bitbag_sylius_cms_plugin.ui.name_when_linked', |
|
38
|
|
|
'required' => false, |
|
39
|
|
|
]) |
|
40
|
|
|
->add('descriptionWhenLinked', TextareaType::class, [ |
|
41
|
|
|
'label' => 'bitbag_sylius_cms_plugin.ui.description_when_linked', |
|
42
|
|
|
'required' => false, |
|
43
|
|
|
]) |
|
44
|
|
|
->add('image', MediaAutocompleteChoiceType::class, [ |
|
45
|
|
|
'label' => 'bitbag_sylius_cms_plugin.ui.image', |
|
46
|
|
|
'required' => false, |
|
47
|
|
|
'media_type' => MediaInterface::IMAGE_TYPE, |
|
48
|
|
|
]) |
|
49
|
|
|
->add('metaKeywords', TextareaType::class, [ |
|
50
|
|
|
'label' => 'bitbag_sylius_cms_plugin.ui.meta_keywords', |
|
51
|
|
|
'required' => false, |
|
52
|
|
|
]) |
|
53
|
|
|
->add('metaDescription', TextareaType::class, [ |
|
54
|
|
|
'label' => 'bitbag_sylius_cms_plugin.ui.meta_description', |
|
55
|
|
|
'required' => false, |
|
56
|
|
|
]) |
|
57
|
|
|
->add('content', WysiwygType::class) |
|
58
|
|
|
->add('title', TextType::class, [ |
|
59
|
|
|
'label' => 'bitbag_sylius_cms_plugin.ui.title', |
|
60
|
|
|
'required' => false, |
|
61
|
|
|
]) |
|
62
|
|
|
; |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
public function getBlockPrefix(): string |
|
66
|
|
|
{ |
|
67
|
|
|
return 'bitbag_sylius_cms_plugin_page_translation'; |
|
68
|
|
|
} |
|
69
|
|
|
} |
|
70
|
|
|
|