Fixed bug #2677: Highlighting of current page in workspace (fixed by Martin Kutschker...
authorMichael Stucki <michael.stucki@typo3.org>
Fri, 16 Feb 2007 11:26:38 +0000 (11:26 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Fri, 16 Feb 2007 11:26:38 +0000 (11:26 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2042 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/alt_db_navframe.php
typo3/tree.js

index 22e0374..62c1acd 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2007-02-16  Michael Stucki  <michael@typo3.org>
 
        * Fixed bug #4973: Check if array is empty before looping over it (thanks to Thomas Oppelt)
+       * Fixed bug #2677: Highlighting of current page in workspace (fixed by Martin Kutschker and Benjamin Mack)
 
 2007-02-16  Dmitry Dulepov  <dmitry@typo3.org>
 
index 3fc3363..614c371 100755 (executable)
@@ -117,7 +117,13 @@ class SC_alt_db_navframe {
                        // Use template rendering only if this is a non-AJAX call:
                if (!$this->ajax) {
                                // Setting highlight mode:
-                       $this->doHighlight = !$BE_USER->getTSConfigVal('options.pageTree.disableTitleHighlight') && $BE_USER->workspace===0;
+                       $this->doHighlight = !$BE_USER->getTSConfigVal('options.pageTree.disableTitleHighlight');
+
+                               // If highlighting is active, define the CSS class for the active item depending on the workspace
+                       if ($this->doHighlight) {
+                               if ($BE_USER->workspace === 0) $hlClass = 'active';
+                               else $hlClass = 'active active-ws wsver'.$BE_USER->workspace; 
+                       }
 
                                // Create template object:
                        $this->doc = t3lib_div::makeInstance('template');
@@ -132,6 +138,8 @@ class SC_alt_db_navframe {
                        ($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
                        // setting prefs for pagetree and drag & drop
                        Tree.thisScript    = "'.$this->pagetree->thisScript.'";
+                       '.($this->doHighlight ? 'Tree.highlightClass = "'.$hlClass.'";' : '').'
+
                        DragDrop.changeURL = "'.$this->backPath.'alt_clickmenu.php";
                        DragDrop.backPath  = "'.t3lib_div::shortMD5(''.'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']).'";
                        DragDrop.table     = "pages";
index ec17fc2..3b4df0b 100755 (executable)
@@ -39,6 +39,7 @@ var Tree = {
        thisScript: null,
        frameSetModule: null,
        activateDragDrop: true,
+       highlightClass: 'active',
 
        // reloads a part of the page tree (useful when "expand" / "collapse")
        load: function(params, isExpand, obj) {
@@ -90,7 +91,7 @@ var Tree = {
        // selects the activated item again, in case it collapsed and got expanded again
        reSelectActiveItem: function() {
                obj = $(top.fsMod.navFrameHighlightedID[this.frameSetModule]);
-               if (obj) Element.addClassName(obj, 'active');
+               if (obj) Element.addClassName(obj, this.highlightClass);
        },
 
        // highlights an active list item in the page tree and registers it to the top-frame
@@ -100,11 +101,11 @@ var Tree = {
 
                // Remove all items that are already highlighted
                obj = $(top.fsMod.navFrameHighlightedID[frameSetModule]);
-               if (obj) Element.removeClassName(obj, 'active');
+               if (obj) Element.removeClassName(obj, this.highlightClass);
 
                // Set the new item
                top.fsMod.navFrameHighlightedID[frameSetModule] = highlightID;
-               if ($(highlightID)) Element.addClassName(highlightID, 'active');
+               if ($(highlightID)) Element.addClassName(highlightID, this.highlightClass);
        }
 
 }