| @@ -1,33 +1,39 @@ | ||
| 1 | -<div id="acym_fulldiv_<?php echo $form->form_tag_name; ?>" class="acym__subscription__form__footer acym__subscription__form-erase"> | |
| 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 id="acym_fulldiv_<?php echo esc_attr($form->form_tag_name); ?>" class="acym__subscription__form__footer acym__subscription__form-erase"> | |
| 2 | 6 | <?php |
| 3 | 7 | if ($edition) { |
| 4 | - echo '<form action="#" onsubmit="return false;" id="'.$form->form_tag_name.'">'; | |
| 8 | + echo '<form action="#" onsubmit="return false;" id="'.esc_attr($form->form_tag_name).'">'; | |
| 5 | 9 | } else { |
| 6 | - $cookieExpirationAttr = empty($form->settings['cookie']['cookie_expiration']) ? 'acym-data-cookie="1"' | |
| 7 | - : 'acym-data-cookie="'.$form->settings['cookie']['cookie_expiration'].'"'; | |
| 8 | - echo '<form acym-data-id="'.$form->id.'" '.$cookieExpirationAttr.' action="'.$form->form_tag_action.'" id="'.$form->form_tag_name.'" name="'.$form->form_tag_name.'" enctype="multipart/form-data" onsubmit="return submitAcymForm(\'subscribe\',\''.$form->form_tag_name.'\', \'acymSubmitSubForm\')">'; | |
| 10 | + $cookieExpiration = empty($form->settings['cookie']['cookie_expiration']) ? '1' : $form->settings['cookie']['cookie_expiration']; | |
| 11 | + echo '<form acym-data-id="'.esc_attr($form->id).'" | |
| 12 | + acym-data-cookie="'.intval($cookieExpiration).'" | |
| 13 | + action="'.esc_url($form->form_tag_action).'" | |
| 14 | + id="'.esc_attr($form->form_tag_name).'" | |
| 15 | + name="'.esc_attr($form->form_tag_name).'" | |
| 16 | + aria-label="'.esc_attr(acym_translation('ACYM_SUBSCRIPTION')).'" | |
| 17 | + enctype="multipart/form-data" | |
| 18 | + onsubmit="return submitAcymForm(\'subscribe\',\''.esc_attr($form->form_tag_name).'\', \'acymSubmitSubForm\')">'; | |
| 9 | 19 | } |
| 10 | - $files = [ | |
| 11 | - 0 => $form->settings['style']['position'] == 'button-right' ? 'fields' : 'button', | |
| 12 | - 1 => $form->settings['style']['position'] == 'button-right' ? 'button' : 'fields', | |
| 13 | - ]; | |
| 20 | + include acym_getPartial('forms', 'fields'); | |
| 21 | + include acym_getPartial('forms', 'button'); | |
| 22 | + include acym_getPartial('forms', 'hidden_params'); | |
| 14 | 23 | |
| 15 | - include acym_getPartial('forms', $files[0]); | |
| 16 | - include acym_getPartial('forms', $files[1]); | |
| 17 | - include acym_getPartial('forms', 'hidden_params'); | |
| 24 | + echo '</form>'; | |
| 18 | 25 | ?> |
| 19 | - </form> | |
| 20 | 26 | </div> |
| 21 | 27 | <style> |
| 22 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name; ?>.acym__subscription__form__footer{ | |
| 28 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer{ | |
| 23 | 29 | position: fixed; |
| 24 | 30 | bottom: 0; |
| 25 | 31 | right: 0; |
| 26 | 32 | left: 0; |
| 27 | - height: <?php echo $form->settings['style']['size']['height']; ?>px; | |
| 28 | - background-color: <?php echo $form->settings['style']['background_color']; ?>; | |
| 29 | - color: <?php echo $form->settings['style']['text_color']; ?> !important; | |
| 33 | + height: <?php echo esc_html($form->settings['style']['size']['height']); ?>px; | |
| 34 | + background-color: <?php echo esc_html($form->settings['style']['background_color']); ?>; | |
| 35 | + color: <?php echo esc_html($form->settings['style']['text_color']); ?> !important; | |
| 30 | 36 | padding: .5rem; |
| 31 | 37 | z-index: 999999; |
| 32 | 38 | text-align: center; |
| 33 | 39 | display: flex; |
| @@ -34,14 +40,14 @@ | ||
| 34 | 40 | justify-content: center; |
| 35 | 41 | align-items: center |
| 36 | 42 | } |
| 37 | 43 | |
| 38 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name; ?>.acym__subscription__form__footer .responseContainer{ | |
| 44 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer .responseContainer{ | |
| 39 | 45 | margin-bottom: 0 !important; |
| 40 | 46 | padding: .4rem !important; |
| 41 | 47 | } |
| 42 | 48 | |
| 43 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name; ?>.acym__subscription__form__footer <?php echo '#'.$form->form_tag_name; ?>{ | |
| 49 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer <?php echo '#'.esc_html($form->form_tag_name); ?>{ | |
| 44 | 50 | margin: 0; |
| 45 | 51 | display: flex; |
| 46 | 52 | justify-content: center; |
| 47 | 53 | align-items: center |
| @@ -46,16 +52,45 @@ | ||
| 46 | 52 | justify-content: center; |
| 47 | 53 | align-items: center |
| 48 | 54 | } |
| 49 | 55 | |
| 50 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name; ?>.acym__subscription__form__footer .acym__subscription__form__fields, <?php echo '#acym_fulldiv_'.$form->form_tag_name; ?>.acym__subscription__form__footer .acym__subscription__form__button{ | |
| 56 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer .acym__subscription__form__fields, <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer .acym__subscription__form__button{ | |
| 51 | 57 | display: flex; |
| 52 | 58 | justify-content: center; |
| 53 | 59 | align-items: center |
| 54 | 60 | } |
| 55 | 61 | |
| 56 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name; ?> | |
| 62 | + <?php if (($form->settings['style']['position'] ?? '') !== 'button-right') { ?> | |
| 63 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer .acym__subscription__form__button{ | |
| 64 | + order: -1; | |
| 65 | + } | |
| 66 | + <?php } ?> | |
| 67 | + | |
| 68 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?> | |
| 57 | 69 | .acym__users__creation__fields__title{ |
| 58 | 70 | margin: 0.5rem |
| 71 | + } | |
| 72 | + | |
| 73 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer, | |
| 74 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer <?php echo '#'.esc_html($form->form_tag_name); ?>, | |
| 75 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer .acym__subscription__form__fields{ | |
| 76 | + flex-wrap: wrap; | |
| 77 | + max-width: 100%; | |
| 78 | + } | |
| 79 | + | |
| 80 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer{ | |
| 81 | + height: auto; | |
| 82 | + min-height: <?php echo esc_html($form->settings['style']['size']['height']); ?>px; | |
| 83 | + } | |
| 84 | + | |
| 85 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer .acym__subscription__form__fields .onefield{ | |
| 86 | + width: auto; | |
| 87 | + } | |
| 88 | + | |
| 89 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer .acym__subscription__form__fields .onefield input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), | |
| 90 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer .acym__subscription__form__fields .onefield select, | |
| 91 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name); ?>.acym__subscription__form__footer .acym__subscription__form__fields .onefield textarea{ | |
| 92 | + width: auto; | |
| 93 | + max-width: 220px; | |
| 59 | 94 | } |
| 60 | 95 | </style> |
| 61 | 96 | <?php if (!$edition) include acym_getPartial('forms', 'cookie'); ?> |