<?php

    return [
        "type"           => "occurrences",
        "model"          => "Occurrence",
        "label"          => "Event Pages",
        "label_singular" => "Event Page",
        "group"          => "content",
        "order"          => TRUE,
        "fields"         => [
            [
                "name"          => "title",
                "label"         => "Event Title",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:150",
                "inList"        => TRUE,
                "search"        => TRUE,
                "sort"          => TRUE
            ],
            [
                "name"          => "occurrence_description",
                "label"         => "Description",
                "type"          => "textArea",
                "maxLength"     => 1200,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:1200",
                "inList"        => FALSE,
                "search"        => FALSE,
                "sort"          => FALSE
            ],
            [
                "name"      => "is_on_map",
                "label"     => "Show on map?",
                "type"      => "checkBox",
                "placement" => "sidebar",
                "inList"    => TRUE,
            ],
            [
                "name"      => "is_on_radio",
                "label"     => "Show on radio?",
                "type"      => "checkBox",
                "placement" => "sidebar",
                "inList"    => TRUE,
            ],
            [
                "name"          => "occurrence_date",
                "label"         => "Date",
                "type"          => "DatePicker",
                "inputType"     => "date",
                "preValidation" => "xss_clean|trim",
                "validation"    => "required|date_format:Y-m-d",
                "info"          => "",
                "inList"        => TRUE,
                "search"        => TRUE,
                "placement"     => "sidebar"
            ],
            [
                "name"          => "occurrence_audio",
                "label"         => "Audio Url",
                "type"          => "textBox",
                "maxLength"     => 300,
                "multiLanguage" => FALSE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:300",
                "placement"     => "sidebar",
                "inList"        => FALSE,
                "search"        => TRUE
            ],
            [
                "name"          => "occurrence_video",
                "label"         => "Video Url",
                "type"          => "textBox",
                "maxLength"     => 300,
                "multiLanguage" => FALSE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:300",
                "placement"     => "sidebar",
                "inList"        => FALSE,
                "search"        => TRUE
            ],
            [
                "name"      => "occurrenceImage",
                "label"     => "Image",
                "type"      => "mediaPicker",
                "multiple"  => FALSE,
                "mediaType" => "image",
                "placement" => "sidebar"
            ],
            [
                "name"        => "locations",
                "label"       => "Locations",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["locations"],
                "order"       => TRUE,
                "maxSize"     => 1,
            ],
            [
                "name"        => "personalities",
                "label"       => "Personalities",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["personalities"],
                "order"       => TRUE,
                "maxSize"     => 32,
            ],
            [
                "name"        => "categories",
                "label"       => "Categories",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["categories"],
                "order"       => TRUE,
                "maxSize"     => 32,
            ],
            [
                "name"        => "themes",
                "label"       => "Themes",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["themes"],
                "order"       => TRUE,
                "maxSize"     => 32,
            ],
            [
                "name"        => "keywords",
                "label"       => "Keywords",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["keywords"],
                "order"       => TRUE,
                "maxSize"     => 32,
            ],
            [
                "name"        => "blocks",
                "label"       => "Blocks",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["blocks"],
                "order"       => TRUE,
                "maxSize"     => 32,
            ],
            [
                "name"          => "is_story",
                "label"         => "Connect to story?",
                "type"          => "selectBox",
                "list"          => [
                    "no"  => "No",
                    "yes" => "Yes",
                ],
                "defaultValue"  => "no",
                "preValidation" => "trim",
                "validation"    => "",
                "placement"     => "sidebar"
            ],
            [
                "name"          => "story_id",
                "label"         => "Story",
                "type"          => "selectBox",
                "contentType"   => "stories",
                "preValidation" => "trim",
                "validation"    => "required_if:is_story,yes|integer|min:1",
                "inList"        => TRUE,
                "search"        => TRUE,
                "sort"          => TRUE,
                "boxSearch"     => TRUE,
                "placement"     => "sidebar",
                "allowInsert"   => TRUE,
                "parent"        => [
                    "name"   => "is_story",
                    "values" => ["yes"]
                ]
            ],
            [
                "name"          => "meta_title",
                "label"         => "[Meta] Title",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:150",
                "placement"     => "sidebar",
                "inList"        => FALSE,
                "search"        => FALSE,
                "sort"          => FALSE
            ],
            [
                "name"          => "meta_description",
                "label"         => "[Meta] Description",
                "type"          => "textArea",
                "maxLength"     => 300,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:300",
                "placement"     => "sidebar",
                "inList"        => FALSE,
                "search"        => FALSE,
                "sort"          => FALSE
            ],
            [
                "name"      => "metaImage",
                "label"     => "[Meta] Image",
                "type"      => "mediaPicker",
                "multiple"  => FALSE,
                "mediaType" => "image",
                "placement" => "sidebar"
            ]
        ],
        "actions"        => [
            "edit", "order", "insert", "delete"
        ]
    ];
