diff options
| author | Peter Thienel <thienel@data-quest.de> | 2026-03-13 14:22:33 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-03-13 15:22:33 +0100 |
| commit | 5239fe23a8b6b3e266dc09fd25d8c805f60d78a3 (patch) | |
| tree | 8648e1e05775791bce7d165d6fff5703c4e1ab59 /lib/models/ModuleManagementModelTreeItem.php | |
| parent | 7c500597a37db933c9188d67bf8a9d4dbd13e0b7 (diff) | |
Resolve "MVV: Modul-Kurzdarstellung im VVZ"
Closes #6252
Merge request studip/studip!4745
Diffstat (limited to 'lib/models/ModuleManagementModelTreeItem.php')
| -rw-r--r-- | lib/models/ModuleManagementModelTreeItem.php | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/models/ModuleManagementModelTreeItem.php b/lib/models/ModuleManagementModelTreeItem.php index 48c3b1b..8e18108 100644 --- a/lib/models/ModuleManagementModelTreeItem.php +++ b/lib/models/ModuleManagementModelTreeItem.php @@ -136,19 +136,27 @@ abstract class ModuleManagementModelTreeItem extends ModuleManagementModel imple * @param string $delimiter A string used as the "glue". * @param int $display_options Display options set by constants defined * in class ModuleManagementModel. - * @return type + * @return array */ public static function getPathes($trails, $delimiter = ' ยท ') { - $pathes = []; + $paths = []; foreach ($trails as $trail) { - $pathes[] = join($delimiter, array_map( - function($a) { - return $a->getDisplayName(); - }, $trail)); + $abschnitt = null; + $names = []; + foreach ($trail as $a) { + if ($a instanceof StgteilAbschnitt) { + $abschnitt = $a; + } + if ($abschnitt && ($a instanceof Modul || $a instanceof Modulteil)) { + $a->setReplaceDfAbschnitt($abschnitt); + } + $names[] = $a->getDisplayName(); + } + $paths[] = implode($delimiter, $names); } - sort($pathes, SORT_LOCALE_STRING); - return $pathes; + sort($paths, SORT_LOCALE_STRING); + return $paths; } /** |
