<?php

class MBCounter extends MBComponentBase
{
  protected function init_options($options)
  {
    $options->enabled = true;
    $options->id = "inoby-counter";
    $options->title = __("Počítadlo", "inoby");
    $options->icon = "visibility";
    $options->render_template = get_theme_file_path("components/counter/template.php");
    $options->fields = [
      [
        'id'       => 'inoby-counter-columns',
        'title'    => __('Počet stĺpcov', 'inoby'),
        'type'     => 'select',
        'options'  => [
          1 => __('1 stĺpec', 'inoby'),
          2 => __('2 stĺpce', 'inoby'),
          3 => __('3 stĺpce', 'inoby'),
          4 => __('4 stĺpce', 'inoby'),
        ],
        'default'  => 3,
      ],
      [
        'group_title'   => __('Counter - {headline}', 'inoby'),
        'id'            => 'component-counter',
        'type'          => 'group',
        'clone'         => true,
        'collapsible'   => true,
        'sort_clone'    => true,
        'add_button'    => __('Pridať ďalšiu sekciu', 'inoby'),
        'fields' => array(
          //number
          [
            'id'       => 'number',
            'title'    => __('Číslo', 'inoby'),
            'placeholder'   => __('Vložte číslo', 'inoby'),
            'type'     => 'number',
            'attributes' => [
              'min' => 0,
              'step' => 1,
            ],
          ],
          //symble
          [
            'id'       => 'symbol',
            'title'    => __('Symbol', 'inoby'),
            'placeholder'   => __('Vložte symbol (napr. %,$,...)', 'inoby'),
            'type'     => 'text',
            'sanitize_callback' => 'none',
          ],
          //title
          [
            'id'       => 'headline',
            'title'    => __('Nadpis', 'inoby'),
            'placeholder'   => __('Vložte nadpis', 'inoby'),
            'type'     => 'text',
            'sanitize_callback' => 'none',
          ],
        )
      ],
    ];
  }
}