aboutsummaryrefslogtreecommitdiff
path: root/templates/wiki/pageversions.php
blob: 1cc1313d4b832641c29ad2eb9a409cae4dc65e1a (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
<table class="default">

    <caption>
        <?= htmlReady($keyword) ?> - <?= _('Versionshistorie') ?>
    </caption>

    <colgroup>
        <col style="width: 5%;">
        <col style="width: 70%;">
        <col style="width: 25%;">
    </colgroup>

    <thead>
        <tr>
            <th>
                <a href="<?= URLHelper::getLink($url, ['keyword' => $keyword, 'sortby' => $versionsortlink]) ?>">
                    <?= _('Version') ?>
                </a>
            </th>
            <th>
                <?= _('Autor/in') ?>
            </th>
            <th>
                <a href="<?= URLHelper::getLink($url, ['keyword' => $keyword, 'sortby' => $changesortlink]) ?>">
                    <?= _('Erstellt am') ?>
                </a>
            </th>
        </tr>
    </thead>

    <tbody>
        <? foreach ($pages as $page): ?>
            <tr>
                <td>
                <a href="<?= URLHelper::getLink('', ['keyword' => $keyword, 'version' => $page->version]) ?>">
                    <?= $page->version ?>
                </td>
                <td>
                    <? if (isset($page->author)) : ?>
                        <a href="<?= URLHelper::getLink('dispatch.php/profile', ['username' => $page->author->username]) ?>">
                            <?= Avatar::getAvatar($page->author->id, $page->author->username)->getImageTag(Avatar::SMALL, ['title' => $page->author->getFullName()]) ?>
                            <?= htmlReady($page->author->getFullName()) ?>
                        </a>
                    <? else : ?>
                        <?= Avatar::getNobody()->getImageTag(Avatar::SMALL) ?>
                        <?= _('unbekannt') ?>
                    <? endif ?>
                </td>
                <td>
                    <?= date('d.m.Y H:i', $page->chdate) ?>
                </td>
            </tr>
        <? endforeach ?>
    </tbody>
    <? if ($GLOBALS['perm']->have_studip_perm('tutor', Context::getId()) && keywordExists($keyword)) :?>
    <tfoot>
        <tr>
            <td colspan="3">
                <?= Studip\LinkButton::create(
                    _('Alle Versionen löschen'),
                    URLHelper::getURL("?cmd=really_delete_all&keyword=".urlencode($keyword)),
                    ['data-confirm' => showDeleteAllDialog($keyword)]
                ) ?>
            </td>
        </tr>
    </tfoot>
    <? endif ?>
</table>