PHP-Code:
$GLOBALS['TL_DCA']['tl_event_db'] = [
// Config
'config' => [
'dataContainer' => 'Table',
'enableVersioning' => true,
'sql' => [
'keys' => [
'id' => 'primary'
]
],
],
'edit' => [
'buttons_callback' => [
['tl_event_db', 'buttonsCallback']
]
],
'list' => [
'sorting' => [
'mode' => 2,
'fields' => ['tstamp'],
'flag' => 1,
'panelLayout' => 'filter;sort,search,limit'
],
'label' => [
'fields' => ['tstamp','firstname','lastname','email','subject','formtype',],
'format' => '%s',
'showColumns' => true,
],
'operations' => [
'edit' => [
'label' => &$GLOBALS['TL_LANG']['tl_sample_table']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif'
],
'show' => [
'label' => &$GLOBALS['TL_LANG']['tl_sample_table']['show'],
'href' => 'act=show',
'icon' => 'show.gif',
'attributes' => 'style="margin-right:3px"'
],
]
],
// Palettes
'palettes' => [
'default' => '{booking_date_legend},formtype,created_at,id,tstamp;{contact_legend},firstname,lastname,phone,email;{notes_legend},subject,comment'
],
// Fields
'fields' => [
'id' => [
'sql' => "int(10) unsigned NOT NULL auto_increment"
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'"
],
'created_at' => [
'sorting' => true,
'inputType' => 'text',
'eval' => ['rgxp' => 'datim', 'tl_class' => 'w50 wizard'],
'sql' => "varchar(10) NOT NULL default ''",
],
'firstname' => [
'inputType' => 'text',
'exclude' => true,
'search' => true,
'filter' => false,
'sorting' => true,
'flag' => 1,
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''"
],
//... Felder hier gekürzt
]
];
Lesezeichen