24use MediaWiki\HookContainer\ProtectedHookAccessorTrait;
154 use ProtectedHookAccessorTrait;
157 public static $typeMappings = [
158 'api' => HTMLApiField::class,
159 'text' => HTMLTextField::class,
160 'textwithbutton' => HTMLTextFieldWithButton::class,
161 'textarea' => HTMLTextAreaField::class,
162 'select' => HTMLSelectField::class,
163 'combobox' => HTMLComboboxField::class,
164 'radio' => HTMLRadioField::class,
165 'multiselect' => HTMLMultiSelectField::class,
166 'limitselect' => HTMLSelectLimitField::class,
167 'check' => HTMLCheckField::class,
168 'toggle' => HTMLCheckField::class,
169 'int' => HTMLIntField::class,
170 'file' => HTMLFileField::class,
171 'float' => HTMLFloatField::class,
172 'info' => HTMLInfoField::class,
173 'selectorother' => HTMLSelectOrOtherField::class,
174 'selectandother' => HTMLSelectAndOtherField::class,
175 'namespaceselect' => HTMLSelectNamespace::class,
176 'namespaceselectwithbutton' => HTMLSelectNamespaceWithButton::class,
177 'tagfilter' => HTMLTagFilter::class,
178 'sizefilter' => HTMLSizeFilterField::class,
179 'submit' => HTMLSubmitField::class,
180 'hidden' => HTMLHiddenField::class,
181 'edittools' => HTMLEditTools::class,
182 'checkmatrix' => HTMLCheckMatrix::class,
183 'cloner' => HTMLFormFieldCloner::class,
184 'autocompleteselect' => HTMLAutoCompleteSelectField::class,
185 'language' => HTMLSelectLanguageField::class,
186 'date' => HTMLDateTimeField::class,
187 'time' => HTMLDateTimeField::class,
188 'datetime' => HTMLDateTimeField::class,
189 'expiry' => HTMLExpiryField::class,
190 'timezone' => HTMLTimezoneField::class,
194 'email' => HTMLTextField::class,
195 'password' => HTMLTextField::class,
196 'url' => HTMLTextField::class,
197 'title' => HTMLTitleTextField::class,
198 'user' => HTMLUserTextField::class,
199 'tagmultiselect' => HTMLTagMultiselectField::class,
200 'usersmultiselect' => HTMLUsersMultiselectField::class,
201 'titlesmultiselect' => HTMLTitlesMultiselectField::class,
202 'namespacesmultiselect' => HTMLNamespacesMultiselectField::class,
210 protected $mFlatFields = [];
215 protected $mSubmitFlags = [
'primary',
'progressive' ];
259 protected $mCollapsible =
false;
266 protected $mCollapsed =
false;
280 protected $mHiddenFields = [];
285 protected $mButtons = [];
294 protected $mTokenSalt =
'';
304 protected $mSubSectionBeforeFields =
true;
311 protected $displayFormat =
'table';
317 protected $availableDisplayFormats = [
328 protected $availableSubclassDisplayFormats = [
337 private $hiddenTitleAddedToForm =
false;
353 $displayFormat, $descriptor,
IContextSource $context, $messagePrefix =
''
355 switch ( $displayFormat ) {
357 return new VFormHTMLForm( $descriptor, $context, $messagePrefix );
359 return new OOUIHTMLForm( $descriptor, $context, $messagePrefix );
361 $form =
new self( $descriptor, $context, $messagePrefix );
362 $form->setDisplayFormat( $displayFormat );
382 $this->mMessagePrefix = $messagePrefix;
386 !$this->
getConfig()->
get( MainConfigNames::HTMLFormAllowTableFormat )
387 && $this->displayFormat ===
'table'
389 $this->displayFormat =
'div';
405 $loadedDescriptor = [];
407 foreach ( $descriptor as $fieldname => $info ) {
409 $section = $info[
'section'] ??
'';
411 if ( isset( $info[
'type'] ) && $info[
'type'] ===
'file' ) {
412 $this->mUseMultipart =
true;
415 $field = static::loadInputFromParameters( $fieldname, $info, $this );
417 $setSection =& $loadedDescriptor;
419 foreach ( explode(
'/', $section ) as $newName ) {
420 if ( !isset( $setSection[$newName] ) ) {
421 $setSection[$newName] = [];
424 $setSection =& $setSection[$newName];
428 $setSection[$fieldname] = $field;
429 $this->mFlatFields[$fieldname] = $field;
432 $this->mFieldTree = array_merge_recursive( $this->mFieldTree, $loadedDescriptor );
442 return isset( $this->mFlatFields[$fieldname] );
451 if ( !$this->
hasField( $fieldname ) ) {
452 throw new DomainException( __METHOD__ .
': no field named ' . $fieldname );
454 return $this->mFlatFields[$fieldname];
469 in_array( $format, $this->availableSubclassDisplayFormats,
true ) ||
470 in_array( $this->displayFormat, $this->availableSubclassDisplayFormats,
true )
472 throw new MWException(
'Cannot change display format after creation, ' .
473 'use HTMLForm::factory() instead' );
476 if ( !in_array( $format, $this->availableDisplayFormats,
true ) ) {
477 throw new MWException(
'Display format must be one of ' .
480 $this->availableDisplayFormats,
481 $this->availableSubclassDisplayFormats
488 if ( !$this->
getConfig()->
get( MainConfigNames::HTMLFormAllowTableFormat ) &&
489 $format ===
'table' ) {
493 $this->displayFormat = $format;
504 return $this->displayFormat;
525 if ( isset( $descriptor[
'class'] ) ) {
526 $class = $descriptor[
'class'];
527 } elseif ( isset( $descriptor[
'type'] ) ) {
528 $class = static::$typeMappings[$descriptor[
'type']];
529 $descriptor[
'class'] = $class;
535 throw new MWException(
"Descriptor with no class for $fieldname: "
536 . print_r( $descriptor,
true ) );
558 $class = static::getClassFromDescriptor( $fieldname, $descriptor );
560 $descriptor[
'fieldname'] = $fieldname;
562 $descriptor[
'parent'] = $parent;
565 # @todo This will throw a fatal error whenever someone try to use
566 # 'class' to feed a CSS class instead of 'cssclass'. Would be
567 # great to avoid the fatal error and show a nice error.
568 return new $class( $descriptor );
581 # Load data from the request.
583 $this->mFormIdentifier ===
null ||
584 $this->
getRequest()->getVal(
'wpFormIdentifier' ) === $this->mFormIdentifier
588 $this->mFieldData = [];
601 if ( $this->mFormIdentifier ===
null ) {
604 $identOkay = $this->
getRequest()->getVal(
'wpFormIdentifier' ) === $this->mFormIdentifier;
610 } elseif ( $this->
getRequest()->wasPosted() ) {
611 $editToken = $this->
getRequest()->getVal(
'wpEditToken' );
612 if ( $this->
getUser()->isRegistered() || $editToken !==
null ) {
616 $tokenOkay = $this->
getUser()->matchEditToken( $editToken, $this->mTokenSalt );
622 if ( $tokenOkay && $identOkay ) {
623 $this->mWasSubmitted =
true;
641 if ( $result ===
true || ( $result instanceof
Status && $result->
isGood() ) ) {
679 $hoistedErrors = Status::newGood();
680 if ( $this->mValidationErrorMessage ) {
681 foreach ( $this->mValidationErrorMessage as $error ) {
682 $hoistedErrors->fatal( ...$error );
685 $hoistedErrors->fatal(
'htmlform-invalid-input' );
688 $this->mWasSubmitted =
true;
690 # Check for cancelled submission
691 foreach ( $this->mFlatFields as $fieldname => $field ) {
692 if ( !array_key_exists( $fieldname, $this->mFieldData ) ) {
695 if ( $field->cancelSubmit( $this->mFieldData[$fieldname], $this->mFieldData ) ) {
696 $this->mWasSubmitted =
false;
701 # Check for validation
702 $hasNonDefault =
false;
703 foreach ( $this->mFlatFields as $fieldname => $field ) {
704 if ( !array_key_exists( $fieldname, $this->mFieldData ) ) {
707 $hasNonDefault = $hasNonDefault || $this->mFieldData[$fieldname] !== $field->getDefault();
708 if ( $field->isDisabled( $this->mFieldData ) ) {
711 $res = $field->validate( $this->mFieldData[$fieldname], $this->mFieldData );
712 if (
$res !==
true ) {
714 if (
$res !==
false && !$field->canDisplayErrors() ) {
715 if ( is_string(
$res ) ) {
716 $hoistedErrors->fatal(
'rawmessage',
$res );
718 $hoistedErrors->fatal(
$res );
726 if ( !$hasNonDefault && $this->
getMethod() ===
'get' &&
727 ( $this->mFormIdentifier ===
null ||
728 $this->
getRequest()->getCheck(
'wpFormIdentifier' ) )
730 $this->mWasSubmitted =
false;
733 return $hoistedErrors;
736 $callback = $this->mSubmitCallback;
737 if ( !is_callable( $callback ) ) {
738 throw new MWException(
'HTMLForm: no submit callback provided. Use ' .
739 'setSubmitCallback() to set one.' );
744 $res = call_user_func( $callback, $data, $this );
745 if (
$res ===
false ) {
746 $this->mWasSubmitted =
false;
767 return $this->mWasSubmitted;
781 $this->mSubmitCallback = $cb;
796 $this->mValidationErrorMessage = $msg;
836 $this->mPre .= $html;
896 if ( $section ===
null ) {
897 $this->mHeader .= $html;
899 if ( !isset( $this->mSectionHeaders[$section] ) ) {
900 $this->mSectionHeaders[$section] =
'';
902 $this->mSectionHeaders[$section] .= $html;
918 if ( $section ===
null ) {
919 $this->mHeader = $html;
921 $this->mSectionHeaders[$section] = $html;
936 if ( $section ===
null ) {
937 return $this->mHeader;
939 return $this->mSectionHeaders[$section] ??
'';
993 if ( $section ===
null ) {
994 $this->mFooter .= $html;
996 if ( !isset( $this->mSectionFooters[$section] ) ) {
997 $this->mSectionFooters[$section] =
'';
999 $this->mSectionFooters[$section] .= $html;
1015 if ( $section ===
null ) {
1016 $this->mFooter = $html;
1018 $this->mSectionFooters[$section] = $html;
1032 if ( $section ===
null ) {
1033 return $this->mFooter;
1035 return $this->mSectionFooters[$section] ??
'';
1087 $this->mPost .= $html;
1101 $this->mPost = $html;
1113 return $this->mPost;
1151 if ( !is_array( $value ) ) {
1153 $attribs += [
'name' => $name ];
1154 $this->mHiddenFields[] = [ $value, $attribs ];
1172 foreach ( $fields as $name => $value ) {
1173 if ( is_array( $value ) ) {
1177 $this->mHiddenFields[] = [ $value, [
'name' => $name ] ];
1207 if ( !is_array( $data ) ) {
1208 $args = func_get_args();
1209 if ( count( $args ) < 2 || count( $args ) > 4 ) {
1210 throw new InvalidArgumentException(
1211 'Incorrect number of arguments for deprecated calling style'
1216 'value' => $args[1],
1217 'id' => $args[2] ??
null,
1218 'attribs' => $args[3] ??
null,
1221 if ( !isset( $data[
'name'] ) ) {
1222 throw new InvalidArgumentException(
'A name is required' );
1224 if ( !isset( $data[
'value'] ) ) {
1225 throw new InvalidArgumentException(
'A value is required' );
1228 $this->mButtons[] = $data + [
1248 $this->mTokenSalt = $salt;
1275 private function getHiddenTitle(): string {
1276 if ( $this->hiddenTitleAddedToForm ) {
1284 $html .= Html::hidden(
'title', $this->
getTitle()->getPrefixedText() ) .
"\n";
1286 $this->hiddenTitleAddedToForm =
true;
1301 # For good measure (it is the default)
1302 $this->getOutput()->setPreventClickjacking(
true );
1303 $this->getOutput()->addModules(
'mediawiki.htmlform' );
1304 $this->getOutput()->addModuleStyles(
'mediawiki.htmlform.styles' );
1306 if ( $this->mCollapsible ) {
1308 $this->getOutput()->addModules(
'jquery.makeCollapsible' );
1312 . $this->getErrorsOrWarnings( $submitResult,
'error' )
1313 . $this->getErrorsOrWarnings( $submitResult,
'warning' )
1314 . $this->getHeaderText()
1315 . $this->getHiddenTitle()
1317 . $this->getHiddenFields()
1318 . $this->getButtons()
1319 . $this->getFooterText();
1321 $html = $this->wrapForm( $html );
1323 return '' . $this->mPre . $html . $this->mPost;
1334 $this->mCollapsible =
true;
1335 $this->mCollapsed = $collapsedByDefault;
1345 # Use multipart/form-data
1346 $encType = $this->mUseMultipart
1347 ?
'multipart/form-data'
1348 :
'application/x-www-form-urlencoded';
1351 'class' =>
'mw-htmlform',
1352 'action' => $this->getAction(),
1353 'method' => $this->getMethod(),
1354 'enctype' => $encType,
1357 $attribs[
'id'] = $this->mId;
1359 if ( is_string( $this->mAutocomplete ) ) {
1360 $attribs[
'autocomplete'] = $this->mAutocomplete;
1362 if ( $this->mName ) {
1363 $attribs[
'name'] = $this->mName;
1365 if ( $this->needsJSForHtml5FormValidation() ) {
1366 $attribs[
'novalidate'] =
true;
1380 # Include a <fieldset> wrapper for style, if requested.
1381 if ( $this->mWrapperLegend !==
false ) {
1382 $legend = is_string( $this->mWrapperLegend ) ? $this->mWrapperLegend :
false;
1383 $html = Xml::fieldset( $legend, $html, $this->mWrapperAttributes );
1386 return Html::rawElement(
1388 $this->getFormAttributes(),
1402 $html .= $this->getHiddenTitle();
1404 if ( $this->mFormIdentifier !==
null ) {
1405 $html .= Html::hidden(
1407 $this->mFormIdentifier
1410 if ( $this->getMethod() ===
'post' ) {
1411 $html .= Html::hidden(
1413 $this->
getUser()->getEditToken( $this->mTokenSalt ),
1414 [
'id' =>
'wpEditToken' ]
1418 foreach ( $this->mHiddenFields as [ $value, $attribs ] ) {
1419 $html .= Html::hidden( $attribs[
'name'], $value, $attribs ) .
"\n";
1432 $useMediaWikiUIEverywhere =
1433 $this->getConfig()->get( MainConfigNames::UseMediaWikiUIEverywhere );
1435 if ( $this->mShowSubmit ) {
1438 if ( isset( $this->mSubmitID ) ) {
1439 $attribs[
'id'] = $this->mSubmitID;
1442 if ( isset( $this->mSubmitName ) ) {
1443 $attribs[
'name'] = $this->mSubmitName;
1446 if ( isset( $this->mSubmitTooltip ) ) {
1447 $attribs += Linker::tooltipAndAccesskeyAttribs( $this->mSubmitTooltip );
1450 $attribs[
'class'] = [
'mw-htmlform-submit' ];
1452 if ( $useMediaWikiUIEverywhere ) {
1453 foreach ( $this->mSubmitFlags as $flag ) {
1454 $attribs[
'class'][] =
'mw-ui-' . $flag;
1456 $attribs[
'class'][] =
'mw-ui-button';
1459 $buttons .= Xml::submitButton( $this->getSubmitText(), $attribs ) .
"\n";
1462 if ( $this->mShowReset ) {
1463 $buttons .= Html::element(
1467 'value' => $this->msg(
'htmlform-reset' )->text(),
1468 'class' => $useMediaWikiUIEverywhere ?
'mw-ui-button' :
null,
1473 if ( $this->mShowCancel ) {
1474 $target = $this->getCancelTargetURL();
1475 $buttons .= Html::element(
1478 'class' => $useMediaWikiUIEverywhere ?
'mw-ui-button' :
null,
1481 $this->msg(
'cancel' )->text()
1485 foreach ( $this->mButtons as $button ) {
1488 'name' => $button[
'name'],
1489 'value' => $button[
'value']
1492 if ( isset( $button[
'label-message'] ) ) {
1493 $label = $this->getMessage( $button[
'label-message'] )->parse();
1494 } elseif ( isset( $button[
'label'] ) ) {
1495 $label = htmlspecialchars( $button[
'label'] );
1496 } elseif ( isset( $button[
'label-raw'] ) ) {
1497 $label = $button[
'label-raw'];
1499 $label = htmlspecialchars( $button[
'value'] );
1503 if ( $button[
'attribs'] ) {
1505 $attrs += $button[
'attribs'];
1508 if ( isset( $button[
'id'] ) ) {
1509 $attrs[
'id'] = $button[
'id'];
1512 if ( $useMediaWikiUIEverywhere ) {
1513 $attrs[
'class'] = isset( $attrs[
'class'] ) ? (array)$attrs[
'class'] : [];
1514 $attrs[
'class'][] =
'mw-ui-button';
1517 $buttons .= Html::rawElement(
'button', $attrs, $label ) .
"\n";
1524 return Html::rawElement(
'span',
1525 [
'class' =>
'mw-htmlform-submit-buttons' ],
"\n$buttons" ) .
"\n";
1534 return $this->displaySection( $this->mFieldTree, $this->mTableId );
1547 if ( !in_array( $elementsType, [
'error',
'warning' ],
true ) ) {
1548 throw new DomainException( $elementsType .
' is not a valid type.' );
1550 $elementstr =
false;
1551 if ( $elements instanceof
Status ) {
1552 [ $errorStatus, $warningStatus ] = $elements->splitByErrorType();
1553 $status = $elementsType ===
'error' ? $errorStatus : $warningStatus;
1554 if ( $status->isGood() ) {
1557 $elementstr = $status
1559 ->setContext( $this )
1560 ->setInterfaceMessageFlag(
true )
1563 } elseif ( $elementsType ===
'error' ) {
1564 if ( is_array( $elements ) ) {
1565 $elementstr = $this->formatErrors( $elements );
1566 } elseif ( $elements && $elements !==
true ) {
1567 $elementstr = (string)$elements;
1571 if ( !$elementstr ) {
1573 } elseif ( $elementsType ===
'error' ) {
1574 return Html::errorBox( $elementstr );
1576 return Html::warningBox( $elementstr );
1590 foreach ( $errors as $error ) {
1591 $errorstr .= Html::rawElement(
1594 $this->getMessage( $error )->parse()
1598 $errorstr = Html::rawElement(
'ul', [], $errorstr );
1611 $this->mSubmitText =
$t;
1623 $this->mSubmitFlags = [
'destructive',
'primary' ];
1637 if ( !$msg instanceof
Message ) {
1638 $msg = $this->msg( $msg );
1640 $this->setSubmitText( $msg->text() );
1650 return $this->mSubmitText ?: $this->msg(
'htmlform-submit' )->text();
1659 $this->mSubmitName = $name;
1670 $this->mSubmitTooltip = $name;
1684 $this->mSubmitID =
$t;
1705 $this->mFormIdentifier = $ident;
1721 $this->mShowSubmit = !$suppressSubmit;
1733 $this->mShowCancel = $show;
1745 $target = TitleValue::castPageToLinkTarget( $target );
1748 $this->mCancelTarget = $target;
1757 if ( is_string( $this->mCancelTarget ) ) {
1758 return $this->mCancelTarget;
1761 $target = Title::castFromLinkTarget( $this->mCancelTarget ) ?: Title::newMainPage();
1762 return $target->getLocalURL();
1776 $this->mTableId = $id;
1797 $this->mName = $name;
1814 $this->mWrapperLegend = $legend;
1827 $this->mWrapperAttributes = $attributes;
1842 if ( !$msg instanceof
Message ) {
1843 $msg = $this->msg( $msg );
1845 $this->setWrapperLegend( $msg->text() );
1860 $this->mMessagePrefix = $p;
1874 $this->mTitle = Title::castFromPageReference(
$t );
1883 return $this->mTitle ?: $this->
getContext()->getTitle();
1894 $this->mMethod = strtolower( $method );
1903 return $this->mMethod;
1917 return Xml::fieldset( $legend, $section, $attributes ) .
"\n";
1939 $fieldsetIDPrefix =
'',
1940 &$hasUserVisibleFields =
false
1942 if ( $this->mFieldData ===
null ) {
1943 throw new LogicException(
'HTMLForm::displaySection() called on uninitialized field data. '
1944 .
'You probably called displayForm() without calling prepareForm() first.' );
1947 $displayFormat = $this->getDisplayFormat();
1950 $subsectionHtml =
'';
1955 $getFieldHtmlMethod = $displayFormat ===
'table' ?
'getTableRow' : (
'get' . $displayFormat );
1957 foreach ( $fields as $key => $value ) {
1959 $v = array_key_exists( $key, $this->mFieldData )
1960 ? $this->mFieldData[$key]
1961 : $value->getDefault();
1963 $retval = $value->$getFieldHtmlMethod( $v ??
'' );
1967 if ( $value->hasVisibleOutput() ) {
1970 $labelValue = trim( $value->getLabel() );
1971 if ( $labelValue !==
"\u{00A0}" && $labelValue !==
' ' && $labelValue !==
'' ) {
1975 $hasUserVisibleFields =
true;
1977 } elseif ( is_array( $value ) ) {
1978 $subsectionHasVisibleFields =
false;
1980 $this->displaySection( $value,
1982 "$fieldsetIDPrefix$key-",
1983 $subsectionHasVisibleFields );
1985 if ( $subsectionHasVisibleFields ===
true ) {
1987 $hasUserVisibleFields =
true;
1989 $legend = $this->getLegend( $key );
1991 $section = $this->getHeaderText( $key ) .
1993 $this->getFooterText( $key );
1996 if ( $fieldsetIDPrefix ) {
1997 $attributes[
'id'] = Sanitizer::escapeIdForAttribute(
"$fieldsetIDPrefix$key" );
1999 $subsectionHtml .= $this->wrapFieldSetSection(
2000 $legend, $section, $attributes, $fields === $this->mFieldTree
2004 $subsectionHtml .= $section;
2009 $html = $this->formatSection( $html, $sectionName, $hasLabel );
2011 if ( $subsectionHtml ) {
2012 if ( $this->mSubSectionBeforeFields ) {
2013 return $subsectionHtml .
"\n" . $html;
2015 return $html .
"\n" . $subsectionHtml;
2030 protected function formatSection( array $fieldsHtml, $sectionName, $anyFieldHasLabel ) {
2031 if ( !$fieldsHtml ) {
2037 $displayFormat = $this->getDisplayFormat();
2038 $html = implode(
'', $fieldsHtml );
2040 if ( $displayFormat ===
'raw' ) {
2046 if ( !$anyFieldHasLabel ) {
2047 $classes[] =
'mw-htmlform-nolabel';
2050 $attribs = [
'class' => $classes ];
2052 if ( $sectionName ) {
2053 $attribs[
'id'] = Sanitizer::escapeIdForAttribute( $sectionName );
2056 if ( $displayFormat ===
'table' ) {
2057 return Html::rawElement(
'table',
2059 Html::rawElement(
'tbody', [],
"\n$html\n" ) ) .
"\n";
2060 } elseif ( $displayFormat ===
'inline' ) {
2061 return Html::rawElement(
'span', $attribs,
"\n$html\n" );
2063 return Html::rawElement(
'div', $attribs,
"\n$html\n" );
2071 $this->prepareForm();
2079 $request = $this->getRequest();
2081 foreach ( $this->mFlatFields as $fieldname => $field ) {
2082 if ( $field->skipLoadData( $request ) ) {
2085 if ( $field->mParams[
'disabled'] ??
false ) {
2086 $fieldData[$fieldname] = $field->getDefault();
2088 $fieldData[$fieldname] = $field->loadDataFromRequest( $request );
2094 foreach ( $fieldData as $name => &$value ) {
2095 $field = $this->mFlatFields[$name];
2096 if ( $field->isDisabled( $fieldData ) ) {
2097 $value = $field->getDefault();
2102 foreach ( $fieldData as $name => &$value ) {
2103 $field = $this->mFlatFields[$name];
2104 $value = $field->filter( $value, $fieldData );
2107 $this->mFieldData = $fieldData;
2118 $this->mShowReset = !$suppressReset;
2147 return $this->msg( $this->mMessagePrefix ?
"{$this->mMessagePrefix}-$key" : $key )->text();
2161 $this->mAction = $action;
2175 if ( $this->mAction !==
false ) {
2176 return $this->mAction;
2179 $articlePath = $this->getConfig()->get( MainConfigNames::ArticlePath );
2185 if ( str_contains( $articlePath,
'?' ) && $this->getMethod() ===
'get' ) {
2186 return $this->getConfig()->get( MainConfigNames::Script );
2189 return $this->
getTitle()->getLocalURL();
2203 $this->mAutocomplete = $autocomplete;
2228 foreach ( $this->mFlatFields as $field ) {
2229 if ( $field->needsJSForHtml5FormValidation() ) {
if(!defined('MW_SETUP_CALLBACK'))
The persistent session ID (if any) loaded at startup.
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
setContext(IContextSource $context)
A class containing constants representing the names of configuration variables.
The Message class deals with fetching and processing of interface message into a variety of formats.
static newFromSpecifier( $value)
Transform a MessageSpecifier or a primitive value used interchangeably with specifiers (a message key...
Generic operation result class Has warning/error list, boolean status and arbitrary value.
isGood()
Returns whether the operation completed and didn't have any error or warnings.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Interface for objects which can provide a MediaWiki context on request.