]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
Merge pull request #1804 from wallabag/j0k3r-patch-1
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / EditEntryType.php
index 0fa4b71f4583d8f685bee1024c95f924317124fa..23d7b23984d3e4059695d3fd4c64ea7f588aab0f 100644 (file)
@@ -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,14 +14,22 @@ 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, array(
+                'required' => true,
+                'label' => 'entry.edit.title_label',
+            ))
+            ->add('is_public', CheckboxType::class, array(
+                'required' => false,
+                'label' => 'entry.edit.is_public_label',
+            ))
+            ->add('url', TextType::class, array(
+                'disabled' => true,
+                'required' => false,
+                'label' => 'entry.edit.url_label',
+            ))
+            ->add('save', SubmitType::class, array(
+                'label' => 'entry.edit.save_label',
+            ))
         ;
     }
 
@@ -29,7 +40,7 @@ class EditEntryType extends AbstractType
         ));
     }
 
-    public function getName()
+    public function getBlockPrefix()
     {
         return 'entry';
     }