<?php declare(strict_types=1); /* * This file is part of modal bundle for Contao. * * (c) Benjamin Roth * * @license LGPL-3.0-or-later */ use Contao\DC_Table; use Contao\DataContainer; $GLOBALS['TL_DCA']['tl_vr_modal'] = array ( 'config' => array ( 'dataContainer' => DC_Table::class, 'ctable' => array('tl_content'), 'switchToEdit' => true, 'enableVersioning' => true, 'markAsCopy' => 'name', 'sql' => array ( 'keys' => array ( 'id' => 'primary' ) ) ), 'list' => array ( 'sorting' => array ( 'mode' => DataContainer::MODE_SORTABLE, 'fields' => array('title ASC'), 'panelLayout' => 'filter;sort,search,limit', ), 'label' => array ( 'fields' => array('title','delay'), 'showColumns' => true, 'format' => '%s', ), 'global_operations' => array ( 'all' => array ( 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"' ) ), 'operations' => array ( 'edit' => array ( 'href' => 'table=tl_content', 'icon' => 'edit.svg' ), 'editheader' => array ( 'href' => 'act=edit', 'icon' => 'header.svg' ), 'copy' => array ( 'href' => 'act=copy', 'icon' => 'copy.svg' ), 'delete' => array ( 'href' => 'act=delete', 'icon' => 'delete.svg', 'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? null) . '\'))return false;Backend.getScrollOffset()"' ), 'toggle' => array ( 'href' => 'act=toggle&field=published', 'icon' => 'visible.svg', 'showInHeader' => true ), 'show' => array ( 'href' => 'act=show', 'icon' => 'show.svg' ) ) ), 'palettes' => array ( '__selector__' => array(''), 'default' => '{title_legend},title;{config_legend},modal_title,delay;{publish_legend},published,start,stop' ), 'subpalettes' => array ( ), 'fields' => array ( 'id' => array ( 'sql' => "int(10) unsigned NOT NULL auto_increment" ), 'pid' => array ( 'foreignKey' => 'tl_news_archive.title', 'sql' => "int(10) unsigned NOT NULL default 0", 'relation' => array('type'=>'belongsTo', 'load'=>'lazy') ), 'tstamp' => array ( 'sorting' => true, 'flag' => DataContainer::SORT_DAY_DESC, 'sql' => "int(10) unsigned NOT NULL default 0" ), 'title' => array ( 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => DataContainer::SORT_INITIAL_LETTER_ASC, 'inputType' => 'text', 'eval' => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'w50'), 'sql' => "varchar(255) NOT NULL default ''" ), 'modal_title' => array ( 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength'=>255, 'tl_class'=>'w50'), 'sql' => "varchar(255) NOT NULL default ''" ), 'delay' => array ( 'exclude' => true, 'sorting' => true, 'flag' => DataContainer::SORT_ASC, 'inputType' => 'text', 'eval' => array('mandatory'=>true, 'rgxp'=>'natural','maxlength'=>5, 'maxval'=>65535, 'tl_class'=>'w50'), 'sql' => "smallint(5) unsigned NOT NULL default 0" ), 'published' => array ( 'exclude' => true, 'toggle' => true, 'filter' => true, 'flag' => DataContainer::SORT_INITIAL_LETTER_ASC, 'inputType' => 'checkbox', 'eval' => array('doNotCopy'=>true), 'sql' => "char(1) NOT NULL default ''" ), 'start' => array ( 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp'=>'datim', 'datepicker'=>true, 'tl_class'=>'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''" ), 'stop' => array ( 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp'=>'datim', 'datepicker'=>true, 'tl_class'=>'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''" ) ) );