Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
1c6b7d70
Commit
1c6b7d70
authored
Apr 25, 2019
by
Robert Lyon
Committed by
Gerrit Code Review
Apr 25, 2019
Browse files
Merge "Bug 1825611: Don't show tag count beside tag on file list page"
parents
9d522ff4
5830f08e
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/json/taglist.php
View file @
1c6b7d70
...
...
@@ -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
++
;
...
...
htdocs/lib/form/elements/tags.php
View file @
1c6b7d70
...
...
@@ -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
;
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment