X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FForm%2FType%2FEditEntryType.php;h=083559286477d5bf53fe8d91cb0f716f37adec8a;hb=8425f5cc3dc77c691f432bda4329ce9dfb015c7d;hp=0fa4b71f4583d8f685bee1024c95f924317124fa;hpb=ac9d58211e1c6676485ef15d023215e5a465f3a8;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..08355928 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,34 @@ 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', + ]) + ->add('origin_url', UrlType::class, [ + 'required' => false, + 'property_path' => 'originUrl', + 'label' => 'entry.edit.origin_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'; }