<?php
return array(
    "type" => "office",
    "model" => "App\Models\Office",
    "label" => "offices",
    "label_singular" => "office",
    "group" => "general",
    "template" => false,
    "order" => true,
    "fields" => array(
        array(
            "name" => "title",
            "label" => "title",
            "type" => "textBox",
            "maxLength" => 50,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required|max:50",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "city",
            "label" => "City",
            "type" => "textBox",
            "maxLength" => 30,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required|max:30",
            "placement" => "sidebar"
        ),
        array(
            "name" => "content",
            "label" => "content",
            "type" => "editor",
            "multiLanguage" => true,
            "preValidation" => "trim|xss_clean",
            "validation" => "",
            "info" => "Old map field - won't be used anymore"
        ),
        array(
            "name" => "address",
            "label" => "Address",
            "type" => "textArea",
            "multiLanguage" => false,
            "preValidation" => "trim|xss_clean",
            "validation" => "max:500"
        ),
        array(
            "name" => "cta",
            "label" => "Link - Website",
            "type" => "link",
            "multiLanguage" => true,
            "required" => false,
            "maxLabel" => 120,
            "objectTypes" => array(),
        ),
        array(
            "name" => "location",
            "label" => "location",
            "type" => "location",
            "required" => false
        ),
        array(
            "name" => "contact_id",
            "label" => "contact",
            "type" => "selectBox",
            "contentType" => "contact",
            "labelField" => "name",
            "dropdownSortField" => "contacts.name",
            "preValidation" => "trim",
            "validation" => "nullable|integer|min:0",
            "inList" => false,
            "search" => false,
            "sort" => false,
            "placement" => "sidebar"
        ),
        array(
            "name" => "country_id",
            "label" => "country",
            "type" => "selectBox",
            "contentType" => "country",
            "preValidation" => "trim",
            "validation" => "required|integer",
            "inList" => true,
            "search" => true,
            "sort" => true,
            "placement" => "sidebar"
        ),
        array(
            "name" => "is_headquarter",
            "label" => "Headquarter",
            "type" => "checkBox",
            "placement" => "sidebar",
            "inList" => true
        ),
        array(
            "name" => "phone",
            "label" => "General Phone",
            "type" => "textBox",
            "maxLength" => 50,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:50",
            "inList" => true,
            "placement" => "sidebar"
        ),
        array(
            "name" => "fax",
            "label" => "Fax",
            "type" => "textBox",
            "maxLength" => 50,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:50",
            "placement" => "sidebar"
        ),
        array(
            "name" => "overviewImage",
            "label" => "overview image",
            "type" => "mediaPicker",
            "multiLanguage" => false,
            "mediaType" => "image",
            "placement" => "sidebar",
            "multiple" => false,
            "minSize" => "0",
            /*
            "thumbnailSizes" => array(
                array("type" => "fit", "name" => "420x670", "width" => 420, "height" => 670)
            ),
            */
            "relatedContentType" => 'office',
            "info" => 'Portrait image - min: 420x670'
        ),
    ),
    "actions" => array(
        "insert", "edit", "duplicate", "delete", "order"
    )
);
