public function onPreRender($param)
{
parent::onPreRender($param);
if ("" == $this->getSiteKey()) {
throw new TConfigurationException('recaptcha_publickey_unknown');
}
if ("" == $this->getSecretKey()) {
throw new TConfigurationException('recaptcha_privatekey_unknown');
}
// need to register captcha fields so they will be sent postback
$this->Page->registerRequiresPostData($this->getResponseFieldName());
$this->Page->ClientScript->registerHeadScriptFile('grecaptcha2', 'https://www.google.com/recaptcha/api.js?onload=TReCaptcha2_onloadCallback&render=explicit&hl=' . $this->getLanguage());
}