[BUGFIX] Make element browser work again 48/33948/4
authorBenjamin Mack <benni@typo3.org>
Mon, 10 Nov 2014 13:55:11 +0000 (14:55 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 10 Nov 2014 17:34:35 +0000 (18:34 +0100)
Due to the cleanup of the DocumentTemplate
html variants, the Element Browser did not
work as a <body> tag is now rendered.

The solution is to only fetch the
<html> and <head> part from the
PageRenderer and build the frameset part.

Resolves: #62825
Resolves: #62345
Releases: master
Change-Id: Id267e1e9b79c000f17e52a60901602002c13d45a
Reviewed-on: http://review.typo3.org/33948
Reviewed-by: Stefan Froemken <froemken@gmail.com>
Tested-by: Stefan Froemken <froemken@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/recordlist/Classes/Controller/ElementBrowserFramesetController.php

index 89bb9fa..1bb88d4 100644 (file)
@@ -41,8 +41,6 @@ class ElementBrowserFramesetController {
                $mode = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('mode');
                $bparams = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('bparams');
                $moduleUrl = BackendUtility::getModuleUrl('wizard_element_browser') . '&mode=';
-               // Set doktype:
-               $GLOBALS['TBE_TEMPLATE']->docType = 'xhtml_frames';
                $GLOBALS['TBE_TEMPLATE']->JScode = $GLOBALS['TBE_TEMPLATE']->wrapScriptTags('
                                function closing() {    //
                                        close();
@@ -55,19 +53,22 @@ class ElementBrowserFramesetController {
                                        close();
                                }
                ');
-               $this->content .= $GLOBALS['TBE_TEMPLATE']->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:TYPO3_Element_Browser'));
+
+               // build the header part
+               $GLOBALS['TBE_TEMPLATE']->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:TYPO3_Element_Browser'));
+
                // URL for the inner main frame:
                $url = $GLOBALS['BACK_PATH'] . $moduleUrl . rawurlencode($mode) . '&bparams=' . rawurlencode($bparams);
-               // Create the frameset for the window:
+
+               // Create the frameset for the window
                // Formerly there were a ' onunload="closing();"' in the <frameset> tag - but it failed on Safari browser on Mac unless the handler was "onUnload"
-               $this->content .= '
-                       <frameset rows="*,1" framespacing="0" frameborder="0" border="0">
+               $this->content = $GLOBALS['TBE_TEMPLATE']->getPageRenderer()->render(\TYPO3\CMS\Core\Page\PageRenderer::PART_HEADER) .
+                       '<frameset rows="*,1" framespacing="0" frameborder="0" border="0">
                                <frame name="content" src="' . htmlspecialchars($url) . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
                                <frame name="menu" src="' . $GLOBALS['BACK_PATH'] . 'dummy.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
                        </frameset>
+               </html>
                ';
-               $this->content .= '
-</html>';
        }
 
        /**