aboutsummaryrefslogtreecommitdiff
path: root/app/views/search/breadcrumb.php
blob: f4b19d7e997ad10aec45acfa5d2072ce49b08a76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<div style="padding-bottom: 20px;">
<? $bc_points = $this->breadcrumb->getTrail(); ?>
<? $sum_points = count($bc_points) - 1; ?>
<? $index = 0; ?>
<? foreach($bc_points as $type => $point):?>
    <? $id2 = isset($point['add']) ? reset(array_values((array) $point['add'])) : null; ?>
    <? $link = $controller->link_for('/' . $point['actn'], $point['id'] ?? null, $id2); ?>
    <? if (isset($point['add']) && is_array($point['add'])) : ?>
        <? $mvv_object = $type::find($point['id']); ?>
        <? if ($mvv_object && $type == 'Fach' && $additional_object = Abschluss::find($point['add']['Abschluss'])) : ?>
            <a href="<?= $link ?>"><?= htmlReady($mvv_object->getDisplayName() . ' (' . $additional_object->name . ')') ?></a>
        <? endif; ?>
        <? if ($mvv_object && $type == 'StgteilBezeichnung' && $additional_object = StudiengangTeil::find($point['add']['StudiengangTeil'])) : ?>
            <a href="<?= $link ?>"><?= htmlReady($mvv_object->getDisplayName() . ': ' . $additional_object->getDisplayName(ModuleManagementModel::DISPLAY_FACH)) ?></a>
        <? endif; ?>
    <? else : ?>
        <? if ($type == 'StudiengangTeil' && $mvv_object = $type::find($point['id'])) : ?>
            <a href="<?= $link ?>"><?= htmlReady($mvv_object->getDisplayName(ModuleManagementModel::DISPLAY_FACH)) ?></a>
        <? elseif (!empty($point['id']) && $mvv_object = $type::find($point['id'])) : ?>
            <a href="<?= $link ?>"><?= htmlReady($mvv_object->getDisplayName(0)) ?></a>
        <? else : ?>
            <a href="<?= $link ?>"><?= htmlReady($point['name']) ?></a>
        <? endif; ?>
    <? endif; ?>
    <? if ($point['actn'] == $controller->action) break; ?>
    <?= $index++ < $sum_points ? '>' : null; ?>
<? endforeach; ?>
</div>