aboutsummaryrefslogtreecommitdiff
path: root/app/views/course/ilias_interface/index.php
blob: 7d33f20d35166dd34a0376c56e79795e4c6af90f (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<form method="post">
<? foreach($ilias_list as $ilias_index => $ilias) : ?>
    <? if (!count($ilias->getCourseModules()) && !$courses[$ilias_index] && !$edit_permission) continue; ?>
    <? if ($anker_target == $ilias_index) : ?>
        <a name='anker'></a>
    <? endif?>
    <table class="default">
        <caption>
            <?= sprintf(_('Lernobjekte in %s'), htmlReady($ilias->getName()))?>
        </caption>
        <colgroup>
            <col style="width: 5%">
            <col style="width: 65%">
            <col style="width: 20%">
            <col style="width: 10%">
        </colgroup>
        <thead>
            <th></th>
            <th><?= _('Name') ?></th>
            <th><?= _('Typ') ?></th>
            <th class="actions"><?= _('Aktionen') ?></th>
        </thead>
        <tbody>
    <? if (count($ilias->getCourseModules())) : ?>
        <? foreach ($ilias->getCourseModules() as $module_id => $module) : ?>
        <tr>
            <td><?=Icon::create('learnmodule', $module->is_offline ? Icon::ROLE_INACTIVE : Icon::ROLE_INFO, [
                            'title'        => $module->getModuleTypeName()
                            ])
            ?></td>
            <? if ($module->is_offline) : ?>
            <td><?=$module->getTitle()?> <?=_('(offline)')?></td>
            <? else : ?>
            <td><a href="<?= $controller->url_for($module->getRoute('view_course'))?>" data-dialog="size=auto"><?=$module->getTitle()?></a></td>
            <? endif ?>
            <td><?=$module->getModuleTypeName()?></td>
                <td class="actions">
                    <? $actionMenu = ActionMenu::get()->setContext($module->getTitle()) ?>
                    <? if (! $module->is_offline) $actionMenu->addButton(
                            'view',
                            _('Info'),
                            Icon::create('info-circle', Icon::ROLE_CLICKABLE, [
                                'title'        => _('Info'),
                                'formaction'   => $controller->url_for($module->getRoute('view_course')),
                                'data-dialog'  => 'size=auto'
                            ])
                    ) ?>
                    <? if ($module->isAllowed('start')) $actionMenu->addButton(
                            'start',
                            _('In ILIAS anzeigen'),
                            Icon::create('play', Icon::ROLE_CLICKABLE, [
                                'title'        => _('In ILIAS anzeigen'),
                                'formaction'   => $controller->url_for($module->getRoute('start')),
                                'target'       => '_blank',
                                'rel'          => 'noopener noreferrer'
                            ])
                    ) ?>
                    <? if ($module->isAllowed('edit')) $actionMenu->addButton(
                            'edit',
                            _('In ILIAS bearbeiten'),
                            Icon::create('edit', Icon::ROLE_CLICKABLE, [
                                'title'        => _('In ILIAS bearbeiten'),
                                'formaction'   => $controller->url_for($module->getRoute('edit')),
                                'target'       => '_blank',
                                'rel'          => 'noopener noreferrer'
                            ])
                    ) ?>
                    <? if ($edit_permission && $module->isAllowed('delete')) $actionMenu->addButton(
                            'remove',
                            _('Entfernen'),
                            Icon::create('trash', Icon::ROLE_CLICKABLE, [
                                'title'        => _('Entfernen'),
                                'formaction'   => $controller->url_for($module->getRoute('remove')),
                                'data-confirm' => $module->siblings_count < 2 ? sprintf(_('Dies ist die einzige Instanz des Objekts "%s". Durch das Entfernen aus dem Kurs wird das Objekt unwiderruflich gelöscht! Wollen Sie das Objekt wirklich löschen?'), $module->getTitle()) : sprintf(_('Wollen Sie das Objekt "%s" jetzt entfernen?'), $module->getTitle()),
                                'target'       => '_blank',
                                'rel'          => 'noopener noreferrer'
                            ])
                    ) ?>
                    <?= $actionMenu->render() ?>
                </td>
        </tr>
        <? endforeach ?>
    <? elseif (!$courses[$ilias_index]) : ?>
        <tr>
            <td colspan="4">
                <?= _('Es sind keine Lernobjekte mit dieser Veranstaltung verknüpft.')?>
            </td>
        </tr>
    <? else : ?>
        <tr>
            <td><?=Icon::create('learnmodule', $course_objects[$ilias_index]->is_offline ? Icon::ROLE_INACTIVE : Icon::ROLE_INFO, [
                            'title'        => _('ILIAS-Kurs')
                            ])
            ?></td>
            <td>
                <a href="<?= $controller->url_for('my_ilias_accounts/redirect/'.$ilias_index.'/start/'.$courses[$ilias_index].'/crs')?>" target="_blank"><?= sprintf(_('Kurs in %s'), $ilias->getName()).($course_objects[$ilias_index]->is_offline ? ' '._('(offline)') : '')?></a>
            </td>
            <td><?=_('ILIAS-Kurs')?></td>
                <td class="actions">
                    <? $actionMenu = ActionMenu::get()->setContext(sprintf(_('Kurs in %s'), $ilias->getName())) ?>
                    <? $actionMenu->addButton(
                            'start',
                            _('In ILIAS anzeigen'),
                            Icon::create('play', Icon::ROLE_CLICKABLE, [
                                'title'        => _('In ILIAS anzeigen'),
                                'formaction'   => $controller->url_for('my_ilias_accounts/redirect/'.$ilias_index.'/start/'.$courses[$ilias_index].'/crs'),
                                'target'       => '_blank',
                                'rel'          => 'noopener noreferrer'
                            ])
                    ) ?>
                    <? if ($edit_permission) $actionMenu->addButton(
                            'remove',
                            _('Entfernen'),
                            Icon::create('trash', Icon::ROLE_CLICKABLE, [
                                'title'        => _('Entfernen'),
                                'formaction'   => $controller->url_for('course/ilias_interface/remove_course/'.$ilias_index.'/'.$courses[$ilias_index]),
                                'data-confirm' => sprintf(_('Verknüpfung zum Kurs in %s entfernen? Hierdurch werden auch die Verknüpfungen zu allen Objekten innerhalb des Kurses entfernt.'), $ilias->getName()),
                                'target'       => '_blank',
                                'rel'          => 'noopener noreferrer'
                            ])
                    ) ?>
                    <?= $actionMenu->render() ?>
                </td>
        </tr>
    <? endif ?>
        </tbody>
    </table>
<? endforeach ?>
</form>