Application->recallObject('CaptchaHelper'); $captcha_helper->validateCode($event->MasterEvent); } /** * [HOOK] Initializes captcha code processing routine * * @param kEvent $event */ function OnPrepareCaptcha($event) { /** @var kCaptchaHelper $captcha_helper */ $captcha_helper = $this->Application->recallObject('CaptchaHelper'); // create field for captcha code storage $virtual_fields = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'VirtualFields'); $virtual_fields['Captcha'] = Array ('type' => 'string', 'default' => ''); $this->Application->setUnitOption($event->MasterEvent->Prefix, 'VirtualFields', $virtual_fields); } }