Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getFormInformation( $tabIndex = 1 ) {
- if ( isset( $this->captchaFallback ) && $this->captchaFallback ) {
- $captcha = $this->getCaptcha();
- $index = $this->storeCaptcha( $captcha );
- return [
- 'html' => "<p><label for=\"wpCaptchaWord\">{$captcha['question']} = </label>" .
- Xml::element( 'input', [
- 'name' => 'wpCaptchaWord',
- 'class' => 'mw-ui-input',
- 'id' => 'wpCaptchaWord',
- 'size' => 5,
- 'autocomplete' => 'off',
- 'tabindex' => $tabIndex
- ] ) . // tab in before the edit textarea
- "</p>\n" . Xml::element( 'input', [
- 'type' => 'hidden',
- 'name' => 'wpCaptchaId',
- 'id' => 'wpCaptchaId',
- 'value' => $index
- ] )
- ];
- } else {
- $this->captchaFallback = true;
- //create Invisible captcha
- return [
- 'html' => "<button type=\"button\" onclick='document.getElementsByTagName(wpCaptchaFallback).value = false'>pass<\button>".
- "<script></script>".
- Xml::element( 'input', [
- 'type' => 'hidden',
- 'name' => 'wpCaptchaFallback',
- 'id' => 'wpCaptchaFallback',
- 'value' => $this->captchaFallback
- ] )
- ];
- }
- }
Add Comment
Please, Sign In to add comment