File: D:/HostingSpaces/SBogers79/artofeinstein.be/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 $showDelete = false;
//public $showCreate = false;
protected $entityAttributesData = [
// Pages Attributes
'page_label' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTitle',
'tab' => 'Pagina',
'options' => [
'title' => 'Admin only',
'onlyForSuperAdmin' => true
],
],
'controller' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'tab' => 'Pagina',
'options' => [
'label' => 'Controller',
'placeholder' => 'Enter a controller',
'onlyForSuperAdmin' => true
]
],
'code_name' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'tab' => 'Pagina',
'options' => [
'label' => 'Code_name',
'placeholder' => 'Enter a name',
'onlyForSuperAdmin' => true
]
],
'meta_title' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'tab' => 'Pagina',
'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',
'tab' => 'Pagina',
'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',
'tab' => 'Pagina',
'options' => [
'label' => 'Parent page',
'placeholder' => 'Select a parent page',
'data' => 'Komma\Kms\Pages\PageRepository@getForSelect',
'exclude' => '[[entityId]]',
// 'data_example' => [
// ['value' => 'Faes', 'content' => 'Data: test', 'htmlContent' => '<i>Data: test</i>'],
// ['value' => 'Faas', 'content' => 'Data: testen', 'htmlContent' => '<i>Data: testen</i>'],
// ['value' => 'Faesch', 'content' => 'Data: tester', 'htmlContent' => '<i>Data: tester</i>'],
// ],
'onlyForSuperAdmin' => true
]
],
'spacer' => [
'type' => 'Komma\Kms\Core\Attributes\KmsSeparator',
'tab' => 'Pagina',
'options' => [
'onlyForSuperAdmin' => true
]
],
'label2' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTitle',
'tab' => 'Pagina',
'options' => [
'title' => 'Pagina',
'onlyForSuperAdmin' => true
],
],
'name' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'tab' => 'Pagina',
'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',
'tab' => 'Pagina',
'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',
'tab' => 'Pagina',
'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
]
],
'images' => [
'type' => 'Komma\Kms\Core\Attributes\KmsImages',
'tab' => 'pagina',
'options' => [
'label' => 'Images',
'subfolder' => 'pages',
'maxImages' => 4,
'uploadSizes' => [
'original' => ['method' => 'fit', 'width' => 2000, 'height' => 8000],
'large' => ['method' => 'fit', 'width' => 1200, 'height' => 8000],
'medium' => ['method' => 'fit', 'width' => 500, 'height' => 8000],
'thumb' => ['method' => 'crop', 'width' => 128, 'height' => 128]
],
'uploadRules' => [
//Possible uploadRules max-height(x),min-height(x),max-width(x),min-width(x),max-size(xMB), min-size(xMB)
'max-height' => "4000", //default 4000
'max-size' => '5MB' // default 5MB
],
]
],
'description' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextEditor',
'tab' => 'Pagina',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Contentblock',
'placeholder' => 'Contentblock'
]
],
];
function __construct(
Kms $kms,
PageRepository $repository,
KmsSectionTabs $tabs)
{
parent::__construct($kms, $repository, $tabs);
}
}