summaryrefslogtreecommitdiff
path: root/src/application/views/form_addpost.php
diff options
context:
space:
mode:
authorJonas Kohl2024-09-12 19:49:17 +0200
committerJonas Kohl2024-09-12 19:49:17 +0200
commit086e2d2668784469ec114f6e6fd2b3dace3d7c3b (patch)
treeb9bacedb713501d88d24085940267a7c94e69b29 /src/application/views/form_addpost.php
parent34b1b391d4b03659a96f868857c230002b351514 (diff)
Way more progress on forum
Diffstat (limited to 'src/application/views/form_addpost.php')
-rw-r--r--src/application/views/form_addpost.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/application/views/form_addpost.php b/src/application/views/form_addpost.php
new file mode 100644
index 0000000..b3cd6ca
--- /dev/null
+++ b/src/application/views/form_addpost.php
@@ -0,0 +1,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:</label>
+ <input type="file" name="files[]" id="i_files" multiple accept="*/*">
+</div>
+<button type="submit" class="btn btn-success">Post reply</button>
+</form>