Skip to content
Snippets Groups Projects
Commit 7062a6fe authored by Nicole Cordes's avatar Nicole Cordes Committed by Jigal van Hemert
Browse files

[BUGFIX] Suggest wizard: Display record icon

Especially for pages the icon is not shown in the list of suggested
records. This patch switches the icons from background images to sprite
icons.

Change-Id: I5bf19c43b2979608270638895022517384f97bea
Fixes: #40731
Releases: 6.1, 6.0, 4.7, 4.5
Reviewed-on: https://review.typo3.org/20040
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
parent 0212a640
No related merge requests found
......@@ -169,7 +169,9 @@ class SuggestDefaultReceiver {
if (!$this->checkRecordAccess($row, $row['uid'])) {
continue;
}
$iconPath = $this->getIcon($row);
$spriteIcon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord(
$this->table, $row, array('style' => 'margin: 0 4px 0 -20px; padding: 0;')
);
$uid = $row['t3ver_oid'] > 0 ? $row['t3ver_oid'] : $row['uid'];
$path = $this->getRecordPath($row, $uid);
if (strlen($path) > 30) {
......@@ -185,9 +187,9 @@ class SuggestDefaultReceiver {
'label' => $label,
'path' => $path,
'uid' => $uid,
'icon' => $iconPath,
'style' => 'background-image:url(' . $iconPath . ');',
'class' => isset($this->config['cssClass']) ? $this->config['cssClass'] : ''
'style' => '',
'class' => isset($this->config['cssClass']) ? $this->config['cssClass'] : '',
'sprite' => $spriteIcon
);
$rows[$this->table . '_' . $uid] = $this->renderRecord($row, $entry);
}
......
......@@ -230,7 +230,7 @@ class SuggestElement {
for ($i = 0; $i < $maxItems; $i++) {
$row = $resultRows[$rowsSort[$i]];
$rowId = $row['table'] . '-' . $row['uid'] . '-' . $table . '-' . $uid . '-' . $field;
$listItems[] = '<li' . ($row['class'] != '' ? ' class="' . $row['class'] . '"' : '') . ' id="' . $rowId . '" style="' . $row['style'] . '">' . $row['text'] . '</li>';
$listItems[] = '<li' . ($row['class'] != '' ? ' class="' . $row['class'] . '"' : '') . ' id="' . $rowId . '"' . ($row['style'] != '' ? ' style="' . $row['style'] . '"' : '') . '>' . $row['sprite'] . $row['text'] . '</li>';
}
}
if (count($listItems) > 0) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment