<?php

class MBBlockFilter extends MBComponentBase {
  protected function init_options($options) {
    $options->enabled = true;
    $options->id = "inoby-block-filter";
    $options->title = __("Filter blokov", "inoby");
    $options->description = __("Vyfiltruje bloky podľa ID", "inoby");
    $options->icon = "fas fa-filter";
    $options->render_template = get_theme_file_path("components/block-filter/template.php");
    $options->fields = [
      [
        "id" => "context",
        "type" => "select",
        "name" => __("Záber filtra", "inoby"),
        "options" => [
          "this" => __("Filtrovať len vnorené bloky", "inoby"),
          "site" => __("Filtrovať bloky na celej stránke", "inoby"),
        ],
      ],
      [
        "id" => "filters",
        "type" => "group",
        "name" => __("Filtre", "inoby"),
        "clone" => true,
        "collapsible" => true,
        "default_state" => "collapsed",
        "group_title" => "{#}. {label}",
        // "max_clone" => 4,
        "add_button" => __("Pridať filter", "inoby"),
        "fields" => [
          [
            "id" => "label",
            "name" => __("Nadpis filtru", "inoby"),
            "type" => "text",
          ],
          [
            "id" => "id",
            "name" => __("ID bloku", "inoby"),
            "desc" => __("ID nájdete v Blok > Pokročilé > HTML kotva", "inoby"),
            "type" => "text",
          ],
        ],
      ],
      [
        "type" => "custom_html",
        "std" => "<div>" . __("Pozor! Filter skryje len tie položky, ktoré sú definové v jednotlivých filtroch!", "inoby") . "</div>",
      ],
    ];
  }
}
