<?php

return [
    "type"           => "event_info",
    "model"          => App\Models\EventInfo::class,
    "label"          => "content_types.event_info_plural",
    "label_singular" => "content_types.event_info_singular",
    "hierarchic"     => FALSE,
    "group"          => "none",
    "parent" => array(
        "field"         => "event_id",
        "contentType"   => "event"
    ),
    "search"         => null,
    "fields"         => [
        [
            "name"          => "title",
            "label"         => "Label",
            "type"          => "textBox",
            "maxLength"     => 50,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "required|max:50",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE
        ],
        [
            "name"          => "type",
            "label"         => "Type",
            "type"          => "selectBox",
            "list"          => [
                "text" => "Text",
                "link"    => "Link"
            ],
            "defaultValue"  => "text",
            "preValidation" => "trim",
            "validation"    => "",
        ],
        [
            "name"          => "content",
            "label"         => "Content",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:255",
            "conditions"     => [
                [
                    "type"  =>      "and",
                    "field" =>      "type",
                    "operator" =>   "in",
                    "value" =>      ["text"]
                ]
            ],
        ],
        [
            "name"          => "link_text",
            "label"         => "Link Text",
            "type"          => "textBox",
            "maxLength"     => 255,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:255",
            "conditions"     => [
                [
                    "type"  =>      "and",
                    "field" =>      "type",
                    "operator" =>   "in",
                    "value" =>      ["link"]
                ]
            ],
        ],
        [
            "name"          => "link",
            "label"         => "Link",
            "type"          => "textBox",
            "maxLength"     => 255,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|url|max:255",
            "conditions"     => [
                [
                    "type"  =>      "and",
                    "field" =>      "type",
                    "operator" =>   "in",
                    "value" =>      ["link"]
                ]
            ],
        ],
    ],
    "actions"        => [
        "insert", "edit", "delete"
    ]
];
