[BUGFIX] Make ElementBrowser Trees expand again 41/41041/2
authorBenjamin Mack <benni@typo3.org>
Thu, 9 Jul 2015 13:23:34 +0000 (15:23 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Thu, 9 Jul 2015 13:52:02 +0000 (15:52 +0200)
Inside the popups the element browser trees don't reload anymore
because the RequireJS calls are added too late.

Resolves: #68012
Releases: master
Change-Id: I492833615d9c16352af667e384de36637fa6ebea
Reviewed-on: http://review.typo3.org/41041
Reviewed-by: Thomas Schlumberger <thomas@b13.de>
Tested-by: Thomas Schlumberger <thomas@b13.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php

index 7e0046b..e45e9d2 100644 (file)
@@ -856,6 +856,12 @@ class ElementBrowser {
         * @return string Modified content variable.
         */
        public function main_rte($wiz = FALSE) {
+               // needs to be executed before doc->startPage()
+               if (in_array($this->act, array('file', 'folder'))) {
+                       $this->doc->getDragDropCode('folders', 'Tree.ajaxID = "SC_alt_file_navframe::expandCollapse"');
+               } elseif ($this->act === 'page') {
+                       $this->doc->getDragDropCode('pages');
+               }
                // Starting content:
                $content = $this->doc->startPage('RTE link');
                // Add the FlashMessages if any
@@ -1255,9 +1261,6 @@ class ElementBrowser {
                        $files = $this->expandFolder($selectedFolder, $allowedExtensions);
                }
                // Create folder tree:
-               $this->doc->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/LegacyTree', 'function(Tree) {
-                       Tree.ajaxID = "SC_alt_file_navframe::expandCollapse";
-               }');
                $content .= '
                                <!--
                                        Wrapper table for folder tree / file/folder list: