FormFields
2 years ago
FormTemplate
2 years ago
ActiveCampaign.php
2 years ago
ConstantContact.php
2 years ago
ConvertKit.php
2 years ago
CurrencySwitcher.php
2 years ago
DonationGoal.php
2 years ago
DonationOptions.php
2 years ago
DoubleTheDonation.php
2 years ago
EmailSettings.php
2 years ago
FeeRecovery.php
2 years ago
FormExcerpt.php
2 years ago
FormFeaturedImage.php
2 years ago
FormFieldManager.php
2 years ago
FormFields.php
2 years ago
FormGrid.php
2 years ago
FormMeta.php
2 years ago
FormTitle.php
2 years ago
FundsAndDesignations.php
2 years ago
GiftAid.php
2 years ago
Mailchimp.php
2 years ago
MigrateMeta.php
2 years ago
OfflineDonations.php
2 years ago
PaymentGateways.php
2 years ago
PdfSettings.php
2 years ago
PerFormGateways.php
2 years ago
RazorpayPerFormSettings.php
1 year ago
RecurringDonationOptions.php
2 years ago
TermsAndConditions.php
2 years ago
ActiveCampaign.php
47 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\FormMigration\Steps; |
| 4 | |
| 5 | use Give\FormMigration\Contracts\FormMigrationStep; |
| 6 | use Give\Framework\Blocks\BlockModel; |
| 7 | |
| 8 | /** |
| 9 | * @since 3.10.0 |
| 10 | */ |
| 11 | class ActiveCampaign extends FormMigrationStep |
| 12 | { |
| 13 | /** |
| 14 | * @since 3.10.0 |
| 15 | */ |
| 16 | public function canHandle(): bool |
| 17 | { |
| 18 | return $this->formV2->isActiveCampaignEnabled(); |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * @since 3.10.0 |
| 23 | */ |
| 24 | public function process(): void |
| 25 | { |
| 26 | $block = BlockModel::make([ |
| 27 | 'name' => 'give-activecampaign/activecampaign', |
| 28 | 'attributes' => $this->getAttributes() |
| 29 | ]); |
| 30 | |
| 31 | $this->fieldBlocks->insertAfter('givewp/email', $block); |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * @since 3.10.0 |
| 36 | */ |
| 37 | private function getAttributes(): array |
| 38 | { |
| 39 | return [ |
| 40 | 'label' => $this->formV2->getActiveCampaignLabel() , |
| 41 | 'defaultChecked' => $this->formV2->getActiveCampaignDefaultChecked(), |
| 42 | 'selectedLists' => $this->formV2->getActiveCampaignSelectedLists(), |
| 43 | 'selectedTags' => $this->formV2->getActiveCampaignTags() |
| 44 | ]; |
| 45 | } |
| 46 | } |
| 47 |