Fixed Bug #16613: CleanUp alt_db_navframe.php to work with new workspaces module
authorSteffen Ritter <info@rs-websystems.de>
Wed, 1 Dec 2010 08:33:00 +0000 (08:33 +0000)
committerSteffen Ritter <info@rs-websystems.de>
Wed, 1 Dec 2010 08:33:00 +0000 (08:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9706 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/alt_db_navframe.php

index 40b9625..9a5a90b 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-12-01  Steffen Ritter  <typo3@steffen-ritter.net>
+
+       * Fixed Bug #16613: CleanUp alt_db_navframe.php to work with new workspaces module
+
 2010-12-01  Sebastian Kurfuerst  <sebastian@typo3.org>
 
        * Updated Extbase and Fluid to 1.3.0beta2. See their ChangeLogs for details.
index bdcc400..b42e41c 100644 (file)
@@ -315,27 +315,22 @@ class SC_alt_db_navframe {
         * @return      string  HTML containing workspace info
         */
        protected function getWorkspaceInfo() {
-               global $LANG;
 
-               if ($GLOBALS['BE_USER']->workspace!==0 || $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.onlineWorkspaceInfo'))  {
-                       switch($GLOBALS['BE_USER']->workspace)  {
-                               case 0:
-                                       $wsTitle = '&nbsp;'.$this->doc->icons(2).'['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:bookmark_onlineWS',1).']';
-                               break;
-                               case -1:
-                                       $wsTitle = '['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:bookmark_offlineWS',1).']';
-                               break;
-                               default:
-                                       $wsTitle = '['.$GLOBALS['BE_USER']->workspace.'] '.htmlspecialchars($GLOBALS['BE_USER']->workspaceRec['title']);
-                               break;
-                       }
+               if (t3lib_extMgm::isLoaded('workspaces') && ($GLOBALS['BE_USER']->workspace !== 0 || $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.onlineWorkspaceInfo'))) {
+                       $wsTitle = htmlspecialchars(tx_Workspaces_Service_Workspaces::getWorkspaceTitle($GLOBALS['BE_USER']->workspace));
 
                        $workspaceInfo = '
-                               <div class="bgColor4 workspace-info">
-                                       <a href="'.htmlspecialchars('mod/user/ws/index.php').'" target="content">'.
-                                         t3lib_iconWorks::getSpriteIcon('apps-toolbar-menu-workspace') .
-                                       '</a>'.$wsTitle.'
-                               </div>
+                               <div class="bgColor4 workspace-info">' .
+                                        t3lib_iconWorks::getSpriteIcon(
+                                               'apps-toolbar-menu-workspace',
+                                               array(
+                                                       'title' => $wsTitle,
+                                                       'onclick' => 'top.goToModule(\'web_WorkspacesWorkspaces\');',
+                                                       'style' => 'cursor:pointer;'
+                                               )
+                                       ) .
+                                       $wsTitle .
+                               '</div>
                        ';
                }