55 lines
3.6 KiB
PHP
55 lines
3.6 KiB
PHP
<?php
|
|
use Bitrix\Main\Localization\Loc;
|
|
|
|
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
|
die();
|
|
}
|
|
|
|
$query = (string)($arResult["REQUEST"]["~QUERY"] ?? "");
|
|
$items = $arResult["VINO_ITEMS"];
|
|
?>
|
|
<section class="vino-razdel-hero">
|
|
<div class="vino-wrap">
|
|
<?php \Jinove\Vinoteca\Breadcrumbs::show(array(array(Loc::getMessage("VINO_SEARCH_PAGE_H1")))); ?>
|
|
<h1 class="vino-razdel-hero__title"><?= Loc::getMessage("VINO_SEARCH_PAGE_H1") ?></h1>
|
|
<form class="vino-search-page__form vino-query" action="<?= htmlspecialcharsbx(\Jinove\Vinoteca\Search::folder()) ?>" method="get" role="search">
|
|
<label class="vino-query__field">
|
|
<span class="vino-sr-only"><?= Loc::getMessage("VINO_SEARCH_PAGE_LABEL") ?></span>
|
|
<svg class="vino-query__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"></circle><path d="m20 20-3.6-3.6"></path></svg>
|
|
<input class="vino-query__input" type="search" name="q" value="<?= htmlspecialcharsbx($query) ?>" placeholder="<?= htmlspecialcharsbx((string)Loc::getMessage("VINO_SEARCH_PAGE_PLACEHOLDER")) ?>" autocomplete="off" enterkeyhint="search" required>
|
|
</label>
|
|
<button class="vino-btn vino-query__submit" type="submit"><?= Loc::getMessage("VINO_SEARCH_PAGE_SUBMIT") ?></button>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
<section class="vino-search-page">
|
|
<div class="vino-wrap">
|
|
<?php if ($query === ""): ?>
|
|
<p class="vino-search-page__status"><?= Loc::getMessage("VINO_SEARCH_PAGE_EMPTY_QUERY") ?></p>
|
|
<?php elseif ((int)$arResult["ERROR_CODE"] !== 0): ?>
|
|
<p class="vino-search-page__status"><?= Loc::getMessage("VINO_SEARCH_PAGE_ERROR") ?></p>
|
|
<?php elseif (!$items): ?>
|
|
<p class="vino-search-page__status"><?= Loc::getMessage("VINO_SEARCH_PAGE_NOTHING", array("#QUERY#" => htmlspecialcharsbx($query))) ?></p>
|
|
<a class="vino-btn vino-search-page__catalog" href="<?= SITE_DIR ?>catalog/"><?= Loc::getMessage("VINO_SEARCH_PAGE_CATALOG") ?></a>
|
|
<?php else: ?>
|
|
<p class="vino-search-page__status" role="status"><?= Loc::getMessagePlural("VINO_SEARCH_PAGE_FOUND", $arResult["VINO_TOTAL"], array("#COUNT#" => $arResult["VINO_TOTAL"], "#QUERY#" => htmlspecialcharsbx($query))) ?></p>
|
|
<ul class="vino-search-page__list">
|
|
<?php foreach ($items as $item): ?>
|
|
<li class="vino-search-page__item">
|
|
<span class="vino-search-page__pic">
|
|
<?php if ($item["image"] !== ""): ?><img class="vino-search-page__img" src="<?= htmlspecialcharsbx($item["image"]) ?>" alt="" loading="lazy" decoding="async"><?php endif; ?>
|
|
</span>
|
|
<span class="vino-search-page__body">
|
|
<span class="vino-search-page__kind"><?= htmlspecialcharsbx($item["label"]) ?></span>
|
|
<a class="vino-search-page__link" href="<?= htmlspecialcharsbx($item["url"]) ?>"><?= htmlspecialcharsbx($item["name"]) ?></a>
|
|
<?php if ($item["meta"] !== ""): ?><span class="vino-search-page__text"><?= htmlspecialcharsbx($item["meta"]) ?></span><?php endif; ?>
|
|
</span>
|
|
<?php if ($item["price"] !== ""): ?><span class="vino-search-page__price"><?= htmlspecialcharsbx($item["price"]) ?></span><?php endif; ?>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
<?= $arResult["NAV_STRING"] ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</section>
|