From 0fa552285e1973cbc955bb28c1b2e89a9db42ce6 Mon Sep 17 00:00:00 2001 From: Terranom674 Date: Sat, 5 Sep 2026 23:30:47 +0200 Subject: [PATCH] Refresh previews after active watermark profile edits --- tools/watermark_profiles.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/watermark_profiles.inc.php b/tools/watermark_profiles.inc.php index 7ee37bd..1e4b95e 100644 --- a/tools/watermark_profiles.inc.php +++ b/tools/watermark_profiles.inc.php @@ -108,9 +108,10 @@ function bratonien_tools_save_watermark_profile() throw new RuntimeException('Profilname darf nicht leer sein.'); } + $existing_profile = $id > 0 ? bratonien_tools_get_watermark_profile($id) : null; if ($id > 0) { - if (!bratonien_tools_get_watermark_profile($id)) + if (!$existing_profile) { throw new RuntimeException('Wasserzeichenprofil nicht gefunden.'); } @@ -128,7 +129,14 @@ function bratonien_tools_save_watermark_profile() mass_inserts($table, array_keys($data), array($data)); } - return array('message'=>'Wasserzeichenprofil gespeichert.'); + if ($id > 0 && function_exists('bratonien_tools_presentation_refresh_enqueue_all')) + { + bratonien_tools_presentation_refresh_enqueue_all('watermark-profile-changed'); + } + + return array('message'=>$id > 0 + ? 'Wasserzeichenprofil gespeichert. Betroffene Vorschauen werden im Hintergrund aktualisiert.' + : 'Wasserzeichenprofil gespeichert.'); } function bratonien_tools_profile_is_referenced($id)