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/SBogers85/equichecker.com/app/KommaApp/Pages/Kms/PageSection.php
<?php
/**
 *
 *
 * @author      Komma <info@komma.pro>
 * @copyright   (c) 2012-2016, Komma Mediadesign
 */

namespace KommaApp\Pages\Kms;

use KommaApp\Kms\Core\Kms;
use KommaApp\Kms\Core\Sections\KmsSectionTabs;
use KommaApp\Kms\Core\Sections\KmsSiteSection;

class PageSection extends KmsSiteSection
{
    protected $title = "Pages";
    protected $subTitle = "All pages";
    protected $slug = "pages";

    public $showSave = 'all';
    public $showDelete = 'all';
    public $showCreate = 'all';

    protected $modelAttributesData = [
        // Pages Attributes
        'page_label' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsTitle',
            'options' => [
                'populate'=>false,
                'title' => 'lang_get:kms/pages.page'
            ],
        ],
        'controller' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsTextField',
            'options' => [
                'label' => 'lang_get:kms/pages.controller',
                'placeholder' => 'Enter a controller',
                'onlyForSuperAdmin' => true,
                'default_value'=> 'pageController@show'
            ]
        ],
        'code_name' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsTextField',
            'options' => [
                'label' => 'lang_get:kms/global.name',
                'placeholder' => 'Enter a name',
                'onlyForSuperAdmin' => true
            ]
        ],
        'parent_id' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsSelect',
            'options' => [
                'label' => 'lang_get:kms/pages.parent_page',
                'placeholder' => 'Select a parent page',
                'data' => 'KommaApp\Pages\Kms\PageRepository@getModelsForSelect',
                'exclude' => '[[modelId]]',
                'data_example' => [
                    ['value' => 'Item 1', 'content' => 'Data: item 1', 'htmlContent' => '<i>Data: Item 1</i>'],
                    ['value' => 'Item 2', 'content' => 'Data: item 2', 'htmlContent' => '<i>Data: Item 2</i>'],
                    ['value' => 'Item 3', 'content' => 'Data: item 3', 'htmlContent' => '<i>Data: Item 3</i>'],
                ]
            ]
        ],

        'images' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsImages',
            'options' => [
                'label' => 'lang_get:kms/global.images',
                'subfolder' => 'pages',
                'maxImages' => 5,
                'small' => [
                    'method' => 'fit',
                    'width' => 640,
                    'height' => 2160
                ],
                'medium' => [
                    'method' => 'fit',
                    'width' => 800,
                    'height' => 2400
                ],
                'large' => [
                    'method' => 'fit',
                    'width' => 1024,
                    'height' => 3200
                ],
            ]
        ],

        'call_to_action' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsSelect',
            'options' => [
                'label' => 'lang_get:kms/pages.call_to_action',
                'placeholder' => 'Kies een call to action',
                'allowNull' => true,
                'data' => [
                    ['value' => 'cta4', 'content' => 'Hulp Algemeen'],
                    ['value' => 'cta2', 'content' => 'Hulp bij bestelling'],
                    ['value' => 'cta3', 'content' => 'Bel of mail zonder button'],
                    ['value' => 'cta1', 'content' => 'Bestel vanaf 10'],

                    ['value' => 'buttonContact', 'content' => 'Button: Contact'],

                    ['value' => 'hobie', 'content' => 'Hobie'],
                    ['value' => 'nicolette', 'content' => 'Nicolette'],
                    ['value' => 'nicolette2', 'content' => 'Nicolette2'],
                    ['value' => 'faq', 'content' => 'Veelgestelde vragen'],
                    ['value' => 'follow_shipment', 'content' => 'Volg uw bestelling'],
                    ['value' => '50sets', 'content' => '+50 sets'],
                    ['value' => 'free_shipping', 'content' => 'Gratis verzenden vanaf'],
                    ['value' => 'extra_set', 'content' => 'Extra filterset'],
                    ['value' => 'change', 'content' => 'Vervang tijdig'],
                    ['value' => 'fresh_air', 'content' => 'Hele jaar verse lucht'],
                    ['value' => 'experience', 'content' => '+35 jaar ervaring'],
                ]
            ]
        ],

        'searchable' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsOnOff',
            'options' => [
                'label' => 'lang_get:kms/pages.searchable',
                'onlyForSuperAdmin' => true,
            ],
        ],

        // Pages Translation Attributes
        'information_label' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsTitle',
            'forEach' => 'CurrentSiteLanguages',
            'options' => [
                'title' => 'lang_get:kms/global.information'
            ],
        ],
        //todo get this with the model method
        'route' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsRoute',
            'forEach' => 'CurrentSiteLanguages',
            'model' => 'translations->routes->alias',
            'relatedAttributeOptions' => [
                ['keyBy' => 'language_id', 'keyId' => '[[languageId]]'],
                ['keyBy' => 'active', 'keyId' => '1']
            ],
            'options' => [
                'label' => 'lang_get:kms/global.route',
                'placeholder' => 'Enter a route',
                'structure' => '{{parentSlugs}}{{slug}}',
                'slugField' => 'slug_[[languageId]]',
                'parentField' => 'parent_id',
                'validation' => [
                    'rules' => 'required|unique:routes,alias,[[routeableId]],routeable_id,site_id,[[siteId]]|',
                    'messages' => [
                        'required' => 'You need to enter a route',
                        'unique' => 'This route already exists',
                        'different' => 'This route needs to be unique'
                    ]
                ]
            ]
        ],
        'slug' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsSlug',
            'forEach' => 'CurrentSiteLanguages',
            'options' => [
                'label' => 'Slug',
                'class' => 'hidden',
                'placeholder' => 'Enter a slug',
                'autoSlugField' => 'name_[[languageId]]',
                'validation' => [
                    'rules' => 'required',
                    'messages' => [
                        'required' => 'You need to enter a slug',
                    ]
                ]
            ]
        ],
        'name' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsTextField',
            'forEach' => 'CurrentSiteLanguages',
            'options' => [
                'label' => 'lang_get:kms/global.title',
                'placeholder' => 'Enter a title',
                'validation' => [
                    'rules' => 'required',
                    'messages' => [
                        'required' => 'You need to enter a title',
                    ]
                ],
            ]
        ],
        'description' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsTextEditor',
            'forEach' => 'CurrentSiteLanguages',
            'options' => [
                'label' => 'lang_get:kms/global.description',
                'placeholder' => 'Enter a description'
            ]
        ],
        'description_two' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsTextEditor',
            'forEach' => 'CurrentSiteLanguages',
            'options' => [
                'label' => 'lang_get:kms/global.description_two',
                'placeholder' => 'Enter a description'
            ]
        ],

        // Meta Attributes
        'spacer_brand' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsSeparator',
            'forEach' => 'CurrentSiteLanguages'
        ],
        'meta_label' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsTitle',
            'forEach' => 'CurrentSiteLanguages',
            'options' => [
                'title' => 'lang_get:kms/global.meta_data'
            ],
        ],
        'meta_title' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsTextField',
            'forEach' => 'CurrentSiteLanguages',
            'options' => [
                'label' => 'lang_get:kms/global.title',
                'placeholder' => 'Enter a title'
            ]
        ],
        'meta_description' => [
            'type' => 'KommaApp\Kms\Core\Attributes\KmsTextArea',
            'forEach' => 'CurrentSiteLanguages',
            'options' => [
                'label' => 'lang_get:kms/global.description',
                'placeholder' => 'Enter a description'
            ]
        ],
    ];

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

    /**
     * This method will stop the load entities of the kmsSiteSection
     *
     * @return array
     *
     */
    public function loadEntities(){
        return [];
    }

}