=== Configuration changes in 1.26 ===
=== New features in 1.26 ===
+* Change tags can now be hidden in the interface by disabling the associated
+ "tag-<id>" interface message.
==== External libraries ====
=== Bug fixes in 1.26 ===
=== Action API changes in 1.26 ===
+* API action=query&list=tags: The displayname can now be boolean false if the
+ tag is meant to be hidden from user interfaces.
=== Action API internal changes in 1.26 ===
=== Other changes in 1.26 ===
-
+* ChangeTags::tagDescription() will return false if the interface message
+ for the tag is disabled.
== Compatibility ==
$tags = explode( ',', $tags );
$displayTags = array();
foreach ( $tags as $tag ) {
+ if ( !$tag ) {
+ continue;
+ }
+ $description = self::tagDescription( $tag );
+ if ( $description === false ) {
+ continue;
+ }
$displayTags[] = Xml::tags(
'span',
array( 'class' => 'mw-tag-marker ' .
Sanitizer::escapeClass( "mw-tag-marker-$tag" ) ),
- self::tagDescription( $tag )
+ $description
);
$classes[] = Sanitizer::escapeClass( "mw-tag-$tag" );
}
+
+ if ( !$displayTags ) {
+ return array( '', array() );
+ }
+
$markers = wfMessage( 'tag-list-wrapper' )
->numParams( count( $displayTags ) )
->rawParams( $wgLang->commaList( $displayTags ) )
}
/**
- * Get a short description for a tag
+ * Get a short description for a tag.
*
- * @param string $tag Tag
+ * Checks if message key "mediawiki:tag-$tag" exists. If it does not,
+ * returns the HTML-escaped tag name. Uses the message if the message
+ * exists, provided it is not disabled. If the message is disabled,
+ * we consider the tag hidden, and return false.
*
- * @return string Short description of the tag from "mediawiki:tag-$tag" if this message exists,
- * html-escaped version of $tag otherwise
+ * @param string $tag Tag
+ * @return string|bool Tag description or false if tag is to be hidden.
+ * @since 1.25 Returns false if tag is to be hidden.
*/
public static function tagDescription( $tag ) {
$msg = wfMessage( "tag-$tag" );
- return $msg->exists() ? $msg->parse() : htmlspecialchars( $tag );
+ if ( !$msg->exists() ) {
+ // No such message, so return the HTML-escaped tag name.
+ return htmlspecialchars( $tag );
+ }
+ if ( $msg->isDisabled() ) {
+ // The message exists but is disabled, hide the tag.
+ return false;
+ }
+
+ // Message exists and isn't disabled, use it.
+ return $msg->parse();
}
/**