function execute(&$form, $action_id) { $config = $form->actions_config[$action_id]; $config = new \GCore\Libs\Parameter($config); if ((bool) $config->get('enabled', 0) === false) { return; } $result = \GCore\Helpers\Captcha\Captcha::check(); if ($result) { $this->events['success'] = 1; } else { $this->events['fail'] = 1; $form->errors[] = $config->get('error', 'You have entered a wrong verification code!'); } }
function render(&$form, $action_id) { $config = !empty($form->actions_config[$action_id]) ? $form->actions_config[$action_id] : array(); $config = new \GCore\Libs\Parameter($config); \GCore\Helpers\Captcha\Captcha::display($config->get('fonts', 0), $form->form['Form']['title'] . '_captcha'); }