<?php

use App\Libs\Services\FcmService;

return [
    "type"           => "news_item",
    "model"          => App\Models\NewsItem::class,
    "label"          => "News",
    "label_singular" => "News Article",
    "group"          => "Exhibitions",
    "order"          => FALSE,
    "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"          => "description",
            "label"         => "Description",
            "type"          => "editor",
            "multiLanguage" => TRUE,
            "preValidation" => "xss_clean|trim",
            "validation"    => ""
        ],
        [
            "name"          => "highlight",
            "label"         => "Highlight",
            "type"          => "checkBox",
            "inList"        => TRUE,
        ],
        [
            "name"          => "author",
            "label"         => "Author",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:150"
        ],
        [
            "name"          => "link",
            "label"         => "Article Link URL",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "required|url|max:255"
        ],
        [
            "name"          => "image",
            "label"         => "Image",
            "type"          => "mediaPicker",
            "multiple"      => FALSE,
            "mediaType"     => "image",
            "placement"     => "sidebar"
        ],
        [
            "name"          => "date",
            "label"         => "Date",
            "type"          => "datePicker",
            "inputType"     => "date", //time|date|datetime
            "multiLanguage" => false,
            "validation"    => "",
            "placement"     => "sidebar",
            "inList"        => true,
            "search"        => true,
            "sort"          => true
        ],
        [
            "name"          => "artists",
            "label"         => "Artists",
            "type"          => "multiplePicker",
            "longList"      => TRUE,
            "allowInsert"   => TRUE,
            "objectTypes"   => ["artist"],
            "order"         => TRUE,
            "maxSize"       => 50
        ],
        /**[
            "name" => "related",
            "label" => "Related subjects",
            "type" => "multiplePicker",
            "websiteFiltered" => true,
            "longList" => true,
            "objectTypes" => ["artist", 'exhibition', 'location', 'city'],
            "order" => true
        ],**/
        [
            "name"          => "news_category_id",
            "label"         => "Category",
            "type"          => "selectBox",
            "boxSearch"     => false,
            "contentType"   => "news_category",
            "labelField"    => "title",
            "validation"    => "required"
        ],
        FcmService::getConfigForSendPushNotifications('news', 'New Publications'),
    ],
    "actions"        => [
        "edit", "insert", "delete"
    ]
];
