| @@ -1,0 +1,40 @@ | ||
| 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 | +<div id="archive_view"> | |
| 6 | + <?php | |
| 7 | + if (empty($data['receiver']->id)) { | |
| 8 | + echo '<p class="acym_front_message_warning">'.esc_html(acym_translation('ACYM_FRONT_ARCHIVE_NOT_CONNECTED')).'</p>'; | |
| 9 | + } | |
| 10 | + ?> | |
| 11 | + <h1 class="contentheading"><?php echo esc_html($data['mail']->subject); ?></h1> | |
| 12 | + | |
| 13 | + <input type="hidden" id="archive_view__content" value="<?php echo esc_attr($data['mail']->body); ?>" /> | |
| 14 | + <div style="min-width:80%" id="archive_view__preview"> | |
| 15 | + <?php | |
| 16 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Campaign content, built by admin and cannot be escaped. | |
| 17 | + echo $data['mail']->body; | |
| 18 | + ?> | |
| 19 | + </div> | |
| 20 | + | |
| 21 | + <?php | |
| 22 | + $attachments = json_decode(!empty($data['mail']->attachments) ? $data['mail']->attachments : '[]', true); | |
| 23 | + | |
| 24 | + if (!empty($attachments)) { | |
| 25 | + ?> | |
| 26 | + <fieldset class="newsletter_attachments"> | |
| 27 | + <legend><?php echo esc_html(acym_translation('ACYM_ATTACHMENTS')); ?></legend> | |
| 28 | + <table> | |
| 29 | + <?php | |
| 30 | + foreach ($attachments as $attachment) { | |
| 31 | + $onlyFilename = explode('/', $attachment['filename']); | |
| 32 | + $onlyFilename = end($onlyFilename); | |
| 33 | + | |
| 34 | + echo '<tr><td><a href="'.esc_url(acym_rootURI().$attachment['filename']).'" target="_blank">'.esc_html($onlyFilename).'</a></td></tr>'; | |
| 35 | + } | |
| 36 | + ?> | |
| 37 | + </table> | |
| 38 | + </fieldset> | |
| 39 | + <?php } ?> | |
| 40 | +</div> | |