Files
BiveEngine/playarea/templates/help_window/select.php
2025-12-24 19:19:01 +03:00

50 lines
1.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
log_message("- Формирую блок фильтров " .time());
$attributes = $variables["attributes"];
$numeric = $variables["numeric"];
$search = new Search(array(
"class" => "Attribute",
"terms" => array("item_slug" => $variables["attribute_slug"])
));
$pages = $search->collect();
if(!$pages) return;
$attribute = $pages[0];
$attribute_slug = $attribute->get_item_slug();
if(!count($attributes)) return;
$attribute_list = array();
foreach ($attributes as $key => $attribute_item) {
if($attribute_item->parent_id != $attribute->item_id) continue;
$attribute_list[] = array(
"slug" => $attribute_item->get_item_slug(),
"title" => $attribute_item->get_item_name()
);
}
if(!count($attribute_list)) return;
$attribute_list = sortArrayByName($attribute_list);
?>
<div class="mt-2 d-flex align-items-center justify-content-between">
<div class="col-6 row align-items-center">
<p class="choose-popup__key col-auto"><?= $attribute->get_item_name(); ?></p>
<div class="choose-popup__tooltip"></div>
</div>
<select name="<?= "filter_" . $attribute_slug; ?>" id="toplivo" class="col-6">
<option>Не выбрано</option>
<?php foreach ($attribute_list as $key => $attribute_item) { ?>
<?php
$item_slug = $attribute_item["slug"];
$active = $_GET["filter_" . $attribute_slug] == $item_slug;
if(!$item_slug) continue;
?>
<option value="<?= $item_slug; ?>"><?= $attribute_item["title"]; ?></option>
<?php } ?>
</select>
</div>