Commit 1c6b7d70 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1825611: Don't show tag count beside tag on file list page"

parents 9d522ff4 5830f08e
......@@ -42,7 +42,7 @@ while ($more && count($tmptag) < $tagsperpage) {
}
$tmptag[] = (object) array('id' => $tag->tag,
'text' => display_tag($tag->tag, $tags['tags'])
'text' => display_tag($tag->tag, $tags['tags'], true)
);
}
$page++;
......
......@@ -78,7 +78,7 @@ function translate_tags_to_names(array $ids) {
$tagname = remove_prefix($id);
if (isset($alltags['tags'][$tagname])) {
$results[] = (object) array('id' => $tagname, 'text' => display_tag($tagname, $alltags['tags']));
$results[] = (object) array('id' => $tagname, 'text' => display_tag($tagname, $alltags['tags'], true));
}
else {
$results[] = (object) array('id' => $tagname, 'text' => $tagname);
......@@ -91,16 +91,23 @@ function translate_tags_to_names(array $ids) {
* Display formatted tag
* Currently is tag name plus the usage count
*
* @param string $name Tag name
* @param string $alltags Array of tags to get the information from
* @param string $name Tag name
* @param string $alltags Array of tags to get the information from
* @param boolean $showcount Whether or not to add the tag count to output
* @return $tag Formatted tag
*/
function display_tag($name, $alltags) {
function display_tag($name, $alltags, $showcount = false) {
if ($alltags[$name]->prefix && !empty($alltags[$name]->prefix)) {
$prefix = $alltags[$name]->prefix;
return $prefix . ': '. $alltags[$name]->tag . ' (' . $alltags[$name]->count . ')';
$tag = $prefix . ': '. $alltags[$name]->tag;
}
return $alltags[$name]->tag . ' (' . $alltags[$name]->count . ')';
else {
$tag = $alltags[$name]->tag;
}
if ($showcount) {
$tag .= ' (' . $alltags[$name]->count . ')';
}
return $tag;
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment