summaryrefslogtreecommitdiff
path: root/src/application/views/form_newtopic.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/application/views/form_newtopic.php')
-rw-r--r--src/application/views/form_newtopic.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/application/views/form_newtopic.php b/src/application/views/form_newtopic.php
new file mode 100644
index 0000000..d5cbfbd
--- /dev/null
+++ b/src/application/views/form_newtopic.php
@@ -0,0 +1,24 @@
+<?php
+
+use mystic\forum\Messaging;
+use mystic\forum\utils\RequestUtils;
+
+if (($_formError = RequestUtils::getAndClearFormError()) !== null) {
+ Messaging::error($_formError);
+}
+
+$lastFormUri = "";
+$lastForm = RequestUtils::getLastForm($lastFormUri) ?? [];
+if ($lastFormUri !== $_SERVER["REQUEST_URI"]) $lastForm = [];
+RequestUtils::clearLastForm();
+
+?>
+<form action="<?= htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post">
+<strong>Topic title:</strong><br>
+<input type="text" name="title" value="<?= htmlentities($lastForm["title"] ?? "") ?>" required><br>
+
+<strong>Message:</strong><br>
+<textarea name="message" rows="12" cols="60" required></textarea><br>
+
+<button type="submit">Create topic</button>
+</form>