aboutsummaryrefslogtreecommitdiff
path: root/lib/functions.php
diff options
context:
space:
mode:
authorThomas Hackl <hackl@data-quest.de>2022-06-20 10:13:30 +0200
committerThomas Hackl <hackl@data-quest.de>2022-06-20 10:13:42 +0200
commitcbc5bec63afbabc79c15f62d3a4cdeb079283984 (patch)
tree11dcaaa542c254a0f8affbf1f9e2d69621c3e1c1 /lib/functions.php
parenteedae6127d7db35b147bc75b7e8ea48d23a9a69a (diff)
use custom permission titles if set, re #1185
Diffstat (limited to 'lib/functions.php')
-rw-r--r--lib/functions.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/functions.php b/lib/functions.php
index 812b531..b2cb073 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -1174,12 +1174,12 @@ function get_title_for_status($type, $count, $sem_type = NULL)
$atype = 'title_'.$type;
$index = $count == 1 ? 0 : 1;
- if (isset($SEM_TYPE[$sem_type][$atype][$index])) {
- $title = $SEM_TYPE[$sem_type][$atype][$index];
- } else if (isset($DEFAULT_TITLE_FOR_STATUS[$type][$index])) {
- $title = $DEFAULT_TITLE_FOR_STATUS[$type][$index];
- } else {
- $title = _('unbekannt');
+ $class = $SEM_TYPE[$sem_type]->getClass();
+
+ $title = $class->offsetGet($count == 1 ? $atype : $atype . '_plural');
+
+ if (!$title) {
+ $title = $DEFAULT_TITLE_FOR_STATUS[$type][$index] ?: _('unbekannt');
}
return $title;