Skip to content
Snippets Groups Projects
Commit 204d0049 authored by Georg Ringer's avatar Georg Ringer Committed by Helmut Hummel
Browse files

[TASK] Show reference headline only if content is available

Currently the headline "References from this item" is
always shown in the info popup, no matter if there are
ones or not.

Therefore add an additional check and render the headline
only if needed.

Change-Id: I605d7ff35001f19fa6df2972b4ffde13cca60d7e
Resolves: #41665
Releases: 6.0
Reviewed-on: http://review.typo3.org/15389
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
parent e68b2e75
No related merge requests found
......@@ -286,8 +286,14 @@ class ElementInformationController {
$code .= $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.table') . ': ' . $GLOBALS['LANG']->sL($GLOBALS['TCA'][$this->table]['ctrl']['title']) . ' (' . $this->table . ') - UID: ' . $this->uid . '<br />';
$this->content .= $this->doc->section('', $code);
// References:
$this->content .= $this->doc->section($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.referencesToThisItem'), $this->makeRef($this->table, $this->row['uid']));
$this->content .= $this->doc->section($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.referencesFromThisItem'), $this->makeRefFrom($this->table, $this->row['uid']));
$references = $this->makeRef($this->table, $this->row['uid']);
if (!empty($references)) {
$this->content .= $this->doc->section($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.referencesToThisItem'), $references);
}
$referencesFrom = $this->makeRefFrom($this->table, $this->row['uid']);
if (!empty($referencesFrom)) {
$this->content .= $this->doc->section($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.referencesFromThisItem'), $referencesFrom);
}
}
/**
......@@ -354,8 +360,12 @@ class ElementInformationController {
$this->content .= $this->doc->section('', $tableCode);
// References:
if ($this->fileObject->isIndexed()) {
$header = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.referencesToThisItem');
$this->content .= $this->doc->section($header, $this->makeRef('_FILE', $this->fileObject));
$references = $this->makeRef('_FILE', $this->fileObject);
if (!empty($references)) {
$header = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.referencesToThisItem');
$this->content .= $this->doc->section($header, $references);
}
}
}
......
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