Tja, hat jetzt schon sehr geholfen, aber mit der liste komm ich noch nicht ganz klar:
Jetzt sehe ich im Backend NUR die Gruppennamen, aber nicht die restlichen, wie z.B. Vorname Benutzername usw.
PHP-Code:
$GLOBALS['TL_DCA']['tl_member']['list']['label']['label_callback'] = array('classGroupName', 'groupName');
Hier müsste ich jetzt noch die restlichen Fields hier einbauen, oder?
Der Rest sieht nun so aus:
PHP-Code:
$GLOBALS['TL_DCA']['tl_member']['list']['label']['label_callback'] = array('classGroupName', 'groupName');
class classGroupName extends tl_member
{
public function groupName($row, $label, DataContainer $dc=null, $args=array())
{
$args = parent::addIcon($row, $label, $dc, $args);
$objGroupNames = $this->Database->prepare("SELECT DISTINCT name FROM tl_member_group WHERE id IN (" . implode(", ", deserialize($row['groups'])) . ") ORDER BY name")
->execute();
$arrGroupNames = array();
while ($objGroupNames->next()) {
$arrGroupNames[] = $objGroupNames->name;
}
if (count($arrGroupNames) > 0) {
$returnString = '';
if ($blnFormatOutput)
{
$returnString .= '<span style="color:#b3b3b3; padding-left:3px; font-size: 9px;">[';
}
$returnString .= implode(", ", $arrGroupNames);
if ($blnFormatOutput)
{
$returnString .= ']</span>';
}
return $returnString;
}
$groupsColumnIndex = array_search('groups', $GLOBALS['TL_DCA']['tl_member']['list']['label']['fields']);
if ($groupsColumnIndex !== FALSE)
{
$args[$groupsColumnIndex];
}
return $args;
}
}
Lesezeichen