aboutsummaryrefslogtreecommitdiff
path: root/app/views/admission/ruleadministration/compatibility.php
blob: f9531579d0f77d9599fdfa763eeeec3f8ec1f974 (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
<?php
/**
 * @var Admission_RuleadministrationController $controller
 * @var AdmissionRule[] $ruletypes
 */
?>
<form class="default" action="<?= $controller->url_for('admission/ruleadministration/save_compat') ?>" method="post">
    <?= CSRFProtection::tokenTag() ?>
    <table class="default">
        <caption>
            <?= _('Welche Anmelderegeln sind wie miteinander kombinierbar?') ?>
        </caption>
        <colgroup>
            <col width="15%">
            <?php foreach ($ruletypes as $data) : ?>
                <col width="<?= floor(85 / count($ruletypes)) ?>%">
            <?php endforeach ?>
        </colgroup>
        <thead>
            <tr>
                <th>&nbsp;</th>
                <th colspan="<?= count($ruletypes) + 1 ?>">
                    <?= _('ist kompatibel mit') ?>
                </th>
            </tr>
            <tr>
                <th><?= _('Regeltyp') ?></th>
                <?php foreach ($ruletypes as $class => $type) : ?>
                    <th>
                        <?= htmlReady($type['name']) ?>
                    </th>
                <?php endforeach ?>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($ruletypes as $class => $type) : ?>
                <tr>
                    <td>
                        <?= htmlReady($type['name']) ?>
                    </td>
                    <?php foreach ($ruletypes as $compat_class => $compat_type) : ?>
                        <td>
                            <input type="checkbox" name="compat[<?= $class ?>][]"
                                   value="<?= $compat_class ?>"<?=
                                    in_array($compat_class, $matrix[$class] ?? []) ? ' checked' : ''?>>
                        </td>
                    <?php endforeach ?>
                </tr>
            <?php endforeach ?>
        </tbody>

        <tfoot>
            <tr>
                <td colspan="<?= count($ruletypes) + 2 ?>">
                    <?= Studip\Button::createAccept(_('Speichern'), 'save') ?>
                </td>
            </tr>
        </tfoot>
    </table>

</form>