<?php

class MBCarouselBoxes extends MBComponentBase
{
  protected function init_options($options)
  {
    $options->enabled = true;
    $options->id = "inoby-carousel-boxes";
    $options->title = __("Carousel", "inoby");
    $options->icon = "welcome-view-site";
    $options->render_template = get_theme_file_path("components/carousel-boxes/template.php");
    $options->fields = [
      //per_slide_lg
      [
        'id'       => 'per_slide_lg',
        'name'    => __('Počet položiek na desktope', 'inoby'),
        'type'     => 'number',
        'std'  => 4,
        'attributes' => [
          'min' => 1,
          'max' => 12,
          'step' => 0.01,
        ],
      ],
      //per_slide_md
      [
        'id'       => 'per_slide_md',
        'name'    => __('Počet položiek na tablete', 'inoby'),
        'type'     => 'number',
        'std'  => 2.33,
        'attributes' => [
          'min' => 1,
          'max' => 12,
          'step' => 0.01,
        ],
      ],
      //per_slide_sm
      [
        'id'       => 'per_slide_sm',
        'name'    => __('Počet položiek na mobile', 'inoby'),
        'type'     => 'number',
        'std'  => 1.33,
        'attributes' => [
          'min' => 1,
          'max' => 12,
          'step' => 0.01,
        ],
      ],
      //spacing
      [
        'id'       => 'spacing',
        'name'    => __('Medzera v [px]', 'inoby'),
        'type'     => 'number',
        'std'  => 0,
        'attributes' => [
          'min' => 0,
          'max' => 100,
          'step' => 1,
        ],
      ],
      [
        'group_title'   => __('Sekcia - {headline}', 'inoby'),
        'id'            => 'carousel-boxes',
        'type'          => 'group',
        'clone'         => true,
        'collapsible'   => true,
        'sort_clone'    => true,
        'add_button'    => __('Pridať ďalšiu sekciu', 'inoby'),
        'fields' => array(
          [
            'id'               => "bg",
            'name'             => __('Pozadie', 'inoby'),
            'type'             => 'image_advanced',
            'force_delete'     => false,
            'max_file_uploads' => 1,
            'max_status'       => false,
            'image_size'       => 'thumbnail',
          ],
          [
            'id'       => 'headline',
            'name'    => __('Nadpis', 'inoby'),
            'placeholder'   => __('Vložte nadpis', 'inoby'),
            'type'     => 'text',
            'sanitize_callback' => 'none',
          ],
          [
            'id'       => 'text',
            'name'    => __('Text', 'inoby'),
            'placeholder'   => __('Vložte text', 'inoby'),
            'type'     => 'text',
            'sanitize_callback' => 'none',
          ],
          [
            'id'       => 'url',
            'name'    => __('Odkaz', 'inoby'),
            'placeholder'   => __('Vložte odkaz', 'inoby'),
            'type'     => 'text',
          ],
        )
      ],
    ];
  }
}
