PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.8.1
GiveWP – Donation Plugin and Fundraising Platform v4.16.8.1
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / FormMigration / Steps / FormTemplate / LegacyTemplateSettings.php

LegacyTemplateSettings.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.8.1, at src/FormMigration/Steps/FormTemplate/LegacyTemplateSettings.php

58 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\FormMigration\Steps\FormTemplate;
4
5 use Give\FormMigration\Concerns\Blocks\BlockFactory;;
6 use Give\FormMigration\Contracts\FormMigrationStep;
7
8 class LegacyTemplateSettings extends FormMigrationStep
9 {
10 public function canHandle(): bool
11 {
12 return 'legacy' === $this->formV2->getFormTemplate();
13 }
14
15 public function process()
16 {
17 [
18 'display_settings' => $displaySettings,
19 ] = $this->formV2->getFormTemplateSettings();
20
21 $this->displaySettings($displaySettings);
22 }
23
24 protected function displaySettings($settings)
25 {
26 [
27 'display_style' => $displayStyle, // 'buttons',
28 'payment_display' => $paymentDisplay, // 'onpage',
29 'reveal_label' => $revealLabel, // '',
30 'checkout_label' => $checkoutLabel, // 'Donate Now',
31 'form_floating_labels' => $floatingLabels, // 'global',
32 'display_content' => $displayContent, // 'disabled',
33 'content_placement' => $contentPlacement, // 'give_pre_form',
34 'form_content' => $formContent, // '',
35 ] = $settings;
36
37 // @note `display_style`` is not supported in v3 forms (defers to the Form Design).
38
39 // @note `payment_display`, `reveal_label` are not supported in v3 forms (defers to the Form Design).
40
41 // @note `checkout_label` is not supported in v3 forms (defers to the Form Design).
42
43 // @note `form_floating_labels` is not supported in v3 forms (defers to the Form Design).
44
45 if(give_is_setting_enabled($displayContent)) {
46
47 $formContentSection = BlockFactory::section();
48 $formContentSection->innerBlocks->append(BlockFactory::paragraph($formContent));
49
50 if('give_pre_form' === $contentPlacement) {
51 $this->fieldBlocks->prepend($formContentSection);
52 } else {
53 $this->fieldBlocks->append($formContentSection);
54 }
55 }
56 }
57 }
58