From 0c1b139744e44f9c9f027ec781084ebbc7d7a3b5 Mon Sep 17 00:00:00 2001 From: JensFalk Date: Mon, 21 Sep 2026 19:25:53 +0200 Subject: [PATCH] Kontaktformular-Schutz hinzugefuegt (v1.1.0) --- .../src/Handler/TemplateHandler.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/fp_altcha_spamschutz/src/Handler/TemplateHandler.php b/fp_altcha_spamschutz/src/Handler/TemplateHandler.php index a29b036..cbc4b07 100644 --- a/fp_altcha_spamschutz/src/Handler/TemplateHandler.php +++ b/fp_altcha_spamschutz/src/Handler/TemplateHandler.php @@ -76,13 +76,27 @@ class TemplateHandler } } + $contactEnabled = $this->altchaService->isEnabledForContact(); + $contactFormCount = 0; + if ($contactEnabled) { + $contactForm = $document->find('form.contact-form'); + $contactFormCount = \count($contactForm); + if ($contactFormCount > 0) { + $this->injectWidget($document, $contactForm); + $injected = true; + } + } + $this->logDebug($args, \sprintf( 'Hook ausgefuehrt: register_enabled=%d register_forms_gefunden=%d ' - . 'newsletter_enabled=%d newsletter_forms_gefunden=%d widget_eingefuegt=%d', + . 'newsletter_enabled=%d newsletter_forms_gefunden=%d ' + . 'contact_enabled=%d contact_forms_gefunden=%d widget_eingefuegt=%d', $registerEnabled ? 1 : 0, $registerFormCount, $newsletterEnabled ? 1 : 0, $newsletterFormCount, + $contactEnabled ? 1 : 0, + $contactFormCount, $injected ? 1 : 0 ));