aboutsummaryrefslogtreecommitdiff
path: root/app/view/templates/editrightbar.php
blob: b0518adcdcf822e5671e7c95ad773baa7790d212 (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
102
<div id="rightbar" class="bar">
    <input id="showrightpanel" name="workspace[showrightpanel]" value="1" class="toggle" type="checkbox"  <?= $showrightpanel == true ? 'checked' : '' ?>>
    <label for="showrightpanel" class="toogle"></label>
    <div id="rightbarpanel" class="panel">
    

    <details id="lastedited" open>
        <summary>Last edited</summary>
    <ul>
    <?php
    foreach ($lasteditedpagelist as $id) {
        ?>
        <li><a href="<?= $this->upage('pageedit', $id) ?>"><?= $id === $page->id() ? '➤' : '✎' ?> <?= $id ?></a></li>
        <?php
    }

    ?>
    </ul>

    </details>


    <details id="tags" open>
        <summary>Tags</summary>
        <?php
        foreach ($tagpagelist as $tag => $idlist) {
            if(count($idlist) > 1) {
            ?>
            <strong><?= $tag ?></strong>
            <?php

            echo '<ul>';
            foreach ($idlist as $id) {
                if($id === $page->id()) {
                    echo '<li>➤ '.$id.'</li>';
                } else {
                ?>
                <li><a href="<?= $this->upage('pageedit', $id) ?>"><?= $id ?></a></li>
                <?php
                }
            }
            }
            echo '</ul>';
        }

        ?>

    </details>

    <details id="tempaltes" open>
        <summary>Templates</summary>
        <ul>
        <?php
        foreach ($templates as $template => $id) {
            if(!empty($id) && !is_bool($id)) {
                ?>
                <li><?= $template ?> : <?= $id ?> <a href="<?= $this->upage('pageedit', $id) ?>"></a></li>
                <?php
            }
        }
        
        ?>
        </ul>
        
    </details>

        <h3>Authors</h3>


    <?php if($user->level() >= 4) { ?>


    <label for="authors">Invites editors</label>
    <select name="authors[]" id="authors">
    <option value="" selected>--add author--</option>
    <?php
    $notyetauthorlist = array_diff($editorlist, $page->authors());
        foreach ($notyetauthorlist as $author) {
            echo '<option value="'.$author.'" >'.$author.'</option>';
        }
    }
    ?>

    </select>
    <?php
        $alreadyauthorlist = array_intersect($editorlist, $page->authors());
        foreach ($alreadyauthorlist as $author) {
            ?>
            <div class="checkexternal">
            <?php if($user->level() >= 4) { ?>
            <input type="checkbox" name="authors[]" id="<?= $author ?>" value="<?= $author ?>" checked>
            <?php } ?>
            <label for="<?= $author ?>" ><?= $author ?></label>
            </div>
            <?php
        }
        ?>
    

    </div>

</div>