Ok, danke. Das ergibt jetzt einen Sinn.
Wobei ich gerne nur name und value aus der tl_lead_data gelistet haben möchte.
Zitat von
Samson1964
PHP-Code:
public function listRows($row)
{
return $row['name'] . ': ' . \Leads\Leads::formatValue((object) $row);
}
Du mußt diese Callback-Funktion nur mit Deinem eigenen DCA überschreiben.
Das habe ich noch nie gemacht.
Reicht es nicht wenn ich in der tl_lead_data.php das Label rausstreiche?
PHP-Code:
'label' => array
(
'sql' => "text NULL"
),
Eine Veränderung gibt es nicht.
Das Label des FE-Formulars wird weiter im BE mit gelistet. Wichtig sind wie gesagt nur der Feldname und der Wert.
Ungelöst ist immer noch das Rätsel, woher die eckigen Klammern und der color-Wert #b3b3b3 in der inline CSS für den value- Wert kommen.
Welche Rolle spielt der DcaWizard in diesem Zusammenhang?
Gefunden habe ich z.B. sowas hier in der DcaWizard.php:
PHP-Code:
/**
* Generate a row operation
*
* @param string $operation operation name
* @param array $row Db row
*
* @return string
*/
public function generateRowOperation($operation, $row)
{
// Load the button definition from the subtable
$def = $GLOBALS['TL_DCA'][$this->foreignTable]['list']['operations'][$operation];
$id = specialchars(rawurldecode($row['id']));
$buttonHref = $this->getButtonHref() . '&' . $def['href'] . '&id='.$row['id'] . '&dcawizard_operation=1';
$label = $def['label'][0] ?: $operation;
$title = sprintf($def['label'][1] ?: $operation, $id);
$attributes = ($def['attributes'] != '') ? ' ' . ltrim(sprintf($def['attributes'], $id, $id)) : '';
// Dca wizard specific
$arrBaseOptions = $this->getDcaWizardOptions();
$arrBaseOptions['url'] = $buttonHref;
$attributes .= ' data-options="' . specialchars(json_encode($arrBaseOptions)) . '"';
$attributes .= ' onclick="Backend.getScrollOffset();DcaWizard.openModalWindow(JSON.parse(this.getAttribute(\'data-options\')));return false"';
// Add the key as CSS class
if (strpos($attributes, 'class="') !== false) {
$attributes = str_replace('class="', 'class="' . $operation . ' ', $attributes);
} else {
$attributes = ' class="' . $operation . '"' . $attributes;
}
// Call a custom function instead of using the default button
if (is_array($def['button_callback'])) {
return \System::importStatic($def['button_callback'][0])->{$def['button_callback'][1]}($row, $def['href'], $label, $title, $def['icon'], $attributes);
} elseif (is_callable($def['button_callback'])) {
return $def['button_callback']($row, $def['href'], $label, $title, $def['icon'], $attributes);
}
return sprintf(
'<a href="%s" title="%s"%s>%s</a> ',
$buttonHref,
specialchars($title),
$attributes,
\Image::getHtml($def['icon'], $label)
);
}
In der /leads/library/leads.php @ Zeile 93 steht ja auch sowas hier:
PHP-Code:
/**
* Format a lead field for list view.
*
* @param object
*
* @return string
*/
public static function formatValue($objData)
{
$fieldModel = \FormFieldModel::findByPk($objData->field_id);
if (null !== $fieldModel) {
$data = $fieldModel->row();
$data['eval'] = $fieldModel->row();
$strValue = Format::dcaValueFromArray($data, $objData->value);
$strLabel = Format::dcaLabelFromArray($data);
return $strLabel . ' <span style="color:#b3b3b3; padding-left:3px;">[' . $strValue . ']</span>';
}
$strValue = implode(', ', deserialize($objData->value, true));
if ($objData->label != '') {
$strLabel = $objData->label;
$arrLabel = deserialize($objData->label, true);
if (!empty($arrLabel)) {
$strLabel = implode(', ', $arrLabel);
}
$strValue = $strLabel . ' <span style="color:#b3b3b3; padding-left:3px;">[' . $strValue . ']</span>';
}
return $strValue;
}
Aber da ändert sich nach dem Editieren auch nix.
Lesezeichen