MediaWiki REL1_31
HTMLReCaptchaField.php
Go to the documentation of this file.
1<?php
2
9 protected $key;
10
12 protected $theme;
13
15 protected $secure;
16
18 protected $error;
19
28 public function __construct( array $params ) {
29 $params += [
30 'secure' => true,
31 'error' => null,
32 ];
33 parent::__construct( $params );
34
35 $this->key = $params['key'];
36 $this->theme = $params['theme'];
37 $this->secure = $params['secure'];
38 $this->error = $params['error'];
39 }
40
41 public function getInputHTML( $value ) {
42 $attribs = $this->getAttributes( [ 'tabindex' ] ) + [ 'theme' => $this->theme ];
43 $js = 'var RecaptchaOptions = ' . Xml::encodeJsVar( $attribs );
44 $widget = recaptcha_get_html( $this->key, $this->error, $this->secure );
45 return Html::inlineScript( $js ) . $widget;
46 }
47
48 public function skipLoadData( $request ) {
49 return true;
50 }
51}
The parent class to generate form fields.
getAttributes(array $list)
Returns the given attributes from the parameters.
Creates a ReCaptcha widget.
__construct(array $params)
Parameters:
bool $secure
Use secure connection to ReCaptcha.
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself.
string $key
Public key parameter to be passed to ReCaptcha.
string $theme
Theme parameter to be passed to ReCaptcha.
skipLoadData( $request)
Skip this field when collecting data.
string $error
Error returned by ReCaptcha in the previous round.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling but I prefer the flexibility This should also do the output encoding The system allocates a global one in $wgOut Title Represents the title of an and does all the work of translating among various forms such as plain database key
Definition design.txt:26
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
Definition hooks.txt:2806
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
Definition hooks.txt:2014
recaptcha_get_html( $pubkey, $error=null, $use_ssl=false)
Gets the challenge HTML (javascript and non-javascript version).
$params