aboutsummaryrefslogtreecommitdiff
path: root/app/views/my_ilias_accounts/index.php
blob: 1ffdd92de447dc620cf2f7d50cbc7c4b49e00340 (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<form method="post">
<? foreach($ilias_list as $ilias_index => $ilias) : ?>
    <? if (!$GLOBALS['perm']->have_perm($ilias->ilias_config['author_perm'])) continue; ?>
    <table class="default">
        <caption>
            <?= sprintf(_('Meine Lernobjekte in %s'), $ilias->getName()) ?>
            <? if (!empty($ilias->ilias_interface_config['create_objects'] && !empty($ilias->ilias_interface_config['create_category']))) : ?>
                <span class="actions">
                    <a href="<?= $controller->url_for('my_ilias_accounts/add_object/'.$ilias_index) ?>" data-dialog="size=auto" title="<?=_('Neues Lernobjekt anlegen')?>">
                        <?= Icon::create('add', Icon::ROLE_CLICKABLE, tooltip2(_('Neues Lernobjekt anlegen'))) ?>
                    </a>
                </span>
            <? endif ?>
        </caption>
        <colgroup>
            <col style="width: 5%">
            <col style="width: 55%">
            <col style="width: 20%">
            <col style="width: 20%">
        </colgroup>
        <thead>
            <th></th>
            <th><?= _('Name') ?></th>
            <th><?= _('Typ') ?></th>
            <th class="actions"><?= _('Aktionen') ?></th>
        </thead>
   <? if (count($ilias->getUserModules())) : ?>
        <? foreach ($ilias->getUserModules() as $module_id => $module) : ?>
        <tr>
            <td><?=Icon::create('learnmodule', Icon::ROLE_INFO, [
                            'title'        => $module->getModuleTypeName()
                            ])
            ?></td>
            <td><a href="<?= $controller->url_for($module->getRoute('view_tools'))?>" data-dialog=""><?=$module->getTitle()?></a></td>
            <td><?=$module->getModuleTypeName()?></td>
                <td class="actions">
                    <? $actionMenu = ActionMenu::get()->setContext($module->getTitle()) ?>
                    <? $actionMenu->addButton(
                            'view',
                            _('Info'),
                            Icon::create('info-circle', Icon::ROLE_CLICKABLE, [
                                'title'        => _('Info'),
                                'formaction'   => $controller->url_for($module->getRoute('view_tools')),
                                'data-dialog'  => ''
                            ])
                    ) ?>
                    <? 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')),
                                'formtarget'       => '_blank',
                                'formrel'          => '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')),
                                'formtarget'       => '_blank',
                                'formrel'          => 'noopener noreferrer'
                            ])
                    ) ?>
                    <?= $actionMenu->render() ?>
                </td>
        </tr>
        <? endforeach ?>
   <? else : ?>
        <tr>
            <td colspan="4">
                 <?= sprintf(
                     _("Sie haben im System %s noch keine eigenen Lernmodule."),
                     htmlReady($ilias->getName())
                 )?>
            </td>
        </tr>
   <? endif ?>
   </table>
   <br>
   <br>
<? endforeach ?>
    <table class="default">
        <caption>
            <?= count($ilias_list) == 1 ? _('Mein Account') : _('Meine Accounts') ?>
        </caption>
        <colgroup>
            <col style="width: 5%">
            <col style="width: 55%">
            <col style="width: 20%">
            <col style="width: 20%">
        </colgroup>
        <thead>
            <th></th>
            <th><?= _('Login') ?></th>
            <th><?= _('System') ?></th>
            <th class="actions"><?= _('Aktionen') ?></th>
        </thead>
        <tbody>
        <? foreach($ilias_list as $ilias_index => $ilias) : ?>
        <? if ($ilias->user->getUserName()) : ?>
            <tr id="ilias-account-<?= htmlReady($ilias_index)?>">
                <td><?=Icon::create('person', Icon::ROLE_INFO, [
                                'title'        => $ilias->user->getUserName()
                                ])
                ?></td>
                <td><?=$ilias->user->getUserName()?></td>
                <td><?=$ilias->getName()?></td>
                <td class="actions">
                    <? $actionMenu = ActionMenu::get()->setContext($ilias->getName()) ?>
                    <? if ($ilias->ilias_config['allow_change_account'] && ($ilias->user->getUserType() === IliasUser::USER_TYPE_CREATED)) $actionMenu->addButton(
                            'new_account',
                            _('Account neu zuordnen'),
                            Icon::create('person', Icon::ROLE_CLICKABLE, [
                                'title'        => _('Account neu zuordnen'),
                                'formaction'   => $controller->url_for('my_ilias_accounts/new_account/'.$ilias_index),
                                'data-confirm' =>
                                    sprintf(_('Möchten Sie wirklich die bestehende Zuordnung aufheben? Sie verlieren dadurch alle mit dem bestehenden Account verbundenen Inhalte und Lernfortschritte im System "%s".'),
                                    $ilias->getName()
                                ),
                                'data-dialog'  => 'size=auto;reload-on-close'
                            ])
                    ) ?>
                    <? if ($ilias->ilias_config['allow_change_account'] && ($ilias->user->getUserType() === IliasUser::USER_TYPE_ORIGINAL)) $actionMenu->addButton(
                            'change_account',
                            _('Account-Zuordnung aufheben'),
                            Icon::create('trash', Icon::ROLE_CLICKABLE, [
                                'title'        => _('Account-Zuordnung aufheben'),
                                'formaction'   => $controller->url_for('my_ilias_accounts/change_account/'.$ilias_index.'/remove'),
                                'data-confirm' =>
                                    sprintf(_('Möchten Sie wirklich die bestehende Zuordnung aufheben? Sie verlieren dadurch alle mit dem bestehenden Account verbundenen Inhalte und Lernfortschritte im System "%s".'),
                                    $ilias->getName()
                                )
                            ])
                    ) ?>
                    <? if ($ilias->user->getUserType() === IliasUser::USER_TYPE_CREATED) $actionMenu->addButton(
                            'update_account',
                            _('Account aktualisieren'),
                            Icon::create('refresh', Icon::ROLE_CLICKABLE, [
                                'title'        => _('Account aktualisieren'),
                                'formaction'   => $controller->url_for('my_ilias_accounts/change_account/'.$ilias_index.'/update')
                            ])
                    ) ?>
                    <?= $actionMenu->render() ?>
                </td>
            </tr>
        <? else : ?>
        <tr>
            <td colspan="4">
                 <?= sprintf(
                     _("Sie haben im System %s noch keinen Account. Loggen Sie sich zuerst in %s ein, um ILIAS-Lernobjekte in Stud.IP nutzen zu können."),
                     htmlReady($ilias->getName()),
                     "<a href=\"".$ilias->getAbsolutePath()."\">".htmlReady($ilias->getName())."</a>"
                 )?>
            </td>
        </tr>
        <? endif ?>
        <? endforeach ?>
        </tbody>
    </table>
</form>