null ]; parent::__construct( $params ); $this->key = $params['key']; $this->error = $params['error']; $this->mName = 'h-captcha-response'; } /** @inheritDoc */ public function getInputHTML( $value ) { $out = $this->mParent->getOutput(); // TODO: Inject config/similar... $url = RequestContext::getMain()->getConfig()->get( 'HCaptchaApiUrl' ); $out->addHeadItem( 'h-captcha', "" ); HCaptcha::addCSPSources( $out->getCSP() ); return Html::element( 'div', [ 'class' => [ 'h-captcha', 'mw-confirmedit-captcha-fail' => (bool)$this->error, ], 'data-sitekey' => $this->key, ] ); } }