<?php

class MBSideGraphics extends MBComponentBase {
  protected function init_options($options) {
    $options->enabled = true;
    $options->id = "inoby-side-graphics";
    $options->title = __("Postranná grafika", "inoby");
    $options->icon = "heart";
    $options->render_template = get_theme_file_path("components/side-graphics/template.php");
    $options->fields = [
      [
        'id'               => "component-side-graphics",
        'title'            => __('Grafika', 'inoby'),
        'type'             => 'image_advanced',
        'force_delete'     => false,
        'max_file_uploads' => 1,
        'max_status'       => false,
        'image_size'       => 'thumbnail',
      ],
      [
        'name'      => __('X posun', 'inoby'),
        'id'         => "component-side-graphics-x",
        'type'       => 'slider',
        'js_options' => [
            'min'   => -1000,
            'max'   => 1000,
            'step'  => 1,
        ],
        'std' => -100,
      ],
      [
        'name'      => __('Y posun', 'inoby'),
        'id'         => "component-side-graphics-y",
        'type'       => 'slider',
        'js_options' => [
            'min'   => -1000,
            'max'   => 1000,
            'step'  => 1,
        ],
        'std' => -50,
      ],
      [
        'name'      => __('Šírka grafiky (v px)', 'inoby'),
        'id'              => 'component-side-graphics-width',
        'type' => 'number',
        'min'   => 10,
        'max'   => 1000,
        'step'  => 5,
      ],
      [
        'name'           => __('Výber strany', 'inoby'),
        'id'              => 'component-side-graphics-side',
        'type'            => 'select_advanced',
        'options'         => [
            'left: 0px;'          => 'Vľavo',
            'right: 0px;'          => 'Vpravo',
        ],
        'placeholder'     => 'Vyberte zarovnanie',
      ],
    ];
  }
}