Hide recaptcha in manage subscription form

[MAILPOET-3459]
This commit is contained in:
wxa
2021-03-09 13:20:08 +03:00
committed by Veljko V
parent 2566ebb13c
commit 3fd379a72d
2 changed files with 6 additions and 3 deletions

View File

@ -58,11 +58,14 @@ class Renderer {
}
}
public function renderBlocks(array $blocks = [], array $formSettings = [], bool $honeypotEnabled = true): string {
public function renderBlocks(array $blocks = [], array $formSettings = [], bool $honeypotEnabled = true, bool $captchaEnabled = true): string {
// add honeypot for spambots
$html = ($honeypotEnabled) ? $this->renderHoneypot() : '';
foreach ($blocks as $key => $block) {
if ($block['type'] === FormEntity::SUBMIT_BLOCK_TYPE && $this->settings->get('captcha.type') === Captcha::TYPE_RECAPTCHA) {
if ($captchaEnabled
&& $block['type'] === FormEntity::SUBMIT_BLOCK_TYPE
&& $this->settings->get('captcha.type') === Captcha::TYPE_RECAPTCHA
) {
$html .= $this->renderReCaptcha();
}
if (in_array($block['type'], [FormEntity::COLUMN_BLOCK_TYPE, FormEntity::COLUMNS_BLOCK_TYPE])) {