<?php

class MBVideoSlider extends MBComponentBase {
  protected function init_options($options) {
    $options->enabled = true;
    $options->id = "inoby-video-slider";
    $options->title = __("Video slider", "inoby");
    $options->icon = "embed-video";
    $options->render_template = get_theme_file_path("components/video-slider/template.php");
    $options->fields = [
      [
        'name'          => __('Nadpis', 'inoby'),
        'id'            => 'video_slider_headline',
        'type'          => 'text',
        'sanitize_callback' => 'none',
      ],
      [
        "type" => "number",
        "id" => "video_slider_per_slide",
        'std'   => 1,
        "name" => __("Počet videí za slide", "inoby"),
      ],
      [
        "type" => "checkbox",
        "id" => "video_slider_infinite",
        "name" => __("Je slider nekonečný?", "inoby"),
      ],
      [
        "type" => "checkbox",
        "id" => "video_slider_auto",
        "name" => __("Automaticky", "inoby"),
      ],
      [
        "type" => "checkbox",
        "id" => "video_slider_arrows",
        "name" => __("Zobraziť šípky", "inoby"),
      ],
      [
        'type'          => 'divider',
      ],
      [
        'group_title'   => __('Video - {#}', 'inoby'),
        'id'            => 'video_slider_videos',
        'type'          => 'group',
        'clone'         => true,
        'collapsible'   => true,
        'sort_clone'    => true,
        'add_button'    => __('Pridať ďalšie video', 'inoby'),
        'fields' => array(
          [
            "name" => __("Náhľadový obrázok", "inoby"),
            "id" => "thumbnail",
            "type" => "image_advanced",
            "force_delete" => false,
            "max_file_uploads" => 1,
            "max_status" => true,
            "image_size" => "thumbnail",
          ],
          [
            "name" => __("Text tlačidla prehrávania", "inoby"),
            "id" => "play-text",
            "type" => "text",
          ],
          [
            "name" => __("Odkaz na video", "inoby"),
            "id" => "src",
            "type" => "text",
          ],
        )
      ],
    ];
  }
}