X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FForm%2FType%2FEditEntryType.php;h=2fc4c204b36075b58270cdda47b1dd9b51c90e11;hb=9f0957b831622ee577fa7d8f92ec0df6f3a8e274;hp=0fa4b71f4583d8f685bee1024c95f924317124fa;hpb=9b9b05008a96a45bbf6da4c0c1c1b1244b83c6af;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..2fc4c204 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\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\TextType; +use Symfony\Component\Form\Extension\Core\Type\UrlType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -11,25 +14,36 @@ 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('url', UrlType::class, [ + 'disabled' => true, + 'required' => false, + 'label' => 'entry.edit.url_label', + 'default_protocol' => null, + ]) + ->add('origin_url', UrlType::class, [ + 'required' => false, + 'property_path' => 'originUrl', + 'label' => 'entry.edit.origin_url_label', + 'default_protocol' => null, + ]) + ->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'; }