<?php
return array(
    "type" => "news",
    "model" => "App\Models\News",
    "label" => "news",
    "label_singular" => "news",
    "group" => "communicating",
    "template" => false,
    "order" => false,
    "type_filter_field" => 'type',
    "baseUri" => array(
        1 => array(
            'in_media'  => '/news',
            'news'  => '/news',
            'blog' => '/news',
            'press_release' => '/news'
        ),
        2 => array(
            'in_media'  => '/news',
            'news'  => '/news',
            'blog' => '/blog',
            'press_release' => '/news'
        )
    ),
    "search" => array(
        1 => array(
            "primary" => array("title", "location"),
            "secondary" => array("content", "summary"),
            "display" => array(
                "title" => "title",
                "content" => "reference_summary|content",
                "image_id" => "media"
            ),
            "relations" => [
                "blocks",
            ]
        ),
        2 => array(
            "primary" => array("title", "location"),
            "secondary" => array("content", "summary"),
            "display" => array(
                "title" => "title",
                "content" => "content",
                "image_id" => "media"
            )
        )
    ),
    "fields" => array(
        array(
            "name" => "title",
            "label" => "title",
            "type" => "textBox",
            "maxLength" => 170,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required|max:170",
            "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" => "header_overlap",
            "label" => "Header overlaps content?",
            "type" => "checkBox",
            "placement" => "sidebar",
            "blocksMode" => "also",
            "parent" => array(
                "name" => "layout_type",
                "values" => array("blocks")
            )
        ),
        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" => "summary",
            "label" => "summary",
            "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"          => "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" => "date",
            "label" => "date",
            "type" => "datePicker",
            "inputType" => "date", //time|date|datetime
            "multiLanguage" => false,
            "validation" => "required",
            "placement" => "sidebar",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "type",
            "label" => "type",
            "type" => "selectBox",
            "list" => array(
                "news" => "News",
                "in_media" => "In media",
                "blog" => "Blog",
                "press_release" => "Press Release"
            ),
            "preValidation" => "trim",
            "validation" => "required|in:news,in_media,blog,press_release",
            "placement" => "sidebar",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "author",
            "label" => "author",
            "type" => "textBox",
            "maxLength" => 50,
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required|max:50",
            "inList" => true,
            "search" => true,
            "sort" => true,
            "placement" => "sidebar"
        ),
        array(
            "name" => "is_thought_leadership",
            "label" => "Thought Leadership",
            "type" => "checkBox",
            "placement" => "sidebar"
        ),
        array(
            "name" => "media",
            "label" => "cover media",
            "type" => "mediaPicker",
            "multiLanguage" => false,
            "mediaType" => "image",
            "placement" => "sidebar",
            "multiple" => false,
            "minSize" => "0",
            /*
            "thumbnailSizes" => array(
                array("type" => "fit", "name" => "280x150", "width" => 280, "height" => 150),
                array("type" => "resize_noup", "name" => "800w", "width" => 800, "height" => 800),
            ),
            */
            "relatedContentType" => 'news'
        ),
        array(
            "name" => "document",
            "label" => "PDF document",
            "type" => "mediaPicker",
            "multiLanguage" => true,
            "mediaType" => "document",
            "placement" => "sidebar",
            "multiple" => false,
            "minSize" => "0",
            "relatedContentType" => 'news'
        ),
        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" => "canonical_url",
            "label" => "Canonical URL (original source of the content)",
            "type" => "textBox",
            "maxLength" => 255,
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "nullable|url|max:255"
        ),
        array(
            "name" => "sidebarWidgets",
            "label" => "Sidebar Widgets",
            "type" => "singlePicker",
            "objectType" => "sidebar_widget",
            "pivotTable" => "news_sidebar_widget",
            "order" => true,
            "maxSize" => 20
        ),
    ),
    "actions" => array(
        "insert", "edit", "duplicate", "delete"
    )
);
