aboutsummaryrefslogtreecommitdiff
path: root/app/views/course/wiki/admin.php
blob: 9e1a5057a6393d464896f57fc17dd8d2818a73c1 (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
<?php
/**
 * @var WikiPage[] $pages
 * @var Course_WikiController $controller
 * @var CourseConfig $config
 * @var Course|Institute $range
 */
?>
<form class="default" method="post" action="<?= $controller->store_course_config() ?>">
    <?= CSRFProtection::tokenTag() ?>

    <? if ($config->WIKI_CREATE_PERMISSION === 'all' || $GLOBALS['perm']->have_studip_perm($config->WIKI_CREATE_PERMISSION, $range->id)) : ?>
        <label>
            <?= _('Wer darf neue Wiki-Seiten anlegen?') ?>
            <select name="wiki_create_permission">
                <option value="all"
                        <? if ($config->WIKI_CREATE_PERMISSION === 'all') echo 'selected'; ?>
                ><?= _('Alle') ?></option>
                <option value="tutor"
                        <? if ($config->WIKI_CREATE_PERMISSION === 'tutor') echo 'selected'; ?>
                ><?= _('Tutor/-innen und Lehrende') ?></option>
                <option value="dozent"
                        <?= $GLOBALS['perm']->have_studip_perm('dozent', $range->id) ? '' : 'disabled'?>
                        <? if ($config->WIKI_CREATE_PERMISSION === 'dozent') echo 'selected'; ?>
                ><?= _('Nur Lehrende') ?></option>
            </select>
        </label>
    <? else : ?>
        <div>
            <?= _('Wer darf neue Wiki-Seiten anlegen?') ?>
            <div>
                <? switch ($config->WIKI_CREATE_PERMISSION) {
                    case 'all':
                        echo _('Alle');
                        break;
                    case 'tutor':
                        echo _('Tutor/-innen und Lehrende');
                        break;
                    case 'dozent':
                        echo _('Nur Lehrende');
                        break;
                } ?>
            </div>
        </div>
    <? endif ?>

    <? if ($config->WIKI_RENAME_PERMISSION === 'all' || $GLOBALS['perm']->have_studip_perm($config->WIKI_RENAME_PERMISSION, $range->id)) : ?>
        <label>
            <?= _('Wer darf Wiki-Seiten umbenennen?') ?>
            <select name="wiki_rename_permission">
                <option value="all"
                        <? if ($config->WIKI_RENAME_PERMISSION === 'all') echo 'selected'; ?>
                ><?= _('Alle') ?></option>
                <option value="tutor"
                        <? if ($config->WIKI_RENAME_PERMISSION === 'tutor') echo 'selected'; ?>
                ><?= _('Tutor/-innen und Lehrende') ?></option>
                <option value="dozent"
                        <?= $GLOBALS['perm']->have_studip_perm('dozent', $range->id) ? '' : 'disabled'?>
                        <? if ($config->WIKI_RENAME_PERMISSION === 'dozent') echo 'selected'; ?>
                ><?= _('Nur Lehrende') ?></option>
            </select>
        </label>
    <? else : ?>
        <div>
            <?= _('Wer darf Wiki-Seiten umbenennen?') ?>
            <div>
                <? switch ($config->WIKI_RENAME_PERMISSION) {
                    case 'all':
                        echo _('Alle');
                        break;
                    case 'tutor':
                        echo _('Tutor/-innen und Lehrende');
                        break;
                    case 'dozent':
                        echo _('Nur Lehrende');
                        break;
                } ?>
            </div>
        </div>
    <? endif ?>

    <div data-dialog-button>
        <?= \Studip\Button::create(_('Übernehmen')) ?>
    </div>
</form>