| 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 |
if (empty($data['allMails'])) { ?> |
| 5 |
<h1 class="cell acym__listing__empty__search__title text-center"><?php echo esc_html(acym_translation('ACYM_NO_RESULTS_FOUND')); ?></h1> |
| 6 |
<?php } else { ?> |
| 7 |
<div class="cell margin-bottom-1 acym__listing__actions grid-x"> |
| 8 |
<?php |
| 9 |
$actions = [ |
| 10 |
'massDuplicate' => acym_translation('ACYM_DUPLICATE'), |
| 11 |
'delete' => acym_translation('ACYM_DELETE'), |
| 12 |
]; |
| 13 |
acym_listingActions($actions); |
| 14 |
?> |
| 15 |
<div class="margin-left-1 margin-right-1 cell medium-auto hide-for-small-only"> |
| 16 |
<?php acym_externalLink( |
| 17 |
'ACYM_SEE_OUR_TEMPLATES_PACK', |
| 18 |
ACYM_ACYMAILING_WEBSITE.'pack-templates-newsletter/?utm_source=acymailing_plugin&utm_campaign=purchase_templates_pack&utm_medium=button_template_listing' |
| 19 |
); ?> |
| 20 |
</div> |
| 21 |
<div class="grid-x cell auto"> |
| 22 |
<div class="cell acym_listing_sort-by"> |
| 23 |
<?php |
| 24 |
acym_sortBy( |
| 25 |
[ |
| 26 |
'name' => acym_translation('ACYM_NAME'), |
| 27 |
'creation_date' => acym_translation('ACYM_DATE_CREATED'), |
| 28 |
], |
| 29 |
'mails', |
| 30 |
$data['ordering'], |
| 31 |
$data['orderingSortOrder'] |
| 32 |
); |
| 33 |
?> |
| 34 |
</div> |
| 35 |
</div> |
| 36 |
</div> |
| 37 |
<div class="grid-x grid-padding-x grid-padding-y grid-margin-x grid-margin-y xxlarge-up-6 large-up-4 medium-up-3 small-up-1 cell margin-bottom-2"> |
| 38 |
<?php foreach ($data['allMails'] as $oneTemplate) { ?> |
| 39 |
<div class="cell grid-x acym__templates__oneTpl acym__listing__block text-center" data-acy-elementid="<?php echo esc_attr($oneTemplate->id); ?>"> |
| 40 |
<a href="<?php echo esc_url(acym_completeLink('mails&task=edit&id='.esc_attr($oneTemplate->id))); ?>" class="cell grid-x text-center"> |
| 41 |
<div class="cell acym__templates__pic"> |
| 42 |
<?php echo '<img src="'.esc_url(acym_getMailThumbnail($oneTemplate->thumbnail)).'" alt="'.esc_attr($oneTemplate->name).'"/>'; ?> |
| 43 |
</div> |
| 44 |
</a> |
| 45 |
<a href="<?php echo esc_url(acym_completeLink('mails&task=edit&id='.esc_attr($oneTemplate->id))); ?>" class="cell grid-x text-center"> |
| 46 |
<div class="cell grid-x acym__templates__footer text-center margin-vertical-1"> |
| 47 |
<div class="cell acym__templates__footer__title acym_text_ellipsis" title="<?php echo esc_attr($oneTemplate->name); ?>"> |
| 48 |
<?php echo esc_html($oneTemplate->name); ?> |
| 49 |
</div> |
| 50 |
<div class="cell acym__templates__footer__date"><?php echo esc_html( |
| 51 |
acym_date($oneTemplate->creation_date, acym_getDateTimeFormat('ACYM_DATE_FORMAT_LC3')) |
| 52 |
); ?></div> |
| 53 |
</div> |
| 54 |
</a> |
| 55 |
<button type="button" data-task="export" data-template="<?php echo intval($oneTemplate->id); ?>" class="text-center cell button acym__listing__block__export"> |
| 56 |
<?php echo esc_html(acym_translation('ACYM_DOWNLOAD')); ?> <i class="acymicon-download"></i> |
| 57 |
</button> |
| 58 |
|
| 59 |
<div class="acym__listing__block__select"> |
| 60 |
<input id="checkbox_<?php echo esc_attr($oneTemplate->id); ?>" |
| 61 |
type="checkbox" |
| 62 |
name="elements_checked[]" |
| 63 |
value="<?php echo esc_attr($oneTemplate->id); ?>"> |
| 64 |
</div> |
| 65 |
|
| 66 |
<div class="acym__listing__block__icons"> |
| 67 |
|
| 68 |
<!-- ICON DEFAULT --> |
| 69 |
<?php $icon = $data['favoriteTemplateId'] === intval($oneTemplate->id) ? 'acymicon-star' : 'acymicon-star-o'; ?> |
| 70 |
<button class="acym__icon acym__listing__default_template" |
| 71 |
type="button" |
| 72 |
data-task="favorite" |
| 73 |
data-template="<?php echo intval($oneTemplate->id); ?>"> |
| 74 |
<i class="<?php echo esc_attr($icon); ?>"></i> |
| 75 |
</button> |
| 76 |
|
| 77 |
<!-- ICON DUPLICATE --> |
| 78 |
<button class="acym__icon acym__listing__block__duplicate" |
| 79 |
type="button" |
| 80 |
data-task="oneDuplicate" |
| 81 |
data-template="<?php echo intval($oneTemplate->id); ?>"> |
| 82 |
<i class="acymicon-content-copy"></i> |
| 83 |
</button> |
| 84 |
|
| 85 |
<!-- ICON DELETE --> |
| 86 |
<div class="acym__listing__block__delete"> |
| 87 |
<div> |
| 88 |
<div class="js-acym__listing__block__delete__trash acym__listing__block__delete__trash acym__icon"> |
| 89 |
<i class="acymicon-delete"></i> |
| 90 |
</div> |
| 91 |
<div class="acym__listing__block__delete__action"> |
| 92 |
|
| 93 |
<div class="js-acym_toggle_delete |
| 94 |
acym__icon |
| 95 |
acym__listing__block__delete__submit" |
| 96 |
data-acy-table="mail" |
| 97 |
data-acy-elementid="<?php echo esc_attr($oneTemplate->id); ?>"> |
| 98 |
<i class="acymicon-delete"></i> |
| 99 |
</div> |
| 100 |
|
| 101 |
<div class="acym__listing__block__delete__cancel acym__background-color__very-dark-gray acym__color__white"> |
| 102 |
<i class="acymicon-keyboard-arrow-right acym__color__white"></i> |
| 103 |
</div> |
| 104 |
</div> |
| 105 |
</div> |
| 106 |
</div> |
| 107 |
</div> |
| 108 |
</div> |
| 109 |
<?php } ?> |
| 110 |
<input type="hidden" name="templateId" value="" /> |
| 111 |
</div> |
| 112 |
<?php |
| 113 |
$data['pagination']->display('mails'); |
| 114 |
} |
| 115 |
|