21 if ( isset(
$params[
'dropdown'] ) || strpos( $this->mClass,
'mw-chosen' ) !==
false ) {
22 $this->mClass .=
' mw-htmlform-dropdown';
25 if ( isset(
$params[
'flatlist'] ) ) {
26 $this->mClass .=
' mw-htmlform-flatlist';
31 $p = parent::validate(
$value, $alldata );
37 if ( !is_array(
$value ) ) {
41 # If all options are valid, array_intersect of the valid options
42 # and the provided options will return the provided options.
45 $validValues = array_intersect(
$value, $validOptions );
46 if ( count( $validValues ) == count(
$value ) ) {
49 return $this->
msg(
'htmlform-select-badoption' )->parse();
54 if ( isset( $this->mParams[
'dropdown'] ) ) {
55 $this->mParent->getOutput()->addModules(
'jquery.chosen' );
70 if ( is_array( $info ) ) {
75 'id' =>
"{$this->mID}-$info",
78 $checked = in_array( $info,
$value,
true );
84 [
'class' =>
'mw-htmlform-flatlist-item' ],
95 throw new MWException(
'HTMLMultiSelectField#getOneCheckbox() is not supported' );
97 $elementFunc = [
'Html', $this->mOptionsLabelsNotFromMessage ?
'rawElement' :
'element' ];
101 call_user_func( $elementFunc,
106 if ( $this->mParent->getConfig()->get(
'UseMediaWikiUIEverywhere' ) ) {
123 $this->mParent->getOutput()->addModules(
'oojs-ui-widgets' );
127 $attr[
'name'] =
"{$this->mName}[]";
132 if ( $this->mOptionsLabelsNotFromMessage ) {
133 foreach ( $attr[
'options']
as &$option ) {
134 $option[
'label'] =
new OOUI\HtmlSnippet( $option[
'label'] );
138 $attr += OOUI\Element::configFromHtmlAttributes(
142 if ( $this->mClass !==
'' ) {
146 return new OOUI\CheckboxMultiselectInputWidget( $attr );
158 return $request->getArray( $this->mName, [] );
166 if ( isset( $this->mDefault ) ) {
179 $res[
"$opt"] = in_array( $opt, $data,
true );
static closeElement($element)
Returns "$element>".
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
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
static check($name, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox.
filterDataForSubmit($data)
Support for seperating multi-option preferences into multiple preferences Due to lack of array suppor...
static openElement($element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
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
validate($value, $alldata)
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
error also a ContextSource you ll probably need to make sure the header is varied on $request
getOneCheckbox($checked, $attribs, $label)
formatOptions($options, $value)
getInputOOUI($value)
Get the OOUI version of this field.
loadDataFromRequest($request)