| 1 |
<?php |
| 2 |
$termspolicy = $form->settings['termspolicy'] ?? []; |
| 3 |
|
| 4 |
if (empty($termspolicy['privacy_type']) || $termspolicy['privacy_type'] === 'article') { |
| 5 |
$privacyURL = acym_getArticleURL( |
| 6 |
(int)($termspolicy['privacy'] ?? 0), |
| 7 |
false, |
| 8 |
'ACYM_PRIVACY_POLICY' |
| 9 |
); |
| 10 |
} elseif ($termspolicy['privacy_type'] === 'url') { |
| 11 |
$privacyURL = $termspolicy['privacy_url'] ?? ''; |
| 12 |
} else { |
| 13 |
$privacyURL = ''; |
| 14 |
} |
| 15 |
|
| 16 |
if (empty($termspolicy['terms_type']) || $termspolicy['terms_type'] === 'article') { |
| 17 |
$termsURL = acym_getArticleURL( |
| 18 |
(int)($termspolicy['termscond'] ?? 0), |
| 19 |
false, |
| 20 |
'ACYM_TERMS_CONDITIONS' |
| 21 |
); |
| 22 |
} elseif ($termspolicy['terms_type'] === 'url') { |
| 23 |
$termsURL = $termspolicy['terms_url'] ?? ''; |
| 24 |
} else { |
| 25 |
$termsURL = ''; |
| 26 |
} |
| 27 |
|
| 28 |
if (!empty($termspolicy['privacy_type']) && $termspolicy['privacy_type'] === 'url' && !empty($privacyURL)) { |
| 29 |
$privacyURL = '<a href="'.acym_escapeUrl($privacyURL).'" target="_blank">'.acym_translation('ACYM_PRIVACY_POLICY').'</a>'; |
| 30 |
} |
| 31 |
|
| 32 |
if (!empty($termspolicy['terms_type']) && $termspolicy['terms_type'] === 'url' && !empty($termsURL)) { |
| 33 |
$termsURL = '<a href="'.acym_escapeUrl($termsURL).'" target="_blank">'.acym_translation('ACYM_TERMS_CONDITIONS').'</a>'; |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
if (empty($termsURL) && empty($privacyURL)) { |
| 38 |
$termslink = ''; |
| 39 |
} elseif (empty($privacyURL)) { |
| 40 |
$termslink = acym_translationSprintf('ACYM_I_AGREE_TERMS', $termsURL); |
| 41 |
} elseif (empty($termsURL)) { |
| 42 |
$termslink = acym_translationSprintf('ACYM_I_AGREE_PRIVACY', $privacyURL); |
| 43 |
} else { |
| 44 |
$termslink = acym_translationSprintf('ACYM_I_AGREE_BOTH', $termsURL, $privacyURL); |
| 45 |
} |
| 46 |
|
| 47 |
if (!empty($termslink)) { |
| 48 |
echo '<div class="acym__subscription__form__termscond">'; |
| 49 |
echo '<div class="onefield fieldacyterms" id="field_terms_'.$form->form_tag_name.'">'; |
| 50 |
echo '<label for="mailingdata_terms_'.$form->form_tag_name.'">'; |
| 51 |
echo '<input id="mailingdata_terms_'.$form->form_tag_name.'" class="checkbox" type="checkbox" name="terms" title="'.acym_translation('ACYM_TERMS_CONDITIONS').'"/> '.$termslink; |
| 52 |
echo '</label>'; |
| 53 |
echo '</div>'; |
| 54 |
?> |
| 55 |
|
| 56 |
<style> |
| 57 |
.acym__subscription__form__header .acym__subscription__form__termscond, |
| 58 |
.acym__subscription__form__footer .acym__subscription__form__termscond{ |
| 59 |
max-width: 250px; |
| 60 |
} |
| 61 |
|
| 62 |
<?php echo '#acym_fulldiv_'.$form->form_tag_name.' '; ?>.acym__subscription__form__fields .acym__subscription__form__termscond input[type="checkbox"]{ |
| 63 |
margin-top: 0 !important; |
| 64 |
} |
| 65 |
</style> |
| 66 |
</div> |
| 67 |
<?php } ?> |
| 68 |
|