From 1a7fb8186d4b24cc7f26c22f85c57b3b7cf6618d Mon Sep 17 00:00:00 2001 From: MatmaRex Date: Thu, 29 Aug 2013 21:34:39 +0200 Subject: [PATCH] Show whether tags are active on Special:Tags Bug: 18908 Change-Id: I888d3e8e665e50560f481d1ab6acc99f3b8d031a --- includes/specials/SpecialTags.php | 7 +++++++ languages/messages/MessagesEn.php | 3 +++ languages/messages/MessagesQqq.php | 3 +++ maintenance/language/messages.inc | 3 +++ 4 files changed, 16 insertions(+) diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index 80c38d55c5..7e34e9846d 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -44,9 +44,13 @@ class SpecialTags extends SpecialPage { $html = Xml::tags( 'tr', null, Xml::tags( 'th', null, $this->msg( 'tags-tag' )->parse() ) . Xml::tags( 'th', null, $this->msg( 'tags-display-header' )->parse() ) . Xml::tags( 'th', null, $this->msg( 'tags-description-header' )->parse() ) . + Xml::tags( 'th', null, $this->msg( 'tags-active-header' )->parse() ) . Xml::tags( 'th', null, $this->msg( 'tags-hitcount-header' )->parse() ) ); + // Used in #doTagRow() + $this->definedTags = array_fill_keys( ChangeTags::listDefinedTags(), true ); + foreach ( ChangeTags::tagUsageStatistics() as $tag => $hitcount ) { $html .= $this->doTagRow( $tag, $hitcount ); } @@ -76,6 +80,9 @@ class SpecialTags extends SpecialPage { } $newRow .= Xml::tags( 'td', null, $desc ); + $active = $this->msg( isset( $this->definedTags[$tag] ) ? 'tags-active-yes' : 'tags-active-no' )->escaped(); + $newRow .= Xml::tags( 'td', null, $active ); + $hitcountLabel = $this->msg( 'tags-hitcount' )->numParams( $hitcount )->escaped(); $hitcountLink = Linker::link( SpecialPage::getTitleFor( 'Recentchanges' ), $hitcountLabel, array(), array( 'tagfilter' => $tag ) ); // add raw $hitcount for sorting, because tags-hitcount contains numbers and letters diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 5e66259bc3..c50979a525 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -4926,7 +4926,10 @@ You should have received [{{SERVER}}{{SCRIPTPATH}}/COPYING a copy of the GNU Gen 'tags-tag' => 'Tag name', 'tags-display-header' => 'Appearance on change lists', 'tags-description-header' => 'Full description of meaning', +'tags-active-header' => 'Active?', 'tags-hitcount-header' => 'Tagged changes', +'tags-active-yes' => 'Yes', +'tags-active-no' => 'No', 'tags-edit' => 'edit', 'tags-hitcount' => '$1 {{PLURAL:$1|change|changes}}', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index dee27e55ee..d1d851a5b7 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -10048,7 +10048,10 @@ Parameters: 'tags-tag' => 'Caption of a column in [[Special:Tags]]. For more information on tags see [[mw:Manual:Tags|MediaWiki]].', 'tags-display-header' => 'Caption of a column in [[Special:Tags]]. For more information on tags see [[mw:Manual:Tags|MediaWiki]].', 'tags-description-header' => 'Caption of a column in [[Special:Tags]]. For more information on tags see [[mw:Manual:Tags|MediaWiki]].', +'tags-active-header' => 'Caption of a column in [[Special:Tags]]. For more information on tags see [[mw:Manual:Tags|MediaWiki]].', 'tags-hitcount-header' => 'Caption of a column in [[Special:Tags]]. For more information on tags see [[mw:Manual:Tags|MediaWiki]].', +'tags-active-yes' => 'Table cell contents if given tag is "active".', +'tags-active-no' => 'Table cell contents if given tag is not "active".', 'tags-edit' => 'Used on [[Special:Tags]]. Verb. Used as display text on a link to create/edit a description. {{Identical|Edit}}', 'tags-hitcount' => 'Shown in the "{{msg-mw|Tags-hitcount-header}}" column in [[Special:Tags]]. For more information on tags see [[mw:Manual:Tags|MediaWiki]]. diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 43be19538c..b87d35a648 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -3771,7 +3771,10 @@ $wgMessageStructure = array( 'tags-tag', 'tags-display-header', 'tags-description-header', + 'tags-active-header', 'tags-hitcount-header', + 'tags-active-yes', + 'tags-active-no', 'tags-edit', 'tags-hitcount', ), -- 2.20.1