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/SBogers79/artofeinstein.be/workbench/komma/kms/src/Komma/Kms/Text/TextSection.php
<?php
/**
 * Short description for the file.
 *
 * @author      Komma <info@komma.pro>
 * @copyright   (c) 2012-2015, Komma Mediadesign
 */

namespace Komma\Kms\Text;

use Komma\Kms\Text\Models\Text;
use Komma\Kms\Core\Kms;
use Komma\Kms\Core\Sections\KmsSectionTabs;
use Komma\Kms\Core\Sections\KmsSection;

class TextSection extends KmsSection
{
    protected $title = "Teksten";
    protected $subTitle = "";
    protected $slug = "text";

    //public $showDelete = false;
    //public $showCreate = false;

    protected $entityAttributesData = [

        'code_name' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
            'tab' => 'Pagina',
            'options' => [
                'validation' => [
                    'rules' => 'required',
                    'messages' => [
                        'required' => 'You need to enter a title',
                    ]
                ],
                'label' => 'Code_name',
                'placeholder' => 'Enter a name',
                'onlyForSuperAdmin' => true
            ]
        ],

        'parent_id' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsSelect',
            'tab' => 'Pagina',
            'options' => [
                'label' => 'Parent page',
                'placeholder' => 'Select a parent page',
                'data' => 'Komma\Kms\Text\TextRepository@getForSelect',
                'exclude' => '[[entityId]]',
//                'data_example' => [
//                    ['value' => 'Faes', 'content' => 'Data: test', 'htmlContent' => '<i>Data: test</i>'],
//                    ['value' => 'Faas', 'content' => 'Data: testen', 'htmlContent' => '<i>Data: testen</i>'],
//                    ['value' => 'Faesch', 'content' => 'Data: tester', 'htmlContent' => '<i>Data: tester</i>'],
//                ],
                'onlyForSuperAdmin' => true
            ]
        ],
        'images' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsImages',
            'tab' => 'pagina',
            'options' => [
                'label' => 'Images',
                'subfolder' => 'text-images',
                'maxImages' => 4,
                'uploadSizes' => [
                    'original' => ['method' => 'fit', 'width' => 2000, 'height' => 8000],
                    'large' => ['method' => 'fit', 'width' => 1200, 'height' => 8000],
                    'medium' => ['method' => 'fit', 'width' => 750, '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' => '5MB' // default 5MB
                ],
            ]
        ],


        'spacer' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsSeparator',
            'tab' => 'Pagina',
            'options' => [
                'onlyForSuperAdmin' => true
            ]
        ],

        'label2' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTitle',
            'tab' => 'Pagina',
            'options' => [
                'title' => 'Tekst',
            ],
        ],

        'name' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
            'tab' => 'Pagina',
            'forEach' => 'AllLanguages',
            'options' => [
                'label' => 'Titel',
                'placeholder' => 'Kies een passende titel voor het tekst',
                'validation' => [
                    'rules' => 'required',
                    'messages' => [
                        'required' => 'You need to enter a title',
                    ]
                ],
            ],
        ],

        'description' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextEditor',
            'tab' => 'Pagina',
            'forEach' => 'AllLanguages',
            'options' => [
                'label' => 'Tekst',
                'placeholder' => 'Tekst'
            ]
        ],



    ];

    function __construct(
        Kms $kms,
        TextRepository $repository,
        KmsSectionTabs $tabs)
    {
        parent::__construct($kms, $repository, $tabs);
    }
}