Go to the documentation of this file.
13 if ( !in_array(
'other', $this->mOptions,
true ) ) {
26 $valInSelect = in_array(
31 $selected = $valInSelect ?
$value :
'other';
33 $select =
new XmlSelect( $this->mName, $this->mID, $selected );
36 $select->setAttribute(
'class',
'mw-htmlform-select-or-other' );
38 $tbAttribs = [
'id' => $this->mID .
'-other',
'size' => $this->
getSize() ];
40 if ( !empty( $this->mParams[
'disabled'] ) ) {
41 $select->setAttribute(
'disabled',
'disabled' );
42 $tbAttribs[
'disabled'] =
'disabled';
45 if ( isset( $this->mParams[
'tabindex'] ) ) {
46 $select->setAttribute(
'tabindex', $this->mParams[
'tabindex'] );
47 $tbAttribs[
'tabindex'] = $this->mParams[
'tabindex'];
50 $select = $select->getHTML();
52 if ( isset( $this->mParams[
'maxlength'] ) ) {
53 $tbAttribs[
'maxlength'] = $this->mParams[
'maxlength'];
56 if ( $this->mClass !==
'' ) {
60 $textbox =
Html::input( $this->mName .
'-other', $valInSelect ?
'' :
$value,
'text', $tbAttribs );
62 return "$select<br />\n$textbox";
70 return [
'mediawiki.widgets.SelectWithInputWidget' ];
74 $this->mParent->getOutput()->addModuleStyles(
'mediawiki.widgets.SelectWithInputWidget.styles' );
79 $valInSelect = in_array(
88 'value' => $valInSelect ?
$value :
'other',
89 'class' => [
'mw-htmlform-select-or-other' ],
97 $dropdownAttribs += OOUI\Element::configFromHtmlAttributes(
103 'name' => $this->mName .
'-other',
105 'value' => $valInSelect ?
'' :
$value,
117 $textAttribs += OOUI\Element::configFromHtmlAttributes(
121 if ( $this->mClass !==
'' ) {
124 if ( $this->mPlaceholder !==
'' ) {
129 if ( isset( $this->mParams[
'disabled' ] ) && $this->mParams[
'disabled' ] ) {
135 'disabled' => $disabled,
136 'textinput' => $textAttribs,
137 'dropdowninput' => $dropdownAttribs,
152 if (
$request->getCheck( $this->mName ) ) {
153 $val =
$request->getText( $this->mName );
155 if ( $val ===
'other' ) {
156 $val =
$request->getText( $this->mName .
'-other' );
getInputOOUI( $value)
Same as getInputHTML, but returns an OOUI object.
Select dropdown field, with an additional "other" textbox.
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
static input( $name, $value='', $type='text', array $attribs=[])
Convenience function to produce an "<input>" element.
Class for generating HTML <select> or <datalist> elements.
loadDataFromRequest( $request)
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
shouldInfuseOOUI()
Whether the field should be automatically infused.
getOOUIModules()
Get the list of extra ResourceLoader modules which must be loaded client-side before it's possible to...
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself.
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<