Initial commit
This commit is contained in:
50
playarea/templates/help_window/select.php
Normal file
50
playarea/templates/help_window/select.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user