[!!!][TASK] RTE: Further API cleanups 80/40580/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 23 Jun 2015 21:10:57 +0000 (23:10 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 24 Jun 2015 11:22:36 +0000 (13:22 +0200)
* editorCSS is not used on JS side, so removed
* Plugin API requiresClassesConfiguration() has some
  regular plugins that are nearly always enabled and
  set this to TRUE, which triggers as call of
  buildJSClassesConfig(). This method is now just
  always called and the "requireClasses" stuff removed.
* getPathToPluginDirectory() was only used together with
  the "requireClasses" construct and is removed as
  logical follow-up.

Resolves: #67716
Releases: master
Change-Id: I0d43564c978ea19869b884ac6638685468d94a98
Reviewed-on: http://review.typo3.org/40580
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/rtehtmlarea/Classes/Extension/BlockStyle.php
typo3/sysext/rtehtmlarea/Classes/Extension/TableOperations.php
typo3/sysext/rtehtmlarea/Classes/Extension/TextStyle.php
typo3/sysext/rtehtmlarea/Classes/RteHtmlAreaApi.php
typo3/sysext/rtehtmlarea/Classes/RteHtmlAreaBase.php
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/HTMLArea.js

index 15dcf3c..e31212c 100644 (file)
@@ -54,11 +54,4 @@ class BlockStyle extends RteHtmlAreaApi {
                'blockstyle' => 'BlockStyle'
        );
 
-       /**
-        * TRUE if the registered plugin requires the PageTSConfig Classes configuration
-        *
-        * @var bool
-        */
-       protected $requiresClassesConfiguration = TRUE;
-
 }
index bb72d5d..14b74e8 100644 (file)
@@ -33,13 +33,6 @@ class TableOperations extends RteHtmlAreaApi {
        protected $pluginName = 'TableOperations';
 
        /**
-        * TRUE if the registered plugin requires the PageTSConfig Classes configuration
-        *
-        * @var bool
-        */
-       protected $requiresClassesConfiguration = TRUE;
-
-       /**
         * The comma-separated list of names of prerequisite plugins
         *
         * @var string
index fffeac9..379318d 100644 (file)
@@ -61,11 +61,4 @@ class TextStyle extends RteHtmlAreaApi {
                'textstyle' => 'TextStyle'
        );
 
-       /**
-        * TRUE if the registered plugin requires the PageTSConfig Classes configuration
-        *
-        * @var bool
-        */
-       protected $requiresClassesConfiguration = TRUE;
-
 }
