added feature #7282: Show Realname of BE-User if available and link it to edit, credi...
authorIngo Renner <ingo.renner@typo3.org>
Sun, 3 Feb 2008 00:10:18 +0000 (00:10 +0000)
committerIngo Renner <ingo.renner@typo3.org>
Sun, 3 Feb 2008 00:10:18 +0000 (00:10 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3025 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/backend.php
typo3/css/backend-style.css

index 7256376..3c20e45 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2008-02-03  Ingo Renner  <ingo@typo3.org>
 
         * fixed a positioning issue with the toolbar items in Safari
+        * added feature #7282: Show Realname of BE-User if available and link it to edit, credits Steffen Kamper
 
 2008-02-02  Benjamin Mack  <mack@xnos.org>
 
index 48873aa..1881999 100644 (file)
@@ -264,14 +264,30 @@ class TYPO3backend {
         * @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 $BE_USER, $BACK_PATH;
+
+               $icon = '<img'.t3lib_iconWorks::skinImg(
+                       '',
+                       $BE_USER->isAdmin() ?
+                               'gfx/i/be_users_admin.gif' :
+                               'gfx/i/be_users.gif',
+                       'width="14" height="14"'
+               )
+               .' title="" alt="" />';
+
+               $label = $GLOBALS['BE_USER']->user['realName'] ?
+                       $BE_USER->user['realName'].' ['.$BE_USER->user['username'].']' :
+                       '['.$BE_USER->user['username'].']';
+
+               $username   = '"><a href="#" onclick="top.goToModule(\'user_setup\');this.blur();return false;">'
+                                       . $icon.'<span>'.htmlspecialchars($label) . '</span></a>';
 
                        // 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   = ' su-user">SU: '.$icon.'<span>'.htmlspecialchars($label).'</span>';
                }
 
-               return $username;
+               return '<div id="username" class="toolbar-item no-separator'.$username.'</div>';
        }
 
        /**
index cca713c..bfe4ce7 100644 (file)
@@ -90,7 +90,21 @@ Description : styles the TYPO3 backend
 /* ----- logged in user ----- */
 
 #username {
-       padding-top: 5px;
+       height: 13px;
+}
+
+#username.su-user {
+       background: #f7989f;
+       padding-left: 4px;
+}
+
+#username img {
+       padding: 0px 4px;
+       vertical-align: bottom;
+}
+
+#username span {
+       padding-right: 4px;
 }
 
 #logout-button {
@@ -272,3 +286,4 @@ Description : styles the TYPO3 backend
 
 
 
+