PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.0.1
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.0.1
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 / default.php

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

108 lines 4.7 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 .= '<table 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 <tr>
16 <td>
17 <input type="checkbox" class="acym_checkbox" name="subscription[]" id="acylist_'.$myListId.'_'.$formName.'" '.$check.' value="'.$myListId.'"/>
18 <label for="acylist_'.$myListId.'_'.$formName.'">'.(!empty($allLists[$myListId]->display_name) ? $allLists[$myListId]->display_name
19 : $allLists[$myListId]->name).'</label>
20 </td>
21 </tr>';
22 }
23 $listsContent .= '</table>';
24 }
25 if ($listPosition == 'before') echo $listsContent;
26 ?>
27
28 <table class="acym_form">
29 <tr>
30 <?php
31 foreach ($fields as $field) {
32 $field->option = json_decode($field->option);
33 $fieldDB = empty($field->option->fieldDB) ? '' : json_decode($field->option->fieldDB);
34 $field->value = empty($field->value) ? '' : json_decode($field->value);
35 $valuesArray = [];
36 if (!empty($field->value)) {
37 foreach ($field->value as $value) {
38 $valueTmp = new stdClass();
39 $valueTmp->text = $value->title;
40 $valueTmp->value = $value->value;
41 if ($value->disabled == 'y') $valueTmp->disable = true;
42 $valuesArray[$value->value] = $valueTmp;
43 }
44 }
45 if (!empty($fieldDB) && !empty($fieldDB->value)) {
46 $fromDB = $fieldClass->getValueFromDB($fieldDB);
47 foreach ($fromDB as $value) {
48 $valuesArray[$value->value] = $value->title;
49 }
50 }
51 $size = empty($field->option->size) ? '' : 'width:'.$field->option->size.'px';
52
53 echo '<td class="onefield acyfield_'.$field->id.' acyfield_'.$field->type.'">';
54 echo $fieldClass->displayField($field, $field->default_value, $size, $valuesArray, $displayOutside, true, $identifiedUser);
55 echo '</td>';
56 if (!$displayInline) echo '</tr><tr>';
57
58 if ($field->id == 2 && $config->get('email_confirmation')) {
59 echo $fieldClass->setEmailConfirmationField($displayOutside, $size, 'td', $displayInline);
60 }
61 }
62
63 if ($listPosition != 'before') {
64 echo '<td>'.$listsContent.'</td>';
65 if (!$displayInline) echo '</tr><tr>';
66 }
67
68 if (empty($identifiedUser->id) && $config->get('captcha', 'none') !== 'none' && acym_level(ACYM_ESSENTIAL)) {
69 echo '<td class="captchakeymodule" '.($displayOutside && !$displayInline ? 'colspan="2"' : '').'>';
70 $captcha = new CaptchaHelper();
71 echo $captcha->display($formName);
72 echo '</td>';
73 if (!$displayInline) echo '</tr><tr>';
74 }
75
76 if (!empty($termslink)) {
77 echo '<td class="acyterms" '.($displayOutside && !$displayInline ? 'colspan="2"' : '').'>';
78 echo '<input id="mailingdata_terms_'.$formName.'" class="checkbox" type="checkbox" name="terms" title="'.acym_translation('ACYM_TERMS_CONDITIONS').'"/> '.$termslink;
79 echo '</td>';
80 if (!$displayInline) echo '</tr><tr>';
81 }
82 ?>
83
84 <td <?php if ($displayOutside && !$displayInline) echo 'colspan="2"'; ?> class="acysubbuttons">
85 <noscript>
86 <?php echo acym_translation('ACYM_NO_JAVASCRIPT'); ?>
87 </noscript>
88 <?php
89 $onclickSubscribe = 'try{ return submitAcymForm("subscribe","'.$formName.'", "acymSubmitSubForm"); }catch(err){alert("The form could not be submitted "+err);return false;}';
90 $onclickUnsubscribe = 'try{ return submitAcymForm("unsubscribe","'.$formName.'", "acymSubmitSubForm"); }catch(err){alert("The form could not be submitted "+err);return false;}';
91 ?>
92 <input type="button"
93 class="btn btn-primary button subbutton"
94 value="<?php echo acym_translation($subscribeText, true); ?>"
95 name="Submit"
96 onclick="<?php echo $disableButtons ? 'return true' : acym_escape($onclickSubscribe); ?>" />
97 <?php if ($unsubButton === '2' || ($unsubButton === '1' && !empty($countUnsub))) { ?>
98 <span style="display: none;"></span>
99 <input type="button"
100 class="btn button unsubbutton"
101 value="<?php echo acym_translation($unsubscribeText, true); ?>"
102 name="Submit"
103 onclick="<?php echo $disableButtons ? 'return true' : acym_escape($onclickUnsubscribe); ?>" />
104 <?php } ?>
105 </td>
106 </tr>
107 </table>
108