From cbc5bec63afbabc79c15f62d3a4cdeb079283984 Mon Sep 17 00:00:00 2001 From: Thomas Hackl <hackl@data-quest.de> Date: Mon, 20 Jun 2022 10:13:30 +0200 Subject: [PATCH] use custom permission titles if set, re #1185 --- lib/functions.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/functions.php b/lib/functions.php index 812b531e5d7..b2cb073f5a5 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; -- GitLab