PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.0
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.0
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
← All changes | back/Partial/editor/versions.php +138 -0 11.1.1 → 11.1.0 View file →
@@ -1,0 +1,138 @@
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 +use AcyMailing\Classes\TagClass;
6 +
7 +if (empty($data['mailInformation'])) {
8 + $data['mailInformation'] = $data['mail'];
9 +}
10 +
11 +$isAbTest = !empty($data['abtest']);
12 +
13 +?>
14 +<input type="hidden" name="current_version" id="current_version" value="main" />
15 +<input type="hidden" name="version_type" value="<?php echo $isAbTest ? 'abtest' : 'multilingual'; ?>" />
16 +<div class="cell acym__wysid__edit__versions-<?php echo $isAbTest ? 'abtest' : 'multilingual'; ?>" id="acym__wysid__edit__versions">
17 + <div class="acym__title acym__title__secondary">
18 + <?php
19 + if ($isAbTest) {
20 + echo esc_html(acym_translation('ACYM_VERSIONS'));
21 + } else {
22 + echo esc_html(acym_translation('ACYM_CONFIGURATION_LANGUAGES'));
23 + acym_info(['textShownInTooltip' => 'ACYM_MULTILINGUAL_DESC']);
24 + } ?>
25 + </div>
26 +
27 + <div class="acym__wysid__edit__versions__selection acym__wysid__edit__versions-selected">
28 + <?php
29 + if ($isAbTest) {
30 + echo '<i class="acymicon-pencil acym__wysid__edit__versions__selection__edition"></i>
31 + <i class="acymicon-check acym__wysid__edit__versions__selection__check"></i>
32 + <span class="acym__wysid__edit__versions__selection__element" acym-data-version="main">'.esc_html($data['main_version']->name).'</span>';
33 + } else {
34 + acym_tooltip(
35 + [
36 + 'hoveredText' => '<i class="acymicon-pencil acym__wysid__edit__versions__selection__edition"></i>
37 + <i class="acymicon-check acym__wysid__edit__versions__selection__check"></i>
38 + <img
39 + class="acym__wysid__edit__versions__selection__element"
40 + acym-data-version="main"
41 + src="'.acym_getFlagByCode($data['main_language']->code).'"
42 + alt="'.$data['main_language']->code.' flag">',
43 + 'textShownInTooltip' => $data['main_language']->name,
44 + ]
45 + );
46 + }
47 +
48 + ?>
49 +
50 + <?php
51 + $code = $isAbTest ? $data['main_version']->name : $data['main_language']->code;
52 + ?>
53 + <?php if (!$isAbTest) { ?>
54 + <input type="hidden" name="mail[language]" value="<?php echo esc_attr($code); ?>">
55 + <?php } ?>
56 + <input type="hidden" name="versions[main][subject]" value="">
57 + <input type="hidden" name="versions[main][preview]" value="">
58 + <input type="hidden" name="versions[main][content]" value="">
59 + <input type="hidden" name="versions[main][autosave]" value="">
60 + <input type="hidden" name="versions[main][settings]" value="">
61 + <input type="hidden" name="versions[main][stylesheet]" value="">
62 + </div>
63 + <?php
64 + $versions = $isAbTest ? $data['versions'] : $data['languages'];
65 + foreach ($versions as $version) {
66 + $containerClass = 'acym__wysid__edit__versions__selection';
67 + if (empty($version->subject)) {
68 + $containerClass .= ' acym__wysid__edit__versions__selection-empty';
69 + } else {
70 + $containerClass .= ' acym__wysid__edit__versions__selection-done';
71 + }
72 + ?>
73 +
74 + <div class="acym__wysid__edit__versions__separator"></div>
75 + <div class="<?php echo esc_attr($containerClass); ?>">
76 + <?php
77 + if ($isAbTest) {
78 + echo '<i class="acymicon-pencil acym__wysid__edit__versions__selection__edition"></i>
79 + <i class="acymicon-check acym__wysid__edit__versions__selection__check"></i>
80 + <span class="acym__wysid__edit__versions__selection__element" acym-data-version="'.esc_attr($version->code).'">'.esc_html(
81 + $version->name
82 + ).'</span>';
83 + } else {
84 + acym_tooltip(
85 + [
86 + 'hoveredText' => '<i class="acymicon-pencil acym__wysid__edit__versions__selection__edition"></i>
87 + <i class="acymicon-check acym__wysid__edit__versions__selection__check"></i>
88 + <img
89 + class="acym__wysid__edit__versions__selection__element"
90 + acym-data-version="'.$version->code.'"
91 + src="'.acym_getFlagByCode($version->code).'"
92 + alt="'.$version->code.' flag">',
93 + 'textShownInTooltip' => $version->name,
94 + ]
95 + );
96 + }
97 + ?>
98 +
99 + <input type="hidden" name="versions[<?php echo esc_attr($version->code); ?>][subject]" value="<?php echo esc_attr($version->subject); ?>">
100 + <input type="hidden" name="versions[<?php echo esc_attr($version->code); ?>][preview]" value="<?php echo esc_attr($version->preview); ?>">
101 + <input type="hidden" name="versions[<?php echo esc_attr($version->code); ?>][content]" value="<?php echo esc_attr($version->content); ?>">
102 + <input type="hidden" name="versions[<?php echo esc_attr($version->code); ?>][autosave]" value="<?php echo esc_attr($version->autosave); ?>">
103 + <input type="hidden" name="versions[<?php echo esc_attr($version->code); ?>][settings]" value="<?php echo esc_attr($version->settings); ?>">
104 + <input type="hidden" name="versions[<?php echo esc_attr($version->code); ?>][stylesheet]" value="<?php echo esc_attr($version->stylesheet); ?>">
105 + </div>
106 + <?php
107 + }
108 + ?>
109 +</div>
110 +
111 +<div id="acym__wysid__edit__versions__creation" class="cell grid-x grid-margin-x text-center align-center is-hidden">
112 + <h5><?php echo esc_html(acym_translation($isAbTest ? 'ACYM_VERSION_CREATION_TITLE' : 'ACYM_MULTILINGUAL_CREATION_TITLE')); ?></h5>
113 + <div class="cell"><?php echo esc_html(acym_translation($isAbTest ? 'ACYM_VERSION_CREATION_DESCRIPTION' : 'ACYM_MULTILINGUAL_CREATION_DESCRIPTION')); ?></div>
114 + <button type="button" class="cell button xlarge-4 large-4 margin-top-1 button-secondary" id="acym__wysid__edit__versions__creation__default">
115 + <?php echo esc_html(acym_translation('ACYM_MULTILINGUAL_CREATION_FROM_DEFAULT')); ?>
116 + </button>
117 + <button type="button" class="cell button xlarge-4 large-4 margin-top-1 button-secondary" id="acym__wysid__edit__versions__creation__scratch">
118 + <?php echo esc_html(acym_translation('ACYM_MULTILINGUAL_CREATION_FROM_SCRATCH')); ?>
119 + </button>
120 + <button type="button"
121 + data-open="acym__template__choose__modal"
122 + aria-controls="acym__template__choose__modal"
123 + tabindex="0"
124 + aria-haspopup="true"
125 + class="cell button xlarge-4 large-4 margin-top-1 button-secondary">
126 + <?php echo esc_html(acym_translation('ACYM_START_FROM_TEMPLATE')); ?>
127 + </button>
128 + <?php
129 + $dataForTemplate = ['allTags' => $data['tagClass']->getAllTagsByType(TagClass::TYPE_MAIL)];
130 + acym_modalInclude(
131 + '',
132 + ACYM_VIEW.'Mails'.DS.'tmpl'.DS.'choose_template_ajax.php',
133 + 'acym__template__choose__modal',
134 + $dataForTemplate,
135 + 'acym__template__choose__modal__listing'
136 + );
137 + ?>
138 +</div>