url_helper = $url_helper; $this->wp = $wp; $this->captcha_session = $captcha_session; } public function getCaptchaPageTitle() { return $this->wp->__("Confirm you’re not a robot", 'mailpoet'); } public function getCaptchaPageContent() { $fields = [ [ 'id' => 'captcha', 'type' => 'text', 'params' => [ 'label' => $this->wp->__('Type in the input the characters you see in the picture above:', 'mailpoet'), 'value' => '', 'obfuscate' => false, ], ], ]; $form = array_merge( $fields, [ [ 'id' => 'submit', 'type' => 'submit', 'params' => [ 'label' => $this->wp->__('Subscribe', 'mailpoet'), ], ], ] ); $captcha_session_form = $this->captcha_session->getFormData(); $form_id = isset($captcha_session_form['form_id']) ? (int)$captcha_session_form['form_id'] : 0; $form_model = FormModel::findOne($form_id); if (!$form_model instanceof FormModel) { return false; } $form_model = $form_model->asArray(); $form_html = '
'; $form_html .= ''; $form_html .= ''; $form_html .= ''; $form_html .= ''; $form_html .= ''; $width = 220; $height = 60; $captcha_url = Url::getCaptchaImageUrl($width, $height); $form_html .= '
'; $form_html .= '

'; $form_html .= ''; $form_html .= '

'; // subscription form $form_html .= FormRenderer::renderBlocks($form, $honeypot = false); $form_html .= '
'; $form_html .= '
'; $form_html .= ''; $form_html .= ''; $form_html .= '
'; $form_html .= '
'; return $form_html; } }