Project

General

Profile

Bug #18055 » 20080126_ShowBEUserNameAndLink.diff

Administrator Admin, 2008-01-26 10:42

View differences:

typo3/backend.php (working copy)
require_once(PATH_t3lib.'class.t3lib_basicfilefunc.php');
require_once('class.alt_menu_functions.inc');
$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xml');
$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_mod_web_list.xml');
/**
* Class for rendering the TYPO3 backend version 4.2+
*
......
* @return string html code snippet displaying the currently logged in user
*/
private function getLoggedInUserLabel() {
$username = '<div id="username" class="toolbar-item no-separator">['.htmlspecialchars($GLOBALS['BE_USER']->user['username']).']</div>';;
global $BACK_PATH;
$label = $GLOBALS['BE_USER']->user['realName'] ? $GLOBALS['BE_USER']->user['realName'] : $GLOBALS['BE_USER']->user['username'];
$title = $GLOBALS['LANG']->getLL('edit',1);
$onclick = 'jump(unescape(\''.rawurlencode($BACK_PATH.'alt_doc.php?&returnUrl=db_list.php?id=0&table=&edit[be_users]['.$GLOBALS['BE_USER']->user['uid'].']=edit').'\'),\'web_list\',\'web\');';
$username = '<div id="username" class="toolbar-item no-separator"><a href="#" title="'.$title.'" onclick="'.$onclick.'">['.htmlspecialchars($label).']</a></div>';;
// superuser mode
if($BE_USER->user['ses_backuserid']) {
$username = '<div id="username" class="toolbar-item no-separator typo3-red-background">[SU: '.htmlspecialchars($GLOBALS['BE_USER']->user['username']).']</div>';
$username = '<div id="username" class="toolbar-item no-separator typo3-red-background"><a href="#" title="'.$title.'" onclick="'.$onclick.'">[SU: '.htmlspecialchars($label).']</a></div>';
}
return $username;
}
......
$TYPO3backend->render();
?>
?>
(1-1/3)