<?php

class MBPriceList extends MBComponentBase {
  protected function init_options($options) {
    $options->enabled = true;
    $options->id = "inoby-pricelist";
    $options->title = __("Cenník", "inoby");
    $options->icon = "list-view";
    $options->render_template = get_theme_file_path("components/pricelist/template.php");
    $options->fields = [
      [
        'id'       => 'pricelist-headline',
        'name'    => __('Nadpis', 'inoby'),
        'placeholder'   => __('Vložte nadpis', 'inoby'),
        'type'     => 'text',
        'sanitize_callback' => 'none',
      ],
      [
        'id'       => 'pricelist-subheadline',
        'name'    => __('Podnadpis', 'inoby'),
        'placeholder'   => __('Vložte podnadpis', 'inoby'),
        'type'     => 'text',
        'sanitize_callback' => 'none',
      ],
      [
        'id'       => 'pricelist-text',
        'name'    => __('Text', 'inoby'),
        'placeholder'   => __('Vložte text', 'inoby'),
        'type'     => 'textarea',
        'sanitize_callback' => 'none',
      ],
      [
        'group_title'   => __('Položka - {service}', 'inoby'),
        'id'            => 'pricelist',
        'type'          => 'group',
        'clone'         => true,
        'collapsible'   => true,
        'sort_clone'    => true,
        'add_button'    => __('Pridať ďalšiu položku', 'inoby'),
        'fields' => array(
          [
            'id'       => 'service',
            'name'    => __('Služba', 'inoby'),
            'type'     => 'text',
            'sanitize_callback' => 'none',
          ],
          [
            'id'       => 'fee',
            'name'    => __('Poplatok', 'inoby'),
            'type'     => 'text',
            'sanitize_callback' => 'none',
          ],
          [
            'id'       => 'payment',
            'name'    => __('Úhrada', 'inoby'),
            'type'     => 'text',
            'sanitize_callback' => 'none',
          ],
        )
      ],
      [
        'id'       => 'pricelist-bottomtext',
        'name'    => __('Spodný text', 'inoby'),
        'placeholder'   => __('Vložte text', 'inoby'),
        'type'     => 'textarea',
        'sanitize_callback' => 'none',
      ],
    ];
  }
}