<?php
return array(
    "type" => "form_item",
    "model" => "FormItem",
    "label" => "Form Items",
    "label_singular" => "Form Field Item",
    "group" => "none",
    "shareable" => "none",
    "websites" => array(2),
    "template" => false,
    "order" => true, 
    "parent" => array(
        "field" => "custom_form_id",
        "contentType" => "form"
    ),
    "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(
                "field" => "Field",
                "section" => "Section Header", 
            ),
            "preValidation" => "trim",
            "validation" => "required|in:field,section"
        ), 
        array(
            "name" => "form_field_id",
            "label" => "Form Field",
            "type" => "selectBox",
            "contentType" => "form_field",
            "preValidation" => "trim",
            "validation" => "required_if:type,field|integer|min:1",
            "parent" => array(
                "name" => "type",
                "values" => array("field")
            ),
        ),
        array(
            "name" => "is_required",
            "label" => "Required field?", 
            "type" => "checkBox",
            "validation" => "",
            "placement" => "sidebar",
            "parent" => array(
                "name" => "type",
                "values" => array("field")
            ),
        ), 
        array(
            "name" => "width",
            "label" => "Width (cols)",
            "type" => "selectBox",
            "list" => array(
                "1" => "One Column",
                "2" => "Two Column",
                "3" => "Three Column"
            ),
            "preValidation" => "trim",
            "validation" => "required_if:type,field|in:1,2,3",
            "placement" => "sidebar",
            "parent" => array(
                "name" => "type",
                "values" => array("field")
            ),   
        ),
        array(
            "name" => "label_position",
            "label" => "Label Position",
            "type" => "selectBox",
            "list" => array(
                "placeholder" => "Placeholder",
                "top" => "Top of Field"
            ),
            "preValidation" => "trim",
            "validation" => "in:placeholder,top,left",
            "placement" => "sidebar",
            "parent" => array(
                "name" => "type",
                "values" => array("field")
            ),
        ),
        array(
            "name" => "section_title",
            "label" => "Section Title", 
            "type" => "textBox",
            "maxLength" => 100,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:100",
            "parent" => array(
                "name" => "type",
                "values" => array("section")
            ),
        ),
        array(
            "name" => "section_description",
            "label" => "Section Description", 
            "type" => "editor",
            "validation" => "",
            "multiLanguage" => true,
            "parent" => array(
                "name" => "type",
                "values" => array("section")
            )
        ),            
    ),
    "actions" => array(
        "insert", "edit", "delete"
    )
);