From 2fa030df262ba28149fe3332e03f4627c0188d55 Mon Sep 17 00:00:00 2001 From: Matheus Zych Date: Mon, 31 Aug 2026 08:51:43 +0200 Subject: [PATCH] News: Move Object Type To Item Property See: https://mantis.ilias.de/view.php?id=48284 News items in context blocks showed the object type and title in the item description. They are now rendered as a separate item property for clearer structure. --- .../classes/class.ilNewsForContextBlockGUI.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/components/ILIAS/News/classes/class.ilNewsForContextBlockGUI.php b/components/ILIAS/News/classes/class.ilNewsForContextBlockGUI.php index bbdb4e99ecff..2b016dc6bf27 100755 --- a/components/ILIAS/News/classes/class.ilNewsForContextBlockGUI.php +++ b/components/ILIAS/News/classes/class.ilNewsForContextBlockGUI.php @@ -142,19 +142,19 @@ protected function getListItemForData(array $data): ?\ILIAS\UI\Component\Item\It ->withDescription($this->lng->txt('news_sorry_not_accessible_anymore')); } - - $props = [ - $this->lng->txt('date') => $info['creation_date'] ?? '' - ]; - $item = $this->ui->factory()->item()->standard( $this->ui->factory()->link()->standard($info['news_title'] ?? '', $info['url'] ?? '') - )->withProperties($props); + ); + + $properties = []; if ($info['ref_id'] > 0) { - $item = $item->withDescription($info['type_txt'] . ': ' . $info['obj_title']); + $properties[$info['type_txt']] = $info['obj_title']; } - return $item; + + $properties[$this->lng->txt('date')] = $info['creation_date'] ?? ''; + + return $item->withProperties($properties); } private function getNewsForId(int $news_id): array