Go to the documentation of this file.
23 parent::__construct( $params );
24 $this->imageUrl = $params[
'imageUrl'];
25 $this->showCreateHelp = !empty( $params[
'showCreateHelp'] );
29 $out = $this->mParent->getOutput();
32 $out->addModuleStyles(
'ext.confirmEdit.fancyCaptcha.styles' );
35 $out->addModules(
'ext.confirmEdit.fancyCaptcha' );
39 [
'class' =>
'confirmedit-captcha-reload fancycaptcha-reload' ],
40 $this->mParent->msg(
'fancycaptcha-reload-text' )->text()
47 'class' =>
'mw-ui-input',
51 'autocomplete' =>
'off',
52 'autocorrect' =>
'off',
53 'autocapitalize' =>
'off',
54 'placeholder' => $this->mParent->msg(
'fancycaptcha-imgcaptcha-ph' )->text()
56 $attribs += $this->
getAttributes( [
'tabindex',
'required',
'autofocus' ] );
58 $html =
Html::openElement(
'div', [
'class' =>
'fancycaptcha-captcha-container' ] )
62 'class' =>
'fancycaptcha-image',
63 'src' => $this->imageUrl,
68 if ( $this->showCreateHelp ) {
71 'class' =>
'mw-createacct-captcha-assisted'
72 ], $this->mParent->msg(
'createacct-imgcaptcha-help' )->parse() );
83 return $this->mParent->msg(
'captcha-label' )->text() .
' '
84 . $this->mParent->msg(
'fancycaptcha-captcha' )->text();
88 $labelHtml = parent::getLabelHtml( $cellAttributes );
89 if ( $this->mLabel ) {
__construct(array $params)
Apart from normal HTMLFormField parameters, recognizes the following keys:
static closeElement( $element)
Returns "</$element>".
Captcha input field for FancyCaptcha that displays a question and returns the answer.
getLabelHtml( $cellAttributes=[])
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself.