<?php
return array(
    "type"           => "cop_item",
    "model"          => "CopItem",
    "label"          => "Cop Map Items",
    "label_singular" => "Cop Map Item",
    "group"          => "general",
    "template"       => false,
    "order"          => false,
    "search" => array(
    ),
    "fields" => array(
        array(
            "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
        ),
        array(
            "name" => "type",
            "label" => "Type",
            "type" => "selectBox",
            "list" => array(
                "video" => "Video",
                "iframe" => "IFrame Page",
            ),
            "preValidation" => "trim",
            "validation" => "required|in:video,iframe",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "cop_topic_id",
            "label" => "Cop Topic",
            "type" => "selectBox",
            "contentType" => "cop_topic",
            "labelField" => "title",
            "validation" => "required",
            "placement"      => "sidebar",
        ),
        array(
            "name"          => "short_description",
            "label"         => "Short Description",
            "type"          => "textBox",
            "multiLanguage" => true,
            "maxLength" => 200,
            "preValidation" => "trim|xss_clean",
            "validation"    => "max:200"
        ),
        array(
            "name" => "source_url",
            "label" => "Video URL / Iframe URL",
            "type" => "textBox",
            "maxLength" => 255,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required|url|max:255",
            "info" => "For video the URL must be an embed URL with the form: https://www.youtube.com/embed/[video id code] eg: https://www.youtube.com/embed/2P0qHN9ML3E"
        ),
        array(
            "name"           => "image",
            "label"          => "Item box image",
            "type"           => "mediaPicker",
            "multiLanguage"  => false,
            "mediaType"      => "image",
            "placement"      => "sidebar",
            "multiple"       => false,
            "minSize"        => "0",
            "relatedContentType" => 'cop_topic'
        ),
        array(
            "name"     => "location",
            "label"    => "location",
            "type"     => "location",
            "required" => true
        ),
        array(
            "name"          => "cta_label",
            "label"         => "Map Card CTA label",
            "type"          => "textBox",
            "maxLength"     => 50,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:50",
        ),
        array(
            "name"          => "cta_desc",
            "label"         => "CTA Description",
            "type"          => "editor",
            "multiLanguage" => true,
            "preValidation" => "xss_clean|trim",
            "validation"    => "",
            "parent" => array(
                "name" => "type",
                "values" => array("video")
            ),
        ),
        array(
            "name"          => "cta",
            "label"         => "Link",
            "type"          => "link",
            "multiLanguage" => true,
            "required"      => false,
            "maxLabel"      => 60,
            "objectTypes"   => array(),
            "parent" => array(
                "name" => "type",
                "values" => array("video")
            ),
        ),
    ),
    "actions" => array(
        "insert", "edit", "delete", "order"
    )
);
