From: Tina Johnson Date: Mon, 16 Mar 2015 19:26:46 +0000 (+0530) Subject: Remove table header from Special:Tags when there are no tags X-Git-Tag: 1.31.0-rc.0~12034 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=12f36b502da6bae4c52d1fa7829821ca537970af;p=lhc%2Fweb%2Fwiklou.git Remove table header from Special:Tags when there are no tags The table header shows up even when there are no tags to be listed in the table. This patch fixes the same Bug: T92728 Change-Id: I22d2c0435bc365f65354cea604b1c87905c769f8 --- diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index ff263b6474..0b8147e196 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -114,6 +114,12 @@ class SpecialTags extends SpecialPage { $showActions = $user->isAllowed( 'managechangetags' ); // Write the headers + $tagUsageStatistics = ChangeTags::tagUsageStatistics(); + + // Show header only if there exists atleast one tag + if ( !$tagUsageStatistics ) { + return; + } $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() ) . @@ -134,7 +140,7 @@ class SpecialTags extends SpecialPage { $this->extensionActivatedTags = array_fill_keys( ChangeTags::listExtensionActivatedTags(), true ); - foreach ( ChangeTags::tagUsageStatistics() as $tag => $hitcount ) { + foreach ( $tagUsageStatistics as $tag => $hitcount ) { $html .= $this->doTagRow( $tag, $hitcount, $showActions ); }