cms = 'WordPress'; $this->installed = acym_isExtensionActive('gravityforms/gravityforms.php'); $this->pluginDescription->name = 'Gravity Forms'; $this->pluginDescription->category = 'Subscription system'; $this->pluginDescription->description = '- Add AcyMailing lists on your forms'; $this->propertyLabels = [ 'acymDisplayedList' => acym_translation('ACYM_DISPLAYED_LISTS'), 'acymCheckedList' => acym_translation('ACYM_LISTS_CHECKED_DEFAULT'), 'acymAutoSubList' => acym_translation('ACYM_AUTO_SUBSCRIBE_TO'), ]; } public function onAcymInitWordpressAddons() { include_once __DIR__.DS.'customFieldGF.php'; add_action('gform_field_standard_settings', [$this, 'subscriptionFormSettings'], 10, 2); add_action('gform_editor_js', [$this, 'subscriptionFormScript']); } public function getListsFormated() { $listClass = new ListClass(); return $listClass->getAllWithIdName(); } private function getSelectMultiple($propertyName, $label, $lists) { $data = [ 'property_name' => $propertyName, 'label' => $label, 'lists' => $lists, ]; echo $this->includeView('select_multiple', $data, __DIR__); } public function subscriptionFormSettings($position, $form_id) { $lists = $this->getListsFormated(); if ($position == 5 && !empty($lists)) { foreach ($this->propertyLabels as $property => $label) { $this->getSelectMultiple($property, $label, $lists); } } } public function subscriptionFormScript() { ?>