summaryrefslogtreecommitdiff
path: root/src/application/views/form_delete_post_confirm.php
blob: 2dc417d0340f395a93a2abfc16e7a8aee4ecb2bb (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
<div class="panel panel-danger">
    <div class="panel-heading">
        <?php if ($postAuthor->id === $GLOBALS["currentUser"]->id): ?>
            <h3 class="panel-title">Do you want to delete your post?</h3>
        <?php else: ?>
            <h3 class="panel-title">Do you want to delete <?= htmlentities($postAuthor->displayName) ?>'s post?</h3>
        <?php endif; ?>
    </div>
    <div class="panel-body">
        Are you sure you want to delete the following post:<br>
        <?php _view("view_post", [
                ...$___PARAMS,
                "hide_actions" => true
            ]) ?>
    </div>
    <div class="panel-footer">
        <div class="text-right">
            <form action=".#post-<?= htmlentities(urlencode($post->id)) ?>" method="get" class="seamless-inline">
                <input type="hidden" name="_action" value="viewtopic">
                <input type="hidden" name="topic" value="<?= htmlentities($post->topicId) ?>">
                <button class="btn btn-default">Keep my post</button>
            </form>
            <form action="?_action=deletepost" method="post" class="seamless-inline">
                <input type="hidden" name="post" value="<?= htmlentities($post->id) ?>">
                <input type="hidden" name="confirm" value="<?= htmlentities(base64_encode(hash("sha256", "confirm" . $post->id, true))); ?>">
                <button class="btn btn-danger">Delete my post</button>
            </form>
        </div>
    </div>
</div>