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