Filter und options_callback
Hallo Community,
ich habe eine Frage, bei der ich leider nicht weiterkomme. Ich möchte nach einem multiple-Select-Feld filtern lassen. Die Definition des Feldes sieht so aus:
PHP-Code:
'station' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_gm_prices']['station'],
'exclude' => true,
'search' => true,
'sorting' => true,
'filter' => true,
'inputType' => 'select',
'options_callback' => array('tl_gm_prices', 'getStations'),
'eval' => array('mandatory'=>true, 'multiple'=>true, 'size'=>6, 'tl_class'=>'w50 w50h'),
'save_callback' => array
(
array('tl_gm_prices', 'saveStations'),
),
),
Die Funktion "getStations" sieht so aus:
PHP-Code:
include_once(TL_ROOT . '/system/modules/backend/languages/de/countries.php');
$arrStations = $this->Database->execute('SELECT `id`, `name`, `country` FROM `tl_gm_stations` ORDER BY `country`, `name` ASC')->fetchAllAssoc();
$arrReturn = array();
if (is_array($arrStations) && count($arrStations))
foreach ($arrStations as $station)
$arrReturn[ $GLOBALS['TL_LANG']['CNT'][$station['country']] ][$station['id']] = $station['name'];
return $arrReturn;
Im Modul wird auch das Feld zum Filtern der Stationen angezeigt, aber es fehlen die Einträge.
Was muss ich ändern, damit es geht?
Nachtrag: Wenn ich statt options_callback foreignKey=... nutze, geht es! Aber dann habe ich nicht mehr diese hübsche Gruppierung beim Bearbeiten drin!
Danke!
Viele Grüße,
raveolution