<?php

class MBCalendar extends MBComponentBase {
    protected function init_options($options) {
        $options->enabled = true;
        $options->id = "inoby-calendar";
        $options->title = __("Kalendár", "inoby");
        $options->icon = "calendar-alt";
        $options->render_template = get_theme_file_path("components/calendar/template.php");
        $options->fields = [
            [
                "id" => "calendar_ics",
                "name" => __("Odkaz na .ics kalendár", "inoby"),
                "placeholder" => __("Vložte odkaz", "inoby"),
                "type" => "url",
            ],
            [
                "id" => "calendar_ics_view",
                "name" => __("Zobrazenie kalendára", "inoby"),
                "type" => "select",
                "options" => [
                  "month" => __("Mesačný prehľad", "inoby"),
                  "list" => __("Zoznam", "inoby"),
                ],
                "std" => "month",
            ],
            [
                "id" => "calendar_ics_posts",
                "type" => "number",
                "std" => 4,
                "min" => 1,
                "max" => 12,
                "name" => __("Počet udalostí, ktoré sa majú zobraziť", "inoby"),
                "desc" => __("Povolené hodnoty sú 1 až 12", "inoby"),
                "visible" => ["calendar_ics_view", "=", "list"],
            ],
            [
                "desc" => __("Zobraziť popis udalostí", "inoby"),
                "id" => "calendar_ics_desc",
                "type" => "checkbox",
                "std" => 0,
                "visible" => ["calendar_ics_view", "=", "list"],
            ],
            [
                "desc" => __("Zobraziť organizátora udalostí (ak je uvedený)", "inoby"),
                "id" => "calendar_ics_organizer",
                "type" => "checkbox",
                "std" => 0,
                "visible" => ["calendar_ics_view", "=", "list"],
            ],
        ];
    }
}