MediaWiki master
MediaWiki\ChangeTags\ChangeTags Class Reference

Recent changes tagging. More...

Static Public Member Functions

static activateTagWithChecks (string $tag, string $reason, Authority $performer, bool $ignoreWarnings=false, array $logEntryTags=[])
 Activates a tag, checking whether it is allowed first, and adding a log entry afterwards.
 
static buildTagFilterSelector ( $selected, $ooui, IContextSource $context, bool $activeOnly=self::TAG_SET_ACTIVE_ONLY, bool $useAllTags=self::USE_ALL_TAGS)
 Build a text box to select a change tag.
 
static canActivateTag (string $tag, ?Authority $performer=null)
 Is it OK to allow the user to activate this tag?
 
static canAddTagsAccompanyingChange (array $tags, ?Authority $performer=null, $checkBlock=true)
 Is it OK to allow the user to apply all the specified tags at the same time as they edit/make the change?
 
static canCreateTag ( $tag, ?Authority $performer=null)
 Is it OK to allow the user to create this tag?
 
static canDeactivateTag (string $tag, ?Authority $performer=null)
 Is it OK to allow the user to deactivate this tag?
 
static canDeleteTag (string $tag, ?Authority $performer=null, int $flags=0)
 Is it OK to allow the user to delete this tag?
 
static canUpdateTags (array $tagsToAdd, array $tagsToRemove, ?Authority $performer=null)
 Is it OK to allow the user to adds and remove the given tags to/from a change?
 
static createTagWithChecks (string $tag, string $reason, Authority $performer, bool $ignoreWarnings=false, array $logEntryTags=[])
 Creates a tag by adding it to change_tag_def table.
 
static deactivateTagWithChecks (string $tag, string $reason, Authority $performer, bool $ignoreWarnings=false, array $logEntryTags=[])
 Deactivates a tag, checking whether it is allowed first, and adding a log entry afterwards.
 
static deleteTagWithChecks (string $tag, string $reason, Authority $performer, bool $ignoreWarnings=false, array $logEntryTags=[])
 Deletes a tag, checking whether it is allowed first, and adding a log entry afterwards.
 
static formatSummaryRow ( $tags, $unused, MessageLocalizer $localizer)
 Creates HTML for the given tags.
 
static getChangeTagList (MessageLocalizer $localizer, Language $lang, bool $activeOnly=self::TAG_SET_ACTIVE_ONLY, bool $useAllTags=self::USE_ALL_TAGS, $labelsOnly=false)
 Get information about change tags for tag filter dropdown menus.
 
static getChangeTagListSummary (MessageLocalizer $localizer, Language $lang, bool $activeOnly=self::TAG_SET_ACTIVE_ONLY, bool $useAllTags=self::USE_ALL_TAGS)
 Get information about change tags, without parsing messages, for tag filter dropdown menus.
 
static isTagNameValid ( $tag)
 Is the tag name valid?
 
static showTagEditingUI (Authority $performer)
 Indicate whether change tag editing UI is relevant.
 
static tagDescription ( $tag, MessageLocalizer $context)
 Get a short description for a tag.
 
static tagHelpLink ( $tag, MessageLocalizer $context)
 Get the tag's help link.
 
static tagLongDescriptionMessage ( $tag, MessageLocalizer $context)
 Get the message object for the tag's long description.
 
static tagShortDescriptionMessage ( $tag, MessageLocalizer $context)
 Get the message object for the tag's short description.
 
static updateTagsWithChecks ( $tagsToAdd, $tagsToRemove, $rc_id, $rev_id, $log_id, $params, string $reason, Authority $performer)
 Adds and/or removes tags to/from a given change, checking whether it is allowed first, and adding a log entry afterwards.
 

Public Attributes

const BYPASS_MAX_USAGE_CHECK = 1
 Flag for canDeleteTag().
 
const DISPLAY_TABLE_ALIAS = 'changetagdisplay'
 
const REVERT_TAGS = [ self::TAG_ROLLBACK, self::TAG_UNDO, self::TAG_MANUAL_REVERT ]
 List of tags which denote a revert of some sort.
 
const TAG_BLANK = 'mw-blank'
 The tagged edit blanks the page (replaces it with the empty string).
 
const TAG_CHANGED_REDIRECT_TARGET = 'mw-changed-redirect-target'
 The tagged edit changes the target of a redirect page.
 
const TAG_CONTENT_MODEL_CHANGE = 'mw-contentmodelchange'
 The tagged edit changes the content model of the page.
 
const TAG_EDITED_OTHER_USERS_CSS = 'mw-edited-other-users-css'
 This tagged edit was performed on a page with the CSS content model on a page not a subpage of the user's own user page.
 
const TAG_EDITED_OTHER_USERS_JS = 'mw-edited-other-users-js'
 This tagged edit was performed on a page with the JavaScript content model on a page not a subpage of the user's own user page.
 
const TAG_IPBLOCK_APPEAL = 'mw-ipblock-appeal'
 This tagged temporary account auto-creation was performed via Special:Mytalk from an IP address that is blocked from account creation.
 
const TAG_MANUAL_REVERT = 'mw-manual-revert'
 The tagged edit restores the page to an earlier revision.
 
const TAG_NEW_REDIRECT = 'mw-new-redirect'
 The tagged edit creates a new redirect (either by creating a new page or turning an existing page into a redirect).
 
const TAG_RECREATE = 'mw-recreated'
 The tagged edit recreates a page that has been previously deleted.
 
const TAG_REMOVED_REDIRECT = 'mw-removed-redirect'
 The tagged edit turns a redirect page into a non-redirect.
 
const TAG_REPLACE = 'mw-replace'
 The tagged edit removes more than 90% of the content of the page.
 
const TAG_REVERTED = 'mw-reverted'
 The tagged edit is reverted by a subsequent edit (which is tagged by one of TAG_ROLLBACK, TAG_UNDO, TAG_MANUAL_REVERT).
 
const TAG_ROLLBACK = 'mw-rollback'
 The tagged edit is a rollback (undoes the previous edit and all immediately preceding edits by the same user, and was performed via the "rollback" link available to advanced users or via the rollback API).
 
const TAG_SERVER_SIDE_UPLOAD = 'mw-server-side-upload'
 This tagged edit was performed while importing media files using the importImages.php maintenance script.
 
const TAG_SET_ACTIVE_ONLY = true
 Constants that can be used to set the activeOnly parameter for calling self::buildCustomTagFilterSelect in order to improve function/parameter legibility.
 
const TAG_SET_ALL = false
 
const TAG_UNDO = 'mw-undo'
 The tagged edit is was performed via the "undo" link.
 
const USE_ALL_TAGS = true
 Constants that can be used to set the useAllTags parameter for calling self::buildCustomTagFilterSelect in order to improve function/parameter legibility.
 
const USE_SOFTWARE_TAGS_ONLY = false
 

Static Protected Member Functions

static restrictedTagError ( $msgOne, $msgMulti, $tags)
 Helper function to generate a fatal status with a 'not-allowed' type error.
 

Detailed Description

Recent changes tagging.

Definition at line 45 of file ChangeTags.php.

Member Function Documentation

◆ activateTagWithChecks()

static MediaWiki\ChangeTags\ChangeTags::activateTagWithChecks ( string $tag,
string $reason,
Authority $performer,
bool $ignoreWarnings = false,
array $logEntryTags = [] )
static

Activates a tag, checking whether it is allowed first, and adding a log entry afterwards.

Includes a call to ChangeTag::canActivateTag(), so your code doesn't need to do that.

Parameters
string$tag
string$reason
Authority$performerwho to check permissions and give credit for the action
bool$ignoreWarningsCan be used for API interaction, default false
array$logEntryTagsChange tags to apply to the entry that will be created in the tag management log
Returns
Status If successful, the Status contains the ID of the added log entry as its value
Since
1.25

Definition at line 657 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\Permissions\Authority\getUser().

◆ buildTagFilterSelector()

static MediaWiki\ChangeTags\ChangeTags::buildTagFilterSelector ( $selected,
$ooui,
IContextSource $context,
bool $activeOnly = self::TAG_SET_ACTIVE_ONLY,
bool $useAllTags = self::USE_ALL_TAGS )
static

Build a text box to select a change tag.

The tag set can be customized via the $activeOnly and $useAllTags parameters and defaults to all active tags.

Deprecated
Since 1.47. Use ChangeTagsFormatter::buildTagFilter() instead.
Parameters
string$selectedTag to select by default
bool$oouiUse an OOUI TextInputWidget as selector instead of a non-OOUI input field You need to call OutputPage::enableOOUI() yourself.
IContextSource$context
bool$activeOnlyWhether to filter for tags that have been used or not
bool$useAllTagsWhether to use all known tags or to only use software defined tags These map to ChangeTagsStore->listDefinedTags and ChangeTagsStore->getCoreDefinedTags respectively
Returns
array{0:string,1:string}|null Two chunks of HTML (label, and dropdown menu) or null if disabled

Definition at line 583 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance(), and wfDeprecated().

◆ canActivateTag()

static MediaWiki\ChangeTags\ChangeTags::canActivateTag ( string $tag,
?Authority $performer = null )
static

Is it OK to allow the user to activate this tag?

Parameters
string$tagTag that you are interested in activating
Authority | null$performerwhose permission you wish to check, or null if you don't care (e.g. maintenance scripts)
Returns
Status
Since
1.25

Definition at line 607 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance().

◆ canAddTagsAccompanyingChange()

static MediaWiki\ChangeTags\ChangeTags::canAddTagsAccompanyingChange ( array $tags,
?Authority $performer = null,
$checkBlock = true )
static

Is it OK to allow the user to apply all the specified tags at the same time as they edit/make the change?

Extensions should not use this function, unless directly handling a user request to add a tag to a revision or log entry that the user is making.

Parameters
string[]$tagsTags that you are interested in applying
Authority | null$performerwhose permission you wish to check, or null to check for a generic non-blocked user with the relevant rights
bool$checkBlockWhether to check the blocked status of $performer
Returns
Status
Since
1.25

Definition at line 319 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\ChangeTags\ChangeTags\restrictedTagError().

◆ canCreateTag()

static MediaWiki\ChangeTags\ChangeTags::canCreateTag ( $tag,
?Authority $performer = null )
static

Is it OK to allow the user to create this tag?

Extensions should NOT use this function. In most cases, a tag can be defined using the ListDefinedTags hook without any checking.

Parameters
string$tagTag that you are interested in creating
Authority | null$performerwhose permission you wish to check, or null if you don't care (e.g. maintenance scripts)
Returns
Status
Since
1.25

Definition at line 793 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance().

◆ canDeactivateTag()

static MediaWiki\ChangeTags\ChangeTags::canDeactivateTag ( string $tag,
?Authority $performer = null )
static

Is it OK to allow the user to deactivate this tag?

Parameters
string$tagTag that you are interested in deactivating
Authority | null$performerwhose permission you wish to check, or null if you don't care (e.g. maintenance scripts)
Returns
Status
Since
1.25

Definition at line 685 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance().

◆ canDeleteTag()

static MediaWiki\ChangeTags\ChangeTags::canDeleteTag ( string $tag,
?Authority $performer = null,
int $flags = 0 )
static

Is it OK to allow the user to delete this tag?

Parameters
string$tagTag that you are interested in deleting
Authority | null$performerwhose permission you wish to check, or null if you don't care (e.g. maintenance scripts)
int$flagsUse ChangeTags::BYPASS_MAX_USAGE_CHECK to ignore whether there are more uses than we would normally allow to be deleted through the user interface.
Returns
Status
Since
1.25

Definition at line 879 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance().

◆ canUpdateTags()

static MediaWiki\ChangeTags\ChangeTags::canUpdateTags ( array $tagsToAdd,
array $tagsToRemove,
?Authority $performer = null )
static

Is it OK to allow the user to adds and remove the given tags to/from a change?

Extensions should not use this function, unless directly handling a user request to add or remove tags from an existing revision or log entry.

Deprecated
Since 1.47
Parameters
string[]$tagsToAddTags that you are interested in adding
string[]$tagsToRemoveTags that you are interested in removing
Authority | null$performerwhose permission you wish to check, or null to check for a generic non-blocked user with the relevant rights
Returns
Status
Since
1.25

Definition at line 369 of file ChangeTags.php.

References wfDeprecated().

◆ createTagWithChecks()

static MediaWiki\ChangeTags\ChangeTags::createTagWithChecks ( string $tag,
string $reason,
Authority $performer,
bool $ignoreWarnings = false,
array $logEntryTags = [] )
static

Creates a tag by adding it to change_tag_def table.

Extensions should NOT use this function; they can use the ListDefinedTags hook instead.

Includes a call to ChangeTag::canCreateTag(), so your code doesn't need to do that.

Parameters
string$tag
string$reason
Authority$performerwho to check permissions and give credit for the action
bool$ignoreWarningsCan be used for API interaction, default false
array$logEntryTagsChange tags to apply to the entry that will be created in the tag management log
Returns
Status If successful, the Status contains the ID of the added log entry as its value
Since
1.25

Definition at line 849 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\Permissions\Authority\getUser().

◆ deactivateTagWithChecks()

static MediaWiki\ChangeTags\ChangeTags::deactivateTagWithChecks ( string $tag,
string $reason,
Authority $performer,
bool $ignoreWarnings = false,
array $logEntryTags = [] )
static

Deactivates a tag, checking whether it is allowed first, and adding a log entry afterwards.

Includes a call to ChangeTag::canDeactivateTag(), so your code doesn't need to do that.

Parameters
string$tag
string$reason
Authority$performerwho to check permissions and give credit for the action
bool$ignoreWarningsCan be used for API interaction, default false
array$logEntryTagsChange tags to apply to the entry that will be created in the tag management log
Returns
Status If successful, the Status contains the ID of the added log entry as its value
Since
1.25

Definition at line 727 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\Permissions\Authority\getUser().

◆ deleteTagWithChecks()

static MediaWiki\ChangeTags\ChangeTags::deleteTagWithChecks ( string $tag,
string $reason,
Authority $performer,
bool $ignoreWarnings = false,
array $logEntryTags = [] )
static

Deletes a tag, checking whether it is allowed first, and adding a log entry afterwards.

Includes a call to ChangeTag::canDeleteTag(), so your code doesn't need to do that.

Parameters
string$tag
string$reason
Authority$performerwho to check permissions and give credit for the action
bool$ignoreWarningsCan be used for API interaction, default false
array$logEntryTagsChange tags to apply to the entry that will be created in the tag management log
Returns
Status If successful, the Status contains the ID of the added log entry as its value
Since
1.25

Definition at line 946 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\Permissions\Authority\getUser().

◆ formatSummaryRow()

static MediaWiki\ChangeTags\ChangeTags::formatSummaryRow ( $tags,
$unused,
MessageLocalizer $localizer )
static

Creates HTML for the given tags.

Deprecated
Since 1.47. Use ChangeTagsFormatter::formatTagsAsSummaryList instead.
Parameters
string$tagsComma-separated list of tags
null | string$unusedUnused (formerly: $page)
MessageLocalizer$localizer
Returns
array Array with two items: (html, classes)
  • html: String: HTML for displaying the tags (empty string when param $tags is empty)
  • classes: Array of strings: CSS classes used in the generated html, one class for each tag

Definition at line 183 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance(), and wfDeprecated().

◆ getChangeTagList()

static MediaWiki\ChangeTags\ChangeTags::getChangeTagList ( MessageLocalizer $localizer,
Language $lang,
bool $activeOnly = self::TAG_SET_ACTIVE_ONLY,
bool $useAllTags = self::USE_ALL_TAGS,
$labelsOnly = false )
static

Get information about change tags for tag filter dropdown menus.

This manipulates the label and description of each tag, which are parsed, stripped and (in the case of description) truncated versions of these messages. Message parsing is expensive, so to detect whether the tag list has changed, use getChangeTagListSummary() instead.

Deprecated
Since 1.47. Use ChangeTagsFormatter::getChangeTagList() instead.
Parameters
MessageLocalizer$localizer
Language$lang
bool$activeOnly
bool$useAllTags
bool$labelsOnlyDo not parse descriptions and omit 'description' in the result
Returns
array[] Same as getChangeTagListSummary(), with messages parsed, stripped and truncated

Definition at line 1035 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance(), and wfDeprecated().

◆ getChangeTagListSummary()

static MediaWiki\ChangeTags\ChangeTags::getChangeTagListSummary ( MessageLocalizer $localizer,
Language $lang,
bool $activeOnly = self::TAG_SET_ACTIVE_ONLY,
bool $useAllTags = self::USE_ALL_TAGS )
static

Get information about change tags, without parsing messages, for tag filter dropdown menus.

By default, this will return explicitly-defined and software-defined tags that are currently active (have hits)

Message contents are the raw values (->plain()), because parsing messages is expensive. Even though we're not parsing messages, building a data structure with the contents of hundreds of i18n messages is still not cheap (see T223260#5370610), so this function caches its output in WANCache for up to 24 hours.

Returns an array of associative arrays with information about each tag:

  • name: Tag name (string)
  • labelMsg: Short description message (Message object, or false for hidden tags)
  • label: Short description message (raw message contents)
  • descriptionMsg: Long description message (Message object)
  • description: Long description message (raw message contents)
  • cssClass: CSS class to use for RC entries with this tag
  • helpLink: Link to a help page describing this tag (string or null)
  • hits: Number of RC entries that have this tag

This data is consumed by the mediawiki.rcfilters.filters.ui module, specifically mw.rcfilters.dm.FilterGroup and mw.rcfilters.dm.FilterItem.

Deprecated
Since 1.47. Use ChangeTagsFormatter::getChangeTagListSummary() instead.
Parameters
MessageLocalizer$localizer
Language$lang
bool$activeOnly
bool$useAllTags
Returns
array[] Information about each tag

Definition at line 1004 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance(), and wfDeprecated().

◆ isTagNameValid()

static MediaWiki\ChangeTags\ChangeTags::isTagNameValid ( $tag)
static

Is the tag name valid?

Parameters
string$tagTag that you are interested in creating
Returns
Status
Since
1.30

Definition at line 753 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance(), NS_MEDIAWIKI, and MediaWiki\ChangeTags\ChangeTagsStore\PRIVATE_TAG_PREFIX.

◆ restrictedTagError()

static MediaWiki\ChangeTags\ChangeTags::restrictedTagError ( $msgOne,
$msgMulti,
$tags )
staticprotected

Helper function to generate a fatal status with a 'not-allowed' type error.

Parameters
string$msgOneMessage key to use in the case of one tag
string$msgMultiMessage key to use in the case of more than one tag
string[]$tagsRestricted tags (passed as $1 into the message, count of $tags passed as $2)
Returns
Status
Since
1.25

Definition at line 296 of file ChangeTags.php.

References MediaWiki\Message\Message\listParam().

Referenced by MediaWiki\ChangeTags\ChangeTags\canAddTagsAccompanyingChange().

◆ showTagEditingUI()

static MediaWiki\ChangeTags\ChangeTags::showTagEditingUI ( Authority $performer)
static

Indicate whether change tag editing UI is relevant.

Returns true if the user has the necessary right and there are any editable tags defined.

This intentionally doesn't check "any addable || any deletable", because it seems like it would be more confusing than useful if the checkboxes suddenly showed up because some abuse filter stopped defining a tag and then suddenly disappeared when someone deleted all uses of that tag.

Parameters
Authority$performer
Returns
bool

Definition at line 1064 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\Permissions\Authority\isAllowed().

Referenced by MediaWiki\Actions\Pager\HistoryPager\__construct().

◆ tagDescription()

static MediaWiki\ChangeTags\ChangeTags::tagDescription ( $tag,
MessageLocalizer $context )
static

Get a short description for a tag.

