<?php

class MBDownloads extends MBComponentBase {
  protected function init_options($options) {
    $options->enabled = true;
    $options->id = "inoby-downloads";
    $options->title = __("Na stiahnutie", "inoby");
    $options->icon = "category";
    $options->render_template = get_theme_file_path("components/downloads/template.php");
    $options->fields = [
      [
        'group_title'   => __('Súbor {name}', 'inoby'),
        'id'            => 'component-downloads',
        'type'          => 'group',
        'clone'         => true,
        'collapsible'   => true,
        'sort_clone'    => true,
        'add_button'    => __('Pridať ďalší súbor', 'inoby'),
        'fields' => array(
          [
            'id'       => 'name',
            'name'    => __('Názov súboru', 'inoby'),
            'placeholder'   => __('Vložte názov', 'inoby'),
            'type'     => 'text',
          ],
          [
            'id'               => 'files',
            'name'    => __('Súbory', 'inoby'),
            'type'             => 'file_advanced',
            'force_delete'     => false,
            'max_file_uploads' => 3,
            'mime_type'        => 'application,audio,video',
            'max_status'       => false,
          ],
        )
      ],
    ];
  }
}