aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/course_wizard_steps/index.php
blob: b951e218ffaff23327ae9db7a2dc6dcca112db3a (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
<?php
/**
 * @var bool $has_enabled
 * @var Admin_CourseWizardStepsController $controller
 * @var CourseWizardStep[] $steps
 */
?>
<? if (!$has_enabled) : ?>
    <?= MessageBox::info(_('Es gibt keine aktiven Schritte für den Anlegeassistenten!')) ?>
<? endif ?>
<form method="post">
    <?= CSRFProtection::tokenTag() ?>
    <table class="default">
        <caption>
            <?= _('Vorhandene Schritte im Anlegeassistenten für Veranstaltungen') ?>
            <span class="actions">
                <a href="<?= $controller->url_for('admin/coursewizardsteps/edit') ?>" data-dialog="size=auto">
                    <?= Icon::create('add')->asImg(tooltip2(_('Neuen Schritt hinzufügen'))) ?>
                </a>
            </span>
        </caption>
        <colgroup>
            <col style="width: 30%">
            <col style="width: 30%">
            <col style="width: 5%">
            <col style="width: 5%">
            <col style="width: 10%">
        </colgroup>
        <thead>
            <th><?= _('Name') ?></th>
            <th><?= _('PHP-Klasse') ?></th>
            <th><?= _('Nummer') ?></th>
            <th><?= _('aktiv?') ?></th>
            <th class="actions"><?= _('Aktionen') ?></th>
        </thead>
        <tbody>
        <? foreach ($steps as $step) : ?>
            <tr id="wizard-step-<?= $step->id ?>">
                <td><?= htmlReady($step->name) ?></td>
                <td><?= htmlReady($step->classname) ?></td>
                <td><?= $step->number ?></td>
                <td>
                    <a href="<?= $controller->link_for("admin/coursewizardsteps/toggle_enabled/{$step->id}") ?>" data-behaviour="ajax-toggle">
                    <? if ($step->enabled): ?>
                        <?= Icon::create('checkbox-checked') ?>
                    <? else: ?>
                        <?= Icon::create('checkbox-unchecked') ?>
                    <? endif; ?>
                    </a>
                </td>
                <td class="actions">
                    <? $actionMenu = ActionMenu::get()->setContext($step->name) ?>
                    <? $actionMenu->addLink(
                        $controller->url_for("admin/coursewizardsteps/edit/{$step->id}"),
                        _('Schritt bearbeiten'),
                        Icon::create('edit'),
                        ['data-dialog' => 'size=auto']
                    ) ?>

                    <? $actionMenu->addButton(
                        'delete_step',
                        _('Schritt löschen'),
                        Icon::create('trash'),
                        [
                            'title'        => _('Schritt löschen'),
                            'formaction'   => $controller->url_for("admin/coursewizardsteps/delete/{$step->id}"),
                            'data-confirm' => sprintf(
                                _('Soll der Eintrag "%s" wirklich gelöscht werden?'),
                                $step->name
                            ),
                        ]
                    ) ?>
                    <?= $actionMenu->render() ?>
                </td>
            </tr>
        <? endforeach; ?>

        <? if (!$steps): ?>
            <tr>
                <td colspan="5" style="text-align: center">
                    <?= _('Es sind keine Schritte für den Veranstaltungsanlegeassistenten registriert!') ?>
                </td>
            </tr>
        <? endif ?>
        </tbody>
    </table>
</form>