<?php

class MBPartners extends MBComponentBase
{
  protected function init_options($options)
  {
    $options->enabled = true;
    $options->id = "inoby-partners";
    $options->title = __("Partneri", "inoby");
    $options->icon = "dashicons dashicons-grid-view";
    $options->render_template = get_theme_file_path("components/partners/template.php");
    $options->fields = [
      [
        'name'    => 'Počet stĺpcov',
        'id'      => 'partners-columns',
        'type'    => 'radio',
        'inline'  => false,
        'options' => [
          '1' => __('1 stĺpec', 'inoby'),
          '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'),
          '7' => __('7 stĺpcov', 'inoby'),
          '8' => __('8 stĺpcov', 'inoby'),
        ],
      ],
      [
        'group_title'   => __('Partner {#}', 'inoby'),
        'id'            => 'partners',
        'type'          => 'group',
        'clone'         => true,
        'collapsible'   => true,
        'default_state' => 'collapsed',
        'sort_clone'    => true,
        'add_button'    => __('Pridať partnera', 'inoby'),
        'fields' => array(
          [
            'id'               => "partner_logo",
            'name'             => __('Logo partnera', 'inoby'),
            'type'             => 'image_advanced',
            'force_delete'     => false,
            'max_file_uploads' => 1,
            'max_status'       => false,
            'image_size'       => 'thumbnail',
          ],
          [
            'id'       => 'partner_url',
            'title'    => __('Link partnera', 'inoby'),
            'placeholder'   => __('Vložte link partnera', 'inoby'),
            'type'     => 'text',
          ],
        )
      ],
    ];
  }
}