summaryrefslogtreecommitdiff
path: root/src/application/views/form_addpost.php
blob: 88648b477dd0d16c0dd6286e2c0c60f180e2746f (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
<?php

use mystic\forum\utils\RequestUtils;

$lastFormUri = "";
$lastForm = RequestUtils::getLastForm($lastFormUri) ?? [];
if ($lastFormUri !== $_SERVER["REQUEST_URI"]) $lastForm = [];
RequestUtils::clearLastForm();

?>
<h3 id="form">Reply to this topic</h3>
<?php
if (($_formError = RequestUtils::getAndClearFormError()) !== null) {
    _view("alert_error", ["message" => $_formError]);
}
?>
<form action="<?= htmlentities($_SERVER["REQUEST_URI"]) ?>#form" method="post" enctype="multipart/form-data">
<div class="form-group">
    <label for="i_message">Message:</label>
    <textarea class="form-control" id="i_message" name="message" required rows="12" cols="60" style="resize:vertical;max-height:499px"></textarea>
</div>
<div class="form-group">
    <label for="i_files">Attachments: <small>(max. <?= htmlentities(MAX_ATTACHMENT_COUNT) ?> files, max. <?= htmlentities(MAX_ATTACHMENT_SIZE >> 20) ?> MiB each)</small></label>
    <input type="file" name="files[]" id="i_files" multiple accept="*/*">
</div>
<button type="submit" class="btn btn-success">Post reply</button>
</form>