<?php

    return [
        "type"           => "videoItems",
        "model"          => App\Models\VideoItem::class,
        "label"          => "Video Items",
        "label_singular" => "Video Item",
        "group"          => "content types",
        "order"          => TRUE,
        "fields"         => [
            [
                "name"          => "title",
                "label"         => "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"         => "Video Type",
                "type"          => "selectBox",
                "list"          => [
                    "local_video" => "Local Video",
                    "youtube" => "YouTube",
                    "vimeo" => "Vimeo"
                ],
                "defaultValue"  => "local_video",
                "preValidation" => "trim",
                "validation"    => "",
                "placement"     => "sidebar",
            ],
            [
                "name"          => "image",
                "label"         => "Video Preview Image",
                "type"          => "mediaPicker",
                "multiple"      => FALSE,
                "mediaType"     => ["image"],
                "minSize"   => 1,
            ],
            [
                "name"          => "video",
                "label"         => "Video",
                "type"          => "mediaPicker",
                "multiple"      => FALSE,
                "mediaType"     => ["video"],
                "parent"        => [
                    "name"   => "type",
                    "values" => ["local_video"]
                ]
            ],
            [
                "name"          => "external_video",
                "label"         => "External Video",
                "type"          => "textBox",
                "maxLength"     => 500,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:500",
                "parent"        => [
                    "name"   => "type",
                    "values" => ["youtube", "vimeo"]
                ]
            ],
            [
                "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)",
            ],
            [
                "name"        => "topic_id",
                "label"       => "Topic",
                "type"        => "selectBox",
                "contentType" => "topics",
                "preValidation" => "trim",
                "validation" => "integer|nullable",
                "inList" => true,
                "search" => true,
                "sort" => true,
                "boxSearch" => true,
                "allowInsert" => false,
            ],
        ],
        "actions"        => [
            "edit", "order", "insert", "delete"
        ]
    ];
