<?php

use App\Models\Backoffice\SliderItem;

return [
    "type"           => "slider_item",
    "model"          => SliderItem::class,
    "label"          => "content_types.slider_item_plural",
    "label_singular" => "content_types.slider_item_singular",
    "group"          => "content",
    "order"          => TRUE,
    "search" => [
        "fields" => [
            "title",
            "description",
        ],
        "parentRelationships" => [
        ]
    ],
    "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"         => "Slider Item Type",
            "type"          => "selectBox",
            "list"          => [
                "image" => "Image",
                "video" => "Video"
            ],
            "defaultValue"  => "image",
            "preValidation" => "trim",
            "validation"    => "",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE
        ],
        [
            "name"          => "image",
            "label"         => "Image",
            "type"          => "mediaPicker",
            "multiple"      => FALSE,
            "mediaType"     => "image",
            "conditions"     => [
                [
                    "type"  =>      "and",
                    "field" =>      "type",
                    "operator" =>   "in",
                    "value" =>      ["image"]
                ]
            ],
        ],
        /*
        [
            "name"          => "video",
            "label"         => "Video",
            "type"          => "textBox",
            "maxLength"     => 500,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:500",
            "conditions"     => [
                [
                    "type"  =>      "and",
                    "field" =>      "type",
                    "operator" =>   "in",
                    "value" =>      ["video"]
                ]
            ],
        ],
        [
            "name"          => "description",
            "label"         => "Description",
            "type"          => "textArea",
            "maxLength"     => 500,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:500",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE
        ],
*/
    ],
    "actions"        => [
        "edit", "insert", "delete"
    ]
];
