File: D:/HostingSpaces/PDeckers/opelkapitan.nl/workbench/komma/kms/src/Komma/Kms/Photos/PhotoSection.php
<?php
/**
* Short description for the file.
*
* @author Komma <info@komma.pro>
* @copyright (c) 2012-2015, Komma Mediadesign
*/
namespace Komma\Kms\Photos;
use Komma\Kms\Photos\Models\Photo;
use Komma\Kms\Core\Kms;
use Komma\Kms\Core\Sections\KmsSectionTabs;
use Komma\Kms\Core\Sections\KmsSection;
class PhotoSection extends KmsSection
{
protected $title = "Foto’s";
protected $subTitle = "";
public $slug = "photos";
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 = [
// Photos Attributes
'code_name' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'options' => [
'label' => 'Code_name',
'class' => 'hidden',
'placeholder' => 'Enter a name',
]
],
'parent_id' => [
'type' => 'Komma\Kms\Core\Attributes\KmsSelect',
'options' => [
'label' => 'Parent photo',
'class' => 'hidden',
'placeholder' => 'Select a parent photo',
'data' => 'Komma\Kms\Photos\PhotoRepository@getForSelect',
'exclude' => '[[entityId]]',
]
],
'name' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Titel',
'placeholder' => 'Kies een passende titel voor het pagina',
],
],
'description' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextEditor',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Omschrijving',
]
],
'images' => [
'type' => 'Komma\Kms\Core\Attributes\KmsImages',
'options' => [
'label' => 'Images',
'subFolder' => 'photos',
'maxImages' => 40,
'uploadSizes' => [
'original' => ['method' => 'fit', 'width' => 2000, 'height' => 8000],
'large' => ['method' => 'fit', 'width' => 1750, 'height' => 8000],
'medium' => ['method' => 'fit', 'width' => 1200, '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' => '2MB' // default 5MB
],
]
],
];
function __construct(
Kms $kms,
PhotoRepository $repository,
KmsSectionTabs $tabs)
{
parent::__construct($kms, $repository, $tabs);
}
}