aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/ilias_interface/index.php
blob: 00e4f36a4cd5aab643bac9273a3f942567c7ff3d (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
<?php
/**
 * @var Admin_IliasInterfaceController $controller
 * @var array $ilias_configs
 */
?>
 <form method="post">
    <?= CSRFProtection::tokenTag() ?>
    <table class="default">
        <caption>
            <?= _('Angebundene ILIAS-Installationen') ?>
            <span class="actions">
                <a href="<?= $controller->url_for('admin/ilias_interface/edit_server/new') ?>" data-dialog="size=auto">
                    <?= Icon::create('add')->asImg(tooltip2(_('Neue ILIAS-Installation hinzufügen'))) ?>
                </a>
            </span>
        </caption>
        <colgroup>
            <col style="width: 10%">
            <col style="width: 60%">
            <col style="width: 10%">
            <col style="width: 10%">
            <col style="width: 10%">
        </colgroup>
        <thead>
            <th><?= _('Aktiv') ?></th>
            <th><?= _('Name') ?></th>
            <th><?= _('Index') ?></th>
            <th><?= _('Version') ?></th>
            <th class="actions"><?= _('Aktionen') ?></th>
        </thead>
        <tbody>
        <? foreach ($ilias_configs as $ilias_index => $ilias_config) : ?>
            <tr id="ilias-<?= htmlReady($ilias_index)?>">
                <td>
                    <? if (!empty($ilias_config['is_active'])) {
                        $text = _('Diese ILIAS-Installation ist aktiv. Klicken Sie hier, um sie zu deaktivieren.');
                        $img  = 'checkbox-checked';
                        $cmd  = 'deactivate';
                    } else {
                        $text = _('Diese ILIAS-Installation ist inaktiv. Klicken Sie hier, um sie zu aktivieren.');
                        $img  = 'checkbox-unchecked';
                        $cmd  = 'activate';
                    }
                    ?>
                    <a href="<?= $controller->url_for('admin/ilias_interface/'.$cmd.'/'.$ilias_index) ?>">
                        <?= Icon::create($img)->asImg(['title' => $text]) ?>
                    </a>
                </td>
                <td><?= htmlReady($ilias_config['name']) ?></td>
                <td><?= htmlReady($ilias_index) ?></td>
                <td><?= htmlReady($ilias_config['version']) ?></td>
                <td class="actions">
                    <? $actionMenu = ActionMenu::get()->setContext($ilias_config['name']) ?>
                    <? $actionMenu->addLink(
                        $controller->url_for("admin/ilias_interface/edit_server/$ilias_index"),
                        _('Servereinstellungen bearbeiten'),
                        Icon::create('edit'),
                        ['data-dialog' => 'size=auto']
                    ) ?>
                    <? $actionMenu->addLink(
                        $controller->url_for("admin/ilias_interface/edit_content/$ilias_index"),
                        _('Inhaltseinstellungen bearbeiten'),
                        Icon::create('edit'),
                        ['data-dialog' => 'size=auto']
                    ) ?>
                    <? $actionMenu->addLink(
                        $controller->url_for("admin/ilias_interface/edit_permissions/$ilias_index"),
                        _('Berechtigungen bearbeiten'),
                        Icon::create('edit'),
                        ['data-dialog' => 'size=auto']
                    ) ?>

                    <? $actionMenu->addButton(
                            'delete_config',
                            _('Konfiguration löschen'),
                            Icon::create('trash'),
                            [
                                'title'        => _('Konfiguration löschen'),
                                'formaction'   => $controller->url_for("admin/ilias_interface/delete/$ilias_index"),
                                'data-confirm' => sprintf(
                                    _('Soll die ILIAS-Installation "%s" wirklich entfernt werden?'),
                                    $ilias_config['name']
                                ),
                            ]
                    ) ?>
                    <?= $actionMenu->render() ?>
                </td>
            </tr>
        <? endforeach; ?>

        <? if (!$ilias_configs): ?>
            <tr>
                <td colspan="5" style="text-align: center">
                    <?= _('Es ist keine ILIAS-Installation eingerichtet.') ?>
                </td>
            </tr>
        <? endif ?>
        </tbody>
    </table>
</form>