From 80470bf9bd14920424642ff3af1046ccf3463b8e Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Mon, 1 Sep 2025 14:07:59 +0200 Subject: [PATCH] fixed showing pdfs to download and not allowing in future --- Layout/default/ConstructionConsent/Form.php | 2 +- Layout/default/ConstructionConsent/View.php | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Layout/default/ConstructionConsent/Form.php b/Layout/default/ConstructionConsent/Form.php index 5a33a92e3..23139d6b4 100644 --- a/Layout/default/ConstructionConsent/Form.php +++ b/Layout/default/ConstructionConsent/Form.php @@ -216,7 +216,7 @@
Oder Plan hochladen
- +
diff --git a/Layout/default/ConstructionConsent/View.php b/Layout/default/ConstructionConsent/View.php index 51787996c..bfddd46ac 100644 --- a/Layout/default/ConstructionConsent/View.php +++ b/Layout/default/ConstructionConsent/View.php @@ -212,10 +212,14 @@ $pagination_entity_name = "Adressen"; Plan/Skizze - file && $item->file->file && $item->file->file->fileExists()): ?> - - - + file && $item->file->file && $item->file->file->fileExists()): + $dataUrl = $item->file->file->asDataUrl(); + if (str_contains($dataUrl, 'application/pdf')) { + echo ' Download PDF'; + } else { + echo 'File preview'; + } + endif; ?>