Index: t3lib/class.t3lib_tceforms.php =================================================================== --- t3lib/class.t3lib_tceforms.php (revision 7910) +++ t3lib/class.t3lib_tceforms.php (working copy) @@ -4892,16 +4892,57 @@ $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.new',1). ''; - $truePid = t3lib_BEfunc::getTSconfig_pidValue($table,$rec['uid'],$rec['pid']); - $prec = t3lib_BEfunc::getRecordWSOL('pages',$truePid,'title'); + $truePid = t3lib_BEfunc::getTSconfig_pidValue($table, $rec['uid'], $rec['pid']); + $prec = t3lib_BEfunc::getRecordWSOL('pages', $truePid, 'title'); $pageTitle = t3lib_BEfunc::getRecordTitle('pages', $prec, TRUE, FALSE); $rLabel = '[PID: ' . $truePid . '] ' . $pageTitle . ''; - + + // Fetch translated title of the table + $tableTitle = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['ctrl']['title']); + if ($table === 'pages') { + $label = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.createNewPage', TRUE); + $pageTitle = sprintf($label, $tableTitle); + } else { + $label = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.createNewRecord', TRUE); + + if ($rec['pid'] == 0) { + $label = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.createNewRecordRootLevel', TRUE); + } + $pageTitle = sprintf($label, $tableTitle, $pageTitle); + } } else { $newLabel = ' ['.$rec['uid'].']'; $rLabel = t3lib_BEfunc::getRecordTitle($table, $rec, TRUE, FALSE); - $prec = t3lib_BEfunc::getRecordWSOL('pages',$rec['pid'],'title'); - $pageTitle = t3lib_BEfunc::getRecordTitle('pages', $prec, TRUE, FALSE); + $prec = t3lib_BEfunc::getRecordWSOL('pages', $rec['pid'], 'uid,title'); + + // Fetch translated title of the table + $tableTitle = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['ctrl']['title']); + if ($table === 'pages') { + $label = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.editPage', TRUE); + + // Just take the record title and prepend an edit label. + $pageTitle = sprintf($label, $tableTitle, $rLabel); + } else { + $label = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.editRecord', TRUE); + + $pageTitle = t3lib_BEfunc::getRecordTitle('pages', $prec, TRUE, FALSE); + if ($rLabel === t3lib_BEfunc::getNoRecordTitle(TRUE)) { + $label = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.editRecordNoTitle', TRUE); + } + if ($rec['pid'] == 0) { + $label = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.editRecordRootLevel', TRUE); + } + + if ($rLabel !== t3lib_BEfunc::getNoRecordTitle(TRUE)) { + + // Just take the record title and prepend an edit label. + $pageTitle = sprintf($label, $tableTitle, $rLabel, $pageTitle); + } else { + + // Leave out the record title since it is not set. + $pageTitle = sprintf($label, $tableTitle, $pageTitle); + } + } } foreach ($arr as $k => $v) { Index: typo3/sysext/lang/locallang_core.xml =================================================================== --- typo3/sysext/lang/locallang_core.xml (revision 7910) +++ typo3/sysext/lang/locallang_core.xml (working copy) @@ -69,6 +69,14 @@ + + + + + + + +