File: D:/HostingSpaces/SBogers84/zuiderbos.nl/workbench/komma/kms/src/Komma/Kms/Interns/InternSection.php
<?php
/**
* @author Pascal Lemmen <pascal@komma.pro>
* @copyright (c) 2012-2016, Komma Mediadesign
*/
namespace Komma\Kms\Interns;
use Komma\Kms\Core\Kms;
use Komma\Kms\Core\Sections\KmsSection;
use Komma\Kms\Core\Sections\KmsSectionTabs;
class InternSection extends KmsSection
{
protected $title = "Interns";
protected $subTitle = "All interns";
protected $slug = "interns";
public $showSave = [0,1,2]; // Options: 'all' | 'admin' (SuperAdmin only) | 'none' (or anything else what isn't all or admin)
public $showDelete = [0,1,2];
public $showCreate = [0,1,2];
protected $entityAttributesData = [
'information_label' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTitle',
'options' => [
'title' => 'Settings',
],
],
'active' => [
'type' => 'Komma\Kms\Core\Attributes\KmsOnOff',
'options' => [
'label' => 'Actief',
]
],
'name' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
'options' => [
'label' => 'Name',
'placeholder' => 'vb John Doe'
]
],
'description' => [
'type' => 'Komma\Kms\Core\Attributes\KmsTextEditor',
'forEach' => 'AllLanguages',
'options' => [
'label' => 'Description',
'placeholder' => 'Enter a description'
]
],
'file' => [
'type' => 'Komma\Kms\Core\Attributes\KmsFileS',
'options' => [
'label' => 'Bestand',
'placeholder' => 'Bestand',
'parentField' => 'parent_id',
'subfolder' => 'newsletter',
'maxFiles' => 1,
]
],
];
function __construct(
Kms $kms,
InternRepository $repository,
KmsSectionTabs $tabs)
{
parent::__construct($kms, $repository, $tabs);
}
function getThumbnail()
{
if(isset($this->entity) && isset($this->entity->person) && sizeof($this->entity->person) > 0) return "<img src='".$this->entity->person[0]['thumb_image_url']."'>";
return parent::getThumbnail();
}
}