| @@ -1,43 +1,71 @@ | ||
| 1 | +<?php | |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- View file, its variables are local to the include scope, not true globals. | |
| 3 | +defined('ABSPATH') || die('Restricted Access'); | |
| 4 | +?> | |
| 1 | 5 | <div class="acym__subscription__form__fields"> |
| 2 | 6 | <?php |
| 3 | 7 | $config = acym_config(); |
| 4 | 8 | if ($form->settings['lists']['display_position'] === 'before') { |
| 5 | 9 | if ($form->type === $form->formClass::SUB_FORM_TYPE_POPUP && !empty($form->settings['message']['text']) && $form->settings['message']['position'] === 'before-lists') { |
| 6 | - echo '<p id="acym__subscription__form__popup-text">'.acym_translation($form->settings['message']['text']).'</p>'; | |
| 10 | + echo '<p id="acym__subscription__form__popup-text">'.esc_html(acym_translation($form->settings['message']['text'])).'</p>'; | |
| 7 | 11 | } |
| 8 | 12 | include acym_getPartial('forms', 'lists'); |
| 9 | 13 | } |
| 10 | 14 | if ($form->type === $form->formClass::SUB_FORM_TYPE_POPUP && !empty($form->settings['message']['text']) && $form->settings['message']['position'] === 'before-fields') { |
| 11 | - echo '<p id="acym__subscription__form__popup-text">'.acym_translation($form->settings['message']['text']).'</p>'; | |
| 15 | + echo '<p id="acym__subscription__form__popup-text">'.esc_html(acym_translation($form->settings['message']['text'])).'</p>'; | |
| 12 | 16 | } |
| 13 | 17 | foreach ($form->settings['fields']['displayed'] as $field) { |
| 14 | - $size = empty($field->option->size) ? '' : 'width:'.$field->option->size.'px'; | |
| 15 | - echo '<div class="onefield fieldacy'.$field->id.' acyfield_'.$field->type.'" id="field_'.$field->id.'">'; | |
| 16 | - echo $form->fieldClass->displayField($field, $field->default_value, $size, $field->valuesArray, $form->settings['fields']['display_mode'] === 'outside', true); | |
| 18 | + echo '<div class="onefield fieldacy'.esc_attr($field->id).' acyfield_'.esc_attr($field->type).'" id="field_'.esc_attr($field->id).'">'; | |
| 19 | + $form->fieldClass->displayField($field, $field->default_value, $field->valuesArray, $form->settings['fields']['display_mode'] === 'outside', true); | |
| 17 | 20 | echo '</div>'; |
| 18 | 21 | |
| 19 | 22 | if ($field->id == 2 && $config->get('email_confirmation')) { |
| 20 | - echo $form->fieldClass->setEmailConfirmationField($form->settings['fields']['display_mode'] === 'outside', $size); | |
| 23 | + $form->fieldClass->setEmailConfirmationField($form->settings['fields']['display_mode'] === 'outside', $field); | |
| 21 | 24 | } |
| 22 | 25 | } |
| 23 | 26 | if ($form->settings['lists']['display_position'] === 'after') { |
| 24 | 27 | if ($form->type === $form->formClass::SUB_FORM_TYPE_POPUP && !empty($form->settings['message']['text']) && $form->settings['message']['position'] === 'before-lists') { |
| 25 | - echo '<p id="acym__subscription__form__popup-text">'.acym_translation($form->settings['message']['text']).'</p>'; | |
| 28 | + echo '<p id="acym__subscription__form__popup-text">'.esc_html(acym_translation($form->settings['message']['text'])).'</p>'; | |
| 26 | 29 | } |
| 27 | 30 | include acym_getPartial('forms', 'lists'); |
| 28 | 31 | } |
| 29 | 32 | include acym_getPartial('forms', 'termspolicy'); |
| 33 | + include acym_getPartial('forms', 'tracking_consent'); | |
| 30 | 34 | include acym_getPartial('forms', 'recaptcha'); |
| 31 | 35 | ?> |
| 32 | 36 | <style> |
| 33 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name.' '; ?>.acym__subscription__form__fields{ | |
| 37 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields{ | |
| 34 | 38 | display: flex; |
| 35 | 39 | justify-content: center; |
| 36 | 40 | align-items: center |
| 37 | 41 | } |
| 38 | 42 | |
| 39 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name.' '; ?>.acym__subscription__form__fields > *{ | |
| 40 | - margin: <?php echo in_array($form->type, [$form->formClass::SUB_FORM_TYPE_FOOTER, $form->formClass::SUB_FORM_TYPE_HEADER]) ? 'auto 10px' : '10px auto';?> !important; | |
| 43 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields > *{ | |
| 44 | + margin: <?php echo in_array($form->type, [$form->formClass::SUB_FORM_TYPE_FOOTER, $form->formClass::SUB_FORM_TYPE_HEADER]) ? 'auto 10px' : '10px auto'; ?> !important; | |
| 45 | + } | |
| 46 | + | |
| 47 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield{ | |
| 48 | + width: 100%; | |
| 49 | + box-sizing: border-box | |
| 50 | + } | |
| 51 | + | |
| 52 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), | |
| 53 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield select, | |
| 54 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield textarea{ | |
| 55 | + display: block; | |
| 56 | + width: <?php echo intval($form->settings['fields']['fields_width']) ?? 100; ?>%; | |
| 57 | + margin-left: auto; | |
| 58 | + margin-right: auto; | |
| 59 | + margin-bottom: 1rem; | |
| 60 | + box-sizing: border-box | |
| 61 | + } | |
| 62 | + | |
| 63 | + @media screen and (max-width: 768px){ | |
| 64 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), | |
| 65 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield select, | |
| 66 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield textarea{ | |
| 67 | + width: 100% | |
| 68 | + } | |
| 41 | 69 | } |
| 42 | 70 | </style> |
| 43 | 71 | </div> |