moved user info and logout button to the toolbar
authorIngo Renner <ingo.renner@typo3.org>
Wed, 28 Nov 2007 13:23:52 +0000 (13:23 +0000)
committerIngo Renner <ingo.renner@typo3.org>
Wed, 28 Nov 2007 13:23:52 +0000 (13:23 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2780 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/backend.php
typo3/classes/class.workspaceselector.php
typo3/css/backend-style.css

index 1489cfc..c41daed 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2007-11-27  Ingo Renner        <ingo@typo3.org>
 
        * added clear cache actions menu to backend.php as part of the cleaner backend project
+       * moved user info and logout button to the toolbar
 
 2007-11-27  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
index 05adc21..aa59777 100644 (file)
@@ -157,8 +157,7 @@ class TYPO3backend {
                $logo->setLogo('gfx/typo3logo_mini.png');
 
                $menu         = $this->moduleMenu->render();
-               $logout       = $this->moduleMenu->renderLogoutButton();
-               $loginInfo    = $this->getLoggedInUserLabel();
+
 
                        // create backend scaffolding
                $backendScaffolding = '
@@ -170,11 +169,8 @@ class TYPO3backend {
                        .'</div>
                </div>
                <div id="typo3-main-container">
-                       <div id="typo3-side-menu">'
-                               .$menu
-                               .$logout
-                               .$loginInfo
-                               .'
+                       <div id="typo3-side-menu">
+                               '.$menu.'
                        </div>
                        <div id="typo3-content">
                                <iframe src="alt_intro.php" name="content" id="content" marginwidth="0" marginheight="0" frameborder="0"  scrolling="auto" noresize="noresize"></iframe>
@@ -230,10 +226,10 @@ class TYPO3backend {
         */
        private function renderToolbar() {
                $toolbar = '<ul id="typo3-toolbar">';
+               $toolbar.= '<li>'.$this->getLoggedInUserLabel().'</li>
+                                       <li><div id="logout-button" class="toolbar-item no-separator">'.$this->moduleMenu->renderLogoutButton().'</div></li>';
 
-               $toolbarItems = $this->toolbarItems;
-
-               foreach($toolbarItems as $toolbarItem) {
+               foreach($this->toolbarItems as $toolbarItem) {
                        $additionalAttributes = $toolbarItem->getAdditionalAttributes();
 
                        $toolbar .= '<li'.$additionalAttributes.'>'.$toolbarItem->render().'</li>';
@@ -248,14 +244,14 @@ class TYPO3backend {
         * @return      string          html code snippet displaying the currently logged in user
         */
        private function getLoggedInUserLabel() {
-               $username = '<p id="username">['.htmlspecialchars($GLOBALS['BE_USER']->user['username']).']</p>';;
+               $username = '<div id="username" class="toolbar-item no-separator">['.htmlspecialchars($GLOBALS['BE_USER']->user['username']).']</div>';;
 
                        // superuser mode
                if($BE_USER->user['ses_backuserid']) {
-                       $username = '<p id="username" class="typo3-red-background">[SU: '.htmlspecialchars($GLOBALS['BE_USER']->user['username']).']</p>';
+                       $username = '<div id="username" class="toolbar-item no-separator typo3-red-background">[SU: '.htmlspecialchars($GLOBALS['BE_USER']->user['username']).']</div>';
                }
 
-               return '<div id="login-info">'.$username.'</div>';
+               return $username;
        }
 
        /**
index 2b844ae..231615f 100644 (file)
@@ -137,7 +137,7 @@ class WorkspaceSelector implements backend_toolbarItem {
                $this->changeWorkspace();
 
                $options             = array();
-               $workspaceSelector   = '';
+               $workspaceSelector   = '<span class="toolbar-item">';
                $availableWorkspaces = $this->getAvailableWorkspaces();
 
                        // build selector box options
@@ -176,7 +176,7 @@ class WorkspaceSelector implements backend_toolbarItem {
                                                'align="top"'
                                        ).'</a>';
 
-               return $workspaceSelector;
+               return $workspaceSelector.'</span>';
        }
 
        /**
index 2e62835..4a3337d 100644 (file)
@@ -59,7 +59,6 @@ Description : styles the TYPO3 backend
 }
 
 .toolbar-item {
-       width: 30px;
        height: 23px;
        padding-top: 2px;
        display: block;
@@ -68,19 +67,41 @@ Description : styles the TYPO3 backend
        background-repeat: no-repeat;
 }
 
+#typo3-toolbar .no-separator {
+       background-image: none;
+}
+
 .toolbar-item-active {
        background-image: url(../gfx/toolbar_item_active_bg.png);
 }
 
+
+/* ----- logged in user ----- */
+
+#username {
+       padding-top: 5px;
+}
+
+#logout-button {
+       padding-left: 4px;
+       padding-right: 6px;
+}
+
+
 /* ----- Workspace Selector ----- */
 
-#workspace-selector {
+#workspace-selector span {
        padding-top: 2px;
+       padding-left: 7px;
        margin-right: 5px;
 }
 
 /* ----- Caching ----- */
 
+#clear-cache-actions-menu {
+       width: 30px;
+}
+
 #clear-cache-actions-menu ul {
        position: absolute;
        list-style: none;