diff options
Diffstat (limited to 'src/Wallabag/GroupBundle/Form/GroupType.php')
-rw-r--r-- | src/Wallabag/GroupBundle/Form/GroupType.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Wallabag/GroupBundle/Form/GroupType.php b/src/Wallabag/GroupBundle/Form/GroupType.php index c2ad764b..c708bdb8 100644 --- a/src/Wallabag/GroupBundle/Form/GroupType.php +++ b/src/Wallabag/GroupBundle/Form/GroupType.php | |||
@@ -3,10 +3,13 @@ | |||
3 | namespace Wallabag\GroupBundle\Form; | 3 | namespace Wallabag\GroupBundle\Form; |
4 | 4 | ||
5 | use Symfony\Component\Form\AbstractType; | 5 | use Symfony\Component\Form\AbstractType; |
6 | use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | ||
7 | use Symfony\Component\Form\Extension\Core\Type\PasswordType; | ||
6 | use Symfony\Component\Form\FormBuilderInterface; | 8 | use Symfony\Component\Form\FormBuilderInterface; |
7 | use Symfony\Component\OptionsResolver\OptionsResolver; | 9 | use Symfony\Component\OptionsResolver\OptionsResolver; |
8 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; | 10 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; |
9 | use Symfony\Component\Form\Extension\Core\Type\TextType; | 11 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
12 | use Wallabag\GroupBundle\Entity\Group; | ||
10 | 13 | ||
11 | class GroupType extends AbstractType | 14 | class GroupType extends AbstractType |
12 | { | 15 | { |
@@ -21,6 +24,31 @@ class GroupType extends AbstractType | |||
21 | 'required' => false, | 24 | 'required' => false, |
22 | 'label' => 'group.form.name_label', | 25 | 'label' => 'group.form.name_label', |
23 | ]) | 26 | ]) |
27 | ->add('defaultRole', ChoiceType::class, [ | ||
28 | 'label' => 'group.form.role_label', | ||
29 | 'choices' => [ | ||
30 | 'group.roles.readonly' => Group::ROLE_READ_ONLY, | ||
31 | 'group.roles.write' => Group::ROLE_WRITE, | ||
32 | 'group.roles.manage_entries' => Group::ROLE_MANAGE_ENTRIES, | ||
33 | 'group.roles.manage_users' => Group::ROLE_MANAGE_USERS, | ||
34 | 'group.roles.admin' => Group::ROLE_ADMIN, | ||
35 | ], | ||
36 | ]) | ||
37 | ->add('acceptSystem', ChoiceType::class, [ | ||
38 | 'label' => 'group.form.access_label', | ||
39 | 'choices' => [ | ||
40 | 'group.access.open' => Group::ACCESS_OPEN, | ||
41 | 'group.access.request' => Group::ACCESS_REQUEST, | ||
42 | 'group.access.password' => Group::ACCESS_PASSWORD, | ||
43 | 'group.access.invitation' => Group::ACCESS_INVITATION_ONLY, | ||
44 | 'group.access.hidden' => Group::ACCESS_HIDDEN, | ||
45 | ], | ||
46 | ]) | ||
47 | ->add('plainPassword', PasswordType::class, [ | ||
48 | 'label' => 'group.form.password_label', | ||
49 | 'required' => false, | ||
50 | 'attr' => ['autocomplete' => 'off'], | ||
51 | ]) | ||
24 | ->add('save', SubmitType::class, [ | 52 | ->add('save', SubmitType::class, [ |
25 | 'label' => 'group.form.save', | 53 | 'label' => 'group.form.save', |
26 | ]) | 54 | ]) |