aboutsummaryrefslogtreecommitdiff
path: root/app/view/templates/alert.php
blob: c4a54b1c4427246dc8b38ad186a994de7754555f (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
<?php

$this->layout('readerlayout') ?>

<?php
$this->start('head');
?>

<head>
    <?= Config::alertcss() ? '<link href="' . Model::globalpath() . 'global.css" rel="stylesheet" />' : '' ?>
</head>


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



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

<body class="alert">

<main class="alert">






    <?= !empty(Config::alerttitle()) ? '<h1>' . Config::alerttitle() . '</h1>' : '' ?>

    <?php

    $form = '<p>
    <form action="' . $this->url('log') .'" method="post">
    <input type="password" name="pass" id="loginpass" placeholder="password">
    <input type="hidden" name="route" value="pageread/">
    <input type="hidden" name="id" value="' . $page->id() . '">
    <input type="submit" name="log" value="login" id="button">
    </form>
    </p>';


    if(!$pageexist) {
        if(!empty(Config::existnot())) {
            echo '<h2>' . Config::existnot() . '</h2>';
        }
        if(Config::existnotpass() && !$canedit) {
            echo $form;
        }        
    } else {



        switch ($page->secure()) {
            case 1:
                if(!empty(Config::private())) {
                    echo '<h2>' . Config::private() . '</h2>';
                }
                if(Config::privatepass()) {
                    echo $form;
                }
                break;
            
            case 2:
                if(!empty(Config::notpublished())) {
                    echo '<h2>' . Config::notpublished() . '</h2>';
                }
                if(Config::notpublishedpass()) {
                    echo $form;
                }
                break;
        }
    }



    if ($canedit) {
        ?>
        <p><a href="<?= $this->upage('pageadd', $page->id()) ?>">⭐ Create</a></p>            
        <?php
        } elseif(!empty(Config::alertlink())) {
            ?>
            <p><a href="<?= $this->upage('pageread/', Config::alertlink()) ?>"><?= empty(Config::alertlinktext()) ? Config::alertlink() : Config::alertlinktext() ?></a></p>
            <?php
        }


    ?>



</main>


</body>

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