<?php
return array(
    "type" => "form",
    "model" => "CustomForm",
    "label" => "Forms",
    "label_singular" => "Form",
    "group" => "communicating",
    "template" => false,
    "order" => false,
    "shareable" => "none",
    "websites" => array(2),
    "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" => "crm_form_type",
            "label" => "Sugar CRM form type (form_type_c)",
            "type" => "textBox",
            "maxLength" => 100,
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required|max:100",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "submit_label",
            "label" => "Submit Button Label",
            "type" => "textBox",
            "maxLength" => 50,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required|max:50",
        ),
        array(
            "name" => "redirect_type",
            "label" => "Redirect to",
            "type" => "selectBox",
            "list" => array(
                "thank_you" => "Thank You generic page",
                "other" => "Other Page"
            ),
            "preValidation" => "trim",
            "validation" => "required|in:thank_you,other",
            "placement" => "sidebar",
        ),
        array(
            "name" => "color_scheme",
            "label" => "Color Scheme",
            "type" => "selectBox",
            "list" => array(
                "dark" => "Light (for dark backgrounds)",
                "light" => "Dark (for light backgrounds)"
            ),
            "preValidation" => "trim",
            "validation" => "required|in:light,dark",
            "placement" => "sidebar",
        ),
        array(
            "name" => "other_redirect",
            "label" => "Redirect URL",
            "type" => "textBox",
            "maxLength" => 255,
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required_if:redirect_type,other|max:255|url",
            "parent" => array(
                "name" => "redirect_type",
                "values" => array("other")
            ),
        ),
        array(
            "name" => "formItems",
            "label" => "Form Field Items",
            "type" => "singlePicker",
            "objectType" => "form_item",
            "order" => true
        ),
    ),
    "actions" => array(
        "insert", "edit", "duplicate", "delete"
    )
);
