Skip to content
wiki.fftac.org

Template Downloads - Source Excerpt 03

Back to Template Downloads

Summary

This source excerpt preserves a bounded section of Anti-Christ.org/wp-content/themes/antichrist-engine/template-downloads.php so readers can inspect the evidence without opening the full source file.

**Source path:** Anti-Christ.org/wp-content/themes/antichrist-engine/template-downloads.php

<p><?php esc_html_e('Vector and square PNG exports are included so the seal can move cleanly across digital contexts.', 'antichrist-engine'); ?></p>
                </article>
                <?php if ($artifact_study_count > 0) : ?>
                    <article class="statement-card foundation-status-card">
                        <span><?php esc_html_e('Artifact Studies', 'antichrist-engine'); ?></span>
                        <strong><?php echo esc_html(number_format_i18n($artifact_study_count)); ?></strong>
                        <p><?php esc_html_e('Supplemental parchment, album, and coin studies extend the symbolic language without replacing the canonical press-kit layer.', 'antichrist-engine'); ?></p>
                    </article>
                <?php endif; ?>
                <?php if ($research_export_count > 0) : ?>
                    <article class="statement-card foundation-status-card">
                        <span><?php esc_html_e('Research Exports', 'antichrist-engine'); ?></span>
                        <strong><?php echo esc_html(number_format_i18n($research_export_count)); ?></strong>
                        <p><?php esc_html_e('Generated CSV, NDJSON, and provenance downloads are tied directly to the live atlas instead of static stale bundles.', 'antichrist-engine'); ?></p>
                    </article>
                <?php endif; ?>
            </section>

            <?php foreach ($collections as $collection) : ?>
                <section id="<?php echo esc_attr($collection['anchor']); ?>" class="card foundation-panel">
                    <header class="entry-header">
                        <p class="eyebrow"><?php echo esc_html($collection['eyebrow']); ?></p>
                        <h2><?php echo esc_html($collection['title']); ?></h2>
                        <p><?php echo esc_html($collection['summary']); ?></p>
                    </header>
                    <div class="downloads-grid">
                        <?php foreach ($collection['items'] as $item) : ?>
                            <?php
                            $preview_asset          = $describe_asset($item['preview'] ?? '');
                            $resolved_actions       = array_values(array_filter(array_map($resolve_download_action, (array) ($item['actions'] ?? array()))));
                            $viewer_open_action     = array();
                            $viewer_download_action = array();

                            foreach ($resolved_actions as $resolved_action) {
                                if (empty($viewer_open_action) && 'download' !== ($resolved_action['mode'] ?? 'view')) {
                                    $viewer_open_action = $resolved_action;
                                }

                                if (empty($viewer_download_action) && 'download' === ($resolved_action['mode'] ?? 'view')) {
                                    $viewer_download_action = $resolved_action;
                                }
                            }

                            if (empty($viewer_open_action) && !empty($resolved_actions[0])) {
                                $viewer_open_action = $resolved_actions[0];
                            }

                            if (empty($viewer_download_action) && !empty($viewer_open_action)) {
                                $viewer_download_action = $viewer_open_action;
                            }

                            $viewer_meta = $build_viewer_meta(array(
                                array(
                                    'label' => __('Collection', 'antichrist-engine'),
                                    'value' => (string) ($collection['title'] ?? ''),
                                ),
                                array(
                                    'label' => __('Preview', 'antichrist-engine'),
                                    'value' => (string) ($preview_asset['meta_label'] ?? ''),
                                ),
                                array(
                                    'label' => __('Primary file', 'antichrist-engine'),
                                    'value' => (string) ($viewer_download_action['meta_label'] ?? ($viewer_open_action['meta_label'] ?? '')),
                                ),
                            ));
                            ?>
                            <article class="card foundation-panel download-card">
                                <div class="download-card__media">
                                    <?php if ($preview_asset['exists']) : ?>
                                        <a
                                            class="download-card__media-link"
                                            href="<?php echo esc_url($preview_asset['url']); ?>"
                                            data-image-viewer-trigger="true"
                                            data-viewer-eyebrow="<?php echo esc_attr($item['eyebrow'] ?? __('Asset Preview', 'antichrist-engine')); ?>"
                                            data-viewer-title="<?php echo esc_attr($item['title']); ?>"
                                            data-viewer-summary="<?php echo esc_attr($item['summary'] ?? ''); ?>"
                                            data-viewer-src="<?php echo esc_url($preview_asset['url']); ?>"
                                            data-viewer-alt="<?php echo esc_attr($item['title']); ?>"
                                            data-viewer-meta="<?php echo $viewer_meta; ?>"
                                            data-viewer-open-url="<?php echo esc_url($viewer_open_action['url'] ?? $preview_asset['url']); ?>"
                                            data-viewer-open-label="<?php echo esc_attr($viewer_open_action['label'] ?? __('Open original file', 'antichrist-engine')); ?>"
                                            data-viewer-download-url="<?php echo esc_url($viewer_download_action['url'] ?? ($viewer_open_action['url'] ?? $preview_asset['url'])); ?>"
                                            data-viewer-download-label="<?php echo esc_attr($viewer_download_action['label'] ?? __('Download file', 'antichrist-engine')); ?>"
                                            data-viewer-download-name="<?php echo esc_attr($viewer_download_action['download_name'] ?? ''); ?>"
                                        >
                                            <img src="<?php echo esc_url($preview_asset['url']); ?>" alt="<?php echo esc_attr($item['title']); ?>" <?php echo antichrist_engine_get_image_attribute_markup(antichrist_engine_get_image_loading_attributes()); ?>>
                                            <span class="download-card__preview-chip"><?php esc_html_e('Inspect image', 'antichrist-engine'); ?></span>
                                        </a>
                                    <?php else : ?>
                                        <div class="download-card__placeholder branding-mark" aria-hidden="true"></div>
                                    <?php endif; ?>
                                </div>
                                <div class="download-card__body">
                                    <p class="eyebrow"><?php echo esc_html($item['eyebrow']); ?></p>
                                    <h3><?php echo esc_html($item['title']); ?></h3>
                                    <p><?php echo esc_html($item['summary']); ?></p>
                                    <?php if (!empty($item['metadata'])) : ?>
                                        <ul class="download-card__notes">
                                            <?php foreach ($item['metadata'] as $note) : ?>
                                                <li><?php echo esc_html($note); ?></li>
                                            <?php endforeach; ?>
                                        </ul>
                                    <?php endif; ?>
                                    <ul class="download-card__actions">
                                        <?php foreach ($resolved_actions as $index => $resolved_action) : ?>
                                            <li>
                                                <a
                                                    class="button button--small<?php echo 0 === $index ? '' : ' button--ghost'; ?>"
                                                    href="<?php echo esc_url($resolved_action['url']); ?>"
                                                    <?php if (!empty($resolved_action['download_name'])) : ?>
                                                        download="<?php echo esc_attr($resolved_action['download_name']); ?>"
                                                    <?php elseif (!empty($resolved_action['should_open_blank'])) : ?>