Fixed bug #14315: Filelist: AJAX bug with multiple file mounts in the folder tree
authorBenni Mack <benni.mack@typo3.org>
Thu, 6 May 2010 19:21:25 +0000 (19:21 +0000)
committerBenni Mack <benni.mack@typo3.org>
Thu, 6 May 2010 19:21:25 +0000 (19:21 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7553 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/class.filelistfoldertree.php

index 1813c11..8936e3a 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-05-06  Benjamin Mack  <benni@typo3.org>
 
+       * Fixed bug #14315: Filelist: AJAX bug with multiple file mounts in the folder tree
        * Fixed bug #12429: Renamed "t3lib_tstemplate::procesIncludes" to "processIncludes" due to a misspelling (Thanks to Bernhard Kraft)
        * Fixed bug #13996: Hardcoded TYPO3 logo shown in "HELP > About TYPO3" (Thanks to Stephan Kellermayr)
        * Fixed bug #13995: Hardcoded TYPO3 logo image shown in "HELP > About Modules" (Thanks to Stephan Kellermayr and Steffen Kamper)
index 1847791..542e4bf 100644 (file)
@@ -169,7 +169,7 @@ class filelistFolderTree extends t3lib_folderTree {
                        // if this item is the start of a new level,
                        // then a new level <ul> is needed, but not in ajax mode
                        if($v['isFirst'] && !($doCollapse) && !($doExpand && $expandedFolderUid == $uid))       {
-                               $itemHTML = "</div><ul>\n";
+                               $itemHTML = "<ul>\n";
                        }
 
                        // add CSS classes to the list item
@@ -179,10 +179,10 @@ class filelistFolderTree extends t3lib_folderTree {
                        $itemHTML .='
                                <li id="'.$idAttr.'"'.($classAttr ? ' class="'.$classAttr.'"' : '').'><div class="treeLinkItem">'.
                                        $v['HTML'].
-                                       $this->wrapTitle($this->getTitleStr($v['row'],$titleLen),$v['row'],$v['bank']);
+                                       $this->wrapTitle($this->getTitleStr($v['row'],$titleLen),$v['row'],$v['bank']) . '</div>';
 
 
-                       if(!$v['hasSub']) { $itemHTML .= "</div></li>\n"; }
+                       if(!$v['hasSub']) { $itemHTML .= "</li>\n"; }
 
                        // we have to remember if this is the last one
                        // on level X so the last child on level X+1 closes the <ul>-tag
@@ -342,6 +342,12 @@ class filelistFolderTree extends t3lib_folderTree {
 
                                // Add tree:
                        $treeArr = array_merge($treeArr, $this->tree);
+                       
+                               // if this is an AJAX call, don't run through all mounts, only 
+                               // show the expansion of the current one, not the rest of the mounts
+                       if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) {
+                               break;
+                       }
                }
                return $this->printTree($treeArr);
        }