File: D:/HostingSpaces/SBogers26/gripp.nu/workbench/komma/kms/src/Komma/Kms/Posts/PostSection.php
<?php
/**
* Short description for the file.
*
* @author Komma <info@komma.pro>
* @copyright (c) 2012-2015, Komma Mediadesign
*/
namespace Komma\Kms\Posts;
use Komma\Kms\Posts\Models\Post;
use Komma\Kms\Core\Kms;
use Komma\Kms\Core\Sections\KmsSectionTabs;
use Komma\Kms\Core\Sections\KmsSection;
class PostSection extends KmsSection
{
protected $title = "Nieuws berichten";
protected $subTitle = "";
protected $slug = "posts";
public $showSave = 'all'; // Options: 'all' | 'admin' (SuperAdmin only) | 'none' (or anything else what isn't all or admin)
public $showDelete = 'all';
public $showCreate = 'all';
protected $entityAttributesData = [
// Posts Attributes
'active' => [
'type' => 'Komma\Kms\Core\Attributes\KmsOnOff',
'options' => [
'label' => 'Actief',
'placeholder' => 1
],
],
'show_on_home' => [
'type' => 'Komma\Kms\Core\Attributes\KmsOnOff',
'options' => [
'label' => 'Toon op de homepagina',
'placeholder' => 1
],
],
'code_name' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'options' => [
'label' => 'Code naam',
'class' => 'hidden',
'placeholder' => 'code naam van het post',
],
],
'route' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'URL',
'placeholder' => 'url van het bericht',
'canNotChange' => true
],
],
'date' => [
'type' => 'Komma\Kms\Core\Attributes\KmsDate',
'options' => [
'label' => 'Post datum',
'placeholder' => 'Gerealiseerd op',
]
],
'title' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Titel',
'placeholder' => 'Titel van het post',
// 'validation' => [
// 'rules' => 'required',
// 'messages' => [
// 'required' => 'Voeg een titel toe',
// ]
// ]
],
],
'meta_description' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextEditor',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Korte omschrijving',
'placeholder' => 'Korte omschrijving',
]
],
'resource' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'options' => [
'label' => 'Bron',
'placeholder' => 'ex. ED',
// 'validation' => [
// 'rules' => 'required',
// 'messages' => [
// 'required' => 'Voeg een titel toe',
// ]
// ]
],
],
'resource_link' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'options' => [
'label' => 'Bronverwijzing',
'placeholder' => 'ex. http://www.ed.nl/algemeen/economie/consumentenvertrouwen-blijft-positief-1.6655824',
// 'validation' => [
// 'rules' => 'required',
// 'messages' => [
// 'required' => 'Voeg een titel toe',
// ]
// ]
],
],
'parent_id' => [
'type' => 'Komma\Kms\Core\Attributes\KmsSelect',
'options' => [
'class' => 'hidden',
'label' => 'Parent page',
'placeholder' => 'Select a parent page',
'data' => 'Komma\Kms\Posts\PostRepository@getForSelect',
'exclude' => '[[entityId]]',
]
],
'description' => [
'type' => 'Komma\Kms\Core\Attributes\KmsDynamic',
'forEach' => 'AllLanguages',
'options' => [
'subFolder' => 'pages',
'label' => 'Eerste contentblock',
'placeholder' => 'Eerste contentblock',
'blockSettings' => [
'two_column_block' => [
'subFolder' => 'section'
],
'content_block' => [
'subFolder' => 'section',
],
'full_image_block' => [
'max_images' => 2,
'subFolder' => 'section',
],
'full_text_block' => [
'subFolder' => 'section',
],
'multiple_images_block' => [
'tab' => [
['max_images' => 1],
['label' => 'Afbeelding 2b (optioneel)', 'max_images' => 1]],
'subFolder' => 'section'
],
]
]
],
];
function __construct(
Kms $kms,
PostRepository $repository,
KmsSectionTabs $tabs)
{
parent::__construct($kms, $repository, $tabs);
}
}