<?php

    return [
        "type"           => "blocks",
        "model"          => App\Models\Block::class,
        "label"          => "Blocks",
        "label_singular" => "Block",
        "group"          => "content",
        "order"          => TRUE,
        "fields"         => [
            [
                "name"          => "title",
                "label"         => "Block Title",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:150",
                "inList"        => TRUE,
                "search"        => TRUE,
                "sort"          => TRUE
            ],
            [
                "name"          => "type",
                "label"         => "Block Type",
                "type"          => "selectBox",
                "list"          => [
                    "blockDocumentLists"   => "Document Lists",
                    "blockTableEditor"     => "Table Editor",
                ],
                "defaultValue"  => "blockDocumentLists",
                "preValidation" => "trim",
                "validation"    => ""
            ],
            [
                "name"          => "block_title",
                "label"         => "Title",
                "type"          => "textBox",
                "maxLength"     => 300,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:300",
                "inList"        => FALSE,
                "search"        => FALSE,
                "sort"          => FALSE,
            ],
            [
                "name"        => "slider",
                "label"       => "Slider",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["sliderItems"],
                "order"       => TRUE,
                "maxSize"     => 32,
                "parent"      => [
                    "name"   => "type",
                    "values" => []
                ]
            ],
            [
                "name"          => "wysiwyg",
                "label"         => "Table Editor",
                "type"          => "editor",
                "tinyMCEType"   => "form-control-table-editor",
                "multiLanguage" => TRUE,
                "preValidation" => "xss_clean|trim",
                "validation"    => "",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockTableEditor",
                    ]
                ]
            ],
            [
                "name"        => "documentLists",
                "label"       => "Document Lists",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["document_lists"],
                "order"       => TRUE,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockDocumentLists",
                    ]
                ]
            ],
        ],
        "actions"        => [
            "edit", "order", "insert", "delete"
        ]
    ];
