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' );
37 $captchaReload = Html::element(
39 [
'class' =>
'confirmedit-captcha-reload fancycaptcha-reload' ],
40 $this->mParent->msg(
'fancycaptcha-reload-text' )->text()
47 'class' =>
'mw-ui-input',
50 'autocomplete' =>
'off',
51 'autocorrect' =>
'off',
52 'autocapitalize' =>
'off',
53 'placeholder' => $this->mParent->msg(
'fancycaptcha-imgcaptcha-ph' )->text()
57 $html = Html::openElement(
'div', [
'class' =>
'fancycaptcha-captcha-container' ] )
58 . Html::openElement(
'div', [
'class' =>
'fancycaptcha-captcha-and-reload' ] )
59 . Html::openElement(
'div', [
'class' =>
'fancycaptcha-image-container' ] )
60 . Html::element(
'img', [
61 'class' =>
'fancycaptcha-image',
62 'src' => $this->imageUrl,
64 ] ) . $captchaReload . Html::closeElement(
'div' ) . Html::closeElement(
'div' ) .
"\n"
65 . Html::element(
'input',
$attribs );
67 if ( $this->showCreateHelp ) {
69 $html .= Html::rawElement(
'small', [
70 'class' =>
'mw-createacct-captcha-assisted'
71 ], $this->mParent->msg(
'createacct-imgcaptcha-help' )->parse() );
74 $html .= Html::closeElement(
'div' );
82 return $this->mParent->msg(
'captcha-label' )->text() .
' '
83 . $this->mParent->msg(
'fancycaptcha-captcha' )->text();
87 $labelHtml = parent::getLabelHtml( $cellAttributes );
88 if ( $this->mLabel ) {
90 $labelHtml = Html::rawElement(
'p', [], $this->mLabel ) . $labelHtml;
Captcha input field for FancyCaptcha that displays a question and returns the answer.
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself.
__construct(array $params)
Apart from normal HTMLFormField parameters, recognizes the following keys:
getLabelHtml( $cellAttributes=[])
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs