diff options
| -rw-r--r-- | app/controllers/course/details.php | 12 | ||||
| -rw-r--r-- | app/views/course/details/index.php | 14 | ||||
| -rw-r--r-- | app/views/shared/mvv_tree.php | 23 |
3 files changed, 40 insertions, 9 deletions
diff --git a/app/controllers/course/details.php b/app/controllers/course/details.php index 2d90e27..bd7b2f6 100644 --- a/app/controllers/course/details.php +++ b/app/controllers/course/details.php @@ -127,6 +127,7 @@ class Course_DetailsController extends AuthenticatedController if (count($mvv_object_path) === 4) { $mvv_object_path['StgteilabschnittModul']->modul->setReplaceDfAbschnitt($mvv_object_path['StgteilAbschnitt']); $mvv_object_path['Modulteil']->setReplaceDfAbschnitt($mvv_object_path['StgteilAbschnitt']); + $abschnitt_id = $mvv_object_path['StgteilAbschnitt']->id; // flatten the paths to a linked list $parent_id = 'root'; foreach ($mvv_object_path as $mvv_object) { @@ -140,6 +141,7 @@ class Course_DetailsController extends AuthenticatedController 'name' => $mvv_object->getDisplayName(), 'class' => get_class($mvv_object), 'tree_id' => $tree_id, + 'abschnitt_id' => $abschnitt_id ]; $parent_id = $tree_id; } @@ -158,16 +160,24 @@ class Course_DetailsController extends AuthenticatedController foreach ($mvv_object_paths as $mvv_object_path) { // show only complete paths if (count($mvv_object_path) === 4) { + $modul_id = ''; + $abschnitt_id = ''; $mvv_object_names = []; $mvv_object_path['StgteilabschnittModul']->modul->setReplaceDfAbschnitt($mvv_object_path['StgteilAbschnitt']); $mvv_object_path['Modulteil']->setReplaceDfAbschnitt($mvv_object_path['StgteilAbschnitt']); foreach ($mvv_object_path as $mvv_object) { if ($mvv_object instanceof StgteilabschnittModul) { $modul_id = $mvv_object->modul_id; + $abschnitt_id = $mvv_object->abschnitt_id; } $mvv_object_names[] = $mvv_object->getDisplayName(); } - $this->mvv_paths[] = [$modul_id => $mvv_object_names]; + $this->mvv_paths[] = + [ + 'modul_id' => $modul_id, + 'names' => $mvv_object_names, + 'abschnitt_id' => $abschnitt_id, + ]; } } } diff --git a/app/views/course/details/index.php b/app/views/course/details/index.php index 98d4eac..84c0aa8 100644 --- a/app/views/course/details/index.php +++ b/app/views/course/details/index.php @@ -432,14 +432,18 @@ if (!empty($mvv_tree)) : ?> <section> <ul class="list-unstyled"> <? foreach ($mvv_paths as $mvv_path) : ?> - <? $types = array_keys($mvv_path); ?> - <? $values = array_values($mvv_path); ?> <li> - <a data-dialog href="<?= URLHelper::getScriptLink('dispatch.php/search/module/overview/' . $types[0] . '/' . $course->start_semester->id) ?>"> - <?= htmlReady(implode(' > ', $values[0])) ?> + <a data-dialog href="<?= URLHelper::getLink( + 'dispatch.php/search/module/overview/' + . $mvv_path['modul_id'] . '/' . $course->start_semester->id, + [ + 'abschnitt_id' => $mvv_path['abschnitt_id'], + ] + ) ?>"> + <?= htmlReady(implode(' > ', $mvv_path['names'])) ?> </a> </li> - <? endforeach; ?> + <? endforeach ?> </ul> </section> </article> diff --git a/app/views/shared/mvv_tree.php b/app/views/shared/mvv_tree.php index 38858b6..23480a4 100644 --- a/app/views/shared/mvv_tree.php +++ b/app/views/shared/mvv_tree.php @@ -5,11 +5,28 @@ <? endif; ?> <label for="<?= htmlReady($current['tree_id'] . $id_sfx->c++) ?>"></label> <? if ($current['class'] == 'StgteilabschnittModul') : ?> - <a data-dialog title="<?= htmlReady($current['name']) ?>" href="<?= URLHelper::getLink('dispatch.php/shared/modul/overview/' . $current['id'] . '/' . $course->start_semester->id) ?>"> + <a + data-dialog + title="<?= htmlReady($current['name']) ?>" + href="<?= URLHelper::getScriptLink( + 'dispatch.php/shared/modul/overview/' + . $current['id'] . '/' . $course->start_semester->id, + [ + 'abschnitt_id' => $current['abschnitt_id'], + ] + ) ?>"> <?= htmlReady($current['name']) ?> </a> - <a data-dialog="size=auto" title="<?= htmlReady($current['name']) ?>" href="<?= URLHelper::getLink('dispatch.php/shared/modul/description/' . $current['id']) ?>"> - <?= Icon::create('log', 'clickable', ['title' => _('Modulbeschreibung')]); ?> + <a + data-dialog="size=auto" + title="<?= htmlReady($current['name']) ?>" + href="<?= URLHelper::getScriptLink( + 'dispatch.php/shared/modul/description/' + . $current['id'], + [ + 'abschnitt_id' => $current['abschnitt_id'], + ]) ?>"> + <?= Icon::create('log', 'clickable', ['title' => _('Modulbeschreibung')]); ?> </a> <? else : ?> <?= htmlReady($current['name']) ?> |
