X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FForm%2FType%2FEditEntryType.php;h=40e5b5b9a2cd88e120cd32a96cf0ddbb71208a08;hb=4094ea47712efbe58624ff74daeb1f77c9b0edcf;hp=0fa4b71f4583d8f685bee1024c95f924317124fa;hpb=82d6d9cb06a1486e2e3b05fa6ce857b3b8655180;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php index 0fa4b71f..40e5b5b9 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php @@ -3,6 +3,9 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -11,25 +14,33 @@ class EditEntryType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('title', 'text', array('required' => true)) - ->add('is_public', 'checkbox', array('required' => false)) - // @todo: add autocomplete - // ->add('tags', 'entity', array( - // 'class' => 'Wallabag\CoreBundle\Entity\Tag', - // 'choice_translation_domain' => true, - // )) - ->add('save', 'submit') + ->add('title', TextType::class, [ + 'required' => true, + 'label' => 'entry.edit.title_label', + ]) + ->add('is_public', CheckboxType::class, [ + 'required' => false, + 'label' => 'entry.edit.is_public_label', + ]) + ->add('url', TextType::class, [ + 'disabled' => true, + 'required' => false, + 'label' => 'entry.edit.url_label', + ]) + ->add('save', SubmitType::class, [ + 'label' => 'entry.edit.save_label', + ]) ; } public function configureOptions(OptionsResolver $resolver) { - $resolver->setDefaults(array( + $resolver->setDefaults([ 'data_class' => 'Wallabag\CoreBundle\Entity\Entry', - )); + ]); } - public function getName() + public function getBlockPrefix() { return 'entry'; }