[TASK] RTE: Move modules to Modules directory 36/33836/2
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 6 Nov 2014 06:09:52 +0000 (01:09 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 6 Nov 2014 06:28:07 +0000 (07:28 +0100)
Move the RTE wizards to Modules directory and cleanup configuration and
class structure.

Releases: master
Resolves: #62731
Change-Id: Ib5eaa065435ea1d09e539059301f22538d4c4d63
Reviewed-on: http://review.typo3.org/33836
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
30 files changed:
typo3/sysext/core/Documentation/Changelog/master/Breaking-62731-RTEWizardClassesRenamed.rst [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Classes/ContentParser.php [deleted file]
typo3/sysext/rtehtmlarea/Classes/Controller/ParseHtmlController.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Classes/Controller/UserElementsController.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Classes/Extension/Typo3HtmlParser.php
typo3/sysext/rtehtmlarea/Classes/Extension/Typo3Image.php
typo3/sysext/rtehtmlarea/Classes/Extension/Typo3Link.php
typo3/sysext/rtehtmlarea/Classes/Extension/UserElements.php
typo3/sysext/rtehtmlarea/Classes/User.php [deleted file]
typo3/sysext/rtehtmlarea/Migrations/Code/ClassAliasMap.php
typo3/sysext/rtehtmlarea/Modules/BrowseLinks/conf.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Modules/BrowseLinks/index.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Modules/ParseHtml/conf.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Modules/ParseHtml/index.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Modules/SelectImage/conf.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Modules/SelectImage/index.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Modules/UserElements/conf.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Modules/UserElements/index.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/ext_tables.php
typo3/sysext/rtehtmlarea/mod3/clear.gif [deleted file]
typo3/sysext/rtehtmlarea/mod3/conf.php [deleted file]
typo3/sysext/rtehtmlarea/mod3/index.php [deleted file]
typo3/sysext/rtehtmlarea/mod4/clear.gif [deleted file]
typo3/sysext/rtehtmlarea/mod4/conf.php [deleted file]
typo3/sysext/rtehtmlarea/mod4/index.php [deleted file]
typo3/sysext/rtehtmlarea/mod5/clear.gif [deleted file]
typo3/sysext/rtehtmlarea/mod5/conf.php [deleted file]
typo3/sysext/rtehtmlarea/mod5/index.php [deleted file]
typo3/sysext/rtehtmlarea/mod6/conf.php [deleted file]
typo3/sysext/rtehtmlarea/mod6/index.php [deleted file]

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-62731-RTEWizardClassesRenamed.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-62731-RTEWizardClassesRenamed.rst
new file mode 100644 (file)
index 0000000..f878c5a
--- /dev/null
@@ -0,0 +1,29 @@
+=============================================
+Breaking: #62291 - RTE wizard classes renamed
+=============================================
+
+Description
+===========
+
+The following two RTE classes were renamed:
+
+TYPO3\CMS\Rtehtmlarea\ContentParser renamed to TYPO3\CMS\Rtehtmlarea\Controller\ParseHtmlController
+TYPO3\CMS\Rtehtmlarea\User renamed to TYPO3\CMS\Rtehtmlarea\Controller\UserElementsController
+
+
+Impact
+======
+
+3rd party extensions referring to an old class name will fail.
+
+
+Affected installations
+======================
+
+A TYPO3 instance is affected if a 3rd party extension refers to a renamed class by its old name.
+
+
+Migration
+=========
+
+The affected 3rd party extensions must be modified to use the new names of these classes.
\ No newline at end of file
diff --git a/typo3/sysext/rtehtmlarea/Classes/ContentParser.php b/typo3/sysext/rtehtmlarea/Classes/ContentParser.php
deleted file mode 100644 (file)
index a399477..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-<?php
-namespace TYPO3\CMS\Rtehtmlarea;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Content parsing for htmlArea RTE
- *
- * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
- */
-class ContentParser {
-
-       /**
-        * @var string
-        */
-       public $content;
-
-       /**
-        * @var array
-        */
-       public $modData;
-
-       /**
-        * document template object
-        *
-        * @var \TYPO3\CMS\Backend\Template\DocumentTemplate
-        */
-       public $doc;
-
-       /**
-        * @var string
-        */
-       public $extKey = 'rtehtmlarea';
-
-       /**
-        * @var string
-        */
-       public $prefixId = 'TYPO3HtmlParser';
-
-       /**
-        * @return      [type]          ...
-        */
-       public function init() {
-               $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
-               $this->doc->backPath = $GLOBALS['BACK_PATH'];
-               $this->doc->JScode = '';
-               $this->modData = $GLOBALS['BE_USER']->getModuleData($GLOBALS['MCONF']['name'], 'ses');
-               if (GeneralUtility::_GP('OC_key')) {
-                       $parts = explode('|', GeneralUtility::_GP('OC_key'));
-                       $this->modData['openKeys'][$parts[1]] = $parts[0] == 'O' ? 1 : 0;
-                       $GLOBALS['BE_USER']->pushModuleData($GLOBALS['MCONF']['name'], $this->modData);
-               }
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @return      [type]          ...
-        */
-       public function main() {
-               $this->content .= $this->main_parse_html($this->modData['openKeys']);
-               header('Content-Type: text/plain; charset=utf-8');
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @return      [type]          ...
-        */
-       public function printContent() {
-               echo $this->content;
-       }
-
-       /**
-        * Rich Text Editor (RTE) html parser
-        *
-        * @param       [type]          $openKeys: ...
-        * @return      [type]          ...
-        */
-       public function main_parse_html($openKeys) {
-               $editorNo = GeneralUtility::_GP('editorNo');
-               $html = GeneralUtility::_GP('content');
-               $RTEtsConfigParts = explode(':', GeneralUtility::_GP('RTEtsConfigParams'));
-               $RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE', \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($RTEtsConfigParts[5]));
-               $thisConfig = \TYPO3\CMS\Backend\Utility\BackendUtility::RTEsetup($RTEsetup['properties'], $RTEtsConfigParts[0], $RTEtsConfigParts[2], $RTEtsConfigParts[4]);
-               $HTMLParser = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Html\\HtmlParser');
-               if (is_array($thisConfig['enableWordClean.'])) {
-                       $HTMLparserConfig = $thisConfig['enableWordClean.']['HTMLparser.'];
-                       if (is_array($HTMLparserConfig)) {
-                               $this->keepSpanTagsWithId($HTMLparserConfig);
-                               $HTMLparserConfig = $HTMLParser->HTMLparserConfig($HTMLparserConfig);
-                       }
-               }
-               if (is_array($HTMLparserConfig)) {
-                       $html = $HTMLParser->HTMLcleaner($html, $HTMLparserConfig[0], $HTMLparserConfig[1], $HTMLparserConfig[2], $HTMLparserConfig[3]);
-               }
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey][$this->prefixId]['cleanPastedContent'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey][$this->prefixId]['cleanPastedContent'] as $classRef) {
-                               $hookObj = GeneralUtility::getUserObj($classRef);
-                               if (method_exists($hookObj, 'cleanPastedContent_afterCleanWord')) {
-                                       $html = $hookObj->cleanPastedContent_afterCleanWord($html, $thisConfig);
-                               }
-                       }
-               }
-               return $html;
-       }
-
-       /**
-        * Modify incoming HTMLparser config in an attempt to keep span tags with id
-        * Such tags are used by the RTE in order to restore the cursor position when the cleaning operation is completed.
-        *
-        * @param array $HTMLparserConfig: incoming HTMLParser configuration (wil be modified)
-        * @return void
-        */
-       protected function keepSpanTagsWithId(&$HTMLparserConfig) {
-               // Allow span tag
-               if (isset($HTMLparserConfig['allowTags'])) {
-                       if (!GeneralUtility::inList($HTMLparserConfig['allowTags'], 'span')) {
-                               $HTMLparserConfig['allowTags'] .= ',span';
-                       }
-               } else {
-                       $HTMLparserConfig['allowTags'] = 'span';
-               }
-               // Allow attributes on span tags
-               if (isset($HTMLparserConfig['noAttrib']) && GeneralUtility::inList($HTMLparserConfig['noAttrib'], 'span')) {
-                       $HTMLparserConfig['noAttrib'] = GeneralUtility::rmFromList('span', $HTMLparserConfig['noAttrib']);
-               }
-               // Do not remove span tags
-               if (isset($HTMLparserConfig['removeTags']) && GeneralUtility::inList($HTMLparserConfig['removeTags'], 'span')) {
-                       $HTMLparserConfig['removeTags'] = GeneralUtility::rmFromList('span', $HTMLparserConfig['removeTags']);
-               }
-               // Review the tags array
-               if (is_array($HTMLparserConfig['tags.'])) {
-                       // Allow span tag
-                       if (isset($HTMLparserConfig['tags.']['span']) && !$HTMLparserConfig['tags.']['span']) {
-                               $HTMLparserConfig['tags.']['span'] = 1;
-                       }
-                       if (is_array($HTMLparserConfig['tags.']['span.'])) {
-                               if (isset($HTMLparserConfig['tags.']['span.']['allowedAttribs'])) {
-                                       if (!$HTMLparserConfig['tags.']['span.']['allowedAttribs']) {
-                                               $HTMLparserConfig['tags.']['span.']['allowedAttribs'] = 'id';
-                                       } elseif (!GeneralUtility::inList($HTMLparserConfig['tags.']['span.']['allowedAttribs'], 'id')) {
-                                               $HTMLparserConfig['tags.']['span.']['allowedAttribs'] .= ',id';
-                                       }
-                               }
-                               if (isset($HTMLparserConfig['tags.']['span.']['fixAttrib.']['id.']['unset'])) {
-                                       unset($HTMLparserConfig['tags.']['span.']['fixAttrib.']['id.']['unset']);
-                               }
-                       }
-               }
-       }
-
-}
diff --git a/typo3/sysext/rtehtmlarea/Classes/Controller/ParseHtmlController.php b/typo3/sysext/rtehtmlarea/Classes/Controller/ParseHtmlController.php
new file mode 100644 (file)
index 0000000..04ea71f
--- /dev/null
@@ -0,0 +1,166 @@
+<?php
+namespace TYPO3\CMS\Rtehtmlarea\Controller;
+
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Content parsing for htmlArea RTE
+ *
+ * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
+ */
+class ParseHtmlController {
+
+       /**
+        * @var string
+        */
+       public $content;
+
+       /**
+        * @var array
+        */
+       public $modData;
+
+       /**
+        * document template object
+        *
+        * @var \TYPO3\CMS\Backend\Template\DocumentTemplate
+        */
+       public $doc;
+
+       /**
+        * @var string
+        */
+       public $extKey = 'rtehtmlarea';
+
+       /**
+        * @var string
+        */
+       public $prefixId = 'TYPO3HtmlParser';
+
+       /**
+        * @return      [type]          ...
+        */
+       public function init() {
+               $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
+               $this->doc->backPath = $GLOBALS['BACK_PATH'];
+               $this->doc->JScode = '';
+               $this->modData = $GLOBALS['BE_USER']->getModuleData($GLOBALS['MCONF']['name'], 'ses');
+               if (GeneralUtility::_GP('OC_key')) {
+                       $parts = explode('|', GeneralUtility::_GP('OC_key'));
+                       $this->modData['openKeys'][$parts[1]] = $parts[0] == 'O' ? 1 : 0;
+                       $GLOBALS['BE_USER']->pushModuleData($GLOBALS['MCONF']['name'], $this->modData);
+               }
+       }
+
+       /**
+        * [Describe function...]
+        *
+        * @return      [type]          ...
+        */
+       public function main() {
+               $this->content .= $this->main_parse_html($this->modData['openKeys']);
+               header('Content-Type: text/plain; charset=utf-8');
+       }
+
+       /**
+        * [Describe function...]
+        *
+        * @return      [type]          ...
+        */
+       public function printContent() {
+               echo $this->content;
+       }
+
+       /**
+        * Rich Text Editor (RTE) html parser
+        *
+        * @param       [type]          $openKeys: ...
+        * @return      [type]          ...
+        */
+       public function main_parse_html($openKeys) {
+               $editorNo = GeneralUtility::_GP('editorNo');
+               $html = GeneralUtility::_GP('content');
+               $RTEtsConfigParts = explode(':', GeneralUtility::_GP('RTEtsConfigParams'));
+               $RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE', \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($RTEtsConfigParts[5]));
+               $thisConfig = \TYPO3\CMS\Backend\Utility\BackendUtility::RTEsetup($RTEsetup['properties'], $RTEtsConfigParts[0], $RTEtsConfigParts[2], $RTEtsConfigParts[4]);
+               $HTMLParser = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Html\\HtmlParser');
+               if (is_array($thisConfig['enableWordClean.'])) {
+                       $HTMLparserConfig = $thisConfig['enableWordClean.']['HTMLparser.'];
+                       if (is_array($HTMLparserConfig)) {
+                               $this->keepSpanTagsWithId($HTMLparserConfig);
+                               $HTMLparserConfig = $HTMLParser->HTMLparserConfig($HTMLparserConfig);
+                       }
+               }
+               if (is_array($HTMLparserConfig)) {
+                       $html = $HTMLParser->HTMLcleaner($html, $HTMLparserConfig[0], $HTMLparserConfig[1], $HTMLparserConfig[2], $HTMLparserConfig[3]);
+               }
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey][$this->prefixId]['cleanPastedContent'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey][$this->prefixId]['cleanPastedContent'] as $classRef) {
+                               $hookObj = GeneralUtility::getUserObj($classRef);
+                               if (method_exists($hookObj, 'cleanPastedContent_afterCleanWord')) {
+                                       $html = $hookObj->cleanPastedContent_afterCleanWord($html, $thisConfig);
+                               }
+                       }
+               }
+               return $html;
+       }
+
+       /**
+        * Modify incoming HTMLparser config in an attempt to keep span tags with id
+        * Such tags are used by the RTE in order to restore the cursor position when the cleaning operation is completed.
+        *
+        * @param array $HTMLparserConfig: incoming HTMLParser configuration (wil be modified)
+        * @return void
+        */
+       protected function keepSpanTagsWithId(&$HTMLparserConfig) {
+               // Allow span tag
+               if (isset($HTMLparserConfig['allowTags'])) {
+                       if (!GeneralUtility::inList($HTMLparserConfig['allowTags'], 'span')) {
+                               $HTMLparserConfig['allowTags'] .= ',span';
+                       }
+               } else {
+                       $HTMLparserConfig['allowTags'] = 'span';
+               }
+               // Allow attributes on span tags
+               if (isset($HTMLparserConfig['noAttrib']) && GeneralUtility::inList($HTMLparserConfig['noAttrib'], 'span')) {
+                       $HTMLparserConfig['noAttrib'] = GeneralUtility::rmFromList('span', $HTMLparserConfig['noAttrib']);
+               }
+               // Do not remove span tags
+               if (isset($HTMLparserConfig['removeTags']) && GeneralUtility::inList($HTMLparserConfig['removeTags'], 'span')) {
+                       $HTMLparserConfig['removeTags'] = GeneralUtility::rmFromList('span', $HTMLparserConfig['removeTags']);
+               }
+               // Review the tags array
+               if (is_array($HTMLparserConfig['tags.'])) {
+                       // Allow span tag
+                       if (isset($HTMLparserConfig['tags.']['span']) && !$HTMLparserConfig['tags.']['span']) {
+                               $HTMLparserConfig['tags.']['span'] = 1;
+                       }
+                       if (is_array($HTMLparserConfig['tags.']['span.'])) {
+                               if (isset($HTMLparserConfig['tags.']['span.']['allowedAttribs'])) {
+                                       if (!$HTMLparserConfig['tags.']['span.']['allowedAttribs']) {
+                                               $HTMLparserConfig['tags.']['span.']['allowedAttribs'] = 'id';
+                                       } elseif (!GeneralUtility::inList($HTMLparserConfig['tags.']['span.']['allowedAttribs'], 'id')) {
+                                               $HTMLparserConfig['tags.']['span.']['allowedAttribs'] .= ',id';
+                                       }
+                               }
+                               if (isset($HTMLparserConfig['tags.']['span.']['fixAttrib.']['id.']['unset'])) {
+                                       unset($HTMLparserConfig['tags.']['span.']['fixAttrib.']['id.']['unset']);
+                               }
+                       }
+               }
+       }
+
+}
diff --git a/typo3/sysext/rtehtmlarea/Classes/Controller/UserElementsController.php b/typo3/sysext/rtehtmlarea/Classes/Controller/UserElementsController.php
new file mode 100644 (file)
index 0000000..15cd438
--- /dev/null
@@ -0,0 +1,286 @@
+<?php
+namespace TYPO3\CMS\Rtehtmlarea\Controller;
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * User defined content for htmlArea RTE
+ *
+ * @author Kasper Skårhøj <kasper@typo3.com>
+ * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
+ */
+class UserElementsController {
+
+       /**
+        * @var string
+        */
+       public $content;
+
+       /**
+        * @var array
+        */
+       public $modData;
+
+       /**
+        * @var string
+        */
+       public $siteUrl;
+
+       /**
+        * document template object
+        *
+        * @var \TYPO3\CMS\Backend\Template\DocumentTemplate
+        */
+       public $doc;
+
+       /**
+        * @var string
+        */
+       public $editorNo;
+
+       /**
+        * Initialize language files
+        */
+       public function __construct() {
+               $GLOBALS['LANG']->includeLLFile('EXT:rtehtmlarea/mod5/locallang.xlf');
+               $GLOBALS['LANG']->includeLLFile('EXT:rtehtmlarea/htmlarea/locallang_dialogs.xlf');
+       }
+
+       /**
+        * @return      [type]          ...
+        */
+       public function init() {
+               $this->editorNo = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('editorNo');
+               $this->siteUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL');
+               $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
+               $this->doc->backPath = $GLOBALS['BACK_PATH'];
+               $this->doc->bodyTagAdditions = 'onload="Init();"';
+               $this->doc->form = '
+       <form action="" id="process" name="process" method="post">
+               <input type="hidden" name="processContent" value="" />
+               <input type="hidden" name="returnUrl" value="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI')) . '" />
+               ';
+               $JScode = '
+                       var plugin = window.parent.RTEarea["' . $this->editorNo . '"].editor.getPlugin("UserElements");
+                       var HTMLArea = window.parent.HTMLArea;
+                       var editor = plugin.editor;
+
+                       function Init() {
+                       };
+                       function insertHTML(content,noHide) {
+                               plugin.restoreSelection();
+                               editor.getSelection().insertHtml(content);
+                               if(!noHide) plugin.close();
+                       };
+                       function wrapHTML(wrap1,wrap2,noHide) {
+                               plugin.restoreSelection();
+                               if(!editor.getSelection().isEmpty()) {
+                                       editor.getSelection().surroundHtml(wrap1,wrap2);
+                               } else {
+                                       alert(' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->getLL('noTextSelection')) . ');
+                               }
+                               if(!noHide) plugin.close();
+                       };
+                       function processSelection(script) {
+                               plugin.restoreSelection();
+                               document.process.action = script;
+                               document.process.processContent.value = editor.getSelection().getHtml();
+                               document.process.submit();
+                       };
+                       function jumpToUrl(URL) {
+                               var RTEtsConfigParams = "&RTEtsConfigParams=' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('RTEtsConfigParams')) . '";
+                               var editorNo = "&editorNo=' . rawurlencode($this->editorNo) . '";
+                               theLocation = URL+RTEtsConfigParams+editorNo;
+                               window.location.href = theLocation;
+                       }
+               ';
+
+               // unset the default jumpToUrl() function
+               unset($this->doc->JScodeArray['jumpToUrl']);
+
+               $this->doc->JScode = $this->doc->wrapScriptTags($JScode);
+               $this->modData = $GLOBALS['BE_USER']->getModuleData('user.php', 'ses');
+               if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('OC_key')) {
+                       $parts = explode('|', \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('OC_key'));
+                       $this->modData['openKeys'][$parts[1]] = $parts[0] == 'O' ? 1 : 0;
+                       $GLOBALS['BE_USER']->pushModuleData('user.php', $this->modData);
+               }
+       }
+
+       /**
+        * [Describe function...]
+        *
+        * @return      [type]          ...
+        */
+       public function main() {
+               $this->content = '';
+               $this->content .= $this->main_user($this->modData['openKeys']);
+       }
+
+       /**
+        * [Describe function...]
+        *
+        * @return      [type]          ...
+        */
+       public function printContent() {
+               echo $this->content;
+       }
+
+       /********************************
+        *
+        * Other functions
+        *
+        *********************************/
+       /**
+        * @param       [type]          $imgInfo: ...
+        * @param       [type]          $maxW: ...
+        * @param       [type]          $maxH: ...
+        * @return      [type]          ...
+        */
+       public function calcWH($imgInfo, $maxW = 380, $maxH = 500) {
+               $IW = $imgInfo[0];
+               $IH = $imgInfo[1];
+               if ($IW > $maxW) {
+                       $IH = ceil($IH / $IW * $maxW);
+                       $IW = $maxW;
+               }
+               if ($IH > $maxH) {
+                       $IW = ceil($IW / $IH * $maxH);
+                       $IH = $maxH;
+               }
+               $imgInfo[3] = 'width="' . $IW . '" height="' . $IH . '"';
+               return $imgInfo;
+       }
+
+       /**
+        * Rich Text Editor (RTE) user element selector
+        *
+        * @param       [type]          $openKeys: ...
+        * @return      [type]          ...
+        */
+       public function main_user($openKeys) {
+               // Starting content:
+               $content = $this->doc->startPage($GLOBALS['LANG']->getLL('Insert Custom Element', TRUE));
+               $RTEtsConfigParts = explode(':', \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('RTEtsConfigParams'));
+               $RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE', \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($RTEtsConfigParts[5]));
+               $thisConfig = \TYPO3\CMS\Backend\Utility\BackendUtility::RTEsetup($RTEsetup['properties'], $RTEtsConfigParts[0], $RTEtsConfigParts[2], $RTEtsConfigParts[4]);
+               if (is_array($thisConfig['userElements.'])) {
+                       $categories = array();
+                       foreach ($thisConfig['userElements.'] as $k => $value) {
+                               $ki = (int)$k;
+                               $v = $thisConfig['userElements.'][$ki . '.'];
+                               if (substr($k, -1) == '.' && is_array($v)) {
+                                       $subcats = array();
+                                       $openK = $ki;
+                                       if ($openKeys[$openK]) {
+                                               $mArray = '';
+                                               if ($v['load'] === 'images_from_folder') {
+                                                       $mArray = array();
+                                                       if ($v['path'] && @is_dir((PATH_site . $v['path']))) {
+                                                               $files = \TYPO3\CMS\Core\Utility\GeneralUtility::getFilesInDir(PATH_site . $v['path'], 'gif,jpg,jpeg,png', 0, '');
+                                                               if (is_array($files)) {
+                                                                       $c = 0;
+                                                                       foreach ($files as $filename) {
+                                                                               $iInfo = @getimagesize((PATH_site . $v['path'] . $filename));
+                                                                               $iInfo = $this->calcWH($iInfo, 50, 100);
+                                                                               $ks = (string)(100 + $c);
+                                                                               $mArray[$ks] = $filename;
+                                                                               $mArray[$ks . '.'] = array(
+                                                                                       'content' => '<img src="' . $this->siteUrl . $v['path'] . $filename . '" />',
+                                                                                       '_icon' => '<img src="' . $this->siteUrl . $v['path'] . $filename . '" ' . $iInfo[3] . ' />',
+                                                                                       'description' => $GLOBALS['LANG']->getLL('filesize') . ': ' . str_replace('&nbsp;', ' ', \TYPO3\CMS\Core\Utility\GeneralUtility::formatSize(@filesize((PATH_site . $v['path'] . $filename)))) . ', ' . $GLOBALS['LANG']->getLL('pixels', 1) . ': ' . $iInfo[0] . 'x' . $iInfo[1]
+                                                                               );
+                                                                               $c++;
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                               if (is_array($mArray)) {
+                                                       if ($v['merge']) {
+                                                               \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($mArray, $v);
+                                                               $v = $mArray;
+                                                       } else {
+                                                               $v = $mArray;
+                                                       }
+                                               }
+                                               foreach ($v as $k2 => $dummyValue) {
+                                                       $k2i = (int)$k2;
+                                                       if (substr($k2, -1) == '.' && is_array($v[$k2i . '.'])) {
+                                                               $title = trim($v[$k2i]);
+                                                               if (!$title) {
+                                                                       $title = '[' . $GLOBALS['LANG']->getLL('noTitle', TRUE) . ']';
+                                                               } else {
+                                                                       $title = $GLOBALS['LANG']->sL($title, TRUE);
+                                                               }
+                                                               $description = $GLOBALS['LANG']->sL($v[($k2i . '.')]['description'], TRUE) . '<br />';
+                                                               if (!$v[($k2i . '.')]['dontInsertSiteUrl']) {
+                                                                       $v[$k2i . '.']['content'] = str_replace('###_URL###', $this->siteUrl, $v[$k2i . '.']['content']);
+                                                               }
+                                                               $logo = $v[$k2i . '.']['_icon'] ?: '';
+                                                               $onClickEvent = '';
+                                                               switch ((string)$v[($k2i . '.')]['mode']) {
+                                                                       case 'wrap':
+                                                                               $wrap = explode('|', $v[$k2i . '.']['content']);
+                                                                               $onClickEvent = 'wrapHTML(' . GeneralUtility::quoteJSvalue($wrap[0]) . ',' . GeneralUtility::quoteJSvalue($wrap[1]) . ',false);';
+                                                                               break;
+                                                                       case 'processor':
+                                                                               $script = trim($v[$k2i . '.']['submitToScript']);
+                                                                               if (substr($script, 0, 4) != 'http') {
+                                                                                       $script = $this->siteUrl . $script;
+                                                                               }
+                                                                               if ($script) {
+                                                                                       $onClickEvent = 'processSelection(' . GeneralUtility::quoteJSvalue($script) . ');';
+                                                                               }
+                                                                               break;
+                                                                       case 'insert':
+
+                                                                       default:
+                                                                               $onClickEvent = 'insertHTML(' . GeneralUtility::quoteJSvalue($v[($k2i . '.')]['content']) . ');';
+                                                               }
+                                                               $A = array('<a href="#" onClick="' . $onClickEvent . 'return false;">', '</a>');
+                                                               $subcats[$k2i] = '<tr>
+                                                                       <td></td>
+                                                                       <td class="bgColor4" valign="top">' . $A[0] . $logo . $A[1] . '</td>
+                                                                       <td class="bgColor4" valign="top">' . $A[0] . '<strong>' . $title . '</strong><br />' . $description . $A[1] . '</td>
+                                                               </tr>';
+                                                       }
+                                               }
+                                               ksort($subcats);
+                                       }
+                                       $categories[$ki] = implode('', $subcats);
+                               }
+                       }
+                       ksort($categories);
+                       // Render menu of the items:
+                       $lines = array();
+                       foreach ($categories as $k => $v) {
+                               $title = trim($thisConfig['userElements.'][$k]);
+                               $openK = $k;
+                               if (!$title) {
+                                       $title = '[' . $GLOBALS['LANG']->getLL('noTitle', TRUE) . ']';
+                               } else {
+                                       $title = $GLOBALS['LANG']->sL($title, TRUE);
+                               }
+                               $lines[] = '<tr><td colspan="3" class="bgColor5"><a href="#" title="' . $GLOBALS['LANG']->getLL('expand', TRUE) . '" onClick="jumpToUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('rtehtmlarea_wizard_user', array('OC_key' => ($openKeys[$openK] ? 'C|' : 'O|') . $openK))) . ');return false;"><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], ('gfx/ol/' . ($openKeys[$openK] ? 'minus' : 'plus') . 'bullet.gif'), 'width="18" height="16"') . ' title="' . $GLOBALS['LANG']->getLL('expand', TRUE) . '" /><strong>' . $title . '</strong></a></td></tr>';
+                               $lines[] = $v;
+                       }
+                       $content .= '<table border="0" cellpadding="1" cellspacing="1">' . implode('', $lines) . '</table>';
+               }
+               $content .= $this->doc->endPage();
+               return $content;
+       }
+
+}
index b749742..7dfe8d3 100644 (file)
@@ -13,6 +13,10 @@ namespace TYPO3\CMS\Rtehtmlarea\Extension;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
+use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * TYPO3 HTML Parser extension for htmlArea RTE
  *
@@ -69,8 +73,8 @@ class Typo3HtmlParser extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi {
                        RTEarea[' . $RTEcounter . '].buttons.' . $button . ' = new Object();';
                        }
                        $registerRTEinJavascriptString .= '
-                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.pathParseHtmlModule = "' .
-                               \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('rtehtmlarea_wizard_parse_html') . '";
+                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.pathParseHtmlModule = ' .
+                               GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('rtehtmlarea_wizard_parse_html')) . ';
                        RTEarea[' . $RTEcounter . '].buttons.' . $button . '.hotKey = "' . ($this->thisConfig['enableWordClean.']['hotKey'] ?: '0') . '";';
                }
                return $registerRTEinJavascriptString;
@@ -84,7 +88,7 @@ class Typo3HtmlParser extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi {
         * @return array toolbar button array, possibly updated
         */
        public function applyToolbarConstraints($show) {
-               return array_unique(array_merge($show, \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->pluginButtons)));
+               return array_unique(array_merge($show, GeneralUtility::trimExplode(',', $this->pluginButtons)));
        }
 
 }
index fe4b5f3..b880f9f 100644 (file)
@@ -13,6 +13,10 @@ namespace TYPO3\CMS\Rtehtmlarea\Extension;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
+use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * TYPO3 Image plugin for htmlArea RTE
  *
@@ -73,8 +77,8 @@ class Typo3Image extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi {
                        RTEarea[' . $RTEcounter . ']["buttons"]["' . $button . '"] = new Object();';
                        }
                        $registerRTEinJavascriptString .= '
-                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.pathImageModule = "' .
-                               \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('rtehtmlarea_wizard_select_image') . '";';
+                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.pathImageModule = ' .
+                               GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('rtehtmlarea_wizard_select_image')) . ';';
                }
                return $registerRTEinJavascriptString;
        }
index 84cbf9c..81c7519 100644 (file)
@@ -75,7 +75,7 @@ class Typo3Link extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi {
                        RTEarea[' . $RTEcounter . '].buttons.' . $button . ' = new Object();';
                        }
                        $registerRTEinJavascriptString .= '
-                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.pathLinkModule = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('rtehtmlarea_wizard_element_browser'));
+                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.pathLinkModule = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('rtehtmlarea_wizard_browse_links')) . ';';
                        if ($this->htmlAreaRTE->is_FE()) {
                                $RTEProperties = $this->htmlAreaRTE->RTEsetup;
                        } else {
index f7bd170..4ab3772 100644 (file)
@@ -13,6 +13,9 @@ namespace TYPO3\CMS\Rtehtmlarea\Extension;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * User Elements extension for htmlArea RTE
  *
@@ -65,8 +68,8 @@ class UserElements extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi {
                        RTEarea[' . $RTEcounter . '].buttons.' . $button . ' = new Object();';
                        }
                        $registerRTEinJavascriptString .= '
-                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.pathUserModule = "' .
-                               \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('rtehtmlarea_wizard_user') . '";';
+                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.pathUserModule = ' .
+                               GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('rtehtmlarea_wizard_user_elements')) . ';';
                }
                return $registerRTEinJavascriptString;
        }
diff --git a/typo3/sysext/rtehtmlarea/Classes/User.php b/typo3/sysext/rtehtmlarea/Classes/User.php
deleted file mode 100644 (file)
index ba6fe0d..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-<?php
-namespace TYPO3\CMS\Rtehtmlarea;
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * User defined content for htmlArea RTE
- *
- * @author Kasper Skårhøj <kasper@typo3.com>
- * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
- */
-class User {
-
-       /**
-        * @var string
-        */
-       public $content;
-
-       /**
-        * @var array
-        */
-       public $modData;
-
-       /**
-        * @var string
-        */
-       public $siteUrl;
-
-       /**
-        * document template object
-        *
-        * @var \TYPO3\CMS\Backend\Template\DocumentTemplate
-        */
-       public $doc;
-
-       /**
-        * @var string
-        */
-       public $editorNo;
-
-       /**
-        * Initialize language files
-        */
-       public function __construct() {
-               $GLOBALS['LANG']->includeLLFile('EXT:rtehtmlarea/mod5/locallang.xlf');
-               $GLOBALS['LANG']->includeLLFile('EXT:rtehtmlarea/htmlarea/locallang_dialogs.xlf');
-       }
-
-       /**
-        * @return      [type]          ...
-        */
-       public function init() {
-               $this->editorNo = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('editorNo');
-               $this->siteUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL');
-               $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
-               $this->doc->backPath = $GLOBALS['BACK_PATH'];
-               $this->doc->bodyTagAdditions = 'onload="Init();"';
-               $this->doc->form = '
-       <form action="" id="process" name="process" method="post">
-               <input type="hidden" name="processContent" value="" />
-               <input type="hidden" name="returnUrl" value="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI')) . '" />
-               ';
-               $JScode = '
-                       var plugin = window.parent.RTEarea["' . $this->editorNo . '"].editor.getPlugin("UserElements");
-                       var HTMLArea = window.parent.HTMLArea;
-                       var editor = plugin.editor;
-
-                       function Init() {
-                       };
-                       function insertHTML(content,noHide) {
-                               plugin.restoreSelection();
-                               editor.getSelection().insertHtml(content);
-                               if(!noHide) plugin.close();
-                       };
-                       function wrapHTML(wrap1,wrap2,noHide) {
-                               plugin.restoreSelection();
-                               if(!editor.getSelection().isEmpty()) {
-                                       editor.getSelection().surroundHtml(wrap1,wrap2);
-                               } else {
-                                       alert(' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->getLL('noTextSelection')) . ');
-                               }
-                               if(!noHide) plugin.close();
-                       };
-                       function processSelection(script) {
-                               plugin.restoreSelection();
-                               document.process.action = script;
-                               document.process.processContent.value = editor.getSelection().getHtml();
-                               document.process.submit();
-                       };
-                       function jumpToUrl(URL) {
-                               var RTEtsConfigParams = "&RTEtsConfigParams=' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('RTEtsConfigParams')) . '";
-                               var editorNo = "&editorNo=' . rawurlencode($this->editorNo) . '";
-                               theLocation = URL+RTEtsConfigParams+editorNo;
-                               window.location.href = theLocation;
-                       }
-               ';
-
-               // unset the default jumpToUrl() function
-               unset($this->doc->JScodeArray['jumpToUrl']);
-
-               $this->doc->JScode = $this->doc->wrapScriptTags($JScode);
-               $this->modData = $GLOBALS['BE_USER']->getModuleData('user.php', 'ses');
-               if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('OC_key')) {
-                       $parts = explode('|', \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('OC_key'));
-                       $this->modData['openKeys'][$parts[1]] = $parts[0] == 'O' ? 1 : 0;
-                       $GLOBALS['BE_USER']->pushModuleData('user.php', $this->modData);
-               }
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @return      [type]          ...
-        */
-       public function main() {
-               $this->content = '';
-               $this->content .= $this->main_user($this->modData['openKeys']);
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @return      [type]          ...
-        */
-       public function printContent() {
-               echo $this->content;
-       }
-
-       /********************************
-        *
-        * Other functions
-        *
-        *********************************/
-       /**
-        * @param       [type]          $imgInfo: ...
-        * @param       [type]          $maxW: ...
-        * @param       [type]          $maxH: ...
-        * @return      [type]          ...
-        */
-       public function calcWH($imgInfo, $maxW = 380, $maxH = 500) {
-               $IW = $imgInfo[0];
-               $IH = $imgInfo[1];
-               if ($IW > $maxW) {
-                       $IH = ceil($IH / $IW * $maxW);
-                       $IW = $maxW;
-               }
-               if ($IH > $maxH) {
-                       $IW = ceil($IW / $IH * $maxH);
-                       $IH = $maxH;
-               }
-               $imgInfo[3] = 'width="' . $IW . '" height="' . $IH . '"';
-               return $imgInfo;
-       }
-
-       /**
-        * Rich Text Editor (RTE) user element selector
-        *
-        * @param       [type]          $openKeys: ...
-        * @return      [type]          ...
-        */
-       public function main_user($openKeys) {
-               // Starting content:
-               $content = $this->doc->startPage($GLOBALS['LANG']->getLL('Insert Custom Element', TRUE));
-               $RTEtsConfigParts = explode(':', \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('RTEtsConfigParams'));
-               $RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE', \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($RTEtsConfigParts[5]));
-               $thisConfig = \TYPO3\CMS\Backend\Utility\BackendUtility::RTEsetup($RTEsetup['properties'], $RTEtsConfigParts[0], $RTEtsConfigParts[2], $RTEtsConfigParts[4]);
-               if (is_array($thisConfig['userElements.'])) {
-                       $categories = array();
-                       foreach ($thisConfig['userElements.'] as $k => $value) {
-                               $ki = (int)$k;
-                               $v = $thisConfig['userElements.'][$ki . '.'];
-                               if (substr($k, -1) == '.' && is_array($v)) {
-                                       $subcats = array();
-                                       $openK = $ki;
-                                       if ($openKeys[$openK]) {
-                                               $mArray = '';
-                                               if ($v['load'] === 'images_from_folder') {
-                                                       $mArray = array();
-                                                       if ($v['path'] && @is_dir((PATH_site . $v['path']))) {
-                                                               $files = \TYPO3\CMS\Core\Utility\GeneralUtility::getFilesInDir(PATH_site . $v['path'], 'gif,jpg,jpeg,png', 0, '');
-                                                               if (is_array($files)) {
-                                                                       $c = 0;
-                                                                       foreach ($files as $filename) {
-                                                                               $iInfo = @getimagesize((PATH_site . $v['path'] . $filename));
-                                                                               $iInfo = $this->calcWH($iInfo, 50, 100);
-                                                                               $ks = (string)(100 + $c);
-                                                                               $mArray[$ks] = $filename;
-                                                                               $mArray[$ks . '.'] = array(
-                                                                                       'content' => '<img src="' . $this->siteUrl . $v['path'] . $filename . '" />',
-                                                                                       '_icon' => '<img src="' . $this->siteUrl . $v['path'] . $filename . '" ' . $iInfo[3] . ' />',
-                                                                                       'description' => $GLOBALS['LANG']->getLL('filesize') . ': ' . str_replace('&nbsp;', ' ', \TYPO3\CMS\Core\Utility\GeneralUtility::formatSize(@filesize((PATH_site . $v['path'] . $filename)))) . ', ' . $GLOBALS['LANG']->getLL('pixels', 1) . ': ' . $iInfo[0] . 'x' . $iInfo[1]
-                                                                               );
-                                                                               $c++;
-                                                                       }
-                                                               }
-                                                       }
-                                               }
-                                               if (is_array($mArray)) {
-                                                       if ($v['merge']) {
-                                                               \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($mArray, $v);
-                                                               $v = $mArray;
-                                                       } else {
-                                                               $v = $mArray;
-                                                       }
-                                               }
-                                               foreach ($v as $k2 => $dummyValue) {
-                                                       $k2i = (int)$k2;
-                                                       if (substr($k2, -1) == '.' && is_array($v[$k2i . '.'])) {
-                                                               $title = trim($v[$k2i]);
-                                                               if (!$title) {
-                                                                       $title = '[' . $GLOBALS['LANG']->getLL('noTitle', TRUE) . ']';
-                                                               } else {
-                                                                       $title = $GLOBALS['LANG']->sL($title, TRUE);
-                                                               }
-                                                               $description = $GLOBALS['LANG']->sL($v[($k2i . '.')]['description'], TRUE) . '<br />';
-                                                               if (!$v[($k2i . '.')]['dontInsertSiteUrl']) {
-                                                                       $v[$k2i . '.']['content'] = str_replace('###_URL###', $this->siteUrl, $v[$k2i . '.']['content']);
-                                                               }
-                                                               $logo = $v[$k2i . '.']['_icon'] ?: '';
-                                                               $onClickEvent = '';
-                                                               switch ((string)$v[($k2i . '.')]['mode']) {
-                                                                       case 'wrap':
-                                                                               $wrap = explode('|', $v[$k2i . '.']['content']);
-                                                                               $onClickEvent = 'wrapHTML(' . GeneralUtility::quoteJSvalue($wrap[0]) . ',' . GeneralUtility::quoteJSvalue($wrap[1]) . ',false);';
-                                                                               break;
-                                                                       case 'processor':
-                                                                               $script = trim($v[$k2i . '.']['submitToScript']);
-                                                                               if (substr($script, 0, 4) != 'http') {
-                                                                                       $script = $this->siteUrl . $script;
-                                                                               }
-                                                                               if ($script) {
-                                                                                       $onClickEvent = 'processSelection(' . GeneralUtility::quoteJSvalue($script) . ');';
-                                                                               }
-                                                                               break;
-                                                                       case 'insert':
-
-                                                                       default:
-                                                                               $onClickEvent = 'insertHTML(' . GeneralUtility::quoteJSvalue($v[($k2i . '.')]['content']) . ');';
-                                                               }
-                                                               $A = array('<a href="#" onClick="' . $onClickEvent . 'return false;">', '</a>');
-                                                               $subcats[$k2i] = '<tr>
-                                                                       <td><img src="clear.gif" width="18" height="1" /></td>
-                                                                       <td class="bgColor4" valign="top">' . $A[0] . $logo . $A[1] . '</td>
-                                                                       <td class="bgColor4" valign="top">' . $A[0] . '<strong>' . $title . '</strong><br />' . $description . $A[1] . '</td>
-                                                               </tr>';
-                                                       }
-                                               }
-                                               ksort($subcats);
-                                       }
-                                       $categories[$ki] = implode('', $subcats);
-                               }
-                       }
-                       ksort($categories);
-                       // Render menu of the items:
-                       $lines = array();
-                       foreach ($categories as $k => $v) {
-                               $title = trim($thisConfig['userElements.'][$k]);
-                               $openK = $k;
-                               if (!$title) {
-                                       $title = '[' . $GLOBALS['LANG']->getLL('noTitle', TRUE) . ']';
-                               } else {
-                                       $title = $GLOBALS['LANG']->sL($title, TRUE);
-                               }
-                               $lines[] = '<tr><td colspan="3" class="bgColor5"><a href="#" title="' . $GLOBALS['LANG']->getLL('expand', TRUE) . '" onClick="jumpToUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('rtehtmlarea_wizard_user', array('OC_key' => ($openKeys[$openK] ? 'C|' : 'O|') . $openK))) . ');return false;"><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], ('gfx/ol/' . ($openKeys[$openK] ? 'minus' : 'plus') . 'bullet.gif'), 'width="18" height="16"') . ' title="' . $GLOBALS['LANG']->getLL('expand', TRUE) . '" /><strong>' . $title . '</strong></a></td></tr>';
-                               $lines[] = $v;
-                       }
-                       $content .= '<table border="0" cellpadding="1" cellspacing="1">' . implode('', $lines) . '</table>';
-               }
-               $content .= $this->doc->endPage();
-               return $content;
-       }
-
-}
index 3295909..2c204cd 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 return array(
        'tx_rtehtmlarea_browse_links' => 'TYPO3\\CMS\\Rtehtmlarea\\BrowseLinks',
-       'tx_rtehtmlarea_parse_html' => 'TYPO3\\CMS\\Rtehtmlarea\\ContentParser',
+       'tx_rtehtmlarea_parse_html' => 'TYPO3\\CMS\\Rtehtmlarea\\Controller\\ParseHtmlController',
        'tx_rtehtmlarea_SC_browse_links' => 'TYPO3\\CMS\\Rtehtmlarea\\Controller\\BrowseLinksController',
        'tx_rtehtmlarea_pi3' => 'TYPO3\\CMS\\Rtehtmlarea\\Controller\\CustomAttributeController',
        'tx_rtehtmlarea_pi2' => 'TYPO3\\CMS\\Rtehtmlarea\\Controller\\FrontendRteController',
@@ -49,6 +49,6 @@ return array(
        'tx_rtehtmlarea_api' => 'TYPO3\\CMS\\Rtehtmlarea\\RteHtmlAreaApi',
        'tx_rtehtmlarea_base' => 'TYPO3\\CMS\\Rtehtmlarea\\RteHtmlAreaBase',
        'tx_rtehtmlarea_select_image' => 'TYPO3\\CMS\\Rtehtmlarea\\SelectImage',
-       'tx_rtehtmlarea_user' => 'TYPO3\\CMS\\Rtehtmlarea\\User',
+       'tx_rtehtmlarea_user' => 'TYPO3\\CMS\\Rtehtmlarea\\Controller\\UserElementsController',
        'TYPO3\\CMS\\Rtehtmlarea\\ImageFolderTree' => 'TYPO3\\CMS\\Rtehtmlarea\\FolderTree',
 );
diff --git a/typo3/sysext/rtehtmlarea/Modules/BrowseLinks/conf.php b/typo3/sysext/rtehtmlarea/Modules/BrowseLinks/conf.php
new file mode 100644 (file)
index 0000000..497f55c
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+$MCONF['name'] = 'rtehtmlarea_wizard_browse_links';
+$MCONF['script'] = '_DISPATCH';
+$MCONF['access'] = '';
diff --git a/typo3/sysext/rtehtmlarea/Modules/BrowseLinks/index.php b/typo3/sysext/rtehtmlarea/Modules/BrowseLinks/index.php
new file mode 100644 (file)
index 0000000..1ac6814
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+/**
+ * Displays the page/file tree for browsing database records or files.
+ * Used from TCEFORMS an other elements
+ * In other words: This is the ELEMENT BROWSER!
+ *
+ * Adapted for htmlArea RTE by Stanislas Rolland
+ *
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
+ */
+
+// Make instance:
+$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Rtehtmlarea\\Controller\\BrowseLinksController');
+$SOBE->main();
+$SOBE->printContent();
diff --git a/typo3/sysext/rtehtmlarea/Modules/ParseHtml/conf.php b/typo3/sysext/rtehtmlarea/Modules/ParseHtml/conf.php
new file mode 100644 (file)
index 0000000..697767e
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+$MCONF['name'] = 'rtehtmlarea_wizard_parse_html';
+$MCONF['script'] = '_DISPATCH';
+$MCONF['access'] = '';
\ No newline at end of file
diff --git a/typo3/sysext/rtehtmlarea/Modules/ParseHtml/index.php b/typo3/sysext/rtehtmlarea/Modules/ParseHtml/index.php
new file mode 100644 (file)
index 0000000..cb15c18
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+/**
+ * Content parsing for htmlArea RTE
+ *
+ * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
+ */
+
+// Make instance:
+$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Rtehtmlarea\\Controller\\ParseHtmlController');
+$SOBE->init();
+$SOBE->main();
+$SOBE->printContent();
diff --git a/typo3/sysext/rtehtmlarea/Modules/SelectImage/conf.php b/typo3/sysext/rtehtmlarea/Modules/SelectImage/conf.php
new file mode 100644 (file)
index 0000000..35bdbe6
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+$MCONF['name'] = 'rtehtmlarea_wizard_select_image';
+$MCONF['script'] = '_DISPATCH';
+$MCONF['access'] = '';
diff --git a/typo3/sysext/rtehtmlarea/Modules/SelectImage/index.php b/typo3/sysext/rtehtmlarea/Modules/SelectImage/index.php
new file mode 100644 (file)
index 0000000..4c7681f
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+/**
+ * Displays image selector for the RTE
+ *
+ * @author Kasper Skårhøj <kasper@typo3.com>
+ * @author Stanislas Rolland <typo3(arobas)jbr.ca>
+ */
+
+// Make instance:
+$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Rtehtmlarea\\Controller\\SelectImageController');
+$SOBE->main();
+$SOBE->printContent();
diff --git a/typo3/sysext/rtehtmlarea/Modules/UserElements/conf.php b/typo3/sysext/rtehtmlarea/Modules/UserElements/conf.php
new file mode 100644 (file)
index 0000000..19eefa6
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+$MCONF['name'] = 'rtehtmlarea_wizard_user_elements';
+$MCONF['script'] = '_DISPATCH';
+$MCONF['access'] = '';
\ No newline at end of file
diff --git a/typo3/sysext/rtehtmlarea/Modules/UserElements/index.php b/typo3/sysext/rtehtmlarea/Modules/UserElements/index.php
new file mode 100644 (file)
index 0000000..6d05345
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+/**
+ * User defined content for htmlArea RTE
+ *
+ * @author Kasper Skårhøj <kasper@typo3.com>
+ * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
+ */
+
+// Make instance:
+$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Rtehtmlarea\\Controller\\UserElementsController');
+$SOBE->init();
+$SOBE->main();
+$SOBE->printContent();
index 3ca9fa4..2c49542 100644 (file)
@@ -60,27 +60,27 @@ if (TYPO3_MODE === 'BE' && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::i
        $GLOBALS['TYPO3_USER_SETTINGS']['showitem'] .= ',--div--;LLL:EXT:rtehtmlarea/locallang.xlf:rteSettings,rteWidth,rteHeight,rteResize,rteMaxHeight,rteCleanPasteBehaviour';
 }
 if (TYPO3_MODE === 'BE') {
-       // Register RTE element browser wizard
+       // Register RTE browse links wizard
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
-               'rtehtmlarea_wizard_element_browser',
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod3/'
+               'rtehtmlarea_wizard_browse_links',
+               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/BrowseLinks/'
        );
 
-       // Register RTE wizard_select_image
+       // Register RTE select image wizard
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
                'rtehtmlarea_wizard_select_image',
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod4/'
+               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/SelectImage/'
        );
 
-       // Register RTE wizard_user
+       // Register RTE user elements wizard
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
-               'rtehtmlarea_wizard_user',
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod5/'
+               'rtehtmlarea_wizard_user_elements',
+               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/UserElements/'
        );
 
-       // Register RTE wizard_user
+       // Register RTE parse html wizard
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
                'rtehtmlarea_wizard_parse_html',
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod6/'
+               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/ParseHtml/'
        );
 }
\ No newline at end of file
diff --git a/typo3/sysext/rtehtmlarea/mod3/clear.gif b/typo3/sysext/rtehtmlarea/mod3/clear.gif
deleted file mode 100644 (file)
index e1d2d83..0000000
Binary files a/typo3/sysext/rtehtmlarea/mod3/clear.gif and /dev/null differ
diff --git a/typo3/sysext/rtehtmlarea/mod3/conf.php b/typo3/sysext/rtehtmlarea/mod3/conf.php
deleted file mode 100644 (file)
index 0a6da35..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-// DO NOT REMOVE OR CHANGE THESE 3 LINES:
-define('TYPO3_MOD_PATH', 'sysext/rtehtmlarea/mod3/');
-$BACK_PATH = '../../../';
-$MCONF['name'] = 'txrtehtmlareabrowselinks';
diff --git a/typo3/sysext/rtehtmlarea/mod3/index.php b/typo3/sysext/rtehtmlarea/mod3/index.php
deleted file mode 100644 (file)
index 1ac6814..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-/**
- * Displays the page/file tree for browsing database records or files.
- * Used from TCEFORMS an other elements
- * In other words: This is the ELEMENT BROWSER!
- *
- * Adapted for htmlArea RTE by Stanislas Rolland
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
- */
-
-// Make instance:
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Rtehtmlarea\\Controller\\BrowseLinksController');
-$SOBE->main();
-$SOBE->printContent();
diff --git a/typo3/sysext/rtehtmlarea/mod4/clear.gif b/typo3/sysext/rtehtmlarea/mod4/clear.gif
deleted file mode 100644 (file)
index e1d2d83..0000000
Binary files a/typo3/sysext/rtehtmlarea/mod4/clear.gif and /dev/null differ
diff --git a/typo3/sysext/rtehtmlarea/mod4/conf.php b/typo3/sysext/rtehtmlarea/mod4/conf.php
deleted file mode 100644 (file)
index 35bdbe6..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-$MCONF['name'] = 'rtehtmlarea_wizard_select_image';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
diff --git a/typo3/sysext/rtehtmlarea/mod4/index.php b/typo3/sysext/rtehtmlarea/mod4/index.php
deleted file mode 100644 (file)
index 4c7681f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-/**
- * Displays image selector for the RTE
- *
- * @author Kasper Skårhøj <kasper@typo3.com>
- * @author Stanislas Rolland <typo3(arobas)jbr.ca>
- */
-
-// Make instance:
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Rtehtmlarea\\Controller\\SelectImageController');
-$SOBE->main();
-$SOBE->printContent();
diff --git a/typo3/sysext/rtehtmlarea/mod5/clear.gif b/typo3/sysext/rtehtmlarea/mod5/clear.gif
deleted file mode 100644 (file)
index e1d2d83..0000000
Binary files a/typo3/sysext/rtehtmlarea/mod5/clear.gif and /dev/null differ
diff --git a/typo3/sysext/rtehtmlarea/mod5/conf.php b/typo3/sysext/rtehtmlarea/mod5/conf.php
deleted file mode 100644 (file)
index 7e988a7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-$MCONF['name'] = 'rtehtmlarea_wizard_user';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
\ No newline at end of file
diff --git a/typo3/sysext/rtehtmlarea/mod5/index.php b/typo3/sysext/rtehtmlarea/mod5/index.php
deleted file mode 100644 (file)
index 95815b4..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-/**
- * User defined content for htmlArea RTE
- *
- * @author Kasper Skårhøj <kasper@typo3.com>
- * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
- */
-
-// Make instance:
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Rtehtmlarea\\User');
-$SOBE->init();
-$SOBE->main();
-$SOBE->printContent();
diff --git a/typo3/sysext/rtehtmlarea/mod6/conf.php b/typo3/sysext/rtehtmlarea/mod6/conf.php
deleted file mode 100644 (file)
index 697767e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-$MCONF['name'] = 'rtehtmlarea_wizard_parse_html';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
\ No newline at end of file
diff --git a/typo3/sysext/rtehtmlarea/mod6/index.php b/typo3/sysext/rtehtmlarea/mod6/index.php
deleted file mode 100644 (file)
index 90c19de..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-/**
- * Content parsing for htmlArea RTE
- *
- * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
- */
-
-// Make instance:
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Rtehtmlarea\\ContentParser');
-$SOBE->init();
-$SOBE->main();
-$SOBE->printContent();