X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/extensions/ConfirmEdit/ReCaptcha/HTMLReCaptchaField.php diff --git a/extensions/ConfirmEdit/ReCaptcha/HTMLReCaptchaField.php b/extensions/ConfirmEdit/ReCaptcha/HTMLReCaptchaField.php new file mode 100644 index 00000000..0859f066 --- /dev/null +++ b/extensions/ConfirmEdit/ReCaptcha/HTMLReCaptchaField.php @@ -0,0 +1,51 @@ + true, + 'error' => null, + ]; + parent::__construct( $params ); + + $this->key = $params['key']; + $this->theme = $params['theme']; + $this->secure = $params['secure']; + $this->error = $params['error']; + } + + public function getInputHTML( $value ) { + $attribs = $this->getAttributes( [ 'tabindex' ] ) + [ 'theme' => $this->theme ]; + $js = 'var RecaptchaOptions = ' . Xml::encodeJsVar( $attribs ); + $widget = recaptcha_get_html( $this->key, $this->error, $this->secure ); + return Html::inlineScript( $js ) . $widget; + } + + public function skipLoadData( $request ) { + return true; + } +}