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 ));