PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.10.2
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.10.2
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / widgets / subscriptionform / tmpl / tableless.php

tableless.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.10.2, at widgets/subscriptionform/tmpl/tableless.php

101 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use AcyMailing\Helpers\CaptchaHelper;
4
5 $listsContent = '';
6 if (!empty($visibleLists)) {
7 $listsContent .= '<div class="acym_lists">';
8 foreach ($visibleLists as $myListId) {
9 $check = '';
10 if (in_array($myListId, $checkedLists)) {
11 $check = 'checked="checked"';
12 }
13
14 $listsContent .= '
15 <div class="onelist">
16 <input type="checkbox" class="acym_checkbox" name="subscription[]" id="acylist_'.$myListId.'_'.$formName.'" '.$check.' value="'.$myListId.'"/>
17 <label for="acylist_'.$myListId.'_'.$formName.'">'.(!empty($allLists[$myListId]->display_name) ? $allLists[$myListId]->display_name : $allLists[$myListId]->name).'</label>
18 </div>';
19 }
20 $listsContent .= '</div>';
21 }
22 if ($listPosition == 'before') echo $listsContent;
23 ?>
24
25 <div class="acym_form">
26 <?php
27 foreach ($fields as $field) {
28 $field->option = !empty($field->option) ? json_decode($field->option) : new stdClass();
29 $fieldDB = empty($field->option->fieldDB) ? '' : json_decode($field->option->fieldDB);
30 $field->value = empty($field->value) ? '' : json_decode($field->value);
31 $valuesArray = [];
32 if (!empty($field->value)) {
33 foreach ($field->value as $value) {
34 $valueTmp = new stdClass();
35 $valueTmp->text = $value->title;
36 $valueTmp->value = $value->value;
37 if ($value->disabled == 'y') $valueTmp->disable = true;
38 $valuesArray[$value->value] = $valueTmp;
39 }
40 }
41 if (!empty($fieldDB) && !empty($fieldDB->value)) {
42 $fromDB = $fieldClass->getValueFromDB($fieldDB);
43 foreach ($fromDB as $value) {
44 $valuesArray[$value->value] = $value->title;
45 }
46 }
47 echo '<div class="onefield fieldacy'.$field->id.' acyfield_'.$field->type.'" id="field_'.$field->id.'">';
48 echo $fieldClass->displayField($field, $field->default_value, $valuesArray, $displayOutside, true, $identifiedUser);
49 echo '</div>';
50
51 if ($field->id == 2 && $config->get('email_confirmation')) {
52 echo $fieldClass->setEmailConfirmationField($displayOutside, $field);
53 }
54 }
55
56 if ($listPosition != 'before') echo $listsContent;
57
58 if (empty($identifiedUser->id) && $config->get('captcha', 'none') !== 'none' && acym_level(ACYM_ESSENTIAL)) {
59 echo '<div class="onefield fieldacycaptcha" id="field_captcha_'.$formName.'">';
60 $captcha = new CaptchaHelper();
61 echo $captcha->display($formName);
62 echo '</div>';
63 }
64
65 if (!empty($termslink)) {
66 echo '<div class="onefield fieldacyterms" id="field_terms_'.$formName.'">';
67 echo '<label for="mailingdata_terms_'.$formName.'">';
68 echo '<input id="mailingdata_terms_'.$formName.'" class="checkbox" type="checkbox" name="terms" title="'.acym_translation('ACYM_TERMS_CONDITIONS').'"/> '.$termslink;
69 echo '</label>';
70 echo '</div>';
71 }
72 ?>
73 </div>
74
75 <p class="acysubbuttons">
76 <noscript>
77 <?php echo acym_translation('ACYM_NO_JAVASCRIPT'); ?>
78 </noscript>
79 <?php
80 $onclickSubscribe = 'try{ return submitAcymForm("subscribe","'.$formName.'", "acymSubmitSubForm"); }catch(err){alert("The form could not be submitted "+err);return false;}';
81 $onclickUnsubscribe = 'try{ return submitAcymForm("unsubscribe","'.$formName.'", "acymSubmitSubForm"); }catch(err){alert("The form could not be submitted "+err);return false;}';
82
83 if ($disableButtons) {
84 $onclickSubscribe = 'return false;';
85 $onclickUnsubscribe = 'return false;';
86 }
87 ?>
88 <button type="submit"
89 class="btn btn-primary button subbutton"
90 onclick="<?php echo acym_escape($onclickSubscribe); ?>">
91 <?php echo acym_escape(acym_translation($subscribeText)); ?>
92 </button>
93 <?php if ($unsubButton === '2' || ($unsubButton === '1' && !empty($countUnsub))) { ?>
94 <button type="submit"
95 class="btn button unsubbutton"
96 onclick="<?php echo acym_escape($onclickUnsubscribe); ?>">
97 <?php echo acym_escape(acym_translation($unsubscribeText)); ?>
98 </button>
99 <?php } ?>
100 </p>
101