<?php

return [
    "type"           => "result_winner",
    "model"          => App\Models\ResultWinner::class,
    "label"          => "content_types.result_winner_plural",
    "label_singular" => "content_types.result_winner_singular",
    "hierarchic"     => FALSE,
    "group"          => "none",
    "parent" => array(
        "field"         => "result_id",
        "contentType"   => "result"
    ),
    "search"         => [
        "title" => "title",
        "fields" => [
            "title",
            "name",
            "content",
            "extra_content"
        ],
        "relations" => [
            "entities"
        ],
    ],
    "fields"         => [
        [
            "name"          => "title",
            "label"         => "content_types.title",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "required|max:255",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE
        ],
        [
            "name"          => "is_import",
            "label"         => "content_types.is_legacy_import",
            "type"          => "checkBox",
            "validation"    => "nullable|boolean",
        ],
        [
            "name"          => "name",
            "label"         => "content_types.winner_name",
            "type"          => "textArea",
            "maxLength"     => 1000,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "required|max:1000",
        ],
        [
            "name"          => "legacy_other",
            "label"         => "content_types.other_legacy",
            "type"          => "textArea",
            "maxLength"     => 1000,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:1000",
            "conditions"    => [
                [
                    "type"      => "and",
                    "field"     => "is_import",
                    "operator"  => "in",
                    "value"     => [true]
                ]
            ]
        ],
        [
            "name"          => "legacy_name2",
            "label"         => "content_types.winner_name_2",
            "type"          => "textArea",
            "maxLength"     => 1000,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:1000",
            "conditions"    => [
                [
                    "type"      => "and",
                    "field"     => "is_import",
                    "operator"  => "in",
                    "value"     => [true]
                ]
            ]
        ],
        [
            "name"          => "legacy_other2",
            "label"         => "content_types.other_legacy_2",
            "type"          => "textArea",
            "maxLength"     => 1000,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:1000",
            "conditions"    => [
                [
                    "type"      => "and",
                    "field"     => "is_import",
                    "operator"  => "in",
                    "value"     => [true]
                ]
            ]
        ],
        [
            "name"          => "prize",
            "label"         => "content_types.prize",
            "type"          => "textBox",
            "maxLength"     => 100,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:100",
        ],
        [
            "name" => "entities",
            "label" => "content_types.winner_participant_entities",
            "type" => "repeater",
            "objectType" => "result_entity",
            "order" => true,
        ],
        [
            "name"          => "images",
            "label"         => "content_types.images",
            "type"          => "mediaPicker",
            "multiple"      => TRUE,
            "mediaType"     => "image",
        ],
        [
            "name"          => "content",
            "label"         => "content_types.content_evaluation",
            "type"          => "editor",
            "multiLanguage" => FALSE,
            "preValidation" => "xss_clean|trim",
        ],
        [
            "name"          => "extra_content",
            "label"         => "content_types.extra_content",
            "type"          => "editor",
            "multiLanguage" => FALSE,
            "preValidation" => "xss_clean|trim",
        ],
    ],
    "actions"        => [
        "insert", "edit", "delete"
    ]
];
