aboutsummaryrefslogtreecommitdiff
path: root/public/w/article.php
blob: e5cfff79ebd36611c6e33218ff24328cb2d74baa (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
<?php

if ($app->exist($_GET['id'])) {

    $art = $app->get($_GET['id']);

    if (isset($_GET['edit']) and $_GET['edit'] == 1 and $app->session() >= $app::EDITOR) {
        echo '<section class=edit>';
        $aff->edit($art, $app, $app->getlister(['id', 'titre']));
        $aff->copy($art, $app->getlister(['id', 'titre']));
        $aff->aside($app);
        echo '</section>';
    } else {
        echo '<section class="lecture">';
        $aff->lecture($art, $app);
        echo '</section>';

    }
} else {
    echo '<span class="alert">This article does not exist yet</span>';

    if ($app->session() >= $app::EDITOR) {
        echo '<form action="?id=' . $_GET['id'] . '&edit=1" method="post"><input type="hidden" name="action" value="new"><input type="submit" value="Create"></form>';
    }

}

?>