Added feature #10428: htmlArea RTE: Remove configuration variables related to Mozilla...
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 12 Feb 2009 21:23:23 +0000 (21:23 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 12 Feb 2009 21:23:23 +0000 (21:23 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5013 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php
typo3/sysext/rtehtmlarea/doc/manual.sxw
typo3/sysext/rtehtmlarea/ext_conf_template.txt
typo3/sysext/rtehtmlarea/ext_localconf.php
typo3/sysext/rtehtmlarea/extensions/CopyPaste/class.tx_rtehtmlarea_copypaste.php
typo3/sysext/rtehtmlarea/htmlarea/plugins/CopyPaste/copy-paste.js

index ba381f9..1538d94 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-02-12  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Added feature #10428: htmlArea RTE: Remove configuration variables related to Mozilla clipboard access
+
 2009-02-12  Dmitry Dulepov  <dmitry@typo3.org>
 
        * Fixed bug #9728: Improve performance of Prototype, Scriptaculous, ExtJS and other contributed scripts
index 53d0093..1a605fa 100644 (file)
@@ -1,3 +1,7 @@
+2009-02-12  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Added feature #10428: htmlArea RTE: Remove configuration variables related to Mozilla clipboard access
+
 2009-02-11  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Follow-up for feature #10339: htmlArea RTE: Move editing mode change to plugin
index 9f1da02..4d211f5 100644 (file)
@@ -801,11 +801,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                                _editor_edited_content_CSS = "' .  $this->editedContentCSS  . '";
                                _typo3_host_url = "' . $this->hostURL . '";
                                _editor_debug_mode = ' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableDebugMode'] ? 'true' : 'false') . ';
-                               _editor_compressed_scripts = ' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableCompressedScripts'] ? 'true' : 'false') . ';'
-                               . (($this->client['BROWSER'] == 'gecko') ? ('
-                               RTEarea[0].enableMozillaExtension = ' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableMozillaExtension'] ?'true' : 'false') . ';
-                               RTEarea[0].mozillaAllowClipboardURL = "' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['mozAllowClipboardURL'] ? $TYPO3_CONF_VARS['EXTCONF'][$this->ID]['mozAllowClipboardURL'] : '') . '";')
-                               : '') . '
+                               _editor_compressed_scripts = ' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableCompressedScripts'] ? 'true' : 'false') . ';
                        }
                /*]]>*/
                </script>';
index 79b520b..e9ff29d 100644 (file)
Binary files a/typo3/sysext/rtehtmlarea/doc/manual.sxw and b/typo3/sysext/rtehtmlarea/doc/manual.sxw differ
index 9f752a8..be7a533 100644 (file)
@@ -34,9 +34,6 @@ enableAccessibilityIcons = 0
   # cat=basic/enable/130; type=boolean; label=Enable the DAM media browser: If set and if the DAM extension is installed, the DAM media browser will be used. DEPRECATED for DAM 1.1+. Use DAM EM setting instead.
 enableDAMBrowser = 0
 
-  # cat=basic/enable/150; type=boolean; label=Enable Mozilla/Firefox extension: If set, enables the triggering of installation of a Mozilla/Firefox extension to allow the RTE to access the clipboard.
-enableMozillaExtension = 0
-
   # cat=basic/enable/170; type=boolean; label=Force Aspell command mode: If set, the spellchecker will use the Aspell command interface. Presumably. PHP is compiled with pspell, but with an old version of Aspell. If set, PHP safe mode should NOT be enabled.
 forceCommandMode = 0
 
@@ -44,7 +41,4 @@ forceCommandMode = 0
 enableDebugMode = 0
 
   # cat=basic/enable/180; type=boolean; label=Enable compressed scripts: If set, the compressed version of the editor scripts will be used.
