Hier meine Anpassung
Code:
// contao/dca/tl_news.php
use Contao\CoreBundle\DataContainer\PaletteManipulator;
$GLOBALS['TL_DCA']['tl_member']['fields']['rank'] = [
'label' => ['Dienstgrad', 'Dienstgrad auswählen'],
'inputType' => 'select',
//'options' => ['fwanwaerter' => 'Feuerwehrmannanwärter', 'fwmann' => 'Feuerwehrmann'],
'options_callback' => array('tl_feuerwehr', 'getTest'),
'eval' => ['tl_class' => 'w50', 'maxlength' => 255, 'mandatory' => 'true' ],
'sql' => ['type' => 'string', 'length' => 255, 'default' => ''],
];
PaletteManipulator::create()
->addField('rank', 'gender')
->applyToPalette('default', 'tl_member')
;
class tl_feuerwehr extends Contao\Backend
{
public function getTest(Contao\DataContainer $dc)
{
$arrSections = array();
$arrSections = array(
'ofwmann' => 'Oberfeuerwehrmann',
'fwmann' => 'Feuerwehrmann',
'fwanwaerter' => 'Feuerwehrmannanwärter',
);
// dump($arrSections);
return $arrSections;
}
}