Application->recallObject('CaptchaHelper'); /* @var $captcha_helper kCaptchaHelper */ $captcha_helper->validateCode($event->MasterEvent); } /** * [HOOK] Initializes captcha code processing routine * * @param kEvent $event */ function OnPrepareCaptcha($event) { $captcha_helper = $this->Application->recallObject('CaptchaHelper'); /* @var $captcha_helper kCaptchaHelper */ // 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); } }