<?php

class MBTestimonials extends MBComponentBase {
  protected function init_options($options) {
    $options->enabled = true;
    $options->id = "inoby-testimonials";
    $options->title = __("Sekcia s odporúčaniami", "inoby");
    $options->icon = "testimonial";
    $options->render_template = get_theme_file_path("components/testimonials/template.php");
    $options->fields = [
      [
        'id'       => 'component-testimonials-headline',
        'name'    => __('Nadpis', 'inoby'),
        'placeholder'   => __('Vložte nadpis', 'inoby'),
        'type'     => 'text',
        'sanitize_callback' => 'none',
      ],
      [
        'id'       => 'component-testimonials-text',
        'name'    => __('Text', 'inoby'),
        'placeholder'   => __('Vložte text', 'inoby'),
        'type'     => 'textarea',
        'sanitize_callback' => 'none',
      ],
      [
        'id'               => "component-testimonials-image",
        'name'             => __('Obrázok', 'inoby'),
        'type'             => 'image_advanced',
        'force_delete'     => false,
        'max_file_uploads' => 1,
        'max_status'       => false,
        'image_size'       => 'thumbnail',
      ],
      [
        'id'      => 'component-testimonials-buttons',
        "name" => __("Tlačidlá", "inoby"),
        'type'    => 'text_list',
        'clone' => true,
        'options' => [
            'Zisti viac'      => 'Text',
            'https://www.google.com/' => 'Odkaz',
            '_self' => 'target',
            '' => 'Špeciálna trieda',
        ],
        "add_button" => __("Pridať tlačidlo", "inoby"),
      ],
      [
        "type" => "divider",
      ],
      [
        "type" => "number",
        "id" => "component-testimonials-slider-slides",
        'std'   => 1,
        "name" => __("Počet výrokov za slide", "inoby"),
      ],
      [
        "type" => "checkbox",
        "id" => "component-testimonials-slider-infinite",
        "name" => __("Je slider nekonečný?", "inoby"),
      ],
      [
        "type" => "checkbox",
        "id" => "component-testimonials-slider-automatic",
        "name" => __("Automaticky", "inoby"),
      ],
      [
        "type" => "checkbox",
        "id" => "component-testimonials-slider-arrows",
        "name" => __("Zobraziť šípky", "inoby"),
      ],
      [
        "type" => "divider",
      ],
      [
        'group_title'   => __('Výrok - {text}', 'inoby'),
        'id'            => 'component-testimonials',
        'type'          => 'group',
        'clone'         => true,
        'collapsible'   => true,
        'sort_clone'    => true,
        'add_button'    => __('Pridať ďalší výrok', 'inoby'),
        'fields' => array(
          [
            'id'       => 'testimonial-short',
            'name'    => __('Výrok', 'inoby'),
            'placeholder'   => __('Napíšte výrok', 'inoby'),
            'type'     => 'textarea',
            'sanitize_callback' => 'none',
          ],
          [
            'id'       => 'testimonial-long',
            'name'    => __('Výrok - Dlhá verzia (vo vyskakovacom okne)', 'inoby'),
            'placeholder'   => __('Napíšte výrok', 'inoby'),
            'type'     => 'textarea',
            'sanitize_callback' => 'none',
          ],
          [
            'id'       => 'author',
            'name'    => __('Autor', 'inoby'),
            'placeholder'   => __('Meno a priezvisko', 'inoby'),
            'type'     => 'text',
          ],
          [
            'id'       => 'author-designation',
            'name'    => __('Informácia o autorovi', 'inoby'),
            'placeholder'   => __('Pozícia', 'inoby'),
            'type'     => 'text',
          ],
          [
            'id'               => "author-image",
            'name'             => __('Fotka autora', 'inoby'),
            'type'             => 'image_advanced',
            'force_delete'     => false,
            'max_file_uploads' => 1,
            'max_status'       => false,
            'image_size'       => 'thumbnail',
          ],
        )
      ],
    ];
  }
}