<?php

use App\Models\GenericBackoffice\Entry;

return [
    "type"           => "page",
    "model"          => App\Models\GenericBackoffice\Entry::class,
    "label"          => "pages",
    "label_singular" => "page",
    "template"       => TRUE,
    "hierarchic"     => TRUE,
    "group"          => "general",
    "order"          => TRUE,
    //"meta_title_update_field" => "title", // content_types should have this property to allow automatic filling of meta info, if not set by user (See BackofficeService::240)
    //  "showSlug" => true,
    "showUri"        => TRUE,
    "search"         => [
        "primary"   => ["title"],
        "secondary" => ["content"],
        "display"   => [
            "title"   => "title",
            "content" => "content"
        ]
    ],
    "fields"         => [
        [
            "name"          => "title",
            "label"         => "title",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "required|max:150",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE
        ],
        [
            "name"          => "content_area",
            "label"         => "Content Screen",
            "type"          => "selectBox",
            "list"          => Entry::getContentAreas(),
            "defaultValue"  => "    ",
            "preValidation" => "trim",
            "validation"    => "required",
            'info'          => 'This will associate this content to a specific app screen. The value must be used only once.',
            "inList"        => TRUE,
        ],
        [
            "name"          => "content",
            "label"         => "content",
            "type"          => "editor",
            "multiLanguage" => TRUE,
            "preValidation" => "trim|xss_clean",
            "validation"    => ""
        ],
        [
            "name"          => "blocks",
            "label"         => "Blocks",
            "type"          => "multiplePicker",
            "longList"      => true,
            "allowInsert"   => true,
            "objectTypes"   => ["blocks"],
            "order"         => true
        ],
        [
            "name"          => "meta_title",
            "label"         => "[Meta] Title",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:150",
            "placement"     => "sidebar",
            "inList"        => FALSE,
            "search"        => FALSE,
            "sort"          => FALSE
        ],
        [
            "name"          => "meta_description",
            "label"         => "[Meta] Description",
            "type"          => "textArea",
            "maxLength"     => 300,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:300",
            "placement"     => "sidebar",
            "inList"        => FALSE,
            "search"        => FALSE,
            "sort"          => FALSE
        ],
        [
            "name"      => "metaImage",
            "label"     => "[Meta] Image",
            "type"      => "mediaPicker",
            "multiple"  => FALSE,
            "mediaType" => "image",
            "placement" => "sidebar"
        ]
    ],
    "actions"        => [
        "insert", "edit", "delete", "order", "configuration"
    ],
    "templates"      => [
        'homepage' => [
            'id'   => 'homepage',
            'name' => 'Home Page',
            'view' => 'frontend.pages.homepage'
        ]
    ]
];
