HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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'),
        ]);
    }
}