aboutsummaryrefslogtreecommitdiff
path: root/app/view/templates/home.php
blob: fafd87bddef1dae83ed91a8ae4a31fd08599b337 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?php $this->layout('layout', ['title' => 'home', 'stylesheets' => [$css . 'home.css', $css . 'tagcolors.css'], 'favicon' => '']) ?>




<?php $this->start('page') ?>


<body>

    <?php $this->insert('backtopbar', ['user' => $user, 'tab' => 'home', 'pagelist' => $pagelist]) ?>

    <?php if ($user->iseditor()) { ?>



    <?php
        $optlist = $optlist ?? null;
        $this->insert('homemenu', ['user' => $user, 'opt' => $opt, 'optlist' => $optlist, 'pagelist' => $pagelist, 'faviconlist' => $faviconlist, 'thumbnaillist' => $thumbnaillist, 'editorlist' => $editorlist, 'colors' => $colors]);
    ?>


    <main class="home">


        <?php $this->insert('homeopt', ['opt' => $opt, 'user' => $user]) ?>

        <section class="pages">

            <div class="block">

                <h2 class="hidephone">Pages (<?= count($table2) ?>)</h2>

                <div class="scroll">

                    <table id="home2table">
                        <thead>
                            <tr>
                                <?php if($user->issupereditor()) { ?><th id="checkall" class="hidephone">x</th> <?php } ?>
                                <?php if($columns['favicon']) { ?>
                                    <th class="favicon"><a href="<?= $opt->sortbyorder('favicon') ?>">ico</a></th>
                                <?php } ?>
                                <th class="id"><a href="<?= $opt->sortbyorder('id') ?>">id</a></th>
                                <th>edit</th>
                                <th>see</th>
                                <th class="delete" title="delete page">del</th>
                                <?php if ($user->issupereditor()) { ?>
                                <th class="download hidephone" title="download page as json">dl</th>
                                <?php }
                                    if ($columns['tag']) { ?>
                                <th class="tag"><a href="<?= $opt->sortbyorder('tag') ?>">tag</a></th>
                                <?php }
                                    if ($columns['title']) { ?>
                                <th class="title"><a href="<?= $opt->sortbyorder('title') ?>">title</a></th>
                                <?php }
                                    if ($columns['description']) { ?>
                                <th class="summary">summary</th>
                                <?php }
                                    if ($columns['linkto']) { ?>
                                <th class="linkto"><a href="<?= $opt->sortbyorder('linkto') ?>">to</a></th>
                                <?php }
                                    if ($columns['linkfrom']) { ?>
                                <th class="linkfrom"><a href="<?= $opt->sortbyorder('linkfrom') ?>">from</a></th>
                                <?php }
                                    if ($columns['datemodif']) { ?>
                                <th class="datemodif"><a href="<?= $opt->sortbyorder('datemodif') ?>">last modification</a></th>
                                <?php }
                                    if ($columns['datecreation']) { ?>
                                <th class="datecreation"><a href="<?= $opt->sortbyorder('datecreation') ?>">date of creation</a></th>
                                <?php }
                                    if ($columns['date']) { ?>
                                <th class="date"><a href="<?= $opt->sortbyorder('date') ?>">date</a></th>
                                <?php }
                                    if ($columns['secure']) { ?>
                                <th class="secure"><a href="<?= $opt->sortbyorder('secure') ?>">privacy</a></th>
                                <?php }
                                    if ($columns['authors']) { ?>
                                        <th class="authors"><a href="<?= $opt->sortbyorder('authors') ?>">authors</a></th>
                                        <?php }
                                    if ($columns['visitcount']) { ?>
                                <th class="visitcount"><a href="<?= $opt->sortbyorder('visitcount') ?>">visit</a></th>
                                <?php }
                                    if ($columns['editcount']) { ?>
                                <th class="editcount"><a href="<?= $opt->sortbyorder('editcount') ?>">edit</a></th>
                                <?php }
                                    if ($columns['affcount']) { ?>
                                <th class="affcount"><a href="<?= $opt->sortbyorder('affcount') ?>">aff</a></th>
                                <?php } ?>
                            </tr>
                        </thead>
                        <tbody>
                            <?php foreach ($table2 as $item) { ?>
                            <tr>
                                <?php if($user->issupereditor()) { ?><td class="hidephone"><input type="checkbox" name="pagesid[]" value="<?= $item->id() ?>" id="id_<?= $item->id() ?>" form="multi"></td><?php } ?>
                                <?php if($columns['favicon']) { ?>
                                    <td class="favicon"><img class="favicon" src="<?= Wcms\Model::faviconpath() . $item->favicon() ?>" alt="<?= $item->favicon() ?>" title="<?= $item->favicon() ?>"></td>
                                <?php } ?>
                                <td class="id"><label title="<?= $item->title() ?>" for="id_<?= $item->id() ?>"><?= $item->id() ?></label></td>
                                <td><?php if($user->issupereditor() || in_array($user->id(), $item->authors())) { ?><a href="<?= $this->upage('pageedit', $item->id()) ?>"><img src="<?= Wcms\Model::iconpath() ?>edit.png" class="icon"></a><?php } ?></td>
                                <td><a href="<?= $this->upage('pageread/', $item->id()) ?>" target="_blank"><img src="<?= Wcms\Model::iconpath() ?>read.png" class="icon"></a></td>
                            <td class="delete"><?php if($user->issupereditor() || $item->authors() === [$user->id()]) { ?><a href="<?= $this->upage('pagedelete', $item->id()) ?>"></a><?php } ?></td>
                                <?php if ($user->issupereditor()) { ?>
                                <td class="hidephone"><a href="<?= $this->upage('pagedownload', $item->id()) ?>" download><img src="<?= Wcms\Model::iconpath() ?>download.png" class="icon"></a></td>
                                <?php }
                                        if ($columns['tag']) { ?>
                                <td class="tag"><?= $opt->taglinks($item->tag('array')) ?></td>
                                <?php }
                                        if ($columns['title']) { ?>
                                <td class="title" title="<?= $item->title() ?>"><label for="id_<?= $item->id() ?>"><?= $item->title() ?></label></td>
                                <?php }
                                        if ($columns['description']) { ?>
                                <td class="summary" title="<?= $item->description() ?>"><?= $item->description('short') ?></td>
                                <?php }
                                        if ($columns['linkto']) { ?>
                                <td class="linkto"><a title="<?= $item->linkto('string') ?>"><?= $item->linkto('sort') ?></a></td>
                                <?php }
                                        if ($columns['linkfrom']) { ?>
                                <td class="linkfrom"><a title="<?= $item->linkfrom('string') ?>"><?= $item->linkfrom('sort') ?></a></td>
                                <?php }
                                        if ($columns['datemodif']) { ?>
                                <td class="datemodif"><?= $item->datemodif('hrdi') ?></td>
                                <?php }
                                        if ($columns['datecreation']) { ?>
                                <td class="datecreation"><?= $item->datecreation('hrdi') ?></td>
                                <?php }
                                        if ($columns['date']) { ?>
                                <td class="date"><?= $item->date('dmy') ?></td>
                                <?php }
                                        if ($columns['secure']) { ?>
                                <td class="secure"><?= $opt->securelink($item->secure('int') , $item->secure('string')) ?></td>
                                <?php }
                                        if ($columns['authors']) { ?>
                                <td class="authors"><?= $opt->authorlinks($item->authors('array')) ?></td>
                                <?php }
                                        if ($columns['visitcount']) { ?>
                                <td class="visitcount"><?= $item->visitcount() ?></td>
                                <?php }
                                        if ($columns['editcount']) { ?>
                                <td class="editcount"><?= $item->editcount() ?></td>
                                <?php }
                                        if ($columns['affcount']) { ?>
                                <td class="affcount"><?= $item->affcount() ?></td>
                                <?php } ?>
                            </tr>

                            <?php  } ?>
                        </tbody>
                    </table>
                </div>

            </div>

        </section>


        <?php if($user->display()['bookmark'] && (!empty(Wcms\Config::bookmark()) || !empty($user->bookmark()))) { ?>

        <section class="hidephone" id="bookmark">
            <div class="block">
                <h2>Bookmarks</h2>
                <div class="scroll">
                    <strong>Public</strong>
                    <ul>
                        <?php foreach (Wcms\Config::bookmark() as $id => $query) { ?>
                            <li>
                                <a href="<?= $query ?>"><?= $id ?></a>
                            </li>
                        <?php } ?>
                    </ul>
                    <strong><?= $user->id() ?></strong>
                    <ul>
                        <?php foreach ($user->bookmark() as $id => $query) { ?>
                            <li>
                                <a href="<?= $query ?>"><?= $id ?></a>
                            </li>
                        <?php } ?>
                    </ul>
                </section>
            </div>
        </nav>

        <?php } ?>

    </main>

    <?php $this->insert('footer', ['footer' => $footer]) ?>

    <script src="<?= Wcms\Model::jspath() ?>home.bundle.js"></script>

    <?php } ?>

</body>



<?php $this->stop() ?>