| @@ -149,8 +149,9 @@ | ||
| 149 | 149 | 'label' => 'ACYM_FIELDS_WIDTH', |
| 150 | 150 | 'description' => 'ACYM_FIELDS_WIDTH_DESC', |
| 151 | 151 | 'type' => 'number', |
| 152 | 152 | 'unit' => '%', |
| 153 | + // Set to 65% by default to fit with the default size of the email field | |
| 153 | 154 | 'default' => 65, |
| 154 | 155 | ], |
| 155 | 156 | ], |
| 156 | 157 | 'termspolicy' => [ |
| @@ -197,8 +198,18 @@ | ||
| 197 | 198 | 'type' => 'text', |
| 198 | 199 | 'default' => '', |
| 199 | 200 | 'conditional' => ['privacy_type' => 'url'], |
| 200 | 201 | ], |
| 202 | + 'tracking_consent' => [ | |
| 203 | + 'label' => 'ACYM_DISPLAY_TRACKING_CONSENT', | |
| 204 | + 'description' => 'ACYM_DISPLAY_TRACKING_CONSENT_DESC', | |
| 205 | + 'type' => 'select', | |
| 206 | + 'options' => [ | |
| 207 | + 'no' => acym_translation('ACYM_NO'), | |
| 208 | + 'yes' => acym_translation('ACYM_YES'), | |
| 209 | + ], | |
| 210 | + 'default' => 'no', | |
| 211 | + ], | |
| 201 | 212 | ], |
| 202 | 213 | 'message' => [ |
| 203 | 214 | 'text' => [ |
| 204 | 215 | 'label' => 'ACYM_CUSTOM_MESSAGE_DISPLAY', |
| @@ -627,46 +638,43 @@ | ||
| 627 | 638 | |
| 628 | 639 | return $form; |
| 629 | 640 | } |
| 630 | 641 | |
| 631 | - public function prepareMenuHtml(object $form, string $type): array | |
| 642 | + public function prepareMenuHtml(object $form, string $type): void | |
| 632 | 643 | { |
| 633 | 644 | $this->initSettings(); |
| 634 | 645 | |
| 635 | 646 | $sections = $this->getSectionTranslations(); |
| 636 | - $htmlMenu = []; | |
| 637 | 647 | foreach ($this->settings[$type] as $category => $options) { |
| 638 | - $categoryOptions = []; | |
| 648 | + $hasOptions = false; | |
| 649 | + | |
| 639 | 650 | foreach ($options as $key => $option) { |
| 640 | 651 | if (!empty($option['allowed_types']) && !in_array($form->type, $option['allowed_types'])) { |
| 641 | 652 | continue; |
| 642 | 653 | } |
| 643 | 654 | |
| 655 | + if (!$hasOptions) { | |
| 656 | + $hasOptions = true; | |
| 657 | + echo '<h3 class="cell acym__forms__menu__title acym__title acym__title__tertiary">'.esc_html(acym_translation($sections[$category])).'</h3>'; | |
| 658 | + } | |
| 659 | + | |
| 644 | 660 | $id = 'form_'.$category.'_'.$key; |
| 645 | 661 | $name = 'form[settings]['.$category.']['.$key.']'; |
| 646 | 662 | $vModel = 'form.settings.'.$category.'.'.$key; |
| 647 | 663 | $value = $form->settings[$category][$key] ?? $option['default']; |
| 648 | 664 | |
| 649 | - $label = '<label class="cell" for="'.$id.'">'.acym_translation($option['label']); | |
| 665 | + echo '<div class="cell grid-x acym__forms__menu__options grid-margin-x acym_vcenter">'; | |
| 666 | + | |
| 667 | + echo '<label class="cell" for="'.esc_attr($id).'">'.esc_html(acym_translation($option['label'])); | |
| 650 | 668 | if (!empty($option['description'])) { |
| 651 | - $label .= acym_info(['textShownInTooltip' => $option['description']]); | |
| 669 | + acym_info(['textShownInTooltip' => $option['description']]); | |
| 652 | 670 | } |
| 653 | - $label .= '</label>'; | |
| 671 | + echo '</label>'; | |
| 654 | 672 | |
| 655 | - ob_start(); | |
| 656 | 673 | include acym_getPartial('fields', $option['type']); |
| 657 | - $categoryOptions[$key] = $label.ob_get_clean(); | |
| 674 | + echo '</div>'; | |
| 658 | 675 | } |
| 659 | - | |
| 660 | - if (!empty($categoryOptions)) { | |
| 661 | - $htmlMenu[] = [ | |
| 662 | - 'title' => acym_translation($sections[$category]), | |
| 663 | - 'render' => $categoryOptions, | |
| 664 | - ]; | |
| 665 | - } | |
| 666 | 676 | } |
| 667 | - | |
| 668 | - return $htmlMenu; | |
| 669 | 677 | } |
| 670 | 678 | |
| 671 | 679 | public function renderForm(object $form, bool $edition = false, bool $isShortcode = false): string |
| 672 | 680 | { |