1 | <?php |
||
25 | final class ShariffShareBlockService extends AbstractAdminBlockService |
||
26 | { |
||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | public function execute(BlockContextInterface $blockContext, Response $response = null) |
||
31 | { |
||
32 | $parameters = [ |
||
33 | 'context' => $blockContext, |
||
34 | 'settings' => $blockContext->getSettings(), |
||
35 | 'block' => $blockContext->getBlock(), |
||
36 | ]; |
||
37 | |||
38 | return $this->renderResponse($blockContext->getTemplate(), $parameters, $response); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function buildEditForm(FormMapper $formMapper, BlockInterface $block): void |
||
45 | { |
||
46 | $formMapper->add('settings', ImmutableArrayType::class, [ |
||
47 | 'keys' => [ |
||
48 | ['url', TextType::class, [ |
||
49 | 'label' => 'form.label_url', |
||
50 | 'required' => false, |
||
51 | ]], |
||
52 | ['class', TextType::class, [ |
||
53 | 'label' => 'form.label_class', |
||
54 | 'required' => false, |
||
55 | ]], |
||
56 | ['services', ChoiceType::class, [ |
||
57 | 'label' => 'form.label_services', |
||
58 | 'choices' => [ |
||
59 | 'form.choice_twitter' => 'twitter', |
||
60 | 'form.choice_facebook' => 'facebook', |
||
61 | 'form.choice_googleplus' => 'googleplus', |
||
62 | 'form.choice_addthis' => 'addthis', |
||
63 | 'form.choice_linkedin' => 'linkedin', |
||
64 | 'form.choice_reddit' => 'reddit', |
||
65 | 'form.choice_stumbleupon' => 'stumbleupon', |
||
66 | 'form.choice_flattr' => 'flattr', |
||
67 | 'form.choice_pinterest' => 'pinterest', |
||
68 | 'form.choice_xing' => 'xing', |
||
69 | 'form.choice_mail' => 'mail', |
||
70 | ], |
||
71 | 'required' => false, |
||
72 | 'multiple' => true, |
||
73 | ]], |
||
74 | ['theme', ChoiceType::class, [ |
||
75 | 'label' => 'form.label_theme', |
||
76 | 'choices' => [ |
||
77 | 'standard' => 'standard', |
||
78 | 'grey' => 'grey', |
||
79 | 'white' => 'white', |
||
80 | ], |
||
81 | 'choice_translation_domain' => false, |
||
82 | ]], |
||
83 | ['orientation', ChoiceType::class, [ |
||
84 | 'label' => 'form.label_orientation', |
||
85 | 'choices' => [ |
||
86 | 'form.choice_vertical' => 'vertical', |
||
87 | 'form.choice_horizontal' => 'horizontal', |
||
88 | ], |
||
89 | ]], |
||
90 | ['flattrUser', TextType::class, [ |
||
91 | 'label' => 'form.label_flattr_user', |
||
92 | 'required' => false, |
||
93 | ]], |
||
94 | ['flattrCategory', TextType::class, [ |
||
95 | 'label' => 'form.label_flattr_category', |
||
96 | 'required' => false, |
||
97 | ]], |
||
98 | ], |
||
99 | 'translation_domain' => 'Core23ShariffBundle', |
||
100 | ]); |
||
101 | } |
||
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | public function configureSettings(OptionsResolver $resolver): void |
||
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | public function getBlockMetadata($code = null) |
||
129 | } |
||
130 |