index 8d0422e..ca3ecf2 100644 (file)
@@ -53,13 +53,6 @@ abstract class RteHtmlAreaApi {
        protected $relativePathToSkin = '';
 
        /**
-        * Path to the directory containing the plugin, relative to the extension dir (should end with slash /)
-        *
-        * @var string
-        */
-       protected $relativePathToPluginDirectory;
-
-       /**
         * Reference to the invoking object
         *
         * @var RteHtmlAreaBase
@@ -228,15 +221,6 @@ abstract class RteHtmlAreaApi {
        }
 
        /**
-        * Returns the path to the plugin directory, if any
-        *
-        * @return string the full path to the plugin directory
-        */
-       public function getPathToPluginDirectory() {
-               return $this->relativePathToPluginDirectory ? $this->htmlAreaRTE->httpTypo3Path . ExtensionManagementUtility::siteRelPath($this->extensionKey) . $this->relativePathToPluginDirectory : '';
-       }
-
-       /**
         * Returns a boolean indicating whether the plugin adds buttons or not to the toolbar
         *
         * @return bool
index f6652ab..d107401 100644 (file)
@@ -548,7 +548,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
         */
        protected function addSkin(array $resultArray) {
                // Get skin file name from Page TSConfig if any
-               $skinFilename = trim($this->thisConfig['skin']) ?: 'EXT:' . $this->ID . '/Resources/Public/Css/Skin/htmlarea.css';
+               $skinFilename = trim($this->thisConfig['skin']) ?: 'EXT:rtehtmlarea/Resources/Public/Css/Skin/htmlarea.css';
                $this->editorCSS = $this->getFullFileName($skinFilename);
                $skinDir = dirname($this->editorCSS);
                // Editing area style sheet
@@ -894,7 +894,6 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                                RTEarea[0] = new Object();
                                RTEarea[0].version = "' . $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->ID]['version'] . '";
                                RTEarea[0].editorUrl = "' . $this->extHttpPath . '";
-                               RTEarea[0].editorCSS = "' . GeneralUtility::createVersionNumberedFilename($this->editorCSS) . '";
                                RTEarea[0].editorSkin = "' . dirname($this->editorCSS) . '/";
                                RTEarea[0].editedContentCSS = "' . GeneralUtility::createVersionNumberedFilename($this->editedContentCSS) . '";
                                RTEarea[0].hostUrl = "' . $this->hostURL . '";
@@ -986,19 +985,9 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                        RTEarea[editornumber].userUid = "' . $this->userUid . '";';
                }
                // Setting the plugin flags
-               $configureRTEInJavascriptString .= '
-                       RTEarea[editornumber].plugin = new Object();
-                       RTEarea[editornumber].pathToPluginDirectory = new Object();';
+               $configureRTEInJavascriptString .= LF . 'RTEarea[editornumber].plugin = new Object();';
                foreach ($this->pluginEnabledArray as $pluginId) {
-                       $configureRTEInJavascriptString .= '
-                       RTEarea[editornumber].plugin.' . $pluginId . ' = true;';
-                       if (is_object($this->registeredPlugins[$pluginId])) {
-                               $pathToPluginDirectory = $this->registeredPlugins[$pluginId]->getPathToPluginDirectory();
-                               if ($pathToPluginDirectory) {
-                                       $configureRTEInJavascriptString .= '
-                       RTEarea[editornumber].pathToPluginDirectory.' . $pluginId . ' = "' . $pathToPluginDirectory . '";';
-                               }
-                       }
+                       $configureRTEInJavascriptString .= LF . 'RTEarea[editornumber].plugin.' . $pluginId . ' = true;';
                }
                // Setting the buttons configuration
                $configureRTEInJavascriptString .= '
@@ -1038,16 +1027,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                }
                $configureRTEInJavascriptString .= '
                        RTEarea[editornumber].pageStyle = ["' . implode('","', $versionNumberedFileNames) . '"];';
-               // Process classes configuration
-               $classesConfigurationRequired = FALSE;
-               foreach ($this->registeredPlugins as $pluginId => $plugin) {
-                       if ($this->isPluginEnabled($pluginId)) {
-                               $classesConfigurationRequired = $classesConfigurationRequired || $plugin->requiresClassesConfiguration();
-                       }
-               }
-               if ($classesConfigurationRequired) {
-                       $configureRTEInJavascriptString .= $this->buildJSClassesConfig();
-               }
+               $configureRTEInJavascriptString .= $this->buildJSClassesConfig();
                // Add Javascript configuration for registered plugins
                foreach ($this->registeredPlugins as $pluginId => $plugin) {
                        if ($this->isPluginEnabled($pluginId)) {
index 4fcc6fd..79bfcaa 100644 (file)
@@ -45,15 +45,11 @@ define('TYPO3/CMS/Rtehtmlarea/HTMLArea/HTMLArea',
                                if (!HtmlArea.editorSkin) {
                                        HtmlArea.editorSkin = HtmlArea.editorUrl + 'Resources/Public/Css/Skin/';
                                }
-                               if (!HtmlArea.editorCSS) {
-                                       HtmlArea.editorCSS = HtmlArea.editorUrl + 'Resources/Public/Css/Skin/htmlarea.css';
-                               }
                                if (typeof HtmlArea.editedContentCSS !== 'string' || HtmlArea.editedContentCSS === '') {
                                        HtmlArea.editedContentCSS = HtmlArea.editorSkin + 'htmlarea-edited-content.css';
                                }
                                HTMLArea.isReady = true;
                                HtmlArea.appendToLog('', 'HTMLArea', 'init', 'Editor url set to: ' + HtmlArea.editorUrl, 'info');
-                               HtmlArea.appendToLog('', 'HTMLArea', 'init', 'Editor skin CSS set to: ' + HtmlArea.editorCSS, 'info');
                                HtmlArea.appendToLog('', 'HTMLArea', 'init', 'Editor content skin CSS set to: ' + HtmlArea.editedContentCSS, 'info');
 
                                Util.apply(HTMLArea, HtmlArea);