diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Form')
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php | 9 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/ConfigType.php | 2 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/UserType.php | 31 |
3 files changed, 36 insertions, 6 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php index 8bf4ca1e..de0ad537 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php | |||
@@ -3,7 +3,6 @@ namespace Wallabag\CoreBundle\Form\Type; | |||
3 | 3 | ||
4 | use Symfony\Component\Form\AbstractType; | 4 | use Symfony\Component\Form\AbstractType; |
5 | use Symfony\Component\Form\FormBuilderInterface; | 5 | use Symfony\Component\Form\FormBuilderInterface; |
6 | use Symfony\Component\OptionsResolver\OptionsResolverInterface; | ||
7 | use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; | 6 | use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; |
8 | use Symfony\Component\Validator\Constraints; | 7 | use Symfony\Component\Validator\Constraints; |
9 | 8 | ||
@@ -23,11 +22,11 @@ class ChangePasswordType extends AbstractType | |||
23 | 'second_options' => array('label' => 'Repeat new password'), | 22 | 'second_options' => array('label' => 'Repeat new password'), |
24 | 'constraints' => array( | 23 | 'constraints' => array( |
25 | new Constraints\Length(array( | 24 | new Constraints\Length(array( |
26 | 'min' => 6, | 25 | 'min' => 8, |
27 | 'minMessage' => 'Password should by at least 6 chars long' | 26 | 'minMessage' => 'Password should by at least 6 chars long', |
28 | )), | 27 | )), |
29 | new Constraints\NotBlank() | 28 | new Constraints\NotBlank(), |
30 | ) | 29 | ), |
31 | )) | 30 | )) |
32 | ->add('save', 'submit') | 31 | ->add('save', 'submit') |
33 | ; | 32 | ; |
diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php index 74e2a6f1..a1e0ce47 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php | |||
@@ -21,7 +21,7 @@ class ConfigType extends AbstractType | |||
21 | 'solarized_dark' => 'Solarized Dark', | 21 | 'solarized_dark' => 'Solarized Dark', |
22 | ), | 22 | ), |
23 | )) | 23 | )) |
24 | ->add('items_per_page') | 24 | ->add('items_per_page', 'text') |
25 | ->add('language') | 25 | ->add('language') |
26 | ->add('save', 'submit') | 26 | ->add('save', 'submit') |
27 | ; | 27 | ; |
diff --git a/src/Wallabag/CoreBundle/Form/Type/UserType.php b/src/Wallabag/CoreBundle/Form/Type/UserType.php new file mode 100644 index 00000000..b479a0b5 --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/UserType.php | |||
@@ -0,0 +1,31 @@ | |||
1 | <?php | ||
2 | namespace Wallabag\CoreBundle\Form\Type; | ||
3 | |||
4 | use Symfony\Component\Form\AbstractType; | ||
5 | use Symfony\Component\Form\FormBuilderInterface; | ||
6 | use Symfony\Component\OptionsResolver\OptionsResolverInterface; | ||
7 | |||
8 | class UserType extends AbstractType | ||
9 | { | ||
10 | public function buildForm(FormBuilderInterface $builder, array $options) | ||
11 | { | ||
12 | $builder | ||
13 | ->add('username', 'text') | ||
14 | ->add('name', 'text') | ||
15 | ->add('email', 'text') | ||
16 | ->add('save', 'submit') | ||
17 | ; | ||
18 | } | ||
19 | |||
20 | public function setDefaultOptions(OptionsResolverInterface $resolver) | ||
21 | { | ||
22 | $resolver->setDefaults(array( | ||
23 | 'data_class' => 'Wallabag\CoreBundle\Entity\User', | ||
24 | )); | ||
25 | } | ||
26 | |||
27 | public function getName() | ||
28 | { | ||
29 | return 'user'; | ||
30 | } | ||
31 | } | ||