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

namespace Komma\Kms\Projects;

use Komma\Kms\Projects\Models\Project;
use Komma\Kms\Core\Kms;
use Komma\Kms\Core\Sections\KmsSectionTabs;
use Komma\Kms\Core\Sections\KmsSection;

class ProjectSection extends KmsSection
{
    protected $title = "Projecten";
    protected $subTitle = "";
    protected $slug = "projects";

    public $showSave = 'all';         // Options: 'all' | 'admin' (SuperAdmin only) | 'none' (or anything else what isn't all or admin)
    public $showDelete = 'admin';
    public $showCreate = 'admin';

    protected $entityAttributesData = [
        // Projects 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
            ],
        ],
        'code_name' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
            'options' => [
                'label' => 'Code naam',
                'placeholder' => 'code naam van het project',
                'validation' => [
                    'rules' => 'required',
                    'messages' => [
                        'required' => 'Voeg een titel toe',
                    ]
                ],
                'onlyForSuperAdmin' => true,
            ],
        ],
        'client' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
            'options' => [
                'label' => 'Klant',
                'placeholder' => 'Naam van de klant',
                'validation' => [
                    'rules' => 'required',
                    'messages' => [
                        'required' => 'Voeg een bedrijf- /klantnaam toe',
                    ]
                ]
            ],
        ],

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

        'category_ids' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsMultiSelect',
            'options' => [
                'label' => 'Categorieën',
                'placeholder' => 'Kies de categorieën voor dit project',
                'data' => 'Komma\Kms\Projects\ProjectRepository@getCategoriesForSelect'
            ]
        ],


        'images' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsImages',
            'options' => [
                'label' => 'Project afbeelding (max:4)',
                'label' => 'Images',
                'subFolder' => 'projects',
                'maxImages' => 4,
                'uploadSizes' => [
                    'original' => ['method' => 'fit', 'width' => 2000, 'height' => 8000],
                    'large' => ['method' => 'fit', 'width' => 1200, 'height' => 8000],
                    'medium' => ['method' => 'fit', 'width' => 500, '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
                ],
            ]
        ],


        'title' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
            'forEach' => 'AllLanguages',
            'options' => [
                'label' => 'Titel',
                'placeholder' => 'Titel van het project',
                'validation' => [
                    'rules' => 'required',
                    'messages' => [
                        'required' => 'Voeg een titel toe',
                    ]
                ]
            ],
        ],
        'sub_title' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
            'forEach' => 'AllLanguages',
            'options' => [
                'label' => 'Subtitel',
                'placeholder' => 'Subtitel van het project',
            ],
        ],


        'parent_id' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsSelect',
            'options' => [
                'class' => 'hidden',
                'label' => 'Parent page',
                'placeholder' => 'Select a parent page',
                'data' => 'Komma\Kms\Projects\ProjectRepository@getForSelect',
                'exclude' => '[[entityId]]',
            ]
        ],

        'description' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextEditor',
            'forEach' => 'AllLanguages',
            'options' => [
                'label' => 'Project omschrijving',
                'placeholder' => 'Project omschrijving',
                'validation' => [
                    'rules' => 'required',
                    'messages' => [
                        'required' => 'Voeg een omschrijving toe',
                    ]
                ]
            ]
        ],
        'meta_title' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextField',
            'forEach' => 'AllLanguages',
            'options' => [
                'label' => 'Meta title',
                'placeholder' => 'tekst in de <title> tag',
            ],
        ],


        /**
         * This is a demo of an extra image field
         */
        'project_image' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsImages',
            'options' => [
                'label' => 'Project afbeelding (max:1)',
                'subFolder' => 'projects',
                'maxImages' => 1,
                'uploadSizes' => [
                    'original' => ['method' => 'fit', 'width' => 2000, 'height' => 8000],
                    'large' => ['method' => 'fit', 'width' => 1200, 'height' => 8000],
                    'medium' => ['method' => 'fit', 'width' => 500, '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
                ],
            ]
        ],



        'meta_description' => [
            'type' => 'Komma\Kms\Core\Attributes\KmsTextEditor',
            'forEach' => 'AllLanguages',
            'options' => [
                'label' => 'Meta description',
                'placeholder' => 'Project omschrijving',
                'validation' => [
                    'rules' => '',
                    'messages' => [
                        'required' => 'Voeg een omschrijving toe',
                    ]
                ]
            ]
        ],


    ];

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