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