The description combines the label from tagShortDescriptionMessage() with the link from tagHelpLink() (unless the label already contains some links).

Deprecated
Since 1.47. Use ChangeTagsFormatter::getTagDescription instead.
Parameters
string$tag
MessageLocalizer$context
Returns
string|false Tag description or false if tag is to be hidden.
Since
1.25 Returns false if tag is to be hidden.

Definition at line 258 of file ChangeTags.php.

References MediaWiki\MediaWikiServices\getInstance(), and wfDeprecated().

◆ tagHelpLink()

static MediaWiki\ChangeTags\ChangeTags::tagHelpLink ( $tag,
MessageLocalizer $context )
static

Get the tag's help link.

Checks if message key "mediawiki:tag-$tag-helppage" exists in content language. If it does, and contains a URL or a page title, return a (possibly relative) link URL that points there. Otherwise return null.

Deprecated
Since 1.47. Use ChangeTagsFormatter::getTagDescription instead.
Since
1.43
Parameters
string$tag
MessageLocalizer$context
Returns
string|null Tag link, or null if not provided or invalid

Definition at line 237 of file ChangeTags.php.

References MediaWiki\Language\MessageLocalizer\msg(), and wfDeprecated().

◆ tagLongDescriptionMessage()

static MediaWiki\ChangeTags\ChangeTags::tagLongDescriptionMessage ( $tag,
MessageLocalizer $context )
static

Get the message object for the tag's long description.

Checks if message key "mediawiki:tag-$tag-description" exists. If it does not, or if message is disabled, returns false. Otherwise, returns the message object for the long description.

Deprecated
Since 1.47. Use ChangeTagsFormatter::getTagDescription instead.
Parameters
string$tag
MessageLocalizer$context
Returns
Message|false Message object of the tag long description or false if there is no description.

Definition at line 280 of file ChangeTags.php.

References MediaWiki\Language\MessageLocalizer\msg(), and wfDeprecated().

◆ tagShortDescriptionMessage()

static MediaWiki\ChangeTags\ChangeTags::tagShortDescriptionMessage ( $tag,
MessageLocalizer $context )
static

Get the message object for the tag's short description.

Checks if message key "mediawiki:tag-$tag" exists. If it does not, returns the tag name in a RawMessage. If the message exists, it is used, provided it is not disabled. If the message is disabled, we consider the tag hidden, and return false.

Deprecated
Since 1.47. Use ChangeTagsFormatter::getTagDescription instead.
Since
1.34
Parameters
string$tag
MessageLocalizer$context
Returns
Message|false Tag description, or false if tag is to be hidden.

Definition at line 206 of file ChangeTags.php.

References MediaWiki\Language\MessageLocalizer\msg(), MediaWiki\Message\Message\plaintextParam(), and wfDeprecated().

◆ updateTagsWithChecks()

static MediaWiki\ChangeTags\ChangeTags::updateTagsWithChecks ( $tagsToAdd,
$tagsToRemove,
$rc_id,
$rev_id,
$log_id,
$params,
string $reason,
Authority $performer )
static

Adds and/or removes tags to/from a given change, checking whether it is allowed first, and adding a log entry afterwards.

This validates that the provided Authority can make the changes, but it does not check whether the *_id parameters are a valid combination. That is up to you to enforce. See ApiTag::execute() for an example.

Extensions should generally avoid this function. Call ChangeTagsStore->updateTags() instead, unless directly handling a user request to add or remove tags from an existing revision or log entry.

Parameters
array | null$tagsToAddIf none, pass [] or null
array | null$tagsToRemoveIf none, pass [] or null
int | null$rc_idThe rc_id of the change to add the tags to
int | null$rev_idThe rev_id of the change to add the tags to
int | null$log_idThe log_id of the change to add the tags to
string | null$paramsParams to put in the ct_params field of table 'change_tag' when adding tags
string$reasonComment for the log
Authority$performerwho to check permissions and give credit for the action
Returns
Status If successful, the value of this Status object will be an object (stdClass) with the following fields:
  • logId: the ID of the added log entry, or null if no log entry was added (i.e. no operation was performed)
  • addedTags: an array containing the tags that were actually added
  • removedTags: an array containing the tags that were actually removed
