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/SBogers33/bbec.nl/workbench/komma/kms/src/Komma/Kms/Posts/PostSection.php
<?php
/**
 * Short description for the file.
 *
 * @author      Komma <info@komma.pro>
 * @copyright   (c) 2012-2015, Komma Mediadesign
 */

namespace Komma\Kms\Posts;

use Komma\Kms\Posts\Models\Post;
use Komma\Kms\Core\Kms;
use Komma\Kms\Core\Sections\KmsSectionTabs;
use Komma\Kms\Core\Sections\KmsSection;

class PostSection extends KmsSection
{
    protected $title = "Nieuws";
    protected $subTitle = "Berichten";
    protected $slug = "posts";

    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 = [
        // Posts Attributes
        'active' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsOnOff',
            'options' => [
                'label' => 'Actief',
                'placeholder' => 1
            ],
        ],
        'show_on_home' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsOnOff',
            'options' => [
                'label' => 'Toon op de homepagina',
                'placeholder' => 1,
                'show' => false
            ],
        ],
        'code_name' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
            'options' => [
                'label' => 'Code naam',
                'show' => false,
                'placeholder' => 'code naam van het post',
            ],
        ],

        'date' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsDate',
            'options' => [
                'label' => 'Post datum',
                'placeholder' => 'Gerealiseerd op',
            ]
        ],

        'images' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsImages',
            'options' => [
                'label' => 'Overview image',
                'subFolder' => 'posts',
                'maxImages' => 1,
                'uploadSizes' => [
                    'original' => ['method' => 'fit', 'width' => 2000, 'height' => 8000],
                    'large' => ['method' => 'fit', 'width' => 1100, 'height' => 8000],
                    'medium' => ['method' => 'fit', 'width' => 525, 'height' => 8000],
                    'small' => ['method' => 'fit', 'width' => 420, '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
                ],
            ]
        ],


        'name' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
            'forEach' => 'AllLanguages',
            'options' => [
                'label' => 'Titel',
                'placeholder' => 'Titel van het post',
//                'validation' => [
//                    'rules' => 'required',
//                    'messages' => [
//                        'required' => 'Voeg een titel toe',
//                    ]
//                ]
            ],
        ],
        'route' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
            'forEach' => 'AllLanguages',
            'options' => [
                'label' => 'URL',
                'placeholder' => 'Wordt automatisch gegenereerd',
                'show' => false
            ]
        ],
        'sub_title' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
            'forEach' => 'AllLanguages',
            'options' => [
                'label' => 'Subtitel',
                'placeholder' => 'Subtitel van het post',
                'show' => false,
            ],
        ],

        'meta_description' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextEditor',
            'forEach' => 'AllLanguages',
            'options' => [
                'label' => 'Meta description',
                'placeholder' => 'Post omschrijving',
            ]
        ],

        'description' => [
            'type'    => 'Komma\Kms\Core\Attributes\KmsDynamic',
            'forEach' => 'AllLanguages',
            'options' => [
                'subFolder'     => 'post',
                'label'         => 'Post content',
                'blockSettings' => [
                    'two_column_block'      => [
                        'typeName' => 'Twee tekst blokken',
                    ],
                    'content_block'         => [
                        'subFolder' => 'content',
                        'typeName' => 'Afbeelding en tekst',
                    ],
                    'full_image_block'      => [
                        'max_images' => 2,
                        'subFolder'  => 'full-image',
                        'typeName' => 'Volledige afbeelding',
                    ],
                    'full_text_block'       => [
                        'typeName' => 'Volledige tekst',
                    ],
                    'multiple_images_block' => [
                        'subFolder' => 'multiple-images',
                        'typeName' => 'Twee afbeeldingen',
                    ],

                    'video_block' => [
                        'typeName' => 'Video',
                        'youtube' => '',
                        'autoPlay' => false
                    ],
                ]

            ]
        ],

    ];

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