File: D:/HostingSpaces/SBogers93/fitale.nl/workbench/komma/kms/src/Komma/Kms/Pages/PageSection.php
<?php
/**
* Short description for the file.
*
* @author Komma <info@komma.pro>
* @copyright (c) 2012-2015, Komma Mediadesign
*/
namespace Komma\Kms\Pages;
use Komma\Kms\Pages\Models\Page;
use Komma\Kms\Core\Kms;
use Komma\Kms\Core\Sections\KmsSectionTabs;
use Komma\Kms\Core\Sections\KmsSection;
class PageSection extends KmsSection
{
protected $title = "Pagina’s";
protected $subTitle = "";
protected $slug = "pages";
public $showSave = 'all'; // Options: 'all' | 'admin' (SuperAdmin only) | 'none' (or anything else what isn't all or admin)
public $showDelete = 'admin';
public $showCreate = 'admin';
protected $entityAttributesData = [
// Pages Attributes
'page_label' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTitle',
'options' => [
'title' => 'Admin only',
'onlyForSuperAdmin' => true
],
],
'active' => [
'type' => 'Komma\Kms\Core\Attributes\KmsOnOff',
'options' => [
'label' => 'Actief',
],
],
'controller' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'options' => [
'label' => 'Controller',
'placeholder' => 'Enter a controller',
'onlyForSuperAdmin' => true
]
],
'code_name' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'options' => [
'label' => 'Code_name',
'placeholder' => 'Enter a name',
'onlyForSuperAdmin' => true
]
],
'meta_title' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Meta Titel',
'placeholder' => 'Kies de meta title',
'validation' => [
'rules' => 'required',
'messages' => [
'required' => 'You need to enter a meta title',
]
],
'onlyForSuperAdmin' => true
],
],
'meta_description' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Meta Description',
'placeholder' => 'Kies de meta description',
'validation' => [
'rules' => 'required',
'messages' => [
'required' => 'You need to enter a meta description',
]
],
'onlyForSuperAdmin' => true
],
],
'parent_id' => [
'type' => 'Komma\Kms\Core\Attributes\KmsSelect',
'options' => [
'label' => 'Parent page',
'placeholder' => 'Select a parent page',
'data' => 'Komma\Kms\Pages\PageRepository@getForSelect',
'exclude' => '[[entityId]]',
'onlyForSuperAdmin' => true
]
],
'block_ids' => [
'type' => 'Komma\Kms\Core\Attributes\KmsMultiSelect',
'options' => [
'label' => 'Blokken',
'placeholder' => 'select block',
'data' => 'Komma\Kms\Blocks\BlockRepository@getForSelect',
'onlyForSuperAdmin' => true
]
],
'spacer' => [
'type' => 'Komma\Kms\Core\Attributes\KmsSeparator',
'options' => [
'onlyForSuperAdmin' => true
]
],
'label2' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTitle',
'options' => [
'title' => 'Pagina',
'onlyForSuperAdmin' => true
],
],
'name' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Titel',
'placeholder' => 'Kies een passende titel voor het pagina',
'validation' => [
'rules' => 'required',
'messages' => [
'required' => 'You need to enter a title',
]
],
'onlyForSuperAdmin' => true
],
],
'route' => [
'type' => 'Komma\Kms\Core\Attributes\KmsRoute',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Webadres',
'class' => 'hidden',
'placeholder' => 'Wordt automatisch gegenereerd',
'structure' => '{{parentSlugs}}{{slug}}',
'slugField' => 'slug_[[languageId]]',
'parentField' => 'parent_id',
'rest_route' => 'pages/[[id]]',
'validation' => [
'rules' => 'required|unique:routes,route,[[routableId]],routable_id|different:[[routesInOtherLanguages]]',
'messages' => [
'required' => 'You need to enter a route',
'unique' => 'This route already exists',
'different' => 'This route needs to be unique'
]
],
'onlyForSuperAdmin' => true
]
],
'slug' => [
'type' => 'Komma\Kms\Core\Attributes\KmsSlug',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Slug',
'class' => 'hidden',
'placeholder' => 'Enter a slug',
'autoSlugField' => 'name_[[languageId]]',
'validation' => [
'rules' => 'required',
'messages' => [
'required' => 'You need to enter a slug',
]
],
'onlyForSuperAdmin' => true
]
],
'description' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextEditor',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Description',
'placeholder' => 'Enter a description'
]
],
];
function __construct(
Kms $kms,
PageRepository $repository,
KmsSectionTabs $tabs)
{
parent::__construct($kms, $repository, $tabs);
}
}