diff options
author | Jonas Kohl | 2024-09-17 14:51:23 +0200 |
---|---|---|
committer | Jonas Kohl | 2024-09-17 14:51:23 +0200 |
commit | a65d424263adfbff9629c7d91a613e4504c84613 (patch) | |
tree | 7d89c6d85168427782ae8c24625db14df90e376a /src/application/views/form_search.php | |
parent | f6dd78734f86f8daed7c5d472e7a199301095ff8 (diff) |
Add search
Diffstat (limited to 'src/application/views/form_search.php')
-rw-r--r-- | src/application/views/form_search.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/application/views/form_search.php b/src/application/views/form_search.php new file mode 100644 index 0000000..edc68b8 --- /dev/null +++ b/src/application/views/form_search.php @@ -0,0 +1,28 @@ +<?php + +use mystic\forum\utils\RequestUtils; + +$lastFormUri = ""; +$lastForm = RequestUtils::getLastForm($lastFormUri) ?? []; +if ($lastFormUri !== $_SERVER["REQUEST_URI"]) $lastForm = []; +RequestUtils::clearLastForm(); + +?> +<div class="page-header margin-top-0"> + <h1><?= __("Search") ?></h1> +</div> +<?php +if (($_formError = RequestUtils::getAndClearFormError()) !== null) { + _view("alert_error", ["message" => $_formError]); +} +?> +<form action="<?= htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post"> + <div class="form-group"> + <div class="input-group"> + <input class="form-control" type="search" id="i_query" name="query" value="<?= htmlentities($lastForm["query"] ?? $query ?? "") ?>" required autofocus> + <div class="input-group-btn"> + <button class="btn btn-primary" type="submit"><?= __("Search") ?></button> + </div> + </div> + </div> +</form> |