File: D:/HostingSpaces/SBogers10/rentman.komma.pro/workbench/komma/kms/src/Komma/Kms/Jobs/JobSection.php
<?php
/**
* Short description for the file.
*
* @author Komma <info@komma.pro>
* @copyright (c) 2012-2015, Komma Mediadesign
*/
namespace Komma\Kms\Jobs;
use Komma\Kms\Jobs\Models\Job;
use Komma\Kms\Core\Kms;
use Komma\Kms\Core\Sections\KmsSectionTabs;
use Komma\Kms\Core\Sections\KmsSection;
class JobSection extends KmsSection
{
protected $title = "Jobs";
protected $subTitle = "";
protected $slug = "jobs";
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 = [
// Jobs Attributes
'active' => [
'type' => 'Komma\Kms\Core\Attributes\KmsOnOff',
'options' => [
'label' => 'Active',
'placeholder' => 1
],
],
'code_name' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'options' => [
'label' => 'Code naam',
'class' => 'hidden',
'placeholder' => 'code naam van het job',
],
],
'images' => [
'type' => 'Komma\Kms\Core\Attributes\KmsImages',
'options' => [
'label' => 'Overview image',
'subFolder' => 'jobs',
'maxImages' => 1,
'uploadSizes' => [
'original' => ['method' => 'fit', 'width' => 2000, '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' => '2MB' // default 5MB
],
]
],
'name' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Name',
'placeholder' => 'Name of the job',
// 'validation' => [
// 'rules' => 'required',
// 'messages' => [
// 'required' => 'Voeg een titel toe',
// ]
// ]
],
],
'route' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'URL',
'placeholder' => 'Will be generated afterwards',
]
],
'parent_id' => [
'type' => 'Komma\Kms\Core\Attributes\KmsSelect',
'options' => [
'class' => 'hidden',
'label' => 'Parent page',
'placeholder' => 'Select a parent page',
'data' => 'Komma\Kms\Jobs\JobRepository@getForSelect',
'exclude' => '[[entityId]]',
]
],
'meta_title' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Meta title',
'placeholder' => 'tekst in de <title> tag',
'class' => 'hidden'
],
],
'meta_description' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextEditor',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Meta description',
'placeholder' => 'Job description also used in overview',
]
],
'description' => [
'type' => 'Komma\Kms\Core\Attributes\KmsDynamic',
'forEach' => 'AllLanguages',
'options' => [
'subFolder' => 'job',
'label' => 'Job content',
'blockSettings' => [
'two_column_block' => [
'subFolder' => 'section',
'typeName' => 'Two column text block',
],
'content_block' => [
'subFolder' => 'section',
'typeName' => 'Image with text',
],
'full_image_block' => [
'max_images' => 2,
'subFolder' => 'section',
'typeName' => 'Full image block',
],
'full_text_block' => [
'subFolder' => 'section',
'typeName' => 'Full text block',
],
'multiple_images_block' => [
'tab' => [
['max_images' => 1],
['label' => 'images 2b (optional)', 'max_images' => 1]],
'subFolder' => 'section',
'typeName' => 'Multiple images',
],
'video_block' => [
'typeName' => 'Video block',
'youtube' => ''
],
]
]
],
];
function __construct(
Kms $kms,
JobRepository $repository,
KmsSectionTabs $tabs)
{
parent::__construct($kms, $repository, $tabs);
}
}