38 private static $coreTags = [
'mw-contentmodelchange' ];
63 $tags = explode(
',', $tags );
65 foreach ( $tags as $tag ) {
70 if ( $description ===
false ) {
73 $displayTags[] = Xml::tags(
75 [
'class' =>
'mw-tag-marker ' .
76 Sanitizer::escapeClass(
"mw-tag-marker-$tag" ) ],
79 $classes[] = Sanitizer::escapeClass(
"mw-tag-$tag" );
82 if ( !$displayTags ) {
86 $markers =
$context->msg(
'tag-list-wrapper' )
87 ->numParams( count( $displayTags ) )
88 ->rawParams(
$context->getLanguage()->commaList( $displayTags ) )
90 $markers = Xml::tags(
'span', [
'class' =>
'mw-tag-markers' ], $markers );
92 return [ $markers, $classes ];
110 if ( !$msg->exists() ) {
112 return htmlspecialchars( $tag );
114 if ( $msg->isDisabled() ) {
120 return $msg->parse();
136 $msg =
$context->msg(
"tag-$tag-description" );
137 if ( !$msg->exists() ) {
140 if ( $msg->isDisabled() ) {
163 public static function addTags( $tags, $rc_id =
null, $rev_id =
null,
167 return (
bool)$result[0];
200 public static function updateTags( $tagsToAdd, $tagsToRemove, &$rc_id =
null,
204 $tagsToAdd = array_filter( (array)$tagsToAdd );
205 $tagsToRemove = array_filter( (array)$tagsToRemove );
207 if ( !$rc_id && !$rev_id && !$log_id ) {
208 throw new MWException(
'At least one of: RCID, revision ID, and log ID MUST be ' .
209 'specified when adding or removing a tag from a change!' );
220 $rc_id = $dbw->selectField(
221 [
'logging',
'recentchanges' ],
225 'rc_timestamp = log_timestamp',
230 } elseif ( $rev_id ) {
231 $rc_id = $dbw->selectField(
232 [
'revision',
'recentchanges' ],
236 'rc_timestamp = rev_timestamp',
237 'rc_this_oldid = rev_id'
242 } elseif ( !$log_id && !$rev_id ) {
244 $log_id = $dbw->selectField(
247 [
'rc_id' => $rc_id ],
250 $rev_id = $dbw->selectField(
253 [
'rc_id' => $rc_id ],
258 if ( $log_id && !$rev_id ) {
259 $rev_id = $dbw->selectField(
262 [
'ls_field' =>
'associated_rev_id',
'ls_log_id' => $log_id ],
265 } elseif ( !$log_id && $rev_id ) {
266 $log_id = $dbw->selectField(
269 [
'ls_field' =>
'associated_rev_id',
'ls_value' => $rev_id ],
276 if ( !self::updateTagSummaryRow( $tagsToAdd, $tagsToRemove, $rc_id, $rev_id,
280 return [ [], [], $prevTags ];
284 if ( count( $tagsToAdd ) ) {
286 foreach ( $tagsToAdd as $tag ) {
291 $tagsRows[] = array_filter(
294 'ct_rc_id' => $rc_id,
295 'ct_log_id' => $log_id,
296 'ct_rev_id' => $rev_id,
302 $dbw->insert(
'change_tag', $tagsRows, __METHOD__, [
'IGNORE' ] );
306 if ( count( $tagsToRemove ) ) {
307 foreach ( $tagsToRemove as $tag ) {
308 $conds = array_filter(
311 'ct_rc_id' => $rc_id,
312 'ct_log_id' => $log_id,
313 'ct_rev_id' => $rev_id
316 $dbw->delete(
'change_tag', $conds, __METHOD__ );
322 Hooks::run(
'ChangeTagsAfterUpdateTags', [ $tagsToAdd, $tagsToRemove, $prevTags,
323 $rc_id, $rev_id, $log_id,
$params, $rc, $user ] );
325 return [ $tagsToAdd, $tagsToRemove, $prevTags ];
345 $rc_id, $rev_id, $log_id, &$prevTags = []
349 $tsConds = array_filter( [
350 'ts_rc_id' => $rc_id,
351 'ts_rev_id' => $rev_id,
352 'ts_log_id' => $log_id
356 $tagsToAdd = array_diff( $tagsToAdd, $tagsToRemove );
361 $prevTags = $dbw->selectField(
'tag_summary',
'ts_tags', $tsConds, __METHOD__ );
362 $prevTags = $prevTags ? $prevTags :
'';
363 $prevTags = array_filter( explode(
',', $prevTags ) );
366 $tagsToAdd = array_values( array_diff( $tagsToAdd, $prevTags ) );
367 $newTags = array_unique( array_merge( $prevTags, $tagsToAdd ) );
370 $tagsToRemove = array_values( array_intersect( $tagsToRemove, $newTags ) );
371 $newTags = array_values( array_diff( $newTags, $tagsToRemove ) );
375 if ( $prevTags == $newTags ) {
382 $dbw->delete(
'tag_summary', $tsConds, __METHOD__ );
384 $dbw->replace(
'tag_summary',
385 [
'ts_rev_id',
'ts_rc_id',
'ts_log_id' ],
386 array_filter( array_merge( $tsConds, [
'ts_tags' => implode(
',', $newTags ) ] ) ),
406 $count = count( $tags );
407 return Status::newFatal( ( $count > 1 ) ? $msgMulti : $msgOne,
408 $lang->commaList( $tags ), $count );
422 if ( !is_null( $user ) ) {
423 if ( !$user->isAllowed(
'applychangetags' ) ) {
424 return Status::newFatal(
'tags-apply-no-permission' );
425 } elseif ( $user->isBlocked() ) {
426 return Status::newFatal(
'tags-apply-blocked', $user->getName() );
432 Hooks::run(
'ChangeTagsAllowedAdd', [ &$allowedTags, $tags, $user ] );
433 $disallowedTags = array_diff( $tags, $allowedTags );
434 if ( $disallowedTags ) {
436 'tags-apply-not-allowed-multi', $disallowedTags );
439 return Status::newGood();
463 array $tags, $rc_id, $rev_id, $log_id,
$params,
User $user
467 if ( !$result->isOK() ) {
468 $result->value =
null;
475 return Status::newGood(
true );
489 public static function canUpdateTags( array $tagsToAdd, array $tagsToRemove,
492 if ( !is_null( $user ) ) {
493 if ( !$user->isAllowed(
'changetags' ) ) {
494 return Status::newFatal(
'tags-update-no-permission' );
495 } elseif ( $user->isBlocked() ) {
496 return Status::newFatal(
'tags-update-blocked', $user->getName() );
504 $diff = array_diff( $tagsToAdd, $explicitlyDefinedTags );
507 'tags-update-add-not-allowed-multi', $diff );
511 if ( $tagsToRemove ) {
516 $intersect = array_intersect( $tagsToRemove, $softwareDefinedTags );
519 'tags-update-remove-not-allowed-multi', $intersect );
523 return Status::newGood();
553 $rc_id, $rev_id, $log_id,
$params, $reason,
User $user
555 if ( is_null( $tagsToAdd ) ) {
558 if ( is_null( $tagsToRemove ) ) {
561 if ( !$tagsToAdd && !$tagsToRemove ) {
563 return Status::newGood( (
object)[
572 if ( !$result->isOK() ) {
573 $result->value =
null;
578 if ( $user->pingLimiter(
'changetag' ) ) {
579 return Status::newFatal(
'actionthrottledtext' );
584 $tagsToRemove, $rc_id, $rev_id, $log_id,
$params,
null, $user );
585 if ( !$tagsAdded && !$tagsRemoved ) {
587 return Status::newGood( (
object)[
596 $logEntry->setPerformer( $user );
597 $logEntry->setComment( $reason );
603 $logEntry->setTarget(
$rev->getTitle() );
605 } elseif ( $log_id ) {
612 if ( !$logEntry->getTarget() ) {
618 '4::revid' => $rev_id,
619 '5::logid' => $log_id,
620 '6:list:tagsAdded' => $tagsAdded,
621 '7:number:tagsAddedCount' => count( $tagsAdded ),
622 '8:list:tagsRemoved' => $tagsRemoved,
623 '9:number:tagsRemovedCount' => count( $tagsRemoved ),
624 'initialTags' => $initialTags,
626 $logEntry->setParameters( $logParams );
627 $logEntry->setRelations( [
'Tag' => array_merge( $tagsAdded, $tagsRemoved ) ] );
630 $logId = $logEntry->insert( $dbw );
632 $logEntry->publish( $logId,
'udp' );
634 return Status::newGood( (
object)[
636 'addedTags' => $tagsAdded,
637 'removedTags' => $tagsRemoved,
662 &$join_conds, &
$options, $filter_tag =
'' ) {
667 $fields = (
array)$fields;
668 $conds = (
array)$conds;
672 if ( in_array(
'recentchanges',
$tables ) ) {
673 $join_cond =
'ct_rc_id=rc_id';
674 } elseif ( in_array(
'logging',
$tables ) ) {
675 $join_cond =
'ct_log_id=log_id';
676 } elseif ( in_array(
'revision',
$tables ) ) {
677 $join_cond =
'ct_rev_id=rev_id';
678 } elseif ( in_array(
'archive',
$tables ) ) {
679 $join_cond =
'ct_rev_id=ar_rev_id';
681 throw new MWException(
'Unable to determine appropriate JOIN condition for tagging.' );
685 ',',
'change_tag',
'ct_tag', $join_cond
693 $join_conds[
'change_tag'] = [
'INNER JOIN', $join_cond ];
694 $conds[
'ct_tag'] = $filter_tag;
696 is_array( $filter_tag ) && count( $filter_tag ) > 1 &&
723 if ( !$config->get(
'UseTagFilter' ) || !count( self::listDefinedTags() ) ) {
730 [
'for' =>
'tagfilter' ],
731 $context->msg(
'tag-filter' )->parse()
736 $data[] =
new OOUI\TextInputWidget( [
738 'name' =>
'tagfilter',
739 'value' => $selected,
740 'classes' =>
'mw-tagfilter-input',
743 $data[] = Xml::input(
747 [
'class' =>
'mw-tagfilter-input mw-ui-input mw-ui-input-inline',
'id' =>
'tagfilter' ]
765 $dbw->replace(
'valid_tag',
767 [
'vt_tag' => $tag ],
784 $dbw->delete(
'valid_tag', [
'vt_tag' => $tag ], __METHOD__ );
805 User $user, $tagCount =
null, array $logEntryTags = []
810 $logEntry->setPerformer( $user );
813 $logEntry->setTarget( Title::newFromText(
'Special:Tags' ) );
814 $logEntry->setComment( $reason );
816 $params = [
'4::tag' => $tag ];
817 if ( !is_null( $tagCount ) ) {
818 $params[
'5:number:count'] = $tagCount;
820 $logEntry->setParameters(
$params );
821 $logEntry->setRelations( [
'Tag' => $tag ] );
822 $logEntry->setTags( $logEntryTags );
824 $logId = $logEntry->insert( $dbw );
825 $logEntry->publish( $logId );
839 if ( !is_null( $user ) ) {
840 if ( !$user->isAllowed(
'managechangetags' ) ) {
841 return Status::newFatal(
'tags-manage-no-permission' );
842 } elseif ( $user->isBlocked() ) {
843 return Status::newFatal(
'tags-manage-blocked', $user->getName() );
851 if ( in_array( $tag, $definedTags ) ) {
852 return Status::newFatal(
'tags-activate-not-allowed', $tag );
857 if ( !isset( $tagUsage[$tag] ) ) {
858 return Status::newFatal(
'tags-activate-not-found', $tag );
861 return Status::newGood();
882 $ignoreWarnings =
false, array $logEntryTags = []
886 if ( $ignoreWarnings ? !$result->isOK() : !$result->isGood() ) {
887 $result->value =
null;
896 null, $logEntryTags );
898 return Status::newGood( $logId );
911 if ( !is_null( $user ) ) {
912 if ( !$user->isAllowed(
'managechangetags' ) ) {
913 return Status::newFatal(
'tags-manage-no-permission' );
914 } elseif ( $user->isBlocked() ) {
915 return Status::newFatal(
'tags-manage-blocked', $user->getName() );
921 if ( !in_array( $tag, $explicitlyDefinedTags ) ) {
922 return Status::newFatal(
'tags-deactivate-not-allowed', $tag );
924 return Status::newGood();
945 $ignoreWarnings =
false, array $logEntryTags = []
949 if ( $ignoreWarnings ? !$result->isOK() : !$result->isGood() ) {
950 $result->value =
null;
959 null, $logEntryTags );
961 return Status::newGood( $logId );
974 return Status::newFatal(
'tags-create-no-name' );
981 if ( strpos( $tag,
',' ) !==
false || strpos( $tag,
'|' ) !==
false
982 || strpos( $tag,
'/' ) !==
false ) {
983 return Status::newFatal(
'tags-create-invalid-chars' );
987 $title = Title::makeTitleSafe( NS_MEDIAWIKI,
"Tag-$tag-description" );
988 if ( is_null( $title ) ) {
989 return Status::newFatal(
'tags-create-invalid-title-chars' );
992 return Status::newGood();
1005 if ( !is_null( $user ) ) {
1006 if ( !$user->isAllowed(
'managechangetags' ) ) {
1007 return Status::newFatal(
'tags-manage-no-permission' );
1008 } elseif ( $user->isBlocked() ) {
1009 return Status::newFatal(
'tags-manage-blocked', $user->getName() );
1020 if ( isset( $tagUsage[$tag] ) || in_array( $tag, self::listDefinedTags() ) ) {
1021 return Status::newFatal(
'tags-create-already-exists', $tag );
1025 $canCreateResult = Status::newGood();
1026 Hooks::run(
'ChangeTagCanCreate', [ $tag, $user, &$canCreateResult ] );
1027 return $canCreateResult;
1047 $ignoreWarnings =
false, array $logEntryTags = []
1051 if ( $ignoreWarnings ? !$result->isOK() : !$result->isGood() ) {
1052 $result->value =
null;
1061 null, $logEntryTags );
1063 return Status::newGood( $logId );
1080 $dbw->startAtomic( __METHOD__ );
1086 $result = $dbw->select(
'change_tag',
1087 [
'ct_rc_id',
'ct_log_id',
'ct_rev_id',
'ct_tag' ],
1088 [
'ct_tag' => $tag ],
1090 foreach ( $result as $row ) {
1093 $tagsToRemove = [ $tag ];
1095 $row->ct_rev_id, $row->ct_log_id );
1099 $dbw->delete(
'change_tag', [
'ct_tag' => $tag ], __METHOD__ );
1101 $dbw->endAtomic( __METHOD__ );
1105 Hooks::run(
'ChangeTagAfterDelete', [ $tag, &
$status ] );
1108 wfDebug(
'ChangeTagAfterDelete error condition downgraded to warning' );
1130 if ( !is_null( $user ) ) {
1131 if ( !$user->isAllowed(
'deletechangetags' ) ) {
1132 return Status::newFatal(
'tags-delete-no-permission' );
1133 } elseif ( $user->isBlocked() ) {
1134 return Status::newFatal(
'tags-manage-blocked', $user->getName() );
1138 if ( !isset( $tagUsage[$tag] ) && !in_array( $tag, self::listDefinedTags() ) ) {
1139 return Status::newFatal(
'tags-delete-not-found', $tag );
1142 if ( isset( $tagUsage[$tag] ) && $tagUsage[$tag] > self::MAX_DELETE_USES ) {
1143 return Status::newFatal(
'tags-delete-too-many-uses', $tag, self::MAX_DELETE_USES );
1147 if ( in_array( $tag, $softwareDefined ) ) {
1150 $status = Status::newFatal(
'tags-delete-not-allowed' );
1156 Hooks::run(
'ChangeTagCanDelete', [ $tag, $user, &
$status ] );
1178 $ignoreWarnings =
false, array $logEntryTags = []
1182 if ( $ignoreWarnings ? !$result->isOK() : !$result->isGood() ) {
1183 $result->value =
null;
1189 $hitcount = isset( $tagUsage[$tag] ) ? $tagUsage[$tag] : 0;
1193 if ( !$deleteResult->isOK() ) {
1194 return $deleteResult;
1199 $hitcount, $logEntryTags );
1201 $deleteResult->value = $logId;
1202 return $deleteResult;
1214 if ( !Hooks::isRegistered(
'ChangeTagsListActive' ) ) {
1217 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
1218 return $cache->getWithSetCallback(
1219 $cache->makeKey(
'active-tags' ),
1220 WANObjectCache::TTL_MINUTE * 5,
1221 function ( $oldValue, &$ttl, array &$setOpts ) use ( $tags ) {
1225 Hooks::run(
'ChangeTagsListActive', [ &$tags ] );
1229 'checkKeys' => [
$cache->makeKey(
'active-tags' ) ],
1230 'lockTSE' => WANObjectCache::TTL_MINUTE * 5,
1231 'pcTTL' => WANObjectCache::TTL_PROC_LONG
1256 return array_values( array_unique( array_merge( $tags1, $tags2 ) ) );
1272 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
1273 return $cache->getWithSetCallback(
1274 $cache->makeKey(
'valid-tags-db' ),
1275 WANObjectCache::TTL_MINUTE * 5,
1279 $setOpts += Database::getCacheSetOptions(
$dbr );
1281 $tags =
$dbr->selectFieldValues(
'valid_tag',
'vt_tag', [],
$fname );
1283 return array_filter( array_unique( $tags ) );
1286 'checkKeys' => [
$cache->makeKey(
'valid-tags-db' ) ],
1287 'lockTSE' => WANObjectCache::TTL_MINUTE * 5,
1288 'pcTTL' => WANObjectCache::TTL_PROC_LONG
1305 if ( !Hooks::isRegistered(
'ListDefinedTags' ) ) {
1308 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
1309 return $cache->getWithSetCallback(
1310 $cache->makeKey(
'valid-tags-hook' ),
1311 WANObjectCache::TTL_MINUTE * 5,
1312 function ( $oldValue, &$ttl, array &$setOpts ) use ( $tags ) {
1315 Hooks::run(
'ListDefinedTags', [ &$tags ] );
1316 return array_filter( array_unique( $tags ) );
1319 'checkKeys' => [
$cache->makeKey(
'valid-tags-hook' ) ],
1320 'lockTSE' => WANObjectCache::TTL_MINUTE * 5,
1321 'pcTTL' => WANObjectCache::TTL_PROC_LONG
1344 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
1346 $cache->touchCheckKey(
$cache->makeKey(
'active-tags' ) );
1347 $cache->touchCheckKey(
$cache->makeKey(
'valid-tags-db' ) );
1348 $cache->touchCheckKey(
$cache->makeKey(
'valid-tags-hook' ) );
1358 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
1360 $cache->touchCheckKey(
$cache->makeKey(
'change-tag-statistics' ) );
1375 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
1376 return $cache->getWithSetCallback(
1377 $cache->makeKey(
'change-tag-statistics' ),
1378 WANObjectCache::TTL_MINUTE * 5,
1382 $setOpts += Database::getCacheSetOptions(
$dbr );
1386 [
'ct_tag',
'hitcount' =>
'count(*)' ],
1389 [
'GROUP BY' =>
'ct_tag',
'ORDER BY' =>
'hitcount DESC' ]
1393 foreach (
$res as $row ) {
1394 $out[$row->ct_tag] = $row->hitcount;
1400 'checkKeys' => [
$cache->makeKey(
'change-tag-statistics' ) ],
1401 'lockTSE' => WANObjectCache::TTL_MINUTE * 5,
1402 'pcTTL' => WANObjectCache::TTL_PROC_LONG
1422 return $user->isAllowed(
'changetags' ) && (bool)self::listExplicitlyDefinedTags();
$wgUseTagFilter
Allow filtering by change tag in recentchanges, history, etc Has no effect if no tags are defined in ...
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
if(!defined( 'MEDIAWIKI')) $fname
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined.
Class for creating log entries manually, to inject them into the database.
Utility class for creating new RC entries.
static getMain()
Static methods.
static suggestTarget( $target, array $ids)
Suggest a target for the revision deletion Optionally override this function.
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
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
when a variable name is used in a function
the array() calling protocol came about after MediaWiki 1.4rc1.
namespace being checked & $result
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables
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 & $options
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 and they can depend only on the ResourceLoaderContext $context
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
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
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
Interface for objects which can provide a MediaWiki context on request.
if(!isset( $args[0])) $lang