X-Git-Url: https://git.toastfreeware.priv.at/toast/cookiecaptcha.git/blobdiff_plain/39bf5608e2e4a6beb83059fa9a29f42e5d9aae0c..beb6a182ebf8245b424314c4d622930d0ded221c:/ReCaptcha.php diff --git a/ReCaptcha.php b/ReCaptcha.php index 1afaab0..a875527 100644 --- a/ReCaptcha.php +++ b/ReCaptcha.php @@ -28,6 +28,13 @@ $wgReCaptchaPrivateKey = ''; $recaptcha_public_key = ''; $recaptcha_private_key = ''; +/** + * Sets the theme for ReCaptcha + * + * See http://code.google.com/apis/recaptcha/docs/customization.html + */ +$wgReCaptchaTheme = 'red'; + $wgExtensionFunctions[] = 'efReCaptcha'; /** @@ -65,10 +72,11 @@ class ReCaptcha extends SimpleCaptcha { * */ function getForm() { - global $wgReCaptchaPublicKey; + global $wgReCaptchaPublicKey, $wgReCaptchaTheme; $useHttps = ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ); - return " " . - recaptcha_get_html($wgReCaptchaPublicKey, $this->recaptcha_error, $useHttps); + $js = 'var RecaptchaOptions = ' . Xml::encodeJsVar( array( 'theme' => $wgReCaptchaTheme, 'tabindex' => 1 ) ); + + return Html::inlineScript( $js ) . recaptcha_get_html($wgReCaptchaPublicKey, $this->recaptcha_error, $useHttps); } /**