<?php
return array(
    "type" => "bar",
    "model" => "Bar",
    "label" => "Bars",
    "label_singular" => "Bar",
    "group" => "none",
    "template" => false,
    "order" => true,
    "websites" => array(2),
    "shareable" => "none",
    "fields" => array(
        array(
            "name" => "title",
            "label" => "title",
            "type" => "textBox",
            "maxLength" => 150,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required|max:100",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "position",
            "label" => "Position",
            "type" => "selectBox",
            "list" => array(
                "top" => "Top",
                "middle" => "Middle (were available)",
                "bottom" => "Content Bottom",
                "before_footer" => "Before Footer"
            ),
            "preValidation" => "trim",
            "placement" => "sidebar",
            "validation" => "required|in:top,bottom,before_footer,middle",
        ),
        array(
            "name" => "type",
            "label" => "Type",
            "type" => "selectBox",
            "list" => array(
                "generic" => "Generic",
                "team" => "Team Members",
                "clients" => "Clients",
                "related" => "Related Boxes",
                "snippets" => "Content Snippets",
                "contact" => "Contact",
            ),
            "placement" => "sidebar",
            "preValidation" => "trim",
            "validation" => "required|in:generic,team,snippets,clients,related,contact"
        ),
        array(
            "name" => "height_size",
            "label" => "Height",
            "type" => "selectBox",
            "list" => array(
                "flex" => "Ajusts to content",
                "tall" => "Tall"
            ),
            "preValidation" => "trim",
            "placement" => "sidebar",
            "validation" => "required_if:type,generic|in:flex,tall",
            "parent" => array(
                "name" => "type",
                "values" => array("generic")
            )
        ),
        array(
            "name" => "bgImage",
            "label" => "Background Image",
            "type" => "mediaPicker",
            "mediaType" => "image",
            "placement" => "sidebar",
            /*
            "thumbnailSizes" => array(
                array("type" => "fit", "name" => "1920x500", "width" => 1920, "height" => 500),
            ),
            */
            "parent" => array(
                "name" => "type",
                "values" => array("generic")
            )
        ),
        array(
            "name" => "content",
            "label" => "Content",
            "type" => "editor",
            "validation" => "",
            "multiLanguage" => true,
            "parent" => array(
                "name" => "type",
                "values" => array("generic")
            )
        ),
        array(
            "name" => "contact_id",
            "label" => "contact",
            "type" => "selectBox",
            "contentType" => "contact",
            "labelField" => "name",
            "dropdownSortField" => "contacts.name",
            "validation" => "required_if:type,contact|integer|min:1",
            "parent" => array(
                "name" => "type",
                "values" => array("contact")
            )
        ),
        array(
            "name" => "color_scheme",
            "label" => "color scheme",
            "type" => "selectBox",
            "list" => array(
                "light" => "Light",
                "dark" => "Dark"
            ),
            "preValidation" => "trim",
            "validation" => "required_if:type,generic|in:light,dark",
            "placement" => "sidebar",
            "parent" => array(
                "name" => "type",
                "values" => array("generic")
            )
        ),
        array(
            "name" => "logoLinks",
            "label" => "Logo Links",
            "type" => "multiplePicker",
            "websiteFiltered" => true,
            "objectTypes" => array("logo_link"),
            "order" => true,
            "parent" => array(
                "name" => "type",
                "values" => array("clients")
            )
        ),
        array(
            "name" => "call_to_action",
            "label" => "call to action",
            "type" => "link",
            "multiLanguage" => true,
            "required" => false,
            "maxLabel" => 60,
            "objectTypes" => array("page","project"),
            "parent" => array(
                "name" => "type",
                "values" => array( "generic", "clients", "team")
            )
        ),
        array(
            "name" => "teamMembers",
            "label" => "Team Members",
            "type" => "multiplePicker",
            "websiteFiltered" => true,
            "objectTypes" => array("team_member"),
            "order" => true,
            "parent" => array(
                "name" => "type",
                "values" => array("team")
            )
        ),
        array(
            "name" => "snippets",
            "label" => "Bar Content Snippets",
            "type" => "multiplePicker",
            "objectTypes" => array("content_snippet"),
            "order" => true,
            "maxSize" => 6,
            "parent" => array(
                "name" => "type",
                "values" => array("snippets")
            )
        ),
    ),
    "actions" => array(
        "insert", "edit", "duplicate", "delete"
    )
);
