131 'api' =>
'HTMLApiField',
132 'text' =>
'HTMLTextField',
133 'textwithbutton' =>
'HTMLTextFieldWithButton',
134 'textarea' =>
'HTMLTextAreaField',
135 'select' =>
'HTMLSelectField',
136 'combobox' =>
'HTMLComboboxField',
137 'radio' =>
'HTMLRadioField',
138 'multiselect' =>
'HTMLMultiSelectField',
139 'limitselect' =>
'HTMLSelectLimitField',
140 'check' =>
'HTMLCheckField',
141 'toggle' =>
'HTMLCheckField',
142 'int' =>
'HTMLIntField',
143 'float' =>
'HTMLFloatField',
144 'info' =>
'HTMLInfoField',
145 'selectorother' =>
'HTMLSelectOrOtherField',
146 'selectandother' =>
'HTMLSelectAndOtherField',
147 'namespaceselect' =>
'HTMLSelectNamespace',
148 'namespaceselectwithbutton' =>
'HTMLSelectNamespaceWithButton',
149 'tagfilter' =>
'HTMLTagFilter',
150 'sizefilter' =>
'HTMLSizeFilterField',
151 'submit' =>
'HTMLSubmitField',
152 'hidden' =>
'HTMLHiddenField',
153 'edittools' =>
'HTMLEditTools',
154 'checkmatrix' =>
'HTMLCheckMatrix',
155 'cloner' =>
'HTMLFormFieldCloner',
156 'autocompleteselect' =>
'HTMLAutoCompleteSelectField',
157 'date' =>
'HTMLDateTimeField',
158 'time' =>
'HTMLDateTimeField',
159 'datetime' =>
'HTMLDateTimeField',
163 'email' =>
'HTMLTextField',
164 'password' =>
'HTMLTextField',
165 'url' =>
'HTMLTextField',
166 'title' =>
'HTMLTitleTextField',
167 'user' =>
'HTMLUserTextField',
168 'usersmultiselect' =>
'HTMLUsersMultiselectField',
278 $arguments = func_get_args();
279 array_shift( $arguments );
283 return ObjectFactory::constructClassInstance( VFormHTMLForm::class, $arguments );
285 return ObjectFactory::constructClassInstance( OOUIHTMLForm::class, $arguments );
288 $form = ObjectFactory::constructClassInstance( self::class, $arguments );
307 $this->mTitle =
false;
308 $this->mMessagePrefix = $messagePrefix;
309 } elseif (
$context ===
null && $messagePrefix !==
'' ) {
310 $this->mMessagePrefix = $messagePrefix;
311 } elseif ( is_string(
$context ) && $messagePrefix ===
'' ) {
319 !$this->
getConfig()->
get(
'HTMLFormAllowTableFormat' )
320 && $this->displayFormat ===
'table'
322 $this->displayFormat =
'div';
326 $loadedDescriptor = [];
327 $this->mFlatFields = [];
329 foreach ( $descriptor as $fieldname => $info ) {
330 $section = isset( $info[
'section'] )
334 if ( isset( $info[
'type'] ) && $info[
'type'] ===
'file' ) {
335 $this->mUseMultipart =
true;
338 $field = static::loadInputFromParameters( $fieldname, $info, $this );
340 $setSection =& $loadedDescriptor;
342 $sectionParts = explode(
'/',
$section );
344 while ( count( $sectionParts ) ) {
345 $newName = array_shift( $sectionParts );
347 if ( !isset( $setSection[$newName] ) ) {
348 $setSection[$newName] = [];
351 $setSection =& $setSection[$newName];
355 $setSection[$fieldname] = $field;
356 $this->mFlatFields[$fieldname] = $field;
359 $this->mFieldTree = $loadedDescriptor;
367 return isset( $this->mFlatFields[$fieldname] );
376 if ( !$this->
hasField( $fieldname ) ) {
377 throw new DomainException( __METHOD__ .
': no field named ' . $fieldname );
379 return $this->mFlatFields[$fieldname];
394 in_array( $format, $this->availableSubclassDisplayFormats,
true ) ||
395 in_array( $this->displayFormat, $this->availableSubclassDisplayFormats,
true )
397 throw new MWException(
'Cannot change display format after creation, ' .
398 'use HTMLForm::factory() instead' );
401 if ( !in_array( $format, $this->availableDisplayFormats,
true ) ) {
402 throw new MWException(
'Display format must be one of ' .
405 $this->availableDisplayFormats,
406 $this->availableSubclassDisplayFormats
413 if ( !$this->
getConfig()->
get(
'HTMLFormAllowTableFormat' ) && $format ===
'table' ) {
417 $this->displayFormat = $format;
459 if ( isset( $descriptor[
'class'] ) ) {
460 $class = $descriptor[
'class'];
461 } elseif ( isset( $descriptor[
'type'] ) ) {
462 $class = static::$typeMappings[$descriptor[
'type']];
463 $descriptor[
'class'] = $class;
469 throw new MWException(
"Descriptor with no class for $fieldname: "
470 . print_r( $descriptor,
true ) );
489 $class = static::getClassFromDescriptor( $fieldname, $descriptor );
491 $descriptor[
'fieldname'] = $fieldname;
493 $descriptor[
'parent'] = $parent;
496 # @todo This will throw a fatal error whenever someone try to use
497 # 'class' to feed a CSS class instead of 'cssclass'. Would be
498 # great to avoid the fatal error and show a nice error.
499 return new $class( $descriptor );
512 # Check if we have the info we need
513 if ( !$this->mTitle instanceof
Title && $this->mTitle !==
false ) {
514 throw new MWException(
'You must call setTitle() on an HTMLForm' );
517 # Load data from the request.
519 $this->mFormIdentifier ===
null ||
520 $this->
getRequest()->getVal(
'wpFormIdentifier' ) === $this->mFormIdentifier
524 $this->mFieldData = [];
538 if ( $this->mFormIdentifier ===
null ) {
547 } elseif ( $this->
getRequest()->wasPosted() ) {
548 $editToken = $this->
getRequest()->getVal(
'wpEditToken' );
549 if ( $this->
getUser()->isLoggedIn() || $editToken !==
null ) {
553 $tokenOkay = $this->
getUser()->matchEditToken( $editToken, $this->mTokenSalt );
559 if ( $tokenOkay && $identOkay ) {
560 $this->mWasSubmitted =
true;
577 if ( $result ===
true || ( $result instanceof
Status && $result->
isGood() ) ) {
614 $hoistedErrors = Status::newGood();
615 if ( $this->mValidationErrorMessage ) {
616 foreach ( (array)$this->mValidationErrorMessage as $error ) {
617 call_user_func_array( [ $hoistedErrors,
'fatal' ], $error );
620 $hoistedErrors->fatal(
'htmlform-invalid-input' );
623 $this->mWasSubmitted =
true;
625 # Check for cancelled submission
626 foreach ( $this->mFlatFields as $fieldname => $field ) {
627 if ( !array_key_exists( $fieldname, $this->mFieldData ) ) {
630 if ( $field->cancelSubmit( $this->mFieldData[$fieldname], $this->mFieldData ) ) {
631 $this->mWasSubmitted =
false;
636 # Check for validation
637 foreach ( $this->mFlatFields as $fieldname => $field ) {
638 if ( !array_key_exists( $fieldname, $this->mFieldData ) ) {
641 if ( $field->isHidden( $this->mFieldData ) ) {
644 $res = $field->validate( $this->mFieldData[$fieldname], $this->mFieldData );
645 if (
$res !==
true ) {
647 if (
$res !==
false && !$field->canDisplayErrors() ) {
648 if ( is_string(
$res ) ) {
649 $hoistedErrors->fatal(
'rawmessage',
$res );
651 $hoistedErrors->fatal(
$res );
658 return $hoistedErrors;
662 if ( !is_callable( $callback ) ) {
663 throw new MWException(
'HTMLForm: no submit callback provided. Use ' .
664 'setSubmitCallback() to set one.' );
669 $res = call_user_func( $callback, $data, $this );
670 if (
$res ===
false ) {
671 $this->mWasSubmitted =
false;
703 $this->mSubmitCallback = $cb;
717 $this->mValidationErrorMessage = $msg;
772 $this->mHeader .= $msg;
774 if ( !isset( $this->mSectionHeaders[
$section] ) ) {
775 $this->mSectionHeaders[
$section] =
'';
777 $this->mSectionHeaders[
$section] .= $msg;
794 $this->mHeader = $msg;
796 $this->mSectionHeaders[
$section] = $msg;
813 return isset( $this->mSectionHeaders[
$section] ) ? $this->mSectionHeaders[
$section] :
'';
827 $this->mFooter .= $msg;
829 if ( !isset( $this->mSectionFooters[
$section] ) ) {
830 $this->mSectionFooters[
$section] =
'';
832 $this->mSectionFooters[
$section] .= $msg;
849 $this->mFooter = $msg;
851 $this->mSectionFooters[
$section] = $msg;
868 return isset( $this->mSectionFooters[
$section] ) ? $this->mSectionFooters[
$section] :
'';
880 $this->mPost .= $msg;
925 foreach ( $fields as $name =>
$value ) {
926 $this->mHiddenFields[] = [
$value, [
'name' =>
$name ] ];
957 if ( !is_array( $data ) ) {
958 $args = func_get_args();
959 if ( count(
$args ) < 2 || count(
$args ) > 4 ) {
960 throw new InvalidArgumentException(
961 'Incorrect number of arguments for deprecated calling style'
968 'attribs' => isset(
$args[3] ) ?
$args[3] :
null,
971 if ( !isset( $data[
'name'] ) ) {
972 throw new InvalidArgumentException(
'A name is required' );
974 if ( !isset( $data[
'value'] ) ) {
975 throw new InvalidArgumentException(
'A value is required' );
978 $this->mButtons[] = $data + [
998 $this->mTokenSalt = $salt;
1027 # For good measure (it is the default)
1028 $this->
getOutput()->preventClickjacking();
1029 $this->
getOutput()->addModules(
'mediawiki.htmlform' );
1030 $this->
getOutput()->addModuleStyles(
'mediawiki.htmlform.styles' );
1051 # Use multipart/form-data
1052 $encType = $this->mUseMultipart
1053 ?
'multipart/form-data'
1054 :
'application/x-www-form-urlencoded';
1057 'class' =>
'mw-htmlform',
1060 'enctype' => $encType,
1065 if ( $this->mAutocomplete ) {
1068 if ( $this->mName ) {
1085 # Include a <fieldset> wrapper for style, if requested.
1086 if ( $this->mWrapperLegend !==
false ) {
1087 $legend = is_string( $this->mWrapperLegend ) ? $this->mWrapperLegend :
false;
1091 return Html::rawElement(
1104 if ( $this->mFormIdentifier !==
null ) {
1105 $html .= Html::hidden(
1107 $this->mFormIdentifier
1111 $html .= Html::hidden(
1113 $this->
getUser()->getEditToken( $this->mTokenSalt ),
1114 [
'id' =>
'wpEditToken' ]
1116 $html .= Html::hidden(
'title', $this->
getTitle()->getPrefixedText() ) .
"\n";
1119 $articlePath = $this->
getConfig()->get(
'ArticlePath' );
1120 if ( strpos( $articlePath,
'?' ) !==
false && $this->
getMethod() ===
'get' ) {
1121 $html .= Html::hidden(
'title', $this->
getTitle()->getPrefixedText() ) .
"\n";
1124 foreach ( $this->mHiddenFields as $data ) {
1138 $useMediaWikiUIEverywhere = $this->
getConfig()->get(
'UseMediaWikiUIEverywhere' );
1140 if ( $this->mShowSubmit ) {
1143 if ( isset( $this->mSubmitID ) ) {
1147 if ( isset( $this->mSubmitName ) ) {
1151 if ( isset( $this->mSubmitTooltip ) ) {
1155 $attribs[
'class'] = [
'mw-htmlform-submit' ];
1157 if ( $useMediaWikiUIEverywhere ) {
1158 foreach ( $this->mSubmitFlags as $flag ) {
1159 $attribs[
'class'][] =
'mw-ui-' . $flag;
1161 $attribs[
'class'][] =
'mw-ui-button';
1167 if ( $this->mShowReset ) {
1168 $buttons .= Html::element(
1172 'value' => $this->
msg(
'htmlform-reset' )->
text(),
1173 'class' => $useMediaWikiUIEverywhere ?
'mw-ui-button' :
null,
1178 if ( $this->mShowCancel ) {
1179 $target = $this->mCancelTarget ?: Title::newMainPage();
1180 if ( $target instanceof
Title ) {
1181 $target = $target->getLocalURL();
1183 $buttons .= Html::element(
1186 'class' => $useMediaWikiUIEverywhere ?
'mw-ui-button' :
null,
1189 $this->
msg(
'cancel' )->text()
1194 $isBadIE = preg_match(
'/MSIE [1-7]\./i', $this->
getRequest()->getHeader(
'User-Agent' ) );
1196 foreach ( $this->mButtons as $button ) {
1199 'name' => $button[
'name'],
1200 'value' => $button[
'value']
1203 if ( isset( $button[
'label-message'] ) ) {
1204 $label = $this->
getMessage( $button[
'label-message'] )->parse();
1205 } elseif ( isset( $button[
'label'] ) ) {
1206 $label = htmlspecialchars( $button[
'label'] );
1207 } elseif ( isset( $button[
'label-raw'] ) ) {
1208 $label = $button[
'label-raw'];
1210 $label = htmlspecialchars( $button[
'value'] );
1213 if ( $button[
'attribs'] ) {
1214 $attrs += $button[
'attribs'];
1217 if ( isset( $button[
'id'] ) ) {
1218 $attrs[
'id'] = $button[
'id'];
1221 if ( $useMediaWikiUIEverywhere ) {
1222 $attrs[
'class'] = isset( $attrs[
'class'] ) ? (
array)$attrs[
'class'] : [];
1223 $attrs[
'class'][] =
'mw-ui-button';
1227 $buttons .= Html::element(
'input', $attrs ) .
"\n";
1229 $buttons .= Html::rawElement(
'button', $attrs, $label ) .
"\n";
1237 return Html::rawElement(
'span',
1238 [
'class' =>
'mw-htmlform-submit-buttons' ],
"\n$buttons" ) .
"\n";
1246 return $this->
displaySection( $this->mFieldTree, $this->mTableId );
1272 if ( !in_array( $elementsType, [
'error',
'warning' ],
true ) ) {
1273 throw new DomainException( $elementsType .
' is not a valid type.' );
1275 $elementstr =
false;
1276 if ( $elements instanceof
Status ) {
1277 list( $errorStatus, $warningStatus ) = $elements->splitByErrorType();
1278 $status = $elementsType ===
'error' ? $errorStatus : $warningStatus;
1282 $elementstr = $this->
getOutput()->parse(
1286 } elseif ( is_array( $elements ) && $elementsType ===
'error' ) {
1288 } elseif ( $elementsType ===
'error' ) {
1289 $elementstr = $elements;
1293 ? Html::rawElement(
'div', [
'class' => $elementsType ], $elementstr )
1307 foreach ( $errors as $error ) {
1308 $errorstr .= Html::rawElement(
1315 $errorstr = Html::rawElement(
'ul', [], $errorstr );
1328 $this->mSubmitText =
$t;
1340 $this->mSubmitFlags = [
'destructive',
'primary' ];
1352 $this->mSubmitFlags = [
'progressive',
'primary' ];
1366 if ( !$msg instanceof
Message ) {
1367 $msg = $this->
msg( $msg );
1379 return $this->mSubmitText ?: $this->
msg(
'htmlform-submit' )->text();
1388 $this->mSubmitName =
$name;
1399 $this->mSubmitTooltip =
$name;
1413 $this->mSubmitID =
$t;
1434 $this->mFormIdentifier = $ident;
1450 $this->mShowSubmit = !$suppressSubmit;
1462 $this->mShowCancel = $show;
1473 $this->mCancelTarget = $target;
1487 $this->mTableId = $id;
1508 $this->mName =
$name;
1525 $this->mWrapperLegend = $legend;
1540 if ( !$msg instanceof
Message ) {
1541 $msg = $this->
msg( $msg );
1558 $this->mMessagePrefix = $p;
1581 return $this->mTitle ===
false
1594 $this->mMethod = strtolower( $method );
1615 return Xml::fieldset( $legend,
$section, $attributes ) .
"\n";
1636 $fieldsetIDPrefix =
'',
1637 &$hasUserVisibleFields =
false
1639 if ( $this->mFieldData ===
null ) {
1640 throw new LogicException(
'HTMLForm::displaySection() called on uninitialized field data. '
1641 .
'You probably called displayForm() without calling prepareForm() first.' );
1647 $subsectionHtml =
'';
1654 foreach ( $fields as $key =>
$value ) {
1656 $v = array_key_exists( $key, $this->mFieldData )
1657 ? $this->mFieldData[$key]
1664 if (
$value->hasVisibleOutput() ) {
1667 $labelValue = trim(
$value->getLabel() );
1668 if ( $labelValue !==
' ' && $labelValue !==
'' ) {
1672 $hasUserVisibleFields =
true;
1674 } elseif ( is_array(
$value ) ) {
1675 $subsectionHasVisibleFields =
false;
1679 "$fieldsetIDPrefix$key-",
1680 $subsectionHasVisibleFields );
1683 if ( $subsectionHasVisibleFields ===
true ) {
1685 $hasUserVisibleFields =
true;
1694 if ( $fieldsetIDPrefix ) {
1695 $attributes[
'id'] = Sanitizer::escapeIdForAttribute(
"$fieldsetIDPrefix$key" );
1707 if ( $subsectionHtml ) {
1708 if ( $this->mSubSectionBeforeFields ) {
1709 return $subsectionHtml .
"\n" .
$html;
1711 return $html .
"\n" . $subsectionHtml;
1725 protected function formatSection( array $fieldsHtml, $sectionName, $anyFieldHasLabel ) {
1727 $html = implode(
'', $fieldsHtml );
1735 if ( !$anyFieldHasLabel ) {
1736 $classes[] =
'mw-htmlform-nolabel';
1740 'class' => implode(
' ', $classes ),
1743 if ( $sectionName ) {
1744 $attribs[
'id'] = Sanitizer::escapeIdForAttribute( $sectionName );
1748 return Html::rawElement(
'table',
1750 Html::rawElement(
'tbody', [],
"\n$html\n" ) ) .
"\n";
1752 return Html::rawElement(
'span',
$attribs,
"\n$html\n" );
1754 return Html::rawElement(
'div',
$attribs,
"\n$html\n" );
1764 foreach ( $this->mFlatFields as $fieldname => $field ) {
1766 if ( $field->skipLoadData(
$request ) ) {
1768 } elseif ( !empty( $field->mParams[
'disabled'] ) ) {
1769 $fieldData[$fieldname] = $field->getDefault();
1771 $fieldData[$fieldname] = $field->loadDataFromRequest(
$request );
1776 foreach ( $fieldData as $name => &
$value ) {
1777 $field = $this->mFlatFields[
$name];
1781 $this->mFieldData = $fieldData;
1792 $this->mShowReset = !$suppressReset;
1819 return $this->
msg(
"{$this->mMessagePrefix}-$key" )->text();
1833 $this->mAction = $action;
1847 if ( $this->mAction !==
false ) {
1851 $articlePath = $this->
getConfig()->get(
'ArticlePath' );
1857 if ( strpos( $articlePath,
'?' ) !==
false && $this->
getMethod() ===
'get' ) {
1861 return $this->
getTitle()->getLocalURL();
1875 $this->mAutocomplete = $autocomplete;
1887 return Message::newFromSpecifier(
$value )->setContext( $this );
1900 foreach ( $this->mFlatFields as $fieldname => $field ) {
1901 if ( $field->needsJSForHtml5FormValidation() ) {
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getUser()
Get the User object.
getRequest()
Get the WebRequest object.
getConfig()
Get the Config object.
getOutput()
Get the OutputPage object.
getContext()
Get the base IContextSource object.
setContext(IContextSource $context)
Set the IContextSource object.
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[])
Returns the attributes for the tooltip and access key.
The Message class provides methods which fulfil two basic services:
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.
Represents a title within MediaWiki.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
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 text
the array() calling protocol came about after MediaWiki 1.4rc1.
namespace being checked & $result
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
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account incomplete not yet checked for validity & $retval
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
Allows to change the fields on the form that will be generated $name
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
Status::newGood()` to allow deletion, and then `return false` from the hook function. Ensure you consume the 'ChangeTagAfterDelete' hook to carry out custom deletion actions. $tag:name of the tag $user:user initiating the action & $status:Status object. See above. 'ChangeTagsListActive':Allows you to nominate which of the tags your extension uses are in active use. & $tags:list of all active tags. Append to this array. 'ChangeTagsAfterUpdateTags':Called after tags have been updated with the ChangeTags::updateTags function. Params:$addedTags:tags effectively added in the update $removedTags:tags effectively removed in the update $prevTags:tags that were present prior to the update $rc_id:recentchanges table id $rev_id:revision table id $log_id:logging table id $params:tag params $rc:RecentChange being tagged when the tagging accompanies the action or null $user:User who performed the tagging when the tagging is subsequent to the action or null 'ChangeTagsAllowedAdd':Called when checking if a user can add tags to a change. & $allowedTags:List of all the tags the user is allowed to add. Any tags the user wants to add( $addTags) that are not in this array will cause it to fail. You may add or remove tags to this array as required. $addTags:List of tags user intends to add. $user:User who is adding the tags. 'ChangeUserGroups':Called before user groups are changed. $performer:The User who will perform the change $user:The User whose groups will be changed & $add:The groups that will be added & $remove:The groups that will be removed 'Collation::factory':Called if $wgCategoryCollation is an unknown collation. $collationName:Name of the collation in question & $collationObject:Null. Replace with a subclass of the Collation class that implements the collation given in $collationName. 'ConfirmEmailComplete':Called after a user 's email has been confirmed successfully. $user:user(object) whose email is being confirmed 'ContentAlterParserOutput':Modify parser output for a given content object. Called by Content::getParserOutput after parsing has finished. Can be used for changes that depend on the result of the parsing but have to be done before LinksUpdate is called(such as adding tracking categories based on the rendered HTML). $content:The Content to render $title:Title of the page, as context $parserOutput:ParserOutput to manipulate 'ContentGetParserOutput':Customize parser output for a given content object, called by AbstractContent::getParserOutput. May be used to override the normal model-specific rendering of page content. $content:The Content to render $title:Title of the page, as context $revId:The revision ID, as context $options:ParserOptions for rendering. To avoid confusing the parser cache, the output can only depend on parameters provided to this hook function, not on global state. $generateHtml:boolean, indicating whether full HTML should be generated. If false, generation of HTML may be skipped, but other information should still be present in the ParserOutput object. & $output:ParserOutput, to manipulate or replace 'ContentHandlerDefaultModelFor':Called when the default content model is determined for a given title. May be used to assign a different model for that title. $title:the Title in question & $model:the model name. Use with CONTENT_MODEL_XXX constants. 'ContentHandlerForModelID':Called when a ContentHandler is requested for a given content model name, but no entry for that model exists in $wgContentHandlers. Note:if your extension implements additional models via this hook, please use GetContentModels hook to make them known to core. $modeName:the requested content model name & $handler:set this to a ContentHandler object, if desired. 'ContentModelCanBeUsedOn':Called to determine whether that content model can be used on a given page. This is especially useful to prevent some content models to be used in some special location. $contentModel:ID of the content model in question $title:the Title in question. & $ok:Output parameter, whether it is OK to use $contentModel on $title. Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok. 'ContribsPager::getQueryInfo':Before the contributions query is about to run & $pager:Pager object for contributions & $queryInfo:The query for the contribs Pager 'ContribsPager::reallyDoQuery':Called before really executing the query for My Contributions & $data:an array of results of all contribs queries $pager:The ContribsPager object hooked into $offset:Index offset, inclusive $limit:Exact query limit $descending:Query direction, false for ascending, true for descending 'ContributionsLineEnding':Called before a contributions HTML line is finished $page:SpecialPage object for contributions & $ret:the HTML line $row:the DB row for this line & $classes:the classes to add to the surrounding< li > & $attribs:associative array of other HTML attributes for the< li > element. Currently only data attributes reserved to MediaWiki are allowed(see Sanitizer::isReservedDataAttribute). 'ContributionsToolLinks':Change tool links above Special:Contributions $id:User identifier $title:User page title & $tools:Array of tool links $specialPage:SpecialPage instance for context and services. Can be either SpecialContributions or DeletedContributionsPage. Extensions should type hint against a generic SpecialPage though. 'ConvertContent':Called by AbstractContent::convert when a conversion to another content model is requested. Handler functions that modify $result should generally return false to disable further attempts at conversion. $content:The Content object to be converted. $toModel:The ID of the content model to convert to. $lossy: boolean indicating whether lossy conversion is allowed. & $result:Output parameter, in case the handler function wants to provide a converted Content object. Note that $result->getContentModel() must return $toModel. 'CustomEditor':When invoking the page editor Return true to allow the normal editor to be used, or false if implementing a custom editor, e.g. for a special namespace, etc. $article:Article being edited $user:User performing the edit 'DatabaseOraclePostInit':Called after initialising an Oracle database $db:the DatabaseOracle object 'DeletedContribsPager::reallyDoQuery':Called before really executing the query for Special:DeletedContributions Similar to ContribsPager::reallyDoQuery & $data:an array of results of all contribs queries $pager:The DeletedContribsPager object hooked into $offset:Index offset, inclusive $limit:Exact query limit $descending:Query direction, false for ascending, true for descending 'DeletedContributionsLineEnding':Called before a DeletedContributions HTML line is finished. Similar to ContributionsLineEnding $page:SpecialPage object for DeletedContributions & $ret:the HTML line $row:the DB row for this line & $classes:the classes to add to the surrounding< li > & $attribs:associative array of other HTML attributes for the< li > element. Currently only data attributes reserved to MediaWiki are allowed(see Sanitizer::isReservedDataAttribute). 'DifferenceEngineAfterLoadNewText':called in DifferenceEngine::loadNewText() after the new revision 's content has been loaded into the class member variable $differenceEngine->mNewContent but before returning true from this function. $differenceEngine:DifferenceEngine object 'DifferenceEngineLoadTextAfterNewContentIsLoaded':called in DifferenceEngine::loadText() after the new revision 's content has been loaded into the class member variable $differenceEngine->mNewContent but before checking if the variable 's value is null. This hook can be used to inject content into said class member variable. $differenceEngine:DifferenceEngine object 'DifferenceEngineMarkPatrolledLink':Allows extensions to change the "mark as patrolled" link which is shown both on the diff header as well as on the bottom of a page, usually wrapped in a span element which has class="patrollink". $differenceEngine:DifferenceEngine object & $markAsPatrolledLink:The "mark as patrolled" link HTML(string) $rcid:Recent change ID(rc_id) for this change(int) 'DifferenceEngineMarkPatrolledRCID':Allows extensions to possibly change the rcid parameter. For example the rcid might be set to zero due to the user being the same as the performer of the change but an extension might still want to show it under certain conditions. & $rcid:rc_id(int) of the change or 0 $differenceEngine:DifferenceEngine object $change:RecentChange object $user:User object representing the current user 'DifferenceEngineNewHeader':Allows extensions to change the $newHeader variable, which contains information about the new revision, such as the revision 's author, whether the revision was marked as a minor edit or not, etc. $differenceEngine:DifferenceEngine object & $newHeader:The string containing the various #mw-diff-otitle[1-5] divs, which include things like revision author info, revision comment, RevisionDelete link and more $formattedRevisionTools:Array containing revision tools, some of which may have been injected with the DiffRevisionTools hook $nextlink:String containing the link to the next revision(if any) $status
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
Interface for objects which can provide a MediaWiki context on request.