diff options
author | Kevin Decherf <kevin@kdecherf.com> | 2020-04-26 15:39:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-26 15:39:57 +0200 |
commit | 0e8a0f77d0b643a884e6687bd9c463267852a970 (patch) | |
tree | 88c6761b4215637bba34b263015e87750c92a187 /src/Wallabag/CoreBundle/Form/Type | |
parent | 8a8a78a64c116caf81aaa4339906298bdc0e32e0 (diff) | |
parent | 71f7e58fbd84e1d15c7a405a3c5872adb937dc37 (diff) | |
download | wallabag-0e8a0f77d0b643a884e6687bd9c463267852a970.tar.gz wallabag-0e8a0f77d0b643a884e6687bd9c463267852a970.tar.zst wallabag-0e8a0f77d0b643a884e6687bd9c463267852a970.zip |
Merge pull request #4026 from wallabag/3760-ignorelist-db
Move Ignore Origin rules to database
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/Type')
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/IgnoreOriginInstanceRuleType.php | 37 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/IgnoreOriginUserRuleType.php | 37 |
2 files changed, 74 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginInstanceRuleType.php b/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginInstanceRuleType.php new file mode 100644 index 00000000..d2e414fb --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginInstanceRuleType.php | |||
@@ -0,0 +1,37 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Form\Type; | ||
4 | |||
5 | use Symfony\Component\Form\AbstractType; | ||
6 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; | ||
7 | use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
8 | use Symfony\Component\Form\FormBuilderInterface; | ||
9 | use Symfony\Component\OptionsResolver\OptionsResolver; | ||
10 | |||
11 | class IgnoreOriginInstanceRuleType extends AbstractType | ||
12 | { | ||
13 | public function buildForm(FormBuilderInterface $builder, array $options) | ||
14 | { | ||
15 | $builder | ||
16 | ->add('rule', TextType::class, [ | ||
17 | 'required' => true, | ||
18 | 'label' => 'config.form_rules.rule_label', | ||
19 | ]) | ||
20 | ->add('save', SubmitType::class, [ | ||
21 | 'label' => 'config.form.save', | ||
22 | ]) | ||
23 | ; | ||
24 | } | ||
25 | |||
26 | public function configureOptions(OptionsResolver $resolver) | ||
27 | { | ||
28 | $resolver->setDefaults([ | ||
29 | 'data_class' => 'Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule', | ||
30 | ]); | ||
31 | } | ||
32 | |||
33 | public function getBlockPrefix() | ||
34 | { | ||
35 | return 'ignore_origin_instance_rule'; | ||
36 | } | ||
37 | } | ||
diff --git a/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginUserRuleType.php b/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginUserRuleType.php new file mode 100644 index 00000000..b9110f17 --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginUserRuleType.php | |||
@@ -0,0 +1,37 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Form\Type; | ||
4 | |||
5 | use Symfony\Component\Form\AbstractType; | ||
6 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; | ||
7 | use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
8 | use Symfony\Component\Form\FormBuilderInterface; | ||
9 | use Symfony\Component\OptionsResolver\OptionsResolver; | ||
10 | |||
11 | class IgnoreOriginUserRuleType extends AbstractType | ||
12 | { | ||
13 | public function buildForm(FormBuilderInterface $builder, array $options) | ||
14 | { | ||
15 | $builder | ||
16 | ->add('rule', TextType::class, [ | ||
17 | 'required' => true, | ||
18 | 'label' => 'config.form_rules.rule_label', | ||
19 | ]) | ||
20 | ->add('save', SubmitType::class, [ | ||
21 | 'label' => 'config.form.save', | ||
22 | ]) | ||
23 | ; | ||
24 | } | ||
25 | |||
26 | public function configureOptions(OptionsResolver $resolver) | ||
27 | { | ||
28 | $resolver->setDefaults([ | ||
29 | 'data_class' => 'Wallabag\CoreBundle\Entity\IgnoreOriginUserRule', | ||
30 | ]); | ||
31 | } | ||
32 | |||
33 | public function getBlockPrefix() | ||
34 | { | ||
35 | return 'ignore_origin_user_rule'; | ||
36 | } | ||
37 | } | ||