<?php
return array(
    "type" => "sidebar_widget",
    "model" => "App\Models\SidebarWidget",
    "label" => "Sidebar Widgets",
    "label_singular" => "Sidebar Widget",
    /*
    "parent" => array(
        "field" => "hp_template_configuration_id",
        "contentType" => "hp_template_configuration"
    ),
    */
    "group" => "none",
    "template" => false,
    "order" => true,
    "websites" => array(1, 2),
    "shareable" => "none",
    "fields" => array(
        array(
            "name" => "title",
            "label" => "title",
            "type" => "textBox",
            "maxLength" => 100,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required|max:100",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "type",
            "label" => "Type",
            "type" => "selectBox",
            "list" => array(
                "object" => "Sidebar Object",
                "image" => "Image",
                "facts" => "Facts & Figures",
                // "standards" => "Standards",
                "testimonial" => "Testimonial",
                "contact" => "Contact",
                "multilang_contact" => "Multilanguage Contact",
                "download" => "Download",
                "image_links" => "Image/Logo Links",
                "latest" => "Latest News/Events/Press/Jobs",
                "subscribe" => "Subscribe Newsletter"
            ),
            "preValidation" => "trim",
            "validation" => "required|in:subscribe,object,image,facts,standards,multilang_contact,testimonial,contact,download,image_links,latest",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "tagline",
            "label" => "Tagline",
            "type" => "textBox",
            "maxLength" => 255,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:255",
            "search" => true,
            "parent" => array(
                "name" => "type",
                "values" => array("contact", "multilang_contact")
            )
        ),
        array(
            "name" => "vposition",
            "label" => "Position",
            "type" => "selectBox",
            "list" => array(
                "top" => "Top",
                "bottom" => "Bottom"
            ),
            "preValidation" => "trim",
            "placement" => "sidebar",
            "validation" => "required|in:top,bottom",
        ),
        array(
            "name" => "image",
            "label" => "Side image",
            "type" => "mediaPicker",
            "mediaType" => "image",
            "placement" => "sidebar",
            /*
            "thumbnailSizes" => array(
                array("type" => "fit", "name" => "150x150", "width" => 150, "height" => 150),
            ),
            */
            "parent" => array(
                "name" => "type",
                "values" => array("text", "generic")
            )
        ),
        array(
            "name" => "bgImage",
            "label" => "Background image",
            "type" => "mediaPicker",
            "mediaType" => "image",
            "placement" => "sidebar",
            /*
            "thumbnailSizes" => array(
                array("type" => "fit", "name" => "470x500", "width" => 470, "height" => 500),
                array("type" => "resize_noup", "name" => "470x500r", "width" => 470, "height" => 500),
            ),
            */
            "parent" => array(
                "name" => "type",
                "values" => array("text", "generic", "image")
            )
        ),
        array(
            "name" => "content",
            "label" => "Content",
            "type" => "editor",
            "validation" => "nullable|required_if:type,generic,facts",
            "multiLanguage" => true,
            "parent" => array(
                "name" => "type",
                "values" => array("generic","facts",'download')
            )
        ),
        array(
            "name" => "latest_type",
            "label" => "Latest Item Type",
            "type" => "selectBox",
            "list" => array(
                "news"   => "News",
                "blogs"  => "Blogs",
                "events" => "Events",
                "press"  => "Press Releases",
                "publications" => "Publications",
                "jobs"   => "Jobs"
            ),
            "preValidation" => "trim",
            "validation" => "nullable|required_if:type,latest|in:jobs,news,blogs,events,press,publications",
            "parent" => array(
                "name" => "type",
                "values" => array("latest")
            )
        ),
        array(
            "name" => "item_count",
            "label" => "Item Count",
            "type" => "textBox",
            "maxLength" => 2,
            "placement" => "sidebar",
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "nullable|required_if:type,latest|integer|max:20",
            "parent" => array(
                "name" => "type",
                "values" => array("latest")
            )
        ),
        array(
            "name" => "testimonial_id",
            "label" => "testimonial",
            "type" => "selectBox",
            "contentType" => "testimonial",
            "validation" => "nullable|required_if:type,testimonial|integer|min:1",
            "parent" => array(
                "name" => "type",
                "values" => array("testimonial")
            )
        ),
        array(
            "name" => "contact_id",
            "label" => "contact",
            "type" => "selectBox",
            "contentType" => "contact",
            "labelField" => "name",
            "validation" => "nullable|required_if:type,contact|integer|min:1",
            "dropdownSortField" => "name",
            "parent" => array(
                "name" => "type",
                "values" => array("contact")
            )
        ),
        array(
            "name" => "multilang_contact_id",
            "label" => "contact",
            "type" => "selectBox",
            "multiLanguage" => true,
            "contentType" => "contact",
            "dropdownSortField" => "contacts.name",
            "labelField" => "name",
            "validation" => "nullable|required_if:type,multilang_contact|integer|min:1",
            "info" => "Please choose the contact for each localization!",
            "parent" => array(
                "name" => "type",
                "values" => array("multilang_contact")
            )
        ),
        array(
            "name" => "color_scheme",
            "label" => "color scheme",
            "type" => "selectBox",
            "list" => array(
                "light" => "Light",
                "dark" => "Dark"
            ),
            "preValidation" => "trim",
            "validation" => "nullable|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("image_links")
            )
        ),
        array(
            "name" => "download_id",
            "label" => "Publication to Download",
            "type" => "selectBox",
            "contentType" => "publication",
            "preValidation" => "trim",
            "validation" => "nullable|required_if:type,download|integer|min:1",
            "parent" => array(
                "name" => "type",
                "values" => array("download")
            )
        ),
        array(
            "name" => "sidebar_object_id",
            "label" => "Sidebar Object",
            "type" => "selectBox",
            "contentType" => "sidebar_object",
            "preValidation" => "trim",
            "validation" => "nullable|required_if:type,object|integer|min:1",
            "parent" => array(
                "name" => "type",
                "values" => array("object")
            )
        ),
        array(
            "name" => "call_to_action",
            "label" => "call to action",
            "type" => "link",
            "multiLanguage" => true,
            "required" => false,
            "maxLabel" => 60,
            "objectTypes" => array("project", "page", "solution", "case_study", "contact", "publication"),
            "parent" => array(
                "name" => "type",
                "values" => array( "generic", "standards", "latest")
            )
        )
    ),
    "actions" => array(
        "insert", "edit", "delete"
    )
);
