<?php

class MBHeroSlider extends MBComponentBase {
  protected function init_options($options) {
    $options->enabled = true;
    $options->id = "inoby-hero-slider";
    $options->title = __("Úvodný slider", "inoby");
    $options->icon = "slides";
    $options->render_template = get_theme_file_path("components/hero-slider/template.php");
    $options->fields = [
      [
        "type" => "checkbox",
        "id" => "hero_slider_infinite",
        "name" => __("Je slider nekonečný?", "inoby"),
      ],
      [
        "type" => "checkbox",
        "id" => "hero_slider_auto",
        "name" => __("Automaticky", "inoby"),
      ],
      [
        "type" => "checkbox",
        "id" => "hero_slider_arrows",
        "name" => __("Zobraziť šípky", "inoby"),
      ],
      [
        'type'          => 'divider',
      ],
      [
        'group_title'   => __('Slide - {heading}', 'inoby'),
        'id'            => 'hero_slider_slides',
        'type'          => 'group',
        'clone'         => true,
        'collapsible'   => true,
        'sort_clone'    => true,
        'add_button'    => __('Pridať ďalší slide', 'inoby'),
        'fields' => array(
          [
            "name" => __("Nadpis", "inoby"),
            "id" => "heading",
            "type" => "text",
            "sanitize_callback" => "none",
          ],
          [
            "name" => __("Text", "inoby"),
            "id" => "text",
            "type" => "text",
            "sanitize_callback" => "none",
          ],
          [
            "name" => __("Tlačidlá", "inoby"),
            "group_title" => __("Tlačidlo - {text}", "inoby"),
            "id" => "buttons",
            "type" => "group",
            "clone" => true,
            'sort_clone' => true,
            "collapsible" => true,
            "default_state" => "collapsed",
            "fields" => inoby_mb_button(),
          ],
          [
            "name" => __("Pozadie", "inoby"),
            "id" => "bg",
            "type" => "image_advanced",
            "force_delete" => false,
            "max_file_uploads" => 1,
            "max_status" => true,
            "image_size" => "thumbnail",
          ],
        )
      ],
    ];
  }
}