| @@ -1,10 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +defined('ABSPATH') || die('Restricted Access'); | |
| 4 | + | |
| 3 | 5 | use AcyMailing\Classes\FieldClass; |
| 4 | 6 | use AcyMailing\Classes\ListClass; |
| 5 | 7 | use AcyMailing\Core\AcymParameter; |
| 6 | 8 | |
| 9 | +// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Prefixed and unique class name. | |
| 7 | 10 | class acySubscriptionFormWidget extends \Elementor\Widget_Base |
| 8 | 11 | { |
| 9 | 12 | private array $displayMode; |
| 10 | 13 | private array $lists; |
| @@ -118,8 +121,9 @@ | ||
| 118 | 121 | protected function register_controls() |
| 119 | 122 | { |
| 120 | 123 | $this->initParams(); |
| 121 | 124 | |
| 125 | + //Main option | |
| 122 | 126 | $this->startControlsSection('main_options', acym_translation('ACYM_MAIN_OPTIONS')); |
| 123 | 127 | $this->getText('title', acym_translation('ACYM_TITLE'), 'Receive our newsletters'); |
| 124 | 128 | $this->getSimpleSelect('mode', acym_translation('ACYM_DISPLAY_MODE'), $this->displayMode, 'inline'); |
| 125 | 129 | $this->getText('subtext', acym_translation('ACYM_SUBSCRIBE_TEXT'), 'Subscribe'); |
| @@ -125,8 +129,9 @@ | ||
| 125 | 129 | $this->getText('subtext', acym_translation('ACYM_SUBSCRIBE_TEXT'), 'Subscribe'); |
| 126 | 130 | $this->getText('subtextlogged', acym_translation('ACYM_SUBSCRIBE_TEXT_LOGGED_IN'), 'Subscribe'); |
| 127 | 131 | $this->end_controls_section(); |
| 128 | 132 | |
| 133 | + //Lists option | |
| 129 | 134 | $this->startControlsSection('lists_options', acym_translation('ACYM_LISTS_OPTIONS')); |
| 130 | 135 | $this->getSelect('hiddenlists', acym_translation('ACYM_AUTO_SUBSCRIBE_TO'), $this->lists, '', true); |
| 131 | 136 | $this->getSelect('displists', acym_translation('ACYM_DISPLAYED_LISTS'), $this->lists, '', true); |
| 132 | 137 | $this->getSelect('listschecked', acym_translation('ACYM_LISTS_CHECKED_DEFAULT'), $this->lists, '', true); |
| @@ -132,8 +137,9 @@ | ||
| 132 | 137 | $this->getSelect('listschecked', acym_translation('ACYM_LISTS_CHECKED_DEFAULT'), $this->lists, '', true); |
| 133 | 138 | $this->getSelect('listposition', acym_translation('ACYM_DISPLAY_LISTS'), $this->listsPlacement, 'before'); |
| 134 | 139 | $this->end_controls_section(); |
| 135 | 140 | |
| 141 | + //Fields option | |
| 136 | 142 | $this->startControlsSection('fields_options', acym_translation('ACYM_FIELDS_OPTIONS')); |
| 137 | 143 | $this->getSelect('fields', acym_translation('ACYM_FIELDS_TO_DISPLAY'), $this->fields, '', true); |
| 138 | 144 | $this->getSimpleSelect('textmode', acym_translation('ACYM_TEXT_MODE'), $this->displayTextMode, '1'); |
| 139 | 145 | $this->getSimpleSelect('userinfo', acym_translation('ACYM_FORM_AUTOFILL_ID'), $this->subscriberInfo, '1'); |
| @@ -138,13 +144,16 @@ | ||
| 138 | 144 | $this->getSimpleSelect('textmode', acym_translation('ACYM_TEXT_MODE'), $this->displayTextMode, '1'); |
| 139 | 145 | $this->getSimpleSelect('userinfo', acym_translation('ACYM_FORM_AUTOFILL_ID'), $this->subscriberInfo, '1'); |
| 140 | 146 | $this->end_controls_section(); |
| 141 | 147 | |
| 148 | + //Terms and policy option | |
| 142 | 149 | $this->startControlsSection('terms_condition_options', acym_translation('ACYM_TERMS_POLICY_OPTIONS')); |
| 143 | 150 | $this->getSimpleSelect('termscontent', acym_translation('ACYM_TERMS_CONDITIONS'), $this->posts, ''); |
| 144 | 151 | $this->getSimpleSelect('privacypolicy', acym_translation('ACYM_PRIVACY_POLICY'), $this->posts, ''); |
| 152 | + $this->getSimpleSelect('trackingconsent', acym_translation('ACYM_DISPLAY_TRACKING_CONSENT'), $this->subscriberInfo, '0'); | |
| 145 | 153 | $this->end_controls_section(); |
| 146 | 154 | |
| 155 | + //Subscribe option | |
| 147 | 156 | $this->startControlsSection('subscribe_options', acym_translation('ACYM_SUBSCRIBE_OPTIONS')); |
| 148 | 157 | $this->getSimpleSelect('successmode', acym_translation('ACYM_SUCCESS_MODE'), $this->replaceMessage, 'replace'); |
| 149 | 158 | $this->getText('confirmation_message', acym_translation('ACYM_CONFIRMATION_MESSAGE')); |
| 150 | 159 | $this->getText('redirect', acym_translation('ACYM_REDIRECT_LINK')); |
| @@ -149,8 +158,9 @@ | ||
| 149 | 158 | $this->getText('confirmation_message', acym_translation('ACYM_CONFIRMATION_MESSAGE')); |
| 150 | 159 | $this->getText('redirect', acym_translation('ACYM_REDIRECT_LINK')); |
| 151 | 160 | $this->end_controls_section(); |
| 152 | 161 | |
| 162 | + //Unsubscribe option | |
| 153 | 163 | $this->startControlsSection('unsubscribe_options', acym_translation('ACYM_UNSUBSCRIBE_OPTIONS')); |
| 154 | 164 | $this->getSimpleSelect('unsub', acym_translation('ACYM_DISPLAY_UNSUB_BUTTON'), $this->unsubButton, '0'); |
| 155 | 165 | $this->getText('unsubtext', acym_translation('ACYM_UNSUBSCRIBE_TEXT'), 'Unsubscribe'); |
| 156 | 166 | $this->getText('unsubredirect', acym_translation('ACYM_REDIRECT_LINK_UNSUB')); |
| @@ -155,8 +165,9 @@ | ||
| 155 | 165 | $this->getText('unsubtext', acym_translation('ACYM_UNSUBSCRIBE_TEXT'), 'Unsubscribe'); |
| 156 | 166 | $this->getText('unsubredirect', acym_translation('ACYM_REDIRECT_LINK_UNSUB')); |
| 157 | 167 | $this->end_controls_section(); |
| 158 | 168 | |
| 169 | + //Advanced option | |
| 159 | 170 | $this->startControlsSection('advanced_options', acym_translation('ACYM_ADVANCED_OPTIONS')); |
| 160 | 171 | $this->getText('introtext', acym_translation('ACYM_INTRO_TEXT')); |
| 161 | 172 | $this->getText('posttext', acym_translation('ACYM_POST_TEXT')); |
| 162 | 173 | $this->getSimpleSelect('alignment', acym_translation('ACYM_ALIGNMENT'), $this->alignment, 'none'); |
| @@ -163,8 +174,9 @@ | ||
| 163 | 174 | $this->getSimpleSelect('includejs', acym_translation('ACYM_MODULE_JS'), $this->includeJavascript, 'header'); |
| 164 | 175 | $this->getText('source', acym_translation('ACYM_SOURCE'), 'elementor_subscription_form'); |
| 165 | 176 | $this->end_controls_section(); |
| 166 | 177 | |
| 178 | + // Style zone | |
| 167 | 179 | $this->startControlsSection('global_options', acym_translation('ACYM_GLOBAL_OPTIONS'), \Elementor\Controls_Manager::TAB_STYLE); |
| 168 | 180 | $this->getColor('background_color', acym_translation('ACYM_BACKGROUND_COLOR')); |
| 169 | 181 | $this->getColor('text_color', acym_translation('ACYM_TEXT_COLOR')); |
| 170 | 182 | $this->end_controls_section(); |
| @@ -274,9 +286,7 @@ | ||
| 274 | 286 | protected function render() |
| 275 | 287 | { |
| 276 | 288 | $settings = $this->get_settings_for_display(); |
| 277 | 289 | $params = new AcymParameter($settings); |
| 278 | - $render = acym_renderForm($params); | |
| 279 | - | |
| 280 | - echo $render; | |
| 290 | + acym_renderForm($params); | |
| 281 | 291 | } |
| 282 | 292 | } |