Fixed issue #17560: htmlArea RTE: Any plugin must be inside HTMLArea namespace
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 12 Feb 2011 02:15:38 +0000 (02:15 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Sat, 12 Feb 2011 02:15:38 +0000 (02:15 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10454 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js

index fd5e3f8..3e37b3c 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
        * Fixed issue #17557: htmlArea RTE: Delete deprecated Page TSConfig properties
        * Fixed issue #17558: htmlArea RTE: Delete deprecated browser identification js variables
        * Fixed issue #17559: htmlArea RTE: Delete deprecated code/functions from main js script
+       * Fixed issue #17560: htmlArea RTE: Any plugin must be inside HTMLArea namespace
 
 2011-02-11  Christian Kuhn  <lolli@schwarzbu.ch>
 
index 9fabda7..c5d9c5f 100644 (file)
@@ -6,6 +6,7 @@
        * Fixed issue #17557: htmlArea RTE: Delete deprecated Page TSConfig properties
        * Fixed issue #17558: htmlArea RTE: Delete deprecated browser identification js variables
        * Fixed issue #17559: htmlArea RTE: Delete deprecated code/functions from main js script
+       * Fixed issue #17560: htmlArea RTE: Any plugin must be inside HTMLArea namespace
 
 2011-02-07  Stanislas Rolland  <typo3@sjbr.ca>
 
index 7b609eb..a1eeb23 100644 (file)
@@ -2297,37 +2297,23 @@ HTMLArea.Editor = Ext.extend(Ext.util.Observable, {
         * @return      boolean         true if the plugin was successfully registered
         */
        registerPlugin: function (pluginName) {
-               var plugin = null;
-               if (Ext.isString(pluginName)) {
-                       /*******************************************************************************
-                        * USE OF PLUGIN NAME OUTSIDE HTMLArea NAMESPACE IS DEPRECATED AS OF TYPO3 4.4 *
-                        *******************************************************************************/
-                       try {
-                               plugin = eval(pluginName);
-                       } catch (e) {
-                               try {
-                                       plugin = eval('HTMLArea.' + pluginName);
-                               } catch (error) {
-                                       HTMLArea._appendToLog('ERROR [HTMLArea.Editor::registerPlugin]: Cannot register invalid plugin: ' + error);
-                                       return false;
-                               }
+               var plugin = HTMLArea[pluginName],
+                       isRegistered = false;
+               if (Ext.isFunction(plugin)) {
+                       var pluginInstance = new plugin(this, pluginName);
+                       if (pluginInstance) {
+                               var pluginInformation = pluginInstance.getPluginInformation();
+                               pluginInformation.instance = pluginInstance;
+                               this.plugins[pluginName] = pluginInformation;
+                               isRegistered = true;
                        }
                }
-               if (!Ext.isFunction(plugin)) {
-                       HTMLArea._appendToLog('ERROR [HTMLArea.Editor::registerPlugin]: Cannot register undefined plugin.');
-                       return false;
-               }
-               var pluginInstance = new plugin(this, pluginName);
-               if (pluginInstance) {
-                       var pluginInformation = pluginInstance.getPluginInformation();
-                       pluginInformation.instance = pluginInstance;
-                       this.plugins[pluginName] = pluginInformation;
+               if (isRegistered) {
                        HTMLArea._appendToLog('[HTMLArea.Editor::registerPlugin]: Plugin ' + pluginName + ' was successfully registered.');
-                       return true;
                } else {
-                       HTMLArea._appendToLog("ERROR [HTMLArea.Editor::registerPlugin]: Can't register plugin " + pluginName + '.');
-                       return false;
+                       HTMLArea._appendToLog('ERROR [HTMLArea.Editor::registerPlugin]: Could not register plugin ' + pluginName + '.');
                }
+               return isRegistered;
        },
        /*
         * Generate registered plugins