<?php

class MBHero extends MBComponentBase {
  protected function init_options($options) {
    $options->enabled = true;
    $options->id = "inoby-hero";
    $options->title = __("Úvodný banner", "inoby");
    $options->icon = "welcome-view-site";
    $options->render_template = get_theme_file_path(
      "components/hero/template.php",
    );
    $options->fields = [
      [
        "id" => "hero_bg",
        "name" => __("Pozadie", "inoby"),
        "type" => "image_advanced",
        "force_delete" => false,
        "max_file_uploads" => 1,
        "max_status" => false,
        "image_size" => "thumbnail",
      ],
      [
        "type" => "checkbox",
        "id" => "hero_as_bg_video",
        "desc" => __("Chcem ako pozadie video", "inoby"),
        "std" => 0,
      ],
      [
        "id" => "hero_bg_video",
        "name" => __("Video pozadie", "inoby"),
        "label_description" => __(
          "Zadajte video nižšie, ideálne vo formáte .mp4",
          "inoby",
        ),
        "type" => "video",
        "max_file_uploads" => 1,
        "force_delete" => false,
        "max_status" => false,
        "visible" => ["hero_as_bg_video", "match", ["true"]],
      ],
      [
        "type" => "divider",
      ],
      [
        "name" => __("Nadpis", "inoby"),
        "placeholder" => __("Vložte nadpis", "inoby"),
        "id" => "hero_headline",
        "type" => "text",
        "sanitize_callback" => "none",
        "translate" => true,
      ],
      [
        "name" => __("Tlačidlo - Text", "inoby"),
        "placeholder" => __("Vložte text", "inoby"),
        "id" => "hero_btn",
        "type" => "text",
        "translate" => true,
      ],
      [
        "name" => __("Tlačidlo - Odkaz", "inoby"),
        "placeholder" => __("Vložte odkaz", "inoby"),
        "id" => "hero_url",
        "type" => "text",
        "translate" => true,
      ],
      [
        "group_title" => __("CTA sekcia - {headline}", "inoby"),
        "id" => "cta",
        "type" => "group",
        "clone" => true,
        "collapsible" => true,
        "sort_clone" => true,
        "max_clone" => 3,
        "add_button" => __("Pridať ďalšiu sekciu", "inoby"),
        "fields" => [
          [
            "id" => "bg",
            "name" => __("Pozadie", "inoby"),
            "type" => "image_advanced",
            "force_delete" => false,
            "max_file_uploads" => 1,
            "max_status" => false,
            "image_size" => "thumbnail",
          ],
          [
            "id" => "headline",
            "title" => __("Nadpis", "inoby"),
            "placeholder" => __("Vložte nadpis", "inoby"),
            "type" => "text",
            "sanitize_callback" => "none",
            "translate" => true,
          ],
          [
            "id" => "text",
            "title" => __("Text", "inoby"),
            "placeholder" => __("Vložte text", "inoby"),
            "type" => "text",
            "sanitize_callback" => "none",
            "translate" => true,
          ],
          [
            "id" => "url",
            "title" => __("Odkaz", "inoby"),
            "placeholder" => __("Vložte odkaz", "inoby"),
            "type" => "text",
            "translate" => true,
          ],
        ],
      ],
    ];
  }
}
