Mark hidden tags on Special:Tags and show in RCFilters
Bug: T281741 Change-Id: I8122fdc709427adc4681b463a52530117fabaef3
This commit is contained in:
parent
a3892f9df6
commit
0d3fa1d14c
4 changed files with 14 additions and 7 deletions
|
|
@ -891,7 +891,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
|
|||
*
|
||||
* Returns an array of associative arrays with information about each tag:
|
||||
* - name: Tag name (string)
|
||||
* - labelMsg: Short description message (Message object)
|
||||
* - 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)
|
||||
|
|
@ -925,15 +925,11 @@ abstract class ChangesListSpecialPage extends SpecialPage {
|
|||
$hits > 0
|
||||
) {
|
||||
$labelMsg = ChangeTags::tagShortDescriptionMessage( $tagName, $context );
|
||||
if ( $labelMsg === false ) {
|
||||
// Tag is hidden, skip it
|
||||
continue;
|
||||
}
|
||||
$descriptionMsg = ChangeTags::tagLongDescriptionMessage( $tagName, $context );
|
||||
$result[] = [
|
||||
'name' => $tagName,
|
||||
'labelMsg' => $labelMsg,
|
||||
'label' => $labelMsg->plain(),
|
||||
'label' => $labelMsg ? $labelMsg->plain() : $tagName,
|
||||
'descriptionMsg' => $descriptionMsg,
|
||||
'description' => $descriptionMsg ? $descriptionMsg->plain() : '',
|
||||
'cssClass' => Sanitizer::escapeClass( 'mw-tag-' . $tagName ),
|
||||
|
|
@ -964,7 +960,11 @@ abstract class ChangesListSpecialPage extends SpecialPage {
|
|||
$language = MediaWikiServices::getInstance()->getLanguageFactory()
|
||||
->getLanguage( $context->getLanguage() );
|
||||
foreach ( $tags as &$tagInfo ) {
|
||||
$tagInfo['label'] = Sanitizer::stripAllTags( $tagInfo['labelMsg']->parse() );
|
||||
if ( $tagInfo['labelMsg'] ) {
|
||||
$tagInfo['label'] = Sanitizer::stripAllTags( $tagInfo['labelMsg']->parse() );
|
||||
} else {
|
||||
$tagInfo['label'] = $context->msg( 'rcfilters-tag-hidden', $tagInfo['name'] )->text();
|
||||
}
|
||||
$tagInfo['description'] = $tagInfo['descriptionMsg'] ?
|
||||
$language->truncateForVisual(
|
||||
Sanitizer::stripAllTags( $tagInfo['descriptionMsg']->parse() ),
|
||||
|
|
|
|||
|
|
@ -188,6 +188,9 @@ class SpecialTags extends SpecialPage {
|
|||
|
||||
$linkRenderer = $this->getLinkRenderer();
|
||||
$disp = ChangeTags::tagDescription( $tag, $this->getContext() );
|
||||
if ( $disp === false ) {
|
||||
$disp = Xml::element( 'em', null, $this->msg( 'tags-hidden' )->text() );
|
||||
}
|
||||
if ( $showEditLinks ) {
|
||||
$disp .= ' ';
|
||||
$editLink = $linkRenderer->makeLink(
|
||||
|
|
|
|||
|
|
@ -1502,6 +1502,7 @@
|
|||
"recentchanges-legend-plusminus": "(<em>±123</em>)",
|
||||
"recentchanges-legend-watchlistexpiry": "Temporarily watched page",
|
||||
"recentchanges-submit": "Show",
|
||||
"rcfilters-tag-hidden": "$1 (hidden tag)",
|
||||
"rcfilters-tag-remove": "Remove '$1'",
|
||||
"rcfilters-legend-heading": "<strong>List of abbreviations:</strong>",
|
||||
"rcfilters-other-review-tools": "Other review tools",
|
||||
|
|
@ -3791,6 +3792,7 @@
|
|||
"tags-source-extension": "Defined by the software",
|
||||
"tags-source-manual": "Applied manually by users and bots",
|
||||
"tags-source-none": "No longer in use",
|
||||
"tags-hidden": "(hidden)",
|
||||
"tags-edit": "edit",
|
||||
"tags-delete": "delete",
|
||||
"tags-activate": "activate",
|
||||
|
|
|
|||
|
|
@ -1727,6 +1727,7 @@
|
|||
"recentchanges-legend-plusminus": "{{optional}}\nA plus/minus sign with a number for the legend.",
|
||||
"recentchanges-legend-watchlistexpiry": "Used as legend on [[Special:Watchlist]], next to an icon of a clock indicating that a watchlist item is temporarily watched.",
|
||||
"recentchanges-submit": "Label for submit button in [[Special:RecentChanges]]\n{{Identical|Show}}",
|
||||
"rcfilters-tag-hidden": "Label used in a dropdown listing all available tags, when the tag has no human-readable name, because it is ''hidden'' (not shown on histories, recent changes, diffs, etc.).\n\nParameters:\n$1 - internal tag name (usually in English)",
|
||||
"rcfilters-tag-remove": "A tooltip for the button that removes a filter from the active filters area in [[Special:RecentChanges]] and [[Special:Watchlist]] when RCFilters are enabled. \n\nParameters: $1 - Tag label\n{{Identical|Remove}}",
|
||||
"rcfilters-legend-heading": "Used as a heading for legend box on [[Special:RecentChanges]] and [[Special:Watchlist]] when RCFilters are enabled.",
|
||||
"rcfilters-other-review-tools": "Used as a heading for the community collection of other links on [[Special:RecentChanges]] when RCFilters are enabled.",
|
||||
|
|
@ -4016,6 +4017,7 @@
|
|||
"tags-source-extension": "Table cell contents if given tag can be applied automatically by the MediaWiki software.\n\nSee also:\n* {{msg-mw|Tags-source-manual}}\n* {{msg-mw|Tags-source-none}}",
|
||||
"tags-source-manual": "\"Applied\" is not past tense, but an adjective that describes an action that sometimes happens, as in the sentence: \"(this tag is usually) applied by users and bots\".\n\nTable cell contents if given tag can be applied by users or bots.\n\nSee also:\n* {{msg-mw|Tags-source-extension}}\n* {{msg-mw|Tags-source-none}}",
|
||||
"tags-source-none": "Table cell contents if given tag is no longer in use. (It was applied in the past, but it is currently not applied.)\n\nSee also:\n* {{msg-mw|Tags-source-extension}}\n* {{msg-mw|Tags-source-manual}}",
|
||||
"tags-hidden": "Table cell contents if given tag is hidden (not shown on histories, recent changes, diffs, etc.)",
|
||||
"tags-edit": "Used on [[Special:Tags]]. Verb. Used as display text on a link to create/edit a description.\n{{Identical|Edit}}",
|
||||
"tags-delete": "Used on [[Special:Tags]]. Verb. Used as display text on a link to delete a tag.\n{{Identical|Delete}}",
|
||||
"tags-activate": "Used on [[Special:Tags]]. Verb. Used as display text on a link to activate a tag.\n{{Identical|Activate}}",
|
||||
|
|
|
|||
Loading…
Reference in a new issue