File: D:/HostingSpaces/SBogers33/bbec.nl/workbench/komma/kms/src/Komma/Kms/Projects/ProjectSection.php
<?php
/**
* Short description for the file.
*
* @author Komma <info@komma.pro>
* @copyright (c) 2012-2015, Komma Mediadesign
*/
namespace Komma\Kms\Projects;
use Komma\Kms\Pages\Models\Page;
use Komma\Kms\Projects\Models\Project;
use Komma\Kms\Core\Kms;
use Komma\Kms\Core\Sections\KmsSectionTabs;
use Komma\Kms\Core\Sections\KmsSection;
class ProjectSection extends KmsSection
{
protected $title = "Placeholder";
protected $subTitle = "Overzicht";
protected $slug = "projects";
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 = [
// Projects Attributes
'active' => [
'type' => 'Komma\Kms\Core\Attributes\KmsOnOff',
'options' => [
'label' => 'Actief',
'placeholder' => 1
],
],
'code_name' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'options' => [
'label' => 'Code naam',
'placeholder' => 'code naam van het project',
'show' => false
],
],
// 'images' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsImages',
// 'options' => [
// 'label' => 'Project afbeelding (max:1)',
// 'subFolder' => 'trucks',
// 'maxImages' => 1,
// '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' => '2MB' // default 5MB
// ],
// ]
// ],
'parent_id' => [
'type' => 'Komma\Kms\Core\Attributes\KmsSelect',
'options' => [
'show' => false,
'label' => 'Parent page',
'placeholder' => 'Select a parent page',
'data' => 'Komma\Kms\Projects\ProjectRepository@getForSelect',
'exclude' => '[[entityId]]',
]
],
'name' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Titel',
'placeholder' => 'Titel van het project',
],
],
'name_short' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Naam overzicht',
'placeholder' => 'Naam voor overzicht',
],
],
// 'description' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextEditor',
// 'forEach' => 'AllLanguages',
// 'options' => [
// 'label' => 'Omschrijving',
// 'placeholder' => 'Omschrijving',
// ]
// ],
//
// 'overview' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
// 'forEach' => 'AllLanguages',
// 'options' => [
// 'label' => 'Overzicht',
// 'placeholder' => 'Overzicht tekst',
// ],
// ],
//
// 'power' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
// 'options' => [
// 'label' => 'Laadvermogen (kg)',
// 'placeholder' => 'Laadvermogen (kg)',
// ],
// ],
//
// 'motor' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
// 'forEach' => 'AllLanguages',
// 'options' => [
// 'label' => 'Motor',
// 'placeholder' => 'Motor',
// ],
// ],
// 'cooling' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
// 'forEach' => 'AllLanguages',
// 'options' => [
// 'label' => 'Koeling',
// 'placeholder' => 'Koeling',
// ],
// ],
// 'drive' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
// 'forEach' => 'AllLanguages',
// 'options' => [
// 'label' => 'Aandrijving',
// 'placeholder' => 'Aandrijving',
// ],
// ],
//
// 'drive_speed' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
// 'options' => [
// 'label' => 'Rijsnelheid (km/h)',
// 'placeholder' => 'Rijsnelheid (km/h)',
// ],
// ],
//
// 'transmission' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
// 'forEach' => 'AllLanguages',
// 'options' => [
// 'label' => 'Transmissie',
// 'placeholder' => 'Transmissie',
// ],
// ],
// 'breaks' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
// 'forEach' => 'AllLanguages',
// 'options' => [
// 'label' => 'Remmen',
// 'placeholder' => 'Remmen',
// ],
// ],
//
// 'tires' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
// 'options' => [
// 'label' => 'Banden',
// 'placeholder' => 'Banden',
// ],
// ],
//
// 'mast' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
// 'forEach' => 'AllLanguages',
// 'options' => [
// 'label' => 'Mast',
// 'placeholder' => 'Mast',
// ],
// ],
// 'turning_circle' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
// 'forEach' => 'AllLanguages',
// 'options' => [
// 'label' => 'Draaicirkel',
// 'placeholder' => 'Draaicirkel',
// ],
// ],
//
// 'weight' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
// 'options' => [
// 'label' => 'Leeggewicht (kg)',
// 'placeholder' => 'Leeggewicht (kg)',
// ],
// ],
//
// 'additional_info' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
// 'forEach' => 'AllLanguages',
// 'options' => [
// 'label' => 'Extra info',
// 'placeholder' => 'Extra info',
// ],
// ],
//
// 'blue_print' => [
// 'type' => 'Komma\Kms\Core\Attributes\KmsImages',
// 'options' => [
// 'label' => 'Blauwdruk (max:1)',
// 'subFolder' => 'trucks',
// 'maxImages' => 1,
// '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' => '2MB' // default 5MB
// ],
// ]
// ],
'projectDescription' => [
'type' => 'Komma\Kms\Core\Attributes\KmsDynamic',
'forEach' => 'AllLanguages',
'options' => [
'subFolder' => 'projectDynamic',
'label' => 'Content',
'blockSettings' => [
'full_text_block' => [
],
// 'two_column_block' => [
// 'subFolder' => 'dynamic'
// ],
'content_block' => [
'subFolder' => 'projectDynamic',
],
// 'full_image_block' => [
// 'max_images' => 1,
// 'subFolder' => 'dynamic',
// ],
// 'multiple_images_block' => [
// 'tab' => [
// ['max_images' => 1],
// ['max_images' => 1]],
// 'subFolder' => 'dynamic'
// ],
// 'video_block' => [
// 'typeName' => 'Projectvideo',
// 'youtube' => ''
// ],
// 'view_block' => [
// ],
]
]
],
];
function __construct(
Kms $kms,
ProjectRepository $repository,
KmsSectionTabs $tabs)
{
parent::__construct($kms, $repository, $tabs);
$this->title = Page::where('code_name', '=', 'service')
->with('kmsTranslation')
->first()->kmsTranslation->name;
}
}