Since
1.25

Definition at line 479 of file ChangeTags.php.

References MediaWiki\Permissions\Authority\authorizeAction(), MediaWiki\MediaWikiServices\getInstance(), MediaWiki\SpecialPage\SpecialPage\getTitleFor(), MediaWiki\Permissions\Authority\getUser(), and MediaWiki\RevisionDelete\RevDelLogList\suggestTarget().

Referenced by MediaWiki\ChangeTags\ChangeTagsLogList\updateChangeTagsOnAll(), and MediaWiki\ChangeTags\ChangeTagsRevisionList\updateChangeTagsOnAll().

Member Data Documentation

◆ BYPASS_MAX_USAGE_CHECK

const MediaWiki\ChangeTags\ChangeTags::BYPASS_MAX_USAGE_CHECK = 1

Flag for canDeleteTag().

Definition at line 132 of file ChangeTags.php.

◆ DISPLAY_TABLE_ALIAS

const MediaWiki\ChangeTags\ChangeTags::DISPLAY_TABLE_ALIAS = 'changetagdisplay'

Definition at line 146 of file ChangeTags.php.

◆ REVERT_TAGS

const MediaWiki\ChangeTags\ChangeTags::REVERT_TAGS = [ self::TAG_ROLLBACK, self::TAG_UNDO, self::TAG_MANUAL_REVERT ]

List of tags which denote a revert of some sort.

(See also TAG_REVERTED.)

Definition at line 127 of file ChangeTags.php.

◆ TAG_BLANK

const MediaWiki\ChangeTags\ChangeTags::TAG_BLANK = 'mw-blank'

The tagged edit blanks the page (replaces it with the empty string).

Definition at line 66 of file ChangeTags.php.

◆ TAG_CHANGED_REDIRECT_TARGET

const MediaWiki\ChangeTags\ChangeTags::TAG_CHANGED_REDIRECT_TARGET = 'mw-changed-redirect-target'

The tagged edit changes the target of a redirect page.

Definition at line 62 of file ChangeTags.php.

◆ TAG_CONTENT_MODEL_CHANGE

const MediaWiki\ChangeTags\ChangeTags::TAG_CONTENT_MODEL_CHANGE = 'mw-contentmodelchange'

The tagged edit changes the content model of the page.

Definition at line 49 of file ChangeTags.php.

◆ TAG_EDITED_OTHER_USERS_CSS

const MediaWiki\ChangeTags\ChangeTags::TAG_EDITED_OTHER_USERS_CSS = 'mw-edited-other-users-css'

This tagged edit was performed on a page with the CSS content model on a page not a subpage of the user's own user page.

Definition at line 122 of file ChangeTags.php.

◆ TAG_EDITED_OTHER_USERS_JS

const MediaWiki\ChangeTags\ChangeTags::TAG_EDITED_OTHER_USERS_JS = 'mw-edited-other-users-js'

This tagged edit was performed on a page with the JavaScript content model on a page not a subpage of the user's own user page.

Definition at line 117 of file ChangeTags.php.

◆ TAG_IPBLOCK_APPEAL

const MediaWiki\ChangeTags\ChangeTags::TAG_IPBLOCK_APPEAL = 'mw-ipblock-appeal'

This tagged temporary account auto-creation was performed via Special:Mytalk from an IP address that is blocked from account creation.

Definition at line 112 of file ChangeTags.php.

◆ TAG_MANUAL_REVERT

const MediaWiki\ChangeTags\ChangeTags::TAG_MANUAL_REVERT = 'mw-manual-revert'

The tagged edit restores the page to an earlier revision.

The associated tag data is a JSON containing the edit result (see EditResult::jsonSerialize()).

Definition at line 95 of file ChangeTags.php.

◆ TAG_NEW_REDIRECT

const MediaWiki\ChangeTags\ChangeTags::TAG_NEW_REDIRECT = 'mw-new-redirect'

The tagged edit creates a new redirect (either by creating a new page or turning an existing page into a redirect).

