<?php

    return [
        "type"           => "blocks",
        "model"          => App\Models\Block::class,
        "label"          => "Blocks",
        "label_singular" => "Block",
        "group"          => "components",
        "order"          => TRUE,

        "search" => [
            "fields" => [
                "block_title",
                "subtitle",
                "wysiwyg",
                "description",
            ],
            "relations" => [
                "cardItems",
                "timelineCards",
                "textCards",
                "teamMembers",
                "accordionItems",
                "trackerCategories",
                "newsTickerSliderItems",
                "links",
            ],
            "parentRelationships" => [
                "page",
            ]
        ],

        "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"          => [
                    // "blockHighlightDocuments"   => "Highlighted Documents",
                    "blockSlider"               => "Logo Slider",
                    "blockHomeHero"             => "Home Hero",
                    "blockSimpleImageHero"      => "Simple Image Hero",
                    "blockPageTitle"            => "Page Title",
                    "blockWysiwyg"              => "Text Editor",
                    // "blockTwoColumnsWysiwyg"    => "Text Editor Two Columns",
                    "blockFeatures"             => "Feature Cards",
                    "blockCardItems"            => "Teaser Link List",
                    "blockMixedMedia"           => "Mixed Media",
                    "blockMixedMediaSimple"     => "Simple Text Image",
                    "blockTimeline"             => "Timeline",
                    "blockTextCards"            => "Text Cards List",
                    "blockBanner"               => "Banner",
                    "blockTwoColumnText"        => "Two Column Text",
                    "blockTeamMembers"          => "Team Members",
                    "blockFeaturedCards"        => "Featured Cards",
                    "blockContactCards"         => "Contact Cards",
                    "blockDocumentList"         => "Document List",
                    "blockImageFull"            => "Image Full Width",
                    "blockMembers"              => "Members List",
                    "blockAccordion"            => "Accordion",
                    "blockFormEIC"              => "Form EIC",
                    "blockFormEventRegistration" => "Form Event Registration",
                    "blockMasterclass26Registration" => "Form Masterclass 26 Registration",
                    "blockEventList"            => "Event List",
                    "blockPressReleaseList"     => "Press Release List",
                    "blockStaticDataTableList"  => "Static Data Table List",
                    "blockPageLinks"            => "Page Links",
                    "blockUpcomingEvents"       => "Upcoming Events",
                    "blockEFETpedia"            => "EFETpedia",
                    "blockHomeSliderHero"       => "Home Slider Hero",
                    "blockHomeSliderNews"       => "Home Slider News",
                    "blockHomePathEnergy"       => "Home Path Energy",
                    "blockHomeFullBanner"       => "Home Full Banner",
                    "blockHomeJoin"             => "Home Join",
                    "blockInjectCode"           => "Inject Code",
                    "blockVideo"                => "Video",
                    "blockClausesSearch"        => "Clauses Search",
                    "blockForm"                 => "Block Form",
                    "blockHomeJoinV2"           => "Home Join V2",
                    "blockVideoList"            => "Video List",
                    "blockImageGallery"         => "Image Gallery",
                    // "blockPodcastList"          => "Podcast List",
                    "blockImageGrid"            => "Image Grid",
                    "blockProgressTracker"      => "Progress Tracker",
                    "blockNewsTickerSlider"           => "IB28 | News Ticker"
                ],
                "defaultValue"  => "blockPageTitle",
                "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"          => "subtitle",
                "label"         => "Subtitle",
                "type"          => "textBox",
                "maxLength"     => 250,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:250",
                "parent"        => [
                    "name"   => "type",
                    "values" => [
                        "blockMixedMedia",
                        "blockPageTitle",
                        "blockBanner",
                        "blockSimpleImageHero",
                        "blockCardItems",
                        "blockTwoColumnText",
                        "blockHomeFullBanner",
                        "blockHomeJoin",
                        "blockVideo",
                        "blockImageGallery",
                    ]
                ]
            ],
            [
                "name"          => "date",
                "label"         => "Date",
                "type"          => "datePicker",
                "inputType"     => "date",
                "validation"    => "nullable",
                "placement"     => "sidebar",
                "info"          => "The time you select here will be considered in Berlin/Brussels timezone (CET/CEST)",
                "parent"        => [
                    "name"   => "type",
                    "values" => [
                        "blockMixedMedia",
                        "blockBanner",
                    ]
                ]
            ],
            [
                "name"        => "slider",
                "label"       => "Slider",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["sliderItems"],
                "order"       => TRUE,
                "maxSize"     => 32,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockSlider",
                        "blockHomeSliderHero",
                        "blockHomeSliderNews",
                    ]
                ]
            ],
            [
                "name"          => "wysiwyg",
                "label"         => "Editor",
                "type"          => "editor",
                "multiLanguage" => TRUE,
                "preValidation" => "xss_clean|trim",
                "validation"    => "",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockWysiwyg",
                        "blockHomeHero",
                        "blockMixedMedia",
                        "blockMixedMediaSimple",
                        "blockTwoColumnText",
                        "blockTwoColumnsWysiwyg",
                        "blockHomePathEnergy",
                        "blockClausesSearch",
                        "blockProgressTracker",
                        "blockNewsTickerSlider"
                    ]
                ]
            ],
            [
                "name"          => "wysiwyg_2",
                "label"         => "Editor 2",
                "type"          => "editor",
                "multiLanguage" => TRUE,
                "preValidation" => "xss_clean|trim",
                "validation"    => "",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockTwoColumnsWysiwyg",
                    ]
                ]
            ],
            [
                "name"          => "text_code",
                "label"         => "Text Code",
                "type"          => "textArea",
                "multiLanguage" => TRUE,
                "preValidation" => "trim",
                "validation"    => "",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockInjectCode",
                    ]
                ]
            ],
            [
                "name"          => "videoUrl",
                "label"         => "Video (Youtube or Vimeo)",
                "type"          => "textBox",
                "maxLength"     => 500,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:500",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockVideo",
                    ]
                ]
            ],
            [
                "name"        => "cardItems",
                "label"       => "Card Item",
                "type"        => "singlePicker",
                "objectType"  => "cardItems",
                "order"       => TRUE,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockCardItems",
                        "blockFeaturedCards",
                        "blockContactCards",
                        "blockHomePathEnergy",
                    ]
                ]
            ],
            [
                "name"          => "image",
                "label"         => "Image",
                "type"          => "mediaPicker",
                "multiple"      => FALSE,
                "mediaType"     => ["image"],
                "placement"     => "sidebar",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockHomeHero",
                        "blockMixedMedia",
                        "blockMixedMediaSimple",
                        "blockSimpleImageHero",
                        "blockImageFull",
                        "blockHomeFullBanner",
                        "blockHomeJoin",
                        "blockProgressTracker",
                        "blockNewsTickerSlider"
                    ]
                ]
            ],
            [
                "name"          => "imageMobile",
                "label"         => "Image Mobile",
                "type"          => "mediaPicker",
                "multiple"      => FALSE,
                "mediaType"     => ["image"],
                "placement"     => "sidebar",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockHomeHero",
                        "blockMixedMedia",
                        "blockMixedMediaSimple",
                        "blockSimpleImageHero",
                        "blockImageFull",
                        "blockHomeFullBanner",
                    ]
                ]
            ],
            [
                "name"          => "document",
                "label"         => "Document",
                "type"          => "mediaPicker",
                "multiple"      => FALSE,
                "mediaType"     => ["document"],
                "placement"     => "sidebar",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockMixedMedia",
                        "blockBanner",
                    ]
                ]
            ],
            [
                "name"          => "video",
                "label"         => "Video",
                "type"          => "mediaPicker",
                "multiple"      => FALSE,
                "mediaType"     => ["video"],
                "placement"     => "sidebar",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockVideo",
                    ]
                ]
            ],
            [
                "name"          => "cta",
                "label"         => "Call to action",
                "type"          => "link",
                "multiLanguage" => TRUE,
                "objectTypes"   => ["page"],
                "maxLabel"      => 50,
                "required"      => false,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockMixedMedia",
                        "blockMixedMediaSimple",
                        "blockBanner",
                        "blockFeatures",
                        "blockHomeFullBanner",
                        "blockHomeJoin",
                        "blockHomeJoinV2",
                        "blockNewsTickerSlider",
                    ]
                ]
            ],
            [
                "name"        => "timelineCards",
                "label"       => "Timeline Cards",
                "type"        => "singlePicker",
                "objectType"  => "timelineCards",
                "order"       => TRUE,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockTimeline",
                    ]
                ]
            ],
            [
                "name"        => "textCards",
                "label"       => "Text Cards",
                "type"        => "singlePicker",
                "objectType"  => "textCards",
                "order"       => TRUE,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockTextCards",
                    ]
                ]
            ],
            [
                "name"        => "teamMembers",
                "label"       => "Team Members",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["teamMembers"],
                "order"       => TRUE,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockTeamMembers",
                    ]
                ]
            ],
            [
                "name"          => "size",
                "label"         => "Size",
                "type"          => "selectBox",
                "list"          => [
                    "small" => "Small",
                    "large" => "Large",
                ],
                "defaultValue"  => "small",
                "preValidation" => "trim",
                "validation"    => "nullable|in:small,large",
                "placement"     => "sidebar",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockBanner",
                    ]
                ]
            ],
            [
                "name"        => "documents",
                "label"       => "Documents",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["document"],
                "order"       => TRUE,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockHighlightDocuments",
                    ]
                ]
            ],
            [
                "name"        => "topic_id",
                "label"       => "Topic",
                "type"        => "selectBox",
                "contentType" => "topics",
                "preValidation" => "trim",
                "validation" => "integer|nullable",
                "inList" => true,
                "search" => true,
                "sort" => true,
                "boxSearch" => true,
                "allowInsert" => false,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockDocumentList",
                        "blockFeatures",
                    ],
                ]
            ],
            [
                "name"        => "document_type_id",
                "label"       => "Document Type",
                "type"        => "selectBox",
                "contentType" => "documentTypes",
                "preValidation" => "trim",
                "validation" => "integer|nullable",
                "inList" => true,
                "search" => true,
                "sort" => true,
                "boxSearch" => true,
                "allowInsert" => false,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockDocumentList",
                    ]
                ]
            ],
            [
                "name"          => "bg_color",
                "label"         => "BG Color",
                "type"          => "selectBox",
                "list"          => [
                    "light" => "Light",
                    "dark" => "dark",
                ],
                "defaultValue"  => "light",
                "preValidation" => "trim",
                "validation"    => "nullable|in:light,dark",
                "placement"     => "sidebar",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockTeamMembers",
                    ]
                ]
            ],
            [
                "name"          => "position",
                "label"         => "Position",
                "type"          => "selectBox",
                "list"          => [
                    "left" => "Left",
                    "center" => "Center",
                ],
                "defaultValue"  => "left",
                "preValidation" => "trim",
                "validation"    => "nullable|in:left,center",
                "placement"     => "sidebar",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockTeamMembers",
                    ]
                ]
            ],
            [
                "name"        => "accordionItems",
                "label"       => "Accordion Items",
                "type"        => "singlePicker",
                "objectType"  => "accordionItems",
                "order"       => TRUE,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockAccordion",
                    ]
                ]
            ],
            [
                "name"        => "trackerCategories",
                "label"       => "Tracker Categories",
                "type"        => "singlePicker",
                "objectType"  => "trackerCategories",
                "order"       => TRUE,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockProgressTracker",
                    ]
                ]
            ],
            [
                "name"        => "newsTickerSliderItems",
                "label"       => "News Ticker Slider Items",
                "type"        => "singlePicker",
                "objectType"  => "newsTickerSliderItems",
                "order"       => TRUE,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockNewsTickerSlider",
                    ]
                ]
            ],
            [
                "name"        => "links",
                "label"       => "Links",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["links"],
                "order"       => TRUE,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockPageLinks",
                    ]
                ]
            ],
            [
                "name"          => "align",
                "label"         => "Align",
                "type"          => "selectBox",
                "list"          => [
                    "middle" => "Middle",
                    "bottom" => "Bottom",
                ],
                "defaultValue"  => "middle",
                "preValidation" => "trim",
                "validation"    => "nullable|in:middle,bottom",
                "placement"     => "sidebar",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockMixedMedia",
                    ]
                ]
            ],
            [
                "name"          => "layout",
                "label"         => "Layout",
                "type"          => "selectBox",
                "list"          => [
                    "default"  => "Default",
                    "coloured" => "Coloured",
                ],
                "defaultValue"  => "default",
                "preValidation" => "trim",
                "validation"    => "nullable|in:default,coloured",
                "placement"     => "sidebar",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockNewsTickerSlider",
                    ]
                ]
            ],
            [
                "name"        => "autoplay",
                "label"       => "Autoplay",
                "type"        => "checkBox",
                "placement"   => "sidebar",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockNewsTickerSlider",
                    ]
                ]
            ],
            [
                "name"          => "image2",
                "label"         => "Image 2",
                "type"          => "mediaPicker",
                "multiple"      => FALSE,
                "mediaType"     => ["image"],
                "placement"     => "sidebar",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockHomeJoin",
                    ]
                ]
            ],
            [
                "name"          => "cta_2",
                "label"         => "Call to action 2",
                "type"          => "link",
                "multiLanguage" => TRUE,
                "objectTypes"   => ["page"],
                "maxLabel"      => 50,
                "required"      => false,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockHomeJoin",
                        "blockHomeJoinV2",
                    ]
                ]
            ],
            [
                "name"        => "form_id",
                "label"       => "Form",
                "type"        => "selectBox",
                "contentType" => "forms",
                "preValidation" => "trim",
                "validation" => "integer|nullable",
                "inList" => true,
                "search" => true,
                "sort" => true,
                "boxSearch" => true,
                "allowInsert" => false,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockForm",
                    ]
                ]
            ],
            [
                "name"        => "picture_variable",
                "label"       => "Picture Variable",
                "type"        => "checkBox",
                "placement"   => "sidebar",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockWysiwyg",
                    ]
                ]
            ],
            [
                "name"          => "filter_time",
                "label"         => "Filter Time",
                "type"          => "selectBox",
                "list"          => [
                    "" => "Nothing",
                    "past" => "Past",
                    "upcoming" => "Upcoming",
                ],
                "defaultValue"  => "",
                "preValidation" => "trim",
                "placement"     => "sidebar",
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockEventList",
                    ]
                ]
            ],
            [
                "name"        => "videos",
                "label"       => "Videos",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["videoItems"],
                "order"       => TRUE,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockVideoList",
                    ]
                ]
            ],
            [
                "name"        => "imageGallery",
                "label"       => "Image Gallery",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["imageItems"],
                "order"       => TRUE,
                "parent"      => [
                    "name"   => "type",
                    "values" => [
                        "blockImageGallery",
                        "blockImageGrid",
                    ]
                ]
            ],
            // [
            //     "name"        => "podcasts",
            //     "label"       => "Podcasts",
            //     "type"        => "multiplePicker",
            //     "longList"    => TRUE,
            //     "allowInsert" => TRUE,
            //     "objectTypes" => ["podcastItems"],
            //     "order"       => TRUE,
            //     "parent"      => [
            //         "name"   => "type",
            //         "values" => [
            //             "blockPodcastList",
            //         ]
            //     ]
            // ],
        ],
        "actions"        => [
            "edit", "order", "insert", "delete"
        ]
    ];
