If records can not be sorted, the title of the link should just state
'Create new record' instead of 'create new record after this record'.
Change-Id: I270ff1043b31366fbb8c90a259d52583a178f301
Resolves: #69934
Releases: master
Reviewed-on: https://review.typo3.org/45195
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
if ($this->showNewRecLink($table)) {
$params = '&edit[' . $table . '][' . -($row['_MOVE_PLH'] ? $row['_MOVE_PLH_uid'] : $row['uid']) . ']=new';
$icon = ($table == 'pages' ? $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL) : $this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL));
if ($this->showNewRecLink($table)) {
$params = '&edit[' . $table . '][' . -($row['_MOVE_PLH'] ? $row['_MOVE_PLH_uid'] : $row['uid']) . ']=new';
$icon = ($table == 'pages' ? $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL) : $this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL));
+ $titleLabel = 'new';
+ if ($GLOBALS['TCA'][$table]['ctrl']['sortby']) {
+ $titleLabel .= ($table === 'pages' ? 'Page' : 'Record');
+ }
$newAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, '', -1))
$newAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, '', -1))
- . '" title="' . $this->getLanguageService()->getLL('new' . ($table == 'pages ' ? 'Page' : 'Record'), true) . '">'
+ . '" title="' . htmlspecialchars($this->getLanguageService()->getLL($titleLabel)) . '">'
. $icon->render() . '</a>';
$this->addActionToCellGroup($cells, $newAction, 'new');
}
. $icon->render() . '</a>';
$this->addActionToCellGroup($cells, $newAction, 'new');
}