styleUtils = $styleUtils; $this->settings = $settings; $this->blocksRenderer = $blocksRenderer; } public function renderStyles(array $form = [], string $prefix = null): string { $html = ''; return $html; } public function renderHTML(array $form = []): string { if (isset($form['body']) && !empty($form['body'])) { return $this->wrapForm( $this->renderBlocks($form['body']), $form['settings'] ); } return ''; } public function getStyles(array $form = []): string { if (isset($form['styles']) && strlen(trim($form['styles'])) > 0) { return strip_tags($form['styles']); } else { return $this->styleUtils->getDefaultStyles(); } } public function renderBlocks(array $blocks = [], bool $honeypotEnabled = true): string { // add honeypot for spambots $html = ($honeypotEnabled) ? $this->renderHoneypot() : ''; foreach ($blocks as $key => $block) { if ($block['type'] == 'submit' && $this->settings->get('captcha.type') === Captcha::TYPE_RECAPTCHA) { $html .= $this->renderReCaptcha(); } $html .= $this->blocksRenderer->renderBlock($block) . PHP_EOL; } return $html; } private function renderHoneypot(): string { return ''; } private function renderReCaptcha(): string { $siteKey = $this->settings->get('captcha.recaptcha_site_token'); return '