<?php

class MBStatistics extends MBComponentBase {
  protected function init_options($options) {
    $options->enabled = true;
    $options->id = "inoby-statistics";
    $options->title = __("Štatistiky", "inoby");
    $options->icon = "dashicons dashicons-megaphone";
    $options->render_template = get_theme_file_path("components/statistics/template.php");
    $options->fields = [
      [
        'name'    => 'Počet stĺpcov',
        'id'      => 'statistics-columns',
        'type'    => 'radio',
        'inline'  => false,
        'options' => [
            '2' => __('2 stĺpce', 'inoby'),
            '3' => __('3 stĺpce', 'inoby'),
            '4' => __('4 stĺpce', 'inoby'),
            '5' => __('5 stĺpcov', 'inoby'),
            '6' => __('6 stĺpcov', 'inoby'),
        ],
      ],
      [
        'group_title'   => __('Štatistika {#}', 'inoby'),
        'id'            => 'statistics',
        'type'          => 'group',
        'clone'         => true,
        'collapsible'   => true,
        'default_state' => 'collapsed',
        'sort_clone'    => true,
        'add_button'    => __('Pridať ďalšiu štatistiku', 'inoby'),
        'fields' => array(
          [
            'id'       => 'headline',
            'title'    => __('Nadpis', 'inoby'),
            'placeholder'   => __('Vložte nadpis', 'inoby'),
            'type'     => 'text',
            'sanitize_callback' => 'none',
          ],
          [
            'id'       => 'text',
            'title'    => __('Text', 'inoby'),
            'placeholder'   => __('Vložte text', 'inoby'),
            'type'     => 'textarea',
            'sanitize_callback' => 'none',
          ],
        )
      ],
    ];
  }
}