File: D:/HostingSpaces/SBogers10/kommabasic.nl/app/TeamMembers/Kms/TeamMemberSection.php
<?php
namespace App\TeamMembers\Kms;
use App\Pages\Models\Page;
use App\TeamMembers\Models\TeamMember;
use Illuminate\Database\Eloquent\Model;
use Komma\KMS\Components\ComponentType\ComponentTypes;
use Komma\KMS\Core\Attributes\Attribute;
use Komma\KMS\Core\Attributes\ComponentArea;
use Komma\KMS\Core\Attributes\Documents;
use Komma\KMS\Core\Attributes\Select;
use Komma\KMS\Core\Attributes\Seperator;
use Komma\KMS\Core\Attributes\TextArea;
use Komma\KMS\Core\ModelServiceInterface;
use Komma\KMS\Core\Sections\Section;
use Komma\KMS\Core\Attributes\Models\ImageProperty;
use Komma\KMS\Core\Attributes\OnOff;
use Komma\KMS\Core\Attributes\TextField;
use Komma\KMS\Users\Models\KmsUserRole;
final class TeamMemberSection extends Section
{
public function defineAttributesAndTabs(Model $currentModel = null): void
{
$this->tabs->makeTab()->addItems([
(new OnOff())
->setLabelText(__('KMS::global.active'))
->switchOn()
->setReference( 'active'),
(new Documents())
->setLabelText(__('KMS::global.images'))
->onlyAllowImages()
->setSmallDragAndDropArea()
->setMaxDocuments(1)
->setSubFolder('teamMembers')
->setImageProperties([
(new ImageProperty())->setName('thumb')->setCropMethod(ImageProperty::Fit)->setWidth(100)->setHeight(100),
(new ImageProperty())->setName('small')->setCropMethod(ImageProperty::Fit)->setWidth(200)->setHeight(200),
(new ImageProperty())->setName('medium')->setCropMethod(ImageProperty::Fit)->setWidth(300)->setHeight(300),
])
->setReference( 'teamMembers'),
(new TextField())
->setLabelText(__('KMS::global.name'))
->setReference('name'),
(new TextField())
->setLabelText(__('KMS::global.email'))
->setReference('email'),
]);
//Build an array with attributes for each current site language
$this->tabs->makeLanguageTabTemplate()->addItems([
(new TextField())
->setLabelText(__('KMS::global.subtitle'))
->setReference( 'function'),
]);
}
}