-enableCompressedScripts = 1
-
-  # cat=basic; type=string; label=Url of AllowClipboard Helper: Full absolute Url of the AllowClipboard Helper extension for Mozilla and Firefox.
-mozAllowClipboardURL = http://typo3.org/fileadmin/allowclipboardhelper-0.6.xpi
\ No newline at end of file
+enableCompressedScripts = 1
\ No newline at end of file
index de657f1..e2c745b 100644 (file)
@@ -249,11 +249,10 @@ $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['UndoRedo']['addIconsToSkin'] =
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['UndoRedo']['disableInFE'] = 0;
 
        // Copy & Paste configuration
-$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableMozillaExtension'] = $_EXTCONF['enableMozillaExtension'] ? $_EXTCONF['enableMozillaExtension'] : 0;
-$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['mozAllowClipboardURL'] = $_EXTCONF['mozAllowClipboardURL'] ? $_EXTCONF['mozAllowClipboardURL'] : 'http://typo3.org/fileadmin/dl/allowclipboard_helper/allowclipboard_helper-0.5.5-fx_mz_zm_deLabelFix.xpi';
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['CopyPaste'] = array();
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['CopyPaste']['objectReference'] = 'EXT:'.$_EXTKEY.'/extensions/CopyPaste/class.tx_rtehtmlarea_copypaste.php:&tx_rtehtmlarea_copypaste';
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['CopyPaste']['addIconsToSkin'] = 0;
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['CopyPaste']['disableInFE'] =  0;
+$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['CopyPaste']['mozillaAllowClipboardURL'] =  'http://typo3.org/fileadmin/allowclipboardhelper-0.6.xpi';
 
 ?>
\ No newline at end of file
index 833ba3b..fa89065 100644 (file)
@@ -77,9 +77,19 @@ class tx_rtehtmlarea_copypaste extends tx_rtehtmlareaapi {
         *      RTEarea['.$RTEcounter.'].buttons.button-id.property = "value";
         */
        public function buildJavascriptConfiguration($RTEcounter) {
-               global $TSFE, $LANG;
-               
                $registerRTEinJavascriptString = '';
+               $button = 'paste';
+               if ($this->htmlAreaRTE->client['BROWSER'] == 'gecko') {
+                       $mozillaAllowClipboardURL = $this->thisConfig['buttons.'][$button.'.']['mozillaAllowClipboardURL'] ? $this->thisConfig['buttons.'][$button.'.']['mozillaAllowClipboardURL'] : $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extensionKey]['plugins']['CopyPaste']['mozillaAllowClipboardURL'];
+                       if ($mozillaAllowClipboardURL) {
+                               if (!is_array($this->thisConfig['buttons.']) || !is_array($this->thisConfig['buttons.'][$button.'.'])) {
+                                       $registerRTEinJavascriptString .= '
+                       RTEarea['.$RTEcounter.'].buttons.'. $button .' = new Object();';
+                               }
+                               $registerRTEinJavascriptString .= '
+                       RTEarea['.$RTEcounter.'].buttons.'. $button .'.mozillaAllowClipboardURL = "' . $mozillaAllowClipboardURL . '";';
+                       }
+               }
                return $registerRTEinJavascriptString;
        }
 
index a10d776..b5df48e 100644 (file)
@@ -356,11 +356,11 @@ CopyPaste = HTMLArea.Plugin.extend({
         * Mozilla clipboard access exception handler
         */
        mozillaClipboardAccessException : function () {
-               if (RTEarea[0].enableMozillaExtension) {
+               if (this.buttonsConfiguration.paste && this.buttonsConfiguration.paste.mozillaAllowClipboardURL) {
                        if (confirm(this.localize("Allow-Clipboard-Helper-Extension"))) {
                                if (InstallTrigger.enabled()) {
                                        var mozillaXpi = new Object();
-                                       mozillaXpi["AllowClipboard Helper"] = RTEarea[0].mozillaAllowClipboardURL;
+                                       mozillaXpi["AllowClipboard Helper"] = this.buttonsConfiguration.paste.mozillaAllowClipboardURL;
                                        var mozillaInstallCallback = this.makeFunctionReference("mozillaInstallCallback");
                                        InstallTrigger.install(mozillaXpi, mozillaInstallCallback);
                                } else {