mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-11-09 19:20:09 +01:00
fix: iframe for PDF display, exclude cover files from public loop, no session on media requests
This commit is contained in:
1 parent
46a3c360ec
commit
e09b056115
3 files changed
+18
-6
No files matched your search
@@ -290,13 +290,18 @@
|
||||
<?php elseif (!empty($data['files'])): ?>
|
||||
<?php foreach ($data['files'] as $file): ?>
|
||||
<?php
|
||||
$ext = strtolower(pathinfo($file['file_path'], PATHINFO_EXTENSION));
|
||||
$ext = strtolower(pathinfo($file['file_path'], PATHINFO_EXTENSION));
|
||||
$fileType = $file['file_type'] ?? '';
|
||||
if ($ext === 'vtt') continue;
|
||||
if ($fileType === 'cover') continue;
|
||||
?>
|
||||
<figure>
|
||||
<?php if ($ext === 'pdf'): ?>
|
||||
<embed src="/media?path=<?= urlencode($file['file_path']) ?>"
|
||||
type="application/pdf" width="100%" height="700px">
|
||||
<iframe src="/media?path=<?= urlencode($file['file_path']) ?>"
|
||||
width="100%" height="700px"
|
||||
style="border:none"
|
||||
title="<?= htmlspecialchars($file['original_name'] ?? basename($file['file_path'])) ?>">
|
||||
</iframe>
|
||||
<p class="tfe-pdf-fallback">
|
||||
<a href="/media?path=<?= urlencode($file['file_path']) ?>&download=1">
|
||||
Télécharger le PDF
|
||||
|
||||
Reference in new issue
Block a user