<?php
return array(
    "type" => "case_study",
    "model" => "CaseStudy",
    "label" => "case studies",
    "label_singular" => "case study",
    "group" => "solutions",
    "template" => false,
    "order" => true,
    "defaultSort" => ['id' => 'DESC'],
    "websites" => array(1),
    "baseUri" => array(
        1 => array(
            "en" => "/clients",
        )
    ),
    "search" => array(
        1 => array(
            "primary" => array("title", "tagline"),
            "secondary" => array("content", "summary", "objective"),
            "display" => array(
                "title" => "title",
                "content" => "reference_summary|summary|tagline",
                "image_id" => "overviewImage"
            ),
            'uri' => array(
                "en" => "/work/{slug}",
                "de" => "/work/{slug}",
                "sv" => "/work/{slug}",
                "es" => "/work/{slug}",
                "pt" => "/work/{slug}",
                "fr" => "/work/{slug}"
            ),
            "relations" => [
                "blocks",
            ]
        )
    ),
    "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" => "reference_summary",
            "label" => "Reference Summary",
            "type" => "textBox",
            "maxLength" => 220,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:220"
        ),
        array(
            "name"          => "blocks",
            "label"         => "Blocks",
            "type"          => "multiplePicker",
            "longList"      => true,
            "multiLanguage" => true,
            "allowInsert"   => true,
            "objectTypes"   => ["block"],
            "order"         => true,
            "blocksMode" => "also",
            "duplicateRelated" => true,
            "parent" => array(
                "name" => "layout_type",
                "values" => array("blocks")
            )
        ),
        array(
            "name" => "tagline",
            "label" => "tagline",
            "type" => "textBox",
            "maxLength" => 255,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:255",
            "inList" => false,
            "search" => false,
            "sort" => false,
            "parent" => array(
                "name" => "layout_type",
                "values" => array("standard", "")
            )
        ),
        array(
            "name" => "layout_type",
            "label" => "Layout Type",
            "type" => "selectBox",
            "list" => array(
                "standard" => "Standard",
                "blocks" => "Blocks"
            ),
            "preValidation" => "trim",
            "validation" => "nullable|in:standard,blocks",
            "placement" => "sidebar",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "header_overlap",
            "label" => "Header overlaps content?",
            "type" => "checkBox",
            "placement" => "sidebar",
            "blocksMode" => "also",
            "parent" => array(
                "name" => "layout_type",
                "values" => array("blocks")
            )
        ),
        array(
            "name" => "summary",
            "label" => "summary",
            "type" => "editor",
            "multiLanguage" => true,
            "preValidation" => "trim|xss_clean",
            "validation" => "",
            "parent" => array(
                "name" => "layout_type",
                "values" => array("standard", "")
            )
        ),
        array(
            "name" => "objective",
            "label" => "objective",
            "type" => "editor",
            "multiLanguage" => true,
            "preValidation" => "trim|xss_clean",
            "validation" => "",
        ),
        array(
            "name" => "content",
            "label" => "content",
            "type" => "editor",
            "multiLanguage" => true,
            "preValidation" => "trim",
            "validation" => "",
            "parent" => array(
                "name" => "layout_type",
                "values" => array("standard", "")
            )
        ),
        array(
            "name" => "slides",
            "label" => "slider images",
            "type" => "mediaPicker",
            "multiLanguage" => false,
            "mediaType" => 'image',
            "multiple" => true,
            "minSize" => "0",
            "relatedContentType" => 'case_study',
            "parent" => array(
                "name" => "layout_type",
                "values" => array("standard", "")
            )
        ),
        array(
            "name" => "sectors",
            "label" => "industry sectors",
            "type" => "multiplePicker",
            "websiteFiltered" => false,
            "objectTypes" => array("sector"),
            "order" => true
        ),
        array(
            "name" => "downloads",
            "label" => "download publications",
            "type" => "multiplePicker",
            "websiteFiltered" => false,
            "allowInsert" => true,
            "objectTypes" => array("publication"),
            "order" => true
        ),
        array(
            "name" => "overviewImage",
            "label" => "overview image",
            "type" => "mediaPicker",
            "multiLanguage" => false,
            "mediaType" => "image",
            "placement" => "sidebar",
            "multiple" => false,
            "minSize" => "0",
            "relatedContentType" => 'case_study'
        ),
        array(
            "name" => "client_name",
            "label" => "client name",
            "type" => "textBox",
            "maxLength" => 150,
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required|max:150",
            "placement" => "sidebar"
        ),
        array(
            "name" => "clientImage",
            "label" => "client logo",
            "type" => "mediaPicker",
            "multiLanguage" => false,
            "mediaType" => "image",
            "placement" => "sidebar",
            "multiple" => false,
            "minSize" => "0",
            "relatedContentType" => 'case_study'
        ),
        array(
            "name" => "recommend",
            "label" => "Also Recommended",
            "type" => "multiplePicker",
            "websiteFiltered" => true,
            "longList" => true,
            "objectTypes" => array("project", "solution", "case_study", "news", "content_snippet", "page", "blog_post", "event_item", "sector"),
            "order" => true
        ),
        array(
            "name" => "meta_title",
            "label" => "SEO - Title Tag",
            "type" => "textBox",
            "maxLength" => 150,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:150"
        ),
        array(
            "name" => "meta_keywords",
            "label" => "SEO - Keywords",
            "type" => "textBox",
            "maxLength" => 150,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:150"
        ),
        array(
            "name" => "meta_description",
            "label" => "SEO - Description",
            "type" => "textArea",
            "maxLength" => 300,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:300"
        ),
        array(
            "name" => "codeEmbeds",
            "label" => "Code Embeds",
            "type" => "multiplePicker",
            "objectTypes" => array("code_embed"),
            "order" => true,
            "allowInsert" =>false,
        ),
        array(
            "name" => "sidebarWidgets",
            "label" => "Sidebar Widgets",
            "type" => "singlePicker",
            "objectType" => "sidebar_widget",
            "pivotTable" => "case_study_sb_widgets",
            "order" => true,
            "maxSize" => 20,
            "parent" => array(
                "name" => "layout_type",
                "values" => array("standard", "")
            )
        )
    ),
    "actions" => array(
        "insert", "edit", "duplicate", "delete", "order"
    )
);
