<?php
return array(
    "type" => "homepage_tile",
    "model" => "App\Models\HomepageTile",
    "label" => "homepage tiles",
    "label_singular" => "homepage tile",
    "parent" => array(
        "field" => "hp_template_configuration_id",
        "contentType" => "hp_template_configuration"
    ),
    "group" => "none",
    "template" => false,
    "order" => true,
    "websites" => array(1),
    "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(
                "generic" => "Generic",
                "text" => "Text",
                "testimonial" => "Testimonial"
            ),
            "preValidation" => "trim",
            "validation" => "required|in:generic,text,testimonial",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "image",
            "label" => "Background image",
            "type" => "mediaPicker",
            "mediaType" => "image",
            "placement" => "sidebar",
            /*
            "thumbnailSizes" => array(
                array("type" => "fit", "name" => "500x640", "width" => 500, "height" => 640),
            )
            */
        ),
        array(
            "name" => "content",
            "label" => "Content",
            "type" => "editor",
            "validation" => "nullable|required_if:type,text,generic",
            "multiLanguage" => true,
            "parent" => array(
                "name" => "type",
                "values" => array("text", "generic")
            )
        ),
        array(
            "name" => "overlay",
            "label" => "White Overlay",
            "type" => "selectBox",
            "list" => array(
                "no" => "No",
                "yes" => "Yes"
            ),
            "preValidation" => "trim",
            "validation" => "nullable|required_if:type,generic|in:yes,no",
            "defaultValue" => "no",
            "parent" => array(
                "name" => "type",
                "values" => array("generic")
            ),
            "placement" => "sidebar"
        ),
        array(
            "name" => "cobenefit_id",
            "label" => "cobenefit",
            "type" => "selectBox",
            "contentType" => "cobenefit",
            "validation" => "nullable|integer",
            "placement" => "sidebar",
            "parent" => array(
                "name" => "type",
                "values" => array("generic")
            )
        ),
        array(
            "name" => "text_scheme",
            "label" => "Text Scheme",
            "type" => "selectBox",
            "list" => array(
                "light" => "Light",
                "dark" => "Dark"
            ),
            "preValidation" => "trim",
            "validation" => "nullable|required_if:type,generic|in:light,dark",
            "parent" => array(
                "name" => "type",
                "values" => array("generic", "text")
            ),
            "placement" => "sidebar"
        ),
        array(
            "name" => "text_position",
            "label" => "Text Position",
            "type" => "selectBox",
            "list" => array(
                "top" => "Top",
                "bottom" => "Bottom"
            ),
            "preValidation" => "trim",
            "validation" => "nullable|required_if:type,generic|in:top,bottom",
            "parent" => array(
                "name" => "type",
                "values" => array("generic")
            ),
            "placement" => "sidebar"
        ),
        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" => "call_to_action",
            "label" => "call to action",
            "type" => "link",
            "multiLanguage" => true,
            "required" => false,
            "maxLabel" => 30,
            "objectTypes" => array("project", "page", "solution", "case_study"),
            "parent" => array(
                "name" => "type",
                "values" => array("text", "generic")
            )
        )
    ),
    "actions" => array(
        "insert", "edit", "delete"
    )
);
