$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() ) .
$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 );
}