<?php

    return [
        "type"           => "blocks",
        "model"          => App\Models\Block::class,
        "label"          => "Blocos",
        "label_singular" => "Bloco",
        "group"          => "blocos",
        "order"          => true,
        "fields"         => [
            [
                "name"          => "title",
                "label"         => "Título de backend",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => true,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:150",
                "inList"        => true,
                "search"        => true,
                "sort"          => true
            ],
            [
                "name"          => "block_title",
                "label"         => "Título do bloco",
                "type"          => "textBox",
                "maxLength"     => 300,
                "multiLanguage" => true,
                "preValidation" => "xss_clean|trim",
                "validation"    => "max:300",
                "inList"        => false,
                "search"        => false,
                "sort"          => false,
            ],
            [
                "name"          => "backgroundImage",
                "label"         => "Imagem de fundo",
                "type"          => "mediaPicker",
                "multiple"      => false,
                "mediaType"     => "image",
            ],
            [
                "name"          => "type",
                "label"         => "Tipo de bloco",
                "type"          => "selectBox",
                "list"          => [
                    "centerImage" => "Bloco com imagem alinhada ao centro",
                    "leftImage"   => "Bloco com imagem alinhada à esquerda",
                    "rightImage"  => "Bloco com imagem alinhada à direita",
                ],
                "preValidation" => "trim",
                "validation"    => "required|in:centerImage,leftImage,rightImage",
                "placement"     => "sidebar"
            ],
            [
                "name"          => "block_size",
                "label"         => "Tamanho do bloco",
                "type"          => "selectBox",
                "list"          => [
                    "normal" => "Normal",
                    "small"  => "Pequeno",
                ],
                "preValidation" => "trim",
                "validation"    => "required|in:small,normal",
                "placement"     => "sidebar"
            ],
            [
                "name"          => "description",
                "label"         => "Descrição",
                "type"          => "textArea",
                "maxLength"     => 2000,
                "multiLanguage" => true,
                "preValidation" => "xss_clean|trim",
                "validation"    => "required|max:2000",
            ],
            [
                "name"          => "imageLegend",
                "label"         => "Imagem",
                "type"          => "multiplePicker",
                "allowInsert"   => true,
                "longList"   => false,
                "objectTypes"   => ["imagelegends"],
                "maxSize"       => 1,
            ],
            [
                "name"          => "year",
                "label"         => "Ano",
                "type"          => "textBox",
                "maxLength"     => 9,
                "multiLanguage" => true,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:9",
                "placement"     => "sidebar",
            ],
            [
                "name"          => "chronologic_era",
                "label"         => "Era cronológica",
                "type"          => "selectBox",
                "list"          => [
                    "dc"  => "d.C.",
                    "ac"  => "a.C."
                ],
                "preValidation" => "trim",
                "validation"    => "required|in:dc,ac",
                "placement"     => "sidebar"
            ],
            [
                "name"          => "storytelling_type",
                "label"         => "Tipo de Storytelling",
                "type"          => "selectBox",
                "list"          => [
                    App\Models\Block::STORYTELLING_TYPE_OLISIPO  => "Olisipo",
                    App\Models\Block::STORYTELLING_TYPE_OLD_WORLD  => "Mundo Antigo"
                ],
                "preValidation" => "trim",
                "validation"    => "required|in:" . App\Models\Block::STORYTELLING_TYPE_OLISIPO . "," . App\Models\Block::STORYTELLING_TYPE_OLD_WORLD,
                "placement"     => "sidebar"
            ],
            [
                "name"          => "videos",
                "label"         => "Vídeos",
                "type"          => "multiplePicker",
                "allowInsert"   => true,
                "longList"      => false,
                "objectTypes"   => ["videos"],
                "order"         => true,
                "maxSize"       => 2,
            ],
        ],
        "actions"        => [
            "insert", "edit", "delete", "order"
        ],
    ];
