aboutsummaryrefslogtreecommitdiff
path: root/app/views/my_studygroups/_course.php
blob: 3a854baa6f71fbb9d2986eec7bbe32d9ac82ff92 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<? foreach ($studygroups as $group)  : ?>
    <tr>
        <td class="gruppe<?= $group['gruppe'] ?>"></td>
        <td>
            <?= StudygroupAvatar::getAvatar($group['seminar_id'])->getImageTag(Avatar::SMALL, ['title' => $group['name']]) ?>
        </td>

        <td style="text-align: left">
            <a href="<?= URLHelper::getLink('dispatch.php/course/go', ['to' => $group['seminar_id']]) ?>"
                <?= $group['last_visitdate'] < $group['chdate'] ? 'style="color: red;"' : '' ?>>
                <?= htmlReady($group['name']) ?>
            </a>
            <? if ($group['visible'] == 0) : ?>
                <? $infotext = _("Versteckte Studiengruppen können über die Suchfunktionen nicht gefunden werden."); ?>
                <? $infotext .= " "; ?>
                <? if (Config::get()->ALLOW_DOZENT_VISIBILITY) : ?>
                    <? $infotext .= _("Um die Studiengruppe sichtbar zu machen, wählen Sie den Punkt \"Sichtbarkeit\" im Administrationsbereich der Veranstaltung."); ?>
                <? else : ?>
                    <? $infotext .= _("Um die Studiengruppe sichtbar zu machen, wenden Sie sich an die Admins."); ?>
                <? endif ?>
                <?= _("[versteckt]") ?>
                <?= tooltipicon($infotext) ?>
            <? endif ?>
        </td>
        <td data-sort-value="<?= $group['mkdate'] ?>">
            <?= htmlReady(date('d.m.Y', $group['mkdate'])) ?>
        </td>
        <td style="text-align: left; white-space: nowrap;">
            <? if (!empty($group['navigation'])) : ?>
                <ul class="my-courses-navigation" style="flex-wrap: nowrap">
                <? foreach (MyRealmModel::array_rtrim($group['navigation']) as $key => $nav)  : ?>
                    <? if (isset($nav) && $nav->isVisible(true)) : ?>
                        <li class="my-courses-navigation-item <? if ($nav->getImage()->signalsAttention()) echo 'my-courses-navigation-important'; ?>">
                            <a href="<?=
                            URLHelper::getLink('dispatch.php/course/go',
                                ['to'     => $group['seminar_id'],
                                      'redirect_to' => $nav->getURL()]) ?>" <?= $nav->hasBadgeNumber() ? 'class="badge" data-badge-number="' . intval($nav->getBadgeNumber()) . '"' : '' ?>>
                                <?= $nav->getImage()->asSvg($nav->getLinkAttributes()) ?>
                            </a>
                        </li>
                    <? elseif (is_string($key)) : ?>
                        <li class="my-courses-navigation-item">
                            <span class="empty-slot" style="width: 20px"></span>
                        </li>
                    <? endif ?>
                <? endforeach ?>
                </ul>
            <? endif ?>
        </td>
        <? if (!$is_widget) : ?>
            <td style="text-align: right">
                <? if (in_array($group["user_status"], ["dozent", "tutor"])) : ?>
                    <? $adminmodule = $group["sem_class"]->getAdminModuleObject(); ?>
                    <? if ($adminmodule && $group['tools']->findOneby('plugin_id', $adminmodule->getPluginId())) : ?>
                        <? $adminnavigation = $adminmodule->getIconNavigation($group['seminar_id'], 0, $GLOBALS['user']->id); ?>
                    <? endif ?>
                    <? if (!empty($adminnavigation)) : ?>
                        <a href="<?= URLHelper::getLink($adminnavigation->getURL(), ['cid' => $group['seminar_id']]) ?>">
                            <?= $adminnavigation->getImage()->asSvg($adminnavigation->getLinkAttributes())?>
                        </a>
                    <? endif ?>

                <? elseif (!empty($group['binding'])) : ?>
                    <a href="<?= URLHelper::getLink('', ['to' => $group['seminar_id'], 'cmd' => 'no_kill']) ?>">
                        <?= Icon::create('door-leave', Icon::ROLE_INACTIVE)->asSvg(['title' => _('Die Teilnahme ist bindend. Bitte wenden Sie sich an die Lehrenden.')]) ?>
                    </a>
                <?
                else : ?>
                    <a href="<?= URLHelper::getLink("dispatch.php/my_courses/decline/{$group['seminar_id']}", ['cmd' => 'suppose_to_kill']) ?>">
                        <?= Icon::create('door-leave', Icon::ROLE_INACTIVE)->asSvg(['title' => _('Aus der Studiengruppe abmelden')]) ?>
                    </a>
                <? endif ?>
            </td>
            <? endif ?>
    </tr>
<? endforeach ?>