[BUGFIX] RTE: Modify image dialogue is broken 05/36005/2
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 13 Jan 2015 18:55:14 +0000 (13:55 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 13 Jan 2015 19:00:27 +0000 (20:00 +0100)
Fix references to undefined variables.

Releases: master
Resolves: #64244
Change-Id: Ie5b99224c3a393b866248eca046cfbfa3365c83f
Reviewed-on: http://review.typo3.org/36005
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/Classes/SelectImage.php

index 7aec1e0..f5fd98b 100644 (file)
@@ -131,10 +131,9 @@ class SelectImage extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
 
                $this->doc->bodyTagId = 'typo3-browse-links-php';
                $this->doc->bodyTagAdditions = $this->getBodyTagAdditions();
-
-               $this->doc->JScode .= $this->doc->wrapScriptTags('
+               $this->doc->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/LegacyTree', 'function(Tree) {
                        Tree.ajaxID = "SC_alt_file_navframe::expandCollapse";
-               ');
+               }');
                $this->doc->getPageRenderer()->addCssFile($this->doc->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3skin') . 'rtehtmlarea/htmlarea.css');
                $this->doc->getContextMenuCode();
        }
@@ -304,11 +303,7 @@ class SelectImage extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
                }
                $JScode = '
                        var plugin = window.parent.RTEarea["' . $editorNo . '"].editor.getPlugin("TYPO3Image");
-                       var HTMLArea = window.parent.HTMLArea;
 
-                       HTMLArea.TYPO3Image.insertElement = function (table, uid, type, filename, filePath, fileExt, fileIcon) {
-                               return jumpToUrl(' . GeneralUtility::quoteJSvalue($this->getThisScript() . 'editorNo=') . ' + \'' . $editorNo . '\' + \'&insertImage=\' + filePath + \'&table=\' + table + \'&uid=\' + uid + \'&type=\' + type + \'bparams=\' + \'' . $this->bparams . '\');
-                       }
                        function insertElement(table, uid, type, fileName, filePath, fileExt, fileIcon, action, close) {
                                return jumpToUrl(' . GeneralUtility::quoteJSvalue($this->getThisScript() . 'editorNo=') . ' + \'' . $editorNo . '\' + \'&insertImage=\' + filePath + \'&table=\' + table + \'&uid=\' + uid + \'&type=\' + type + \'bparams=\' + \'' . $this->bparams . '\');
                        }