| 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 |
?> |
| 5 |
<div class="acym__subscription__form__fields"> |
| 6 |
<?php |
| 7 |
$config = acym_config(); |
| 8 |
if ($form->settings['lists']['display_position'] === 'before') { |
| 9 |
if ($form->type === $form->formClass::SUB_FORM_TYPE_POPUP && !empty($form->settings['message']['text']) && $form->settings['message']['position'] === 'before-lists') { |
| 10 |
echo '<p id="acym__subscription__form__popup-text">'.esc_html(acym_translation($form->settings['message']['text'])).'</p>'; |
| 11 |
} |
| 12 |
include acym_getPartial('forms', 'lists'); |
| 13 |
} |
| 14 |
if ($form->type === $form->formClass::SUB_FORM_TYPE_POPUP && !empty($form->settings['message']['text']) && $form->settings['message']['position'] === 'before-fields') { |
| 15 |
echo '<p id="acym__subscription__form__popup-text">'.esc_html(acym_translation($form->settings['message']['text'])).'</p>'; |
| 16 |
} |
| 17 |
foreach ($form->settings['fields']['displayed'] as $field) { |
| 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); |
| 20 |
echo '</div>'; |
| 21 |
|
| 22 |
if ($field->id == 2 && $config->get('email_confirmation')) { |
| 23 |
$form->fieldClass->setEmailConfirmationField($form->settings['fields']['display_mode'] === 'outside', $field); |
| 24 |
} |
| 25 |
} |
| 26 |
if ($form->settings['lists']['display_position'] === 'after') { |
| 27 |
if ($form->type === $form->formClass::SUB_FORM_TYPE_POPUP && !empty($form->settings['message']['text']) && $form->settings['message']['position'] === 'before-lists') { |
| 28 |
echo '<p id="acym__subscription__form__popup-text">'.esc_html(acym_translation($form->settings['message']['text'])).'</p>'; |
| 29 |
} |
| 30 |
include acym_getPartial('forms', 'lists'); |
| 31 |
} |
| 32 |
include acym_getPartial('forms', 'termspolicy'); |
| 33 |
include acym_getPartial('forms', 'tracking_consent'); |
| 34 |
include acym_getPartial('forms', 'recaptcha'); |
| 35 |
?> |
| 36 |
<style> |
| 37 |
<?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields{ |
| 38 |
display: flex; |
| 39 |
justify-content: center; |
| 40 |
align-items: center |
| 41 |
} |
| 42 |
|
| 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 |
} |
| 69 |
} |
| 70 |
</style> |
| 71 |
</div> |
| 72 |
|