diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-05-31 09:31:18 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2017-06-23 10:08:54 +0200 |
commit | bf6c0346d8d35a719dd1bff1cb4d573d422f99ff (patch) | |
tree | 04fb80e20ad1cffacb72357a632a9afe2ec058cb /src/Wallabag/FederationBundle/Form | |
parent | d6d3f4ec3698effd1d4b063e295341791bdcf7d7 (diff) | |
download | wallabag-bf6c0346d8d35a719dd1bff1cb4d573d422f99ff.tar.gz wallabag-bf6c0346d8d35a719dd1bff1cb4d573d422f99ff.tar.zst wallabag-bf6c0346d8d35a719dd1bff1cb4d573d422f99ff.zip |
WIPfederation
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'src/Wallabag/FederationBundle/Form')
-rw-r--r-- | src/Wallabag/FederationBundle/Form/Type/AccountType.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/Wallabag/FederationBundle/Form/Type/AccountType.php b/src/Wallabag/FederationBundle/Form/Type/AccountType.php new file mode 100644 index 00000000..af291ced --- /dev/null +++ b/src/Wallabag/FederationBundle/Form/Type/AccountType.php | |||
@@ -0,0 +1,46 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\FederationBundle\Form\Type; | ||
4 | |||
5 | use Symfony\Component\Form\AbstractType; | ||
6 | use Symfony\Component\Form\Extension\Core\Type\FileType; | ||
7 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; | ||
8 | use Symfony\Component\Form\Extension\Core\Type\TextareaType; | ||
9 | use Symfony\Component\Form\FormBuilderInterface; | ||
10 | use Symfony\Component\OptionsResolver\OptionsResolver; | ||
11 | use Wallabag\FederationBundle\Entity\Account; | ||
12 | |||
13 | class AccountType extends AbstractType | ||
14 | { | ||
15 | public function buildForm(FormBuilderInterface $builder, array $options) | ||
16 | { | ||
17 | $builder | ||
18 | ->add('description', TextareaType::class, ['label' => 'config.form_account.description_label']) | ||
19 | ->add('avatar', FileType::class, [ | ||
20 | 'label' => 'config.form_account.avatar_label', | ||
21 | 'required' => false, | ||
22 | 'data_class' => null, | ||
23 | ]) | ||
24 | ->add('banner', FileType::class, [ | ||
25 | 'label' => 'config.form_account.banner_label', | ||
26 | 'required' => false, | ||
27 | 'data_class' => null, | ||
28 | ]) | ||
29 | ->add('save', SubmitType::class, [ | ||
30 | 'label' => 'config.form.save', | ||
31 | ]) | ||
32 | ; | ||
33 | } | ||
34 | |||
35 | public function configureOptions(OptionsResolver $resolver) | ||
36 | { | ||
37 | $resolver->setDefaults(array( | ||
38 | 'data_class' => Account::class, | ||
39 | )); | ||
40 | } | ||
41 | |||
42 | public function getBlockPrefix() | ||
43 | { | ||
44 | return 'update_account'; | ||
45 | } | ||
46 | } | ||