Commit c13a2840 authored by Johannes Schlier's avatar Johannes Schlier Committed by Christian Kuhn
Browse files

[BUGFIX] Remove disabled button in inline records

If the info icon is disabled it is now removed completely.
Previously the logic for new records was not caught correctly, so that
the case for the enabled icon with a new record was executed.
Disabling the icon should remove it completely,
as a disabled non-clickable icon is not helpful and confusing for editors.
This is now done, and the case for the enabled icon with new records is
also correctly caught.

Resolves: #81380
Releases: master, 8.7
Change-Id: I1c78a99a83efa3c88e3a6337df9cd0c8a959ea7b
Reviewed-on: https://review.typo3.org/52970

Reviewed-by: Daniel Windloff's avatarDaniel Windloff <daniel.jc.windloff@googlemail.com>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMarkus Sommer <markussom@posteo.de>
Tested-by: default avatarMarkus Sommer <markussom@posteo.de>
Tested-by: Daniel Windloff's avatarDaniel Windloff <daniel.jc.windloff@googlemail.com>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent eb65591e
......@@ -434,13 +434,15 @@ class InlineRecordContainer extends AbstractContainer
$uid = $rec['uid'];
$table = $foreignTable;
}
if ($enabledControls['info'] && !$isNewItem) {
$cells['info'] = '
if ($enabledControls['info']) {
if ($isNewItem) {
$cells['info'] = '<span class="btn btn-default disabled">' . $this->iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render() . '</span>';
} else {
$cells['info'] = '
<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(('top.launchView(' . GeneralUtility::quoteJSvalue($table) . ', ' . GeneralUtility::quoteJSvalue($uid) . '); return false;')) . '" title="' . htmlspecialchars($languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_mod_web_list.xlf:showInfo')) . '">
' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)->render() . '
</a>';
} else {
$cells['info'] = '<span class="btn btn-default disabled">' . $this->iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render() . '</span>';
}
}
// If the table is NOT a read-only table, then show these links:
if (!$tcaTableCtrl['readOnly'] && !$data['isInlineDefaultLanguageRecordInLocalizedParentContext']) {
......
Supports Markdown
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