<?php
  return [
    "type"           => "block",
    "model"          => "Block",
    "label"          => "Blocks",
    "label_singular" => "Block",
    "group"          => "none",
    "order"          => TRUE,
    "template"       => FALSE,
    //  "showSlug" => true,
    "showUri"        => TRUE,
    "baseUri"        => [
      'de' => Lang::get('routes.uri_blocks', [], 'de'),
      'en' => Lang::get('routes.uri_blocks', [], 'en'),
      'fr' => Lang::get('routes.uri_blocks', [], 'fr')
    ],
    "parent"         => [
      "field"       => "story_id",
      "contentType" => "story"
    ],
    "fields"         => [
      [
        "name"          => "title",
        "label"         => "Block Title",
        "type"          => "textBox",
        "maxLength"     => 255,
        "multiLanguage" => TRUE,
        "preValidation" => "strip_tags|xss_clean|trim",
        "validation"    => "required|max:255",
        "inList"        => TRUE,
        "search"        => TRUE,
        "sort"          => TRUE
      ],
      [
        "name"       => "block_type",
        "label"      => "Block Type",
        "type"       => "selectBox",
        "inList"     => TRUE,
        "list"       => [
          "title"    => "Title",
          "subtitle" => "Subtitle",
          "image"    => "Image",
          "wysiwyg"  => "Wysiwyg",
          "cta"      => "CTA",
          "slider"   => "Slider"
        ],
        "validation" => "",
        "placement"  => "sidebar"
      ],
      [
        "name"          => "block_title",
        "label"         => "Title",
        "type"          => "textArea",
        "maxLength"     => 3000,
        "multiLanguage" => TRUE,
        "preValidation" => "xss_clean|trim",
        "validation"    => "max:3000",
        "parent"        => [
          "name"   => "block_type",
          "values" => ["title"]
        ]
      ],
      [
        "name"          => "block_subtitle",
        "label"         => "Subtitle",
        "type"          => "textArea",
        "maxLength"     => 3000,
        "multiLanguage" => TRUE,
        "preValidation" => "xss_clean|trim",
        "validation"    => "max:3000",
        "parent"        => [
          "name"   => "block_type",
          "values" => ["subtitle"]
        ]
      ],
      [
        "name"               => "image",
        "label"              => "Image",
        "type"               => "mediaPicker",
        "multiLanguage"      => FALSE,
        "mediaType"          => "image",
        "multiple"           => FALSE,
        "minSize"            => "0",
        "thumbnailSizes"     => [
          ["type" => "fit", "name" => "Fit870xAuto", "width" => 870, "height" => NULL],
          ["type" => "resize", "name" => "Resize870xAuto", "width" => 870, "height" => NULL]
        ],
        "relatedContentType" => 'story',
        "info"               => "Upload Image",
        "parent"             => [
          "name"   => "block_type",
          "values" => ["image"]
        ]
      ],
      [
        "name"          => "block_wysiwyg",
        "label"         => "Wysiwyg",
        "type"          => "editor",
        "maxLength"     => 10000,
        "multiLanguage" => TRUE,
        "preValidation" => "xss_clean|trim",
        "validation"    => "max:10000",
        "parent"        => [
          "name"   => "block_type",
          "values" => ["wysiwyg"]
        ]
      ],
      [
        "name"          => "block_cta_title",
        "label"         => "CTA Title",
        "type"          => "textBox",
        "maxLength"     => 255,
        "multiLanguage" => TRUE,
        "preValidation" => "strip_tags|xss_clean|trim",
        "validation"    => "max:255",
        "parent"        => [
          "name"   => "block_type",
          "values" => ["cta"]
        ]
      ],
      [
        "name"          => "block_cta_url",
        "label"         => "CTA Url",
        "type"          => "textBox",
        "maxLength"     => 255,
        "multiLanguage" => TRUE,
        "preValidation" => "strip_tags|xss_clean|trim",
        "validation"    => "max:255",
        "parent"        => [
          "name"   => "block_type",
          "values" => ["cta"]
        ]
      ],
      [
        "name"          => "block_video_url",
        "label"         => "Video Url",
        "type"          => "textBox",
        "maxLength"     => 400,
        "multiLanguage" => TRUE,
        "preValidation" => "strip_tags|xss_clean|trim",
        "validation"    => "max:400",
        "parent"        => [
          "name"   => "block_type",
          "values" => ["video"]
        ]
      ],
      [
        "name"          => "slider_id",
        "label"         => "Slider",
        "type"          => "selectBox",
        "contentType"   => "slider",
        "preValidation" => "trim",
        "validation"    => "integer|min:0",
        "inList"        => TRUE,
        "search"        => FALSE,
        "sort"          => FALSE,
        "parent"        => [
          "name"   => "block_type",
          "values" => ["slider"]
        ]
      ],
    ],
    "actions"        => [
      "insert", "edit", "delete", "order"
    ]
  ];