Definition at line 54 of file ChangeTags.php.

◆ TAG_RECREATE

const MediaWiki\ChangeTags\ChangeTags::TAG_RECREATE = 'mw-recreated'

The tagged edit recreates a page that has been previously deleted.

Definition at line 74 of file ChangeTags.php.

◆ TAG_REMOVED_REDIRECT

const MediaWiki\ChangeTags\ChangeTags::TAG_REMOVED_REDIRECT = 'mw-removed-redirect'

The tagged edit turns a redirect page into a non-redirect.

Definition at line 58 of file ChangeTags.php.

◆ TAG_REPLACE

const MediaWiki\ChangeTags\ChangeTags::TAG_REPLACE = 'mw-replace'

The tagged edit removes more than 90% of the content of the page.

Definition at line 70 of file ChangeTags.php.

◆ TAG_REVERTED

const MediaWiki\ChangeTags\ChangeTags::TAG_REVERTED = 'mw-reverted'

The tagged edit is reverted by a subsequent edit (which is tagged by one of TAG_ROLLBACK, TAG_UNDO, TAG_MANUAL_REVERT).

Multiple edits might be reverted by the same edit.

The associated tag data is a JSON containing the edit result (see EditResult::jsonSerialize()) with an extra 'revertId' field containing the revision ID of the reverting edit.

Definition at line 103 of file ChangeTags.php.

◆ TAG_ROLLBACK

const MediaWiki\ChangeTags\ChangeTags::TAG_ROLLBACK = 'mw-rollback'

The tagged edit is a rollback (undoes the previous edit and all immediately preceding edits by the same user, and was performed via the "rollback" link available to advanced users or via the rollback API).

The associated tag data is a JSON containing the edit result (see EditResult::jsonSerialize()).

Definition at line 82 of file ChangeTags.php.

◆ TAG_SERVER_SIDE_UPLOAD

const MediaWiki\ChangeTags\ChangeTags::TAG_SERVER_SIDE_UPLOAD = 'mw-server-side-upload'

This tagged edit was performed while importing media files using the importImages.php maintenance script.

Definition at line 107 of file ChangeTags.php.

◆ TAG_SET_ACTIVE_ONLY

const MediaWiki\ChangeTags\ChangeTags::TAG_SET_ACTIVE_ONLY = true

Constants that can be used to set the activeOnly parameter for calling self::buildCustomTagFilterSelect in order to improve function/parameter legibility.

If TAG_SET_ACTIVE_ONLY is used then the hit count for each tag will be checked against and only tags with hits will be returned Otherwise if TAG_SET_ALL is used then all tags will be returned regardless of if they've ever been used or not

Definition at line 157 of file ChangeTags.php.

◆ TAG_SET_ALL

const MediaWiki\ChangeTags\ChangeTags::TAG_SET_ALL = false

Definition at line 158 of file ChangeTags.php.

◆ TAG_UNDO

const MediaWiki\ChangeTags\ChangeTags::TAG_UNDO = 'mw-undo'

The tagged edit is was performed via the "undo" link.

(Usually this means that it undoes some previous edit, but the undo workflow includes an edit step so it could be anything.)

The associated tag data is a JSON containing the edit result (see EditResult::jsonSerialize()).

Definition at line 89 of file ChangeTags.php.

◆ USE_ALL_TAGS

const MediaWiki\ChangeTags\ChangeTags::USE_ALL_TAGS = true

Constants that can be used to set the useAllTags parameter for calling self::buildCustomTagFilterSelect in order to improve function/parameter legibility.

If USE_ALL_TAGS is used then all on-wiki tags will be returned Otherwise if USE_SOFTWARE_TAGS_ONLY is used then only mediawiki core-defined tags will be returned

Definition at line 168 of file ChangeTags.php.

◆ USE_SOFTWARE_TAGS_ONLY

const MediaWiki\ChangeTags\ChangeTags::USE_SOFTWARE_TAGS_ONLY = false

Definition at line 169 of file ChangeTags.php.


The documentation for this class was generated from the following file: