<?php
return array(
    "type" => "form_field",
    "model" => "FormField",
    "label" => "Form Fields",
    "label_singular" => "Form Field",
    "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" => "type",
            "label" => "Type",
            "type" => "selectBox",
            "list" => array(
                "text" => "Text Input",
                "textarea" => "Text Area",
                "select" => "Select",
                "checkbox" => "Checkbox",
                "date" => "Date",
                "radio" => "Radio Group",
                "hidden" => "Hidden"
            ),
            "preValidation" => "trim",
            "validation" => "required|in:text,textarea,select,checkbox,date,radio,hidden",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "label",
            "label" => "Field Label",
            "type" => "textBox",
            "maxLength" => 100,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:100"
        ),
        array(
            "name" => "field_id",
            "label" => "Field ID",
            "type" => "textBox",
            "maxLength" => 100,
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required|max:100"
        ),
        array(
            "name" => "field_name",
            "label" => "Field Name",
            "type" => "textBox",
            "maxLength" => 100,
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required|max:100"
        ),
        array(
            "name" => "default_value",
            "label" => "Default value",
            "type" => "textBox",
            "maxLength" => 255,
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required_if:type,hidden|max:255"
        ),
        array(
            "name" => "validation",
            "label" => "Validation",
            "type" => "selectBox",
            "list" => array(
                "email" => "E-mail",
                "url" => "URL link",
                "number" => "Number"
            ),
            "preValidation" => "trim",
            "validation" => "in:email,url,number",
            "parent" => array(
                "name" => "type",
                "values" => array("text")
            ),
            "placement" => "sidebar",
        ),
        array(
            "name" => "max_length",
            "label" => "Max Length",
            "type" => "textBox",
            "maxLength" => 4,
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "nullable|integer",
            "parent" => array(
                "name" => "type",
                "values" => array("text", "textarea")
            ),
            "placement" => "sidebar",
        ),
        array(
            "name" => "lines",
            "label" => "Textarea Lines",
            "type" => "selectBox",
            "list" => array(
                "1" => "1",
                "2" => "2",
                "3" => "3",
                "4" => "4",
            ),
            "validation" => "nullable|integer",
            "parent" => array(
                "name" => "type",
                "values" => array("textarea")
            ),
            "placement" => "sidebar",
        ),
        array(
            "name" => "multiple",
            "label" => "Pick multiple options?",
            "type" => "checkBox",
            "validation" => "",
            "placement" => "sidebar",
            "parent" => array(
                "name" => "type",
                "values" => array("select")
            ),
        ),
        array(
            "name" => "inline_options",
            "label" => "Inline options?",
            "type" => "checkBox",
            "validation" => "",
            "placement" => "sidebar",
            "parent" => array(
                "name" => "type",
                "values" => array("radio")
            ),
        ),
        array(
            "name" => "options",
            "label" => "Options",
            "type" => "textArea",
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "",
            "parent" => array(
                "name" => "type",
                "values" => array("select", "radio")
            ),
            "info" => "Set one select/radio option per line like [id]:[label]"
        ),
    ),
    "actions" => array(
        "insert", "edit", "delete"
    )
);
