]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
Entry: handle originUrl in edit form, update translations
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / EditEntryType.php
CommitLineData
82d6d9cb
JB
1<?php
2
3namespace Wallabag\CoreBundle\Form\Type;
4
5use Symfony\Component\Form\AbstractType;
619cc453
JB
6use Symfony\Component\Form\Extension\Core\Type\SubmitType;
7use Symfony\Component\Form\Extension\Core\Type\TextType;
82d6d9cb
JB
8use Symfony\Component\Form\FormBuilderInterface;
9use Symfony\Component\OptionsResolver\OptionsResolver;
10
11class EditEntryType extends AbstractType
12{
13 public function buildForm(FormBuilderInterface $builder, array $options)
14 {
15 $builder
4094ea47 16 ->add('title', TextType::class, [
0d42217e
JB
17 'required' => true,
18 'label' => 'entry.edit.title_label',
4094ea47 19 ])
4094ea47 20 ->add('url', TextType::class, [
0d42217e
JB
21 'disabled' => true,
22 'required' => false,
23 'label' => 'entry.edit.url_label',
4094ea47 24 ])
03b020eb
KD
25 ->add('origin_url', TextType::class, [
26 'required' => false,
27 'property_path' => 'originUrl',
28 'label' => 'entry.edit.origin_url_label',
29 ])
4094ea47 30 ->add('save', SubmitType::class, [
0d42217e 31 'label' => 'entry.edit.save_label',
4094ea47 32 ])
82d6d9cb
JB
33 ;
34 }
35
36 public function configureOptions(OptionsResolver $resolver)
37 {
4094ea47 38 $resolver->setDefaults([
82d6d9cb 39 'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
4094ea47 40 ]);
82d6d9cb
JB
41 }
42
619cc453 43 public function getBlockPrefix()
82d6d9cb
JB
44 {
45 return 'entry';
46 }
47}