blob: c139a007d74307932908e33a4fc770ea604f3cee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<?php
$filename = basename($attachment->href);
if (!$attachment->isImage() && $attachment->description) {
$filename = $attachment->description;
}
?>
<div>
<?php if ($attachment->isImage()): ?>
<img src="<?= $attachment->href ?>" alt="<?= htmlspecialchars($attachment->description ?? '') ?>"
title="<?= htmlspecialchars($attachment->description ?? '') ?>">
<?php else: ?>
<a class="file" href="<?= $attachment->href ?>" target="_blank" download="<?= htmlspecialchars($filename) ?>">
<span class="material-symbols attach-file"></span>
<span><?= htmlspecialchars($filename) ?></span>
</a>
<?php endif; ?>
</div>
|