* Added feature: Various enhancements to link dialogues in htmlArea RTE
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 24 Jan 2008 05:07:57 +0000 (05:07 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 24 Jan 2008 05:07:57 +0000 (05:07 +0000)
* Fixed bug #6787: classesAnchor and classesLinks get lost when changing tab in link browser
* Added feature #4100: Insert/Modify Link with DAM

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2956 709f56b5-9817-0410-a4d7-c38de5d9e867

46 files changed:
ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php
typo3/sysext/rtehtmlarea/doc/manual.sxw
typo3/sysext/rtehtmlarea/ext_localconf.php
typo3/sysext/rtehtmlarea/extensions/DefaultLink/class.tx_rtehtmlarea_defaultlink.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/extensions/DefaultLink/skin/htmlarea.css [new file with mode: 0644]
typo3/sysext/rtehtmlarea/extensions/DefaultLink/skin/images/link.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/extensions/DefaultLink/skin/images/unlink.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/extensions/TYPO3Link/class.tx_rtehtmlarea_typo3link.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/extensions/TYPO3Link/skin/htmlarea.css [new file with mode: 0644]
typo3/sysext/rtehtmlarea/extensions/TYPO3Link/skin/images/link.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/extensions/TYPO3Link/skin/images/unlink.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js
typo3/sysext/rtehtmlarea/htmlarea/locallang_tooltips.xml
typo3/sysext/rtehtmlarea/htmlarea/plugins/ContextMenu/context-menu.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultLink/default-link.js [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultLink/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultLink/popups/link.html [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/skins/default/htmlarea-edited-content.css
typo3/sysext/rtehtmlarea/htmlarea/skins/default/htmlarea.css
typo3/sysext/rtehtmlarea/htmlarea/skins/default/images/ed_link.gif
typo3/sysext/rtehtmlarea/htmlarea/skins/default/images/ed_unlink.gif
typo3/sysext/rtehtmlarea/mod3/browse_links.php
typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php
typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_dam_browse_links.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod3/locallang.xml
typo3/sysext/rtehtmlarea/mod4/class.tx_rtehtmlarea_dam_browse_media.php
typo3/sysext/rtehtmlarea/mod4/class.tx_rtehtmlarea_select_image.php
typo3/sysext/rtehtmlarea/res/accessibilityicons/img/download.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/accessibilityicons/img/external_link.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/accessibilityicons/img/external_link_new_window.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/accessibilityicons/img/internal_link.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/accessibilityicons/img/internal_link_new_window.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/accessibilityicons/img/mail.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/accessibilityicons/locallang.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/accessibilityicons/pageTSConfig.txt
typo3/sysext/rtehtmlarea/res/demo/pageTSConfig.txt
typo3/sysext/rtehtmlarea/res/typical/pageTSConfig.txt
typo3/sysext/t3skin/rtehtmlarea/htmlarea-edited-content.css
typo3/sysext/t3skin/rtehtmlarea/htmlarea.css
typo3/sysext/t3skin/rtehtmlarea/images/ed_link.gif
typo3/sysext/t3skin/rtehtmlarea/images/ed_unlink.gif

index a5f0220..1b5745d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-24  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
+
+       * Added feature: Various enhancements to link dialogues in htmlArea RTE
+       * Fixed bug #6787: classesAnchor and classesLinks get lost when changing tab in link browser
+       * Added feature #4100: Insert/Modify Link with DAM
+
 2008-01-23  Ingo Renner  <ingo@typo3.org>
 
        * fixed bugs #7251 , #6524: Make the folding/unfolding of the menu items use AJAX, credits Steffen Kamper
index c23f2b9..7099b81 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-24  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
+
+       * Added feature: Various enhancements to link dialogues in htmlArea RTE
+       * Fixed bug #6787: classesAnchor and classesLinks get lost when changing tab in link browser
+       * Added feature #4100: Insert/Modify Link with DAM
+
 2008-01-21  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
        * Fixed JS error when opening the TYPO3 image browser and proc.plainImageMode is not set
index 82ae817..1507d9c 100644 (file)
@@ -101,7 +101,6 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                'unorderedlist'         => 'InsertUnorderedList',
                'emoticon'              => 'InsertSmiley',
                'line'                  => 'InsertHorizontalRule',
-               'link'                  => 'CreateLink',
                'table'                 => 'InsertTable',
                'cut'                   => 'Cut',
                'copy'                  => 'Copy',
@@ -180,7 +179,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                '7'     =>      'xxx-large (48px)',
                );
        
-       var $pluginList = 'TableOperations, ContextMenu, SpellChecker, SelectColor, TYPO3Browsers, InsertSmiley, FindReplace, RemoveFormat, CharacterMap, QuickTag, UserElements, TYPO3HtmlParser';
+       var $pluginList = 'TableOperations, ContextMenu, SpellChecker, SelectColor, InsertSmiley, FindReplace, RemoveFormat, QuickTag, UserElements, TYPO3HtmlParser';
        
        var $pluginButton = array(
                'SpellChecker'          => 'spellcheck',
@@ -654,7 +653,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        bar, left, center, right, justifyfull,
                        bar, orderedlist, unorderedlist, outdent, indent,  bar, lefttoright, righttoleft,
                        bar, textcolor, bgcolor, textindicator,
-                       bar, emoticon, insertcharacter, line, link, image, table,' . (($this->thisConfig['hideTableOperationsInToolbar'] && is_array($this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['toggleborders.']) && $this->thisConfig['buttons.']['toggleborders.']['keepInToolbar']) ? ' toggleborders,': '') . ' user, acronym, bar, findreplace, spellcheck,
+                       bar, emoticon, insertcharacter, line, link, unlink, image, table,' . (($this->thisConfig['hideTableOperationsInToolbar'] && is_array($this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['toggleborders.']) && $this->thisConfig['buttons.']['toggleborders.']['keepInToolbar']) ? ' toggleborders,': '') . ' user, acronym, bar, findreplace, spellcheck,
                        bar, chMode, inserttag, removeformat, bar, copy, cut, paste, bar, undo, redo, bar, showhelp, about, linebreak, 
                        ' . ($this->thisConfig['hideTableOperationsInToolbar'] ? '': 'bar, toggleborders,') . ' bar, tableproperties, bar, rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit, bar,
                        columninsertbefore, columninsertafter, columndelete, columnsplit, bar,
@@ -666,7 +665,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                                bar, fontstyle, space, fontsize, space, formatblock, insertparagraphbefore, insertparagraphafter, blockquote, bar, bold, italic, underline, strikethrough,
                                subscript, superscript, lefttoright, righttoleft, bar, left, center, right, justifyfull, linebreak,
                                bar, orderedlist, unorderedlist, outdent, indent, bar, textcolor, bgcolor, textindicator, bar, emoticon,
-                               insertcharacter, line, link, image, table, user, acronym, bar, findreplace, spellcheck, bar, chMode, inserttag,
+                               insertcharacter, line, link, unlink, image, table, user, acronym, bar, findreplace, spellcheck, bar, chMode, inserttag,
                                removeformat, bar, copy, cut, paste, bar, undo, redo, bar, showhelp, about, linebreak,
                                bar, toggleborders, bar, tableproperties, bar, rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit, bar,
                                columninsertbefore, columninsertafter, columndelete, columnsplit, bar,
@@ -675,7 +674,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                                bar, fontstyle, space, fontsize, space, formatblock, insertparagraphbefore, insertparagraphafter, blockquote, bar, bold, italic, underline, strikethrough,
                                subscript, superscript, linebreak, bar, lefttoright, righttoleft, bar, left, center, right, justifyfull,
                                orderedlist, unorderedlist, outdent, indent, bar, textcolor, bgcolor, textindicator, bar, emoticon,
-                               insertcharacter, line, link, image, table, user, acronym, linebreak, bar, findreplace, spellcheck, bar, chMode, inserttag,
+                               insertcharacter, line, link, unlink, image, table, user, acronym, linebreak, bar, findreplace, spellcheck, bar, chMode, inserttag,
                                removeformat, bar, copy, cut, paste, bar, undo, redo, bar, showhelp, about, linebreak,
                                bar, toggleborders, bar, tableproperties, bar, rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit, bar,
                                columninsertbefore, columninsertafter, columndelete, columnsplit, bar,
@@ -791,7 +790,6 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                }
                if($this->thisConfig['disableContextMenu'] || $this->thisConfig['disableRightClick']) $hidePlugins[] = 'ContextMenu';
                if($this->thisConfig['disableSelectColor']) $hidePlugins[] = 'SelectColor';
-               if($this->thisConfig['disableTYPO3Browsers']) $hidePlugins[] = 'TYPO3Browsers';
                if(!$this->thisConfig['enableWordClean'] || !is_array($this->thisConfig['enableWordClean.'])) $hidePlugins[] = 'TYPO3HtmlParser';
                if(!t3lib_extMgm::isLoaded('static_info_tables') || in_array($this->language, t3lib_div::trimExplode(',', $TYPO3_CONF_VARS['EXTCONF'][$this->ID]['noSpellCheckLanguages']))) $hidePlugins[] = 'SpellChecker';
                $this->pluginEnabledArray = array_diff($this->pluginEnabledArray, $hidePlugins);
@@ -912,7 +910,6 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                return (!$this->is_FE() ? '' : '
                ' . '/*<![CDATA[*/') . ($this->is_FE() ? '' : '
                        RTEarea[0]["RTEtsConfigParams"] = "&RTEtsConfigParams=' . rawurlencode($this->RTEtsConfigParams()) . '";
-                       RTEarea[0]["pathLinkModule"] = "../../mod3/browse_links.php";
                        RTEarea[0]["pathUserModule"] = "../../mod5/user.php";
                        RTEarea[0]["pathParseHtmlModule"] = "' . $this->extHttpPath . 'mod6/parse_html.php";')
                        . $loadPluginCode .  '
@@ -1123,10 +1120,6 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        }
                }
                
-               if ($this->isPluginEnabled('TYPO3Browsers')) {
-                       $configureRTEInJavascriptString .= $this->buildJSClassesAnchorConfig($RTEcounter);
-               }
-               
                        // Add Javascript configuration for registered plugins
                foreach ($this->registeredPlugins as $pluginId => $plugin) {
                        if ($this->isPluginEnabled($pluginId)) {
@@ -1516,66 +1509,6 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
        }
        
        /**
-        * Return Javascript configuration of special anchor classes
-        *
-        * @param       integer         $RTEcounter: The index number of the current RTE editing area within the form.
-        *
-        * @return      string          Javascript configuration of special anchor classes
-        */
-       function buildJSClassesAnchorConfig($RTEcounter) {
-               
-               if ($this->is_FE()) {
-                       $RTEProperties = $this->RTEsetup;
-               } else {
-                       $RTEProperties = $this->RTEsetup['properties'];
-               }
-               
-               $configureRTEInJavascriptString = '';
-               if (is_array($RTEProperties['classesAnchor.'])) {
-                       $configureRTEInJavascriptString .= '
-                       RTEarea['.$RTEcounter.']["classesAnchorUrl"] = "' . $this->writeTemporaryFile('', 'classesAnchor_'.$this->contentLanguageUid, 'js', $this->buildJSClassesAnchorArray()) . '";';
-               }
-               return $configureRTEInJavascriptString;
-       }
-       
-       /**
-        * Return a JS array for special anchor classes
-        *
-        * @return      string          classesAnchor array definition
-        */
-       function buildJSClassesAnchorArray() {
-               global $LANG, $TYPO3_CONF_VARS;
-               
-               $linebreak = $TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableCompressedScripts'] ? '' : chr(10);
-               $JSClassesAnchorArray .= 'editor.classesAnchorSetup = [ ' . $linebreak;
-               $classesAnchorIndex = 0;
-               foreach ($this->RTEsetup['properties']['classesAnchor.'] as $label => $conf) {
-                       if (is_array($conf) && $conf['class']) {
-                               $JSClassesAnchorArray .= (($classesAnchorIndex++)?',':'') . ' { ' . $linebreak;
-                               $index = 0;
-                               $JSClassesAnchorArray .= (($index++)?',':'') . 'name : "' . $conf['class'] . '"' . $linebreak;
-                               if ($conf['type']) {
-                                       $JSClassesAnchorArray .= (($index++)?',':'') . 'type : "' . $conf['type'] . '"' . $linebreak;
-                               }
-                               if (trim(str_replace('\'', '', str_replace('"', '', $conf['image'])))) {
-                                       $JSClassesAnchorArray .= (($index++)?',':'') . 'image : "' . $this->getFullFileName(trim(str_replace('\'', '', str_replace('"', '', $conf['image'])))) . '"' . $linebreak;
-                               }
-                               if (trim($conf['altText'])) {
-                                       $string = $this->getLLContent(trim($conf['altText']));
-                                       $JSClassesAnchorArray .= (($index++)?',':'') . 'altText : ' . str_replace('"', '\"', str_replace('\\\'', '\'', $string)) . $linebreak;
-                               }
-                               if (trim($conf['titleText'])) {
-                                       $string = $this->getLLContent(trim($conf['titleText']));
-                                       $JSClassesAnchorArray .= (($index++)?',':'') . 'titleText : ' . str_replace('"', '\"', str_replace('\\\'', '\'', $string)) . $linebreak;
-                               }
-                               $JSClassesAnchorArray .= '}' . $linebreak;
-                       }
-               }       
-               $JSClassesAnchorArray .= '];' . $linebreak;
-               return $JSClassesAnchorArray;
-        }
-       
-       /**
         * Writes contents in a file in typo3temp/rtehtmlarea directory and returns the file name
         *
         * @param       string          $sourceFileName: The name of the file from which the contents should be extracted
@@ -1744,7 +1677,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                return $toolbar;
        }
        
-       function getLLContent($string) {
+       public function getLLContent($string) {
                global $LANG;
                
                $BE_lang = $LANG->lang;
@@ -1788,7 +1721,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                return 'String.fromCharCode('.implode(',',$nArr).')';
        }
        
-       function getFullFileName($filename) {
+       public function getFullFileName($filename) {
                if (substr($filename,0,4)=='EXT:')      {       // extension
                        list($extKey,$local) = explode('/',substr($filename,4),2);
                        $newFilename = '';
index 5a0e379..0d5212b 100644 (file)
Binary files a/typo3/sysext/rtehtmlarea/doc/manual.sxw and b/typo3/sysext/rtehtmlarea/doc/manual.sxw differ
index 168922b..8794eff 100644 (file)
@@ -77,6 +77,13 @@ $TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Image'] = array();
 $TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Image']['objectReference'] = 'EXT:'.$_EXTKEY.'/extensions/TYPO3Image/class.tx_rtehtmlarea_typo3image.php:&tx_rtehtmlarea_typo3image';
 $TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Image']['addIconsToSkin'] = 0;
 $TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Image']['disableInFE'] = 1;
+$TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['DefaultLink'] = array();
+$TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['DefaultLink']['objectReference'] = 'EXT:'.$_EXTKEY.'/extensions/DefaultLink/class.tx_rtehtmlarea_defaultlink.php:&tx_rtehtmlarea_defaultlink';
+$TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['DefaultLink']['addIconsToSkin'] = 0;
+$TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Link'] = array();
+$TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Link']['objectReference'] = 'EXT:'.$_EXTKEY.'/extensions/TYPO3Link/class.tx_rtehtmlarea_typo3link.php:&tx_rtehtmlarea_typo3link';
+$TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Link']['addIconsToSkin'] = 0;
+$TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Link']['disableInFE'] = 1;
 
 $_EXTCONF = unserialize($_EXTCONF);    // unserializing the configuration so we can use it here:
 
@@ -124,6 +131,7 @@ if ($TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableAccessibilityIcons']) {
        // Register DAM element browser rendering
 if (t3lib_extMgm::isLoaded('dam') && $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableDAMBrowser']) {
        $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'][] = 'EXT:'.$_EXTKEY.'/mod4/class.tx_rtehtmlarea_dam_browse_media.php:&tx_rtehtmlarea_dam_browse_media';
+       $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'][] = 'EXT:'.$_EXTKEY.'/mod3/class.tx_rtehtmlarea_dam_browse_links.php:&tx_rtehtmlarea_dam_browse_links';
 }
 
        // Add default Page TSonfig RTE configuration for enabling the Click-enlarge feature
diff --git a/typo3/sysext/rtehtmlarea/extensions/DefaultLink/class.tx_rtehtmlarea_defaultlink.php b/typo3/sysext/rtehtmlarea/extensions/DefaultLink/class.tx_rtehtmlarea_defaultlink.php
new file mode 100644 (file)
index 0000000..869c124
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2008 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+*  All rights reserved
+*
+*  This script is part of the Typo3 project. The Typo3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+/**
+ * Default Link extension for htmlArea RTE
+ *
+ * @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+ *
+ * TYPO3 SVN ID: $Id$
+ *
+ */
+
+require_once(t3lib_extMgm::extPath('rtehtmlarea').'class.tx_rtehtmlareaapi.php');
+
+class tx_rtehtmlarea_defaultlink extends tx_rtehtmlareaapi {
+
+       protected $extensionKey = 'rtehtmlarea';        // The key of the extension that is extending htmlArea RTE
+       protected $pluginName = 'DefaultLink';          // The name of the plugin registered by the extension
+       protected $relativePathToLocallangFile = '';    // Path to this main locallang file of the extension relative to the extension dir.
+       protected $relativePathToSkin = 'extensions/DefaultLink/skin/htmlarea.css';             // Path to the skin (css) file relative to the extension dir.
+       protected $htmlAreaRTE;                         // Reference to the invoking object
+       protected $thisConfig;                          // Reference to RTE PageTSConfig
+       protected $toolbar;                             // Reference to RTE toolbar array
+       protected $LOCAL_LANG;                          // Frontend language array
+       
+       protected $pluginButtons = 'link';
+       protected $convertToolbarForHtmlAreaArray = array (
+               'link'  => 'CreateLink',
+               );
+       
+       /**
+        * Return JS configuration of the htmlArea plugins registered by the extension
+        *
+        * @param       integer         Relative id of the RTE editing area in the form
+        *
+        * @return string               JS configuration for registered plugins
+        *
+        * The returned string will be a set of JS instructions defining the configuration that will be provided to the plugin(s)
+        * Each of the instructions should be of the form:
+        *      RTEarea['.$RTEcounter.']["buttons"]["button-id"]["property"] = "value";
+        */
+       public function buildJavascriptConfiguration($RTEcounter) {
+               $registerRTEinJavascriptString = '';
+               $button = 'link';
+               if (in_array($button, $this->toolbar) && $this->htmlAreaRTE->is_FE()) {
+                       if (!is_array( $this->thisConfig['buttons.']) || !is_array( $this->thisConfig['buttons.'][$button.'.'])) {
+                               $registerRTEinJavascriptString .= '
+                       RTEarea['.$RTEcounter.']["buttons"]["'. $button .'"] = new Object();';
+                       }
+                       $registerRTEinJavascriptString .= '
+                       RTEarea['.$RTEcounter.'].buttons.'. $button .'.stripBaseUrl = true;';
+               }
+               return $registerRTEinJavascriptString;
+       }
+
+} // end of class
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/DefaultLink/class.tx_rtehtmlarea_defaultlink.php']) {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/DefaultLink/class.tx_rtehtmlarea_defaultlink.php']);
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/rtehtmlarea/extensions/DefaultLink/skin/htmlarea.css b/typo3/sysext/rtehtmlarea/extensions/DefaultLink/skin/htmlarea.css
new file mode 100644 (file)
index 0000000..be1450c
--- /dev/null
@@ -0,0 +1,4 @@
+/* Selectors for the Default Link plugin of htmlArea RTE */
+/* TYPO3 SVN ID: $Id$ */
+.htmlarea .toolbar .CreateLink {background-image:url("images/link.gif");}
+.htmlarea .toolbar .UnLink {background-image:url("images/unlink.gif");}
diff --git a/typo3/sysext/rtehtmlarea/extensions/DefaultLink/skin/images/link.gif b/typo3/sysext/rtehtmlarea/extensions/DefaultLink/skin/images/link.gif
new file mode 100644 (file)
index 0000000..a1ae562
Binary files /dev/null and b/typo3/sysext/rtehtmlarea/extensions/DefaultLink/skin/images/link.gif differ
diff --git a/typo3/sysext/rtehtmlarea/extensions/DefaultLink/skin/images/unlink.gif b/typo3/sysext/rtehtmlarea/extensions/DefaultLink/skin/images/unlink.gif
new file mode 100644 (file)
index 0000000..26f7f4f
Binary files /dev/null and b/typo3/sysext/rtehtmlarea/extensions/DefaultLink/skin/images/unlink.gif differ
diff --git a/typo3/sysext/rtehtmlarea/extensions/TYPO3Link/class.tx_rtehtmlarea_typo3link.php b/typo3/sysext/rtehtmlarea/extensions/TYPO3Link/class.tx_rtehtmlarea_typo3link.php
new file mode 100644 (file)
index 0000000..538695a
--- /dev/null
@@ -0,0 +1,138 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2008 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+*  All rights reserved
+*
+*  This script is part of the Typo3 project. The Typo3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+/**
+ * TYPO3 Image plugin for htmlArea RTE
+ *
+ * @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+ *
+ * TYPO3 SVN ID: $Id$
+ *
+ */
+
+require_once(t3lib_extMgm::extPath('rtehtmlarea').'class.tx_rtehtmlareaapi.php');
+
+class tx_rtehtmlarea_typo3link extends tx_rtehtmlareaapi {
+
+       protected $extensionKey = 'rtehtmlarea';        // The key of the extension that is extending htmlArea RTE
+       protected $pluginName = 'TYPO3Link';            // The name of the plugin registered by the extension
+       protected $relativePathToLocallangFile = '';    // Path to this main locallang file of the extension relative to the extension dir.
+       protected $relativePathToSkin  = 'extensions/TYPO3Link/skin/htmlarea.css';      // Path to the skin (css) file relative to the extension dir.
+       protected $htmlAreaRTE;                         // Reference to the invoking object
+       protected $thisConfig;                          // Reference to RTE PageTSConfig
+       protected $toolbar;                             // Reference to RTE toolbar array
+       protected $LOCAL_LANG;                          // Frontend language array
+       
+       protected $pluginButtons = 'link, unlink';
+       protected $convertToolbarForHtmlAreaArray = array (
+               'link'          => 'CreateLink',
+               'unlink'        => 'UnLink',
+               );
+       
+       public function main($parentObject) {
+                       // Check if this should be enabled based on Page TSConfig
+               return parent::main($parentObject) && !$this->thisConfig['disableTYPO3Browsers'] 
+                               && !(is_array( $this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['link.']) && is_array($this->thisConfig['buttons.']['link.']['TYPO3Browser.']) && $this->thisConfig['buttons.']['link.']['TYPO3Browser.']['disabled']);
+       }
+       
+       /**
+        * Return JS configuration of the htmlArea plugins registered by the extension
+        *
+        * @param       integer         Relative id of the RTE editing area in the form
+        *
+        * @return      string          JS configuration for registered plugins, in this case, JS configuration of block elements
+        *
+        * The returned string will be a set of JS instructions defining the configuration that will be provided to the plugin(s)
+        * Each of the instructions should be of the form:
+        *      RTEarea['.$RTEcounter.']["buttons"]["button-id"]["property"] = "value";
+        */
+       public function buildJavascriptConfiguration($RTEcounter) {
+               
+               $registerRTEinJavascriptString = '';
+               $button = 'link';
+               if (in_array($button, $this->toolbar)) {
+                       if (!is_array( $this->thisConfig['buttons.']) || !is_array( $this->thisConfig['buttons.'][$button.'.'])) {
+                                       $registerRTEinJavascriptString .= '
+                       RTEarea['.$RTEcounter.']["buttons"]["'. $button .'"] = new Object();';
+                       }
+                       $registerRTEinJavascriptString .= '
+                       RTEarea['.$RTEcounter.'].buttons.'. $button .'.pathLinkModule = "../../mod3/browse_links.php";';
+                       
+                       if ($this->htmlAreaRTE->is_FE()) {
+                               $RTEProperties = $this->htmlAreaRTE->RTEsetup;
+                       } else {
+                               $RTEProperties = $this->htmlAreaRTE->RTEsetup['properties'];
+                       }
+                       if (is_array($RTEProperties['classesAnchor.'])) {
+                               $registerRTEinJavascriptString .= '
+                       RTEarea['.$RTEcounter.'].buttons.'. $button .'.classesAnchorUrl = "' . $this->htmlAreaRTE->writeTemporaryFile('', 'classesAnchor_'.$this->htmlAreaRTE->contentLanguageUid, 'js', $this->buildJSClassesAnchorArray()) . '";';
+                       }
+               }
+               return $registerRTEinJavascriptString;
+       }
+       
+       /**
+        * Return a JS array for special anchor classes
+        *
+        * @return      string          classesAnchor array definition
+        */
+       function buildJSClassesAnchorArray() {
+               global $LANG, $TYPO3_CONF_VARS;
+               
+               $linebreak = $TYPO3_CONF_VARS['EXTCONF'][$this->htmlAreaRTE->ID]['enableCompressedScripts'] ? '' : chr(10);
+               $JSClassesAnchorArray .= 'HTMLArea.classesAnchorSetup = [ ' . $linebreak;
+               $classesAnchorIndex = 0;
+               foreach ($this->htmlAreaRTE->RTEsetup['properties']['classesAnchor.'] as $label => $conf) {
+                       if (is_array($conf) && $conf['class']) {
+                               $JSClassesAnchorArray .= (($classesAnchorIndex++)?',':'') . ' { ' . $linebreak;
+                               $index = 0;
+                               $JSClassesAnchorArray .= (($index++)?',':'') . 'name : "' . $conf['class'] . '"' . $linebreak;
+                               if ($conf['type']) {
+                                       $JSClassesAnchorArray .= (($index++)?',':'') . 'type : "' . $conf['type'] . '"' . $linebreak;
+                               }
+                               if (trim(str_replace('\'', '', str_replace('"', '', $conf['image'])))) {
+                                       $JSClassesAnchorArray .= (($index++)?',':'') . 'image : "' . $this->htmlAreaRTE->getFullFileName(trim(str_replace('\'', '', str_replace('"', '', $conf['image'])))) . '"' . $linebreak;
+                               }
+                               $JSClassesAnchorArray .= (($index++)?',':'') . 'addIconAfterLink : ' . ($conf['addIconAfterLink']?'true':'false') . $linebreak;
+                               if (trim($conf['altText'])) {
+                                       $string = $this->htmlAreaRTE->getLLContent(trim($conf['altText']));
+                                       $JSClassesAnchorArray .= (($index++)?',':'') . 'altText : ' . str_replace('"', '\"', str_replace('\\\'', '\'', $string)) . $linebreak;
+                               }
+                               if (trim($conf['titleText'])) {
+                                       $string = $this->htmlAreaRTE->getLLContent(trim($conf['titleText']));
+                                       $JSClassesAnchorArray .= (($index++)?',':'') . 'titleText : ' . str_replace('"', '\"', str_replace('\\\'', '\'', $string)) . $linebreak;
+                               }
+                               $JSClassesAnchorArray .= '}' . $linebreak;
+                       }
+               }       
+               $JSClassesAnchorArray .= '];' . $linebreak;
+               return $JSClassesAnchorArray;
+        }
+
+} // end of class
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/TYPO3Link/class.tx_rtehtmlarea_typo3link.php']) {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/TYPO3Link/class.tx_rtehtmlarea_typo3link.php']);
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/rtehtmlarea/extensions/TYPO3Link/skin/htmlarea.css b/typo3/sysext/rtehtmlarea/extensions/TYPO3Link/skin/htmlarea.css
new file mode 100644 (file)
index 0000000..e0cc6fa
--- /dev/null
@@ -0,0 +1,4 @@
+/* Selectors for the TYPO3 Link plugin of htmlArea RTE */
+/* TYPO3 SVN ID: $Id$ */
+.htmlarea .toolbar .CreateLink {background-image:url("images/link.gif");}
+.htmlarea .toolbar .UnLink {background-image:url("images/unlink.gif");}
diff --git a/typo3/sysext/rtehtmlarea/extensions/TYPO3Link/skin/images/link.gif b/typo3/sysext/rtehtmlarea/extensions/TYPO3Link/skin/images/link.gif
new file mode 100644 (file)
index 0000000..a1ae562
Binary files /dev/null and b/typo3/sysext/rtehtmlarea/extensions/TYPO3Link/skin/images/link.gif differ
diff --git a/typo3/sysext/rtehtmlarea/extensions/TYPO3Link/skin/images/unlink.gif b/typo3/sysext/rtehtmlarea/extensions/TYPO3Link/skin/images/unlink.gif
new file mode 100644 (file)
index 0000000..26f7f4f
Binary files /dev/null and b/typo3/sysext/rtehtmlarea/extensions/TYPO3Link/skin/images/unlink.gif differ
index 2a762a6..6c17082 100644 (file)
@@ -189,7 +189,9 @@ HTMLArea.prototype.rangeIntersectsNode = function(range, node) {
        } catch (e) {
                nodeRange.selectNodeContents(node);
        }
-       return (range.compareBoundaryPoints(range.END_TO_START, nodeRange) == -1 && range.compareBoundaryPoints(range.START_TO_END, nodeRange) == 1);
+               // Note: sometimes Safari inverts the end points
+       return (range.compareBoundaryPoints(range.END_TO_START, nodeRange) == -1 && range.compareBoundaryPoints(range.START_TO_END, nodeRange) == 1) ||
+               (range.compareBoundaryPoints(range.END_TO_START, nodeRange) == 1 && range.compareBoundaryPoints(range.START_TO_END, nodeRange) == -1);
 };
 
 /*
index 437e391..0e8cc56 100644 (file)
@@ -279,8 +279,6 @@ HTMLArea.Config = function () {
        this.pageStyle = "";
                // set to true if you want Word code to be cleaned upon Paste
        this.enableWordClean = true;
-               // enable the 'Target' field in the Make Link dialog
-       this.makeLinkShowsTarget = true;
                // remove tags (these have to be a regexp, or null if this functionality is not desired)
        this.htmlRemoveTags = null;
                // remove tags and any contents (these have to be a regexp, or null if this functionality is not desired)
@@ -302,7 +300,6 @@ HTMLArea.Config = function () {
                ForeColor:              ["Font Color", "ed_color_fg.gif",false, function(editor) {editor.execCommand("ForeColor");}],
                HiliteColor:            ["Background Color", "ed_color_bg.gif",false, function(editor) {editor.execCommand("HiliteColor");}],
                InsertHorizontalRule:   ["Horizontal Rule", "ed_hr.gif",false, function(editor) {editor.execCommand("InsertHorizontalRule");}],
-               CreateLink:             ["Insert Web Link", "ed_link.gif", false, function(editor) {editor.execCommand("CreateLink", true);}, "a", false, true],
                InsertTable:            ["Insert Table", "insert_table.gif", false, function(editor) {editor.execCommand("InsertTable");}],
                HtmlMode:               ["Toggle HTML Source", "ed_html.gif", true, function(editor) {editor.execCommand("HtmlMode");}],
                SelectAll:              ["SelectAll", "", true, function(editor) {editor.execCommand("SelectAll");}, null, true, false],
@@ -653,10 +650,7 @@ HTMLArea.prototype.createButton = function (txt,tb_line,first_cell_on_line,label
                        newObj["labelUsed"] = true;
                }
                HTMLArea._addEvents(newObj["el"],["mouseover", "mouseout", "mousedown", "click"], HTMLArea.toolBarButtonHandler);
-               
                newObj["el"].className += " " + txt;
-               if (this.plugins["TYPO3Browsers"] && txt == "CreateLink") newObj["el"].className += "-TYPO3Browsers";
-               
                newObj["created"] = true;
        }
        return newObj;
@@ -1727,9 +1721,12 @@ HTMLArea.prototype.updateToolbar = function(noStatus) {
                                        }
                                }
                        }
-                       if (cmd == "CreateLink") btn.state("enabled", (!text || btn.text) && (inContext || selection));
-                               else btn.state("enabled", (!text || btn.text) && inContext && (selection || !btn.selection));
                        
+                       if (cmd == "CreateLink") {
+                               btn.state("enabled", (!text || btn.text) && (inContext || selection));
+                       } else {
+                               btn.state("enabled", (!text || btn.text) && inContext && (selection || !btn.selection));
+                       }
                        if (typeof(cmd) == "function") { continue; };
                                // look-it-up in the custom dropdown boxes
                        var dropdown = this.config.customSelects[cmd];
@@ -1941,89 +1938,8 @@ HTMLArea.prototype._getFirstAncestor = function(sel,types) {
 };
 
 /***************************************************
- *  LINKS, IMAGES AND TABLES
+ *  TABLES
  ***************************************************/
-
-/*
- * Get the create link action function
- */
-HTMLArea.createLinkDialog = function(editor,link) {
-       return (function(param) {
-               if (!param || typeof(param.f_href) == "undefined") return false;
-               var a = link;
-               if(!a) {
-                       try {
-                               editor._doc.execCommand("CreateLink",false,param.f_href);
-                               a = editor.getParentElement();
-                               var sel = editor._getSelection();
-                               var range = editor._createRange(sel);
-                               if (!HTMLArea.is_ie) {
-                                       a = range.startContainer;
-                                       if (!/^a$/i.test(a.tagName)) {
-                                               a = a.nextSibling;
-                                               if(a == null) a = range.startContainer.parentNode;
-                                       }
-                               }
-                       } catch(e) {}
-               } else {
-                       var href = param.f_href.trim();
-                       editor.selectNodeContents(a);
-                       if (href == "") {
-                               editor._doc.execCommand("Unlink", false, null);
-                               editor.updateToolbar();
-                               return false;
-                       }
-                       else {
-                               a.href = href;
-                       }
-               }
-               if (!(a && /^a$/i.test(a.tagName))) return false;
-               if (typeof(param.f_target) != "undefined") a.target = param.f_target.trim();
-               if (typeof(param.f_title) != "undefined") a.title = param.f_title.trim();
-               editor.selectNodeContents(a);
-               editor.updateToolbar();
-               editor = null;
-               link = null;
-       });
-};
-
-/*
- * Process the create link request
- */
-HTMLArea.prototype._createLink = function(link) {
-       var outparam = null;
-       this.focusEditor();
-       if (typeof(link) == "undefined") {
-               link = this.getParentElement();
-               if(link) {
-                       if(/^img$/i.test(link.tagName)) link = link.parentNode;
-                       if(!/^a$/i.test(link.tagName)) link = null;
-               }
-       }
-       if (!link) {
-               var sel = this._getSelection();
-               if (this._selectionEmpty(sel)) {
-                       alert("You need to select some text before creating a link");
-                       return;
-               }
-               outparam = {
-                       f_href : '',
-                       f_title : '',
-                       f_target : '',
-                       f_usetarget : this.config.makeLinkShowsTarget
-               };
-       } else {
-               outparam = {
-                       f_href   : HTMLArea.is_ie ? this.stripBaseURL(link.href) : link.getAttribute("href"),
-                       f_title  : link.title,
-                       f_target : link.target,
-                       f_usetarget : this.config.makeLinkShowsTarget
-               };
-       }
-       var createLinkDialogFunctRef = HTMLArea.createLinkDialog(this, link);
-       this._popupDialog("link.html", createLinkDialogFunctRef, outparam, 450, 145);
-};
-
 /*
  * Get the insert table action function
  */
@@ -2133,7 +2049,6 @@ HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
                var colorDialogFunctRef = HTMLArea.selectColorDialog(this, cmdID);
                this._popupDialog("select_color.html", colorDialogFunctRef, HTMLArea._colorToRgb(this._doc.queryCommandValue(cmdID)), 200, 182);
                break;
-           case "CreateLink"   : this._createLink(); break;
            case "Undo"         :
            case "Redo"         :
                if(this._customUndo) this[cmdID.toLowerCase()]();
@@ -2558,6 +2473,23 @@ HTMLArea._hasClass = function(el, className) {
        }
        return false;
 };
+
+/*
+ * Select a value in a select element
+ *
+ * @param      object          select: the select object
+ * @param      string          value: the value
+ * @return     void
+ */
+HTMLArea.selectValue = function(select, value) {
+       var options = select.getElementsByTagName("option");
+       for (var i = options.length; --i >= 0;) {
+               var option = options[i];
+               option.selected = (option.value == value);
+               select.selectedIndex = i;
+       }
+};
+
 HTMLArea.RE_blockTags = /^(body|p|h1|h2|h3|h4|h5|h6|ul|ol|pre|dl|dt|dd|div|noscript|blockquote|form|hr|table|caption|fieldset|address|td|tr|th|li|tbody|thead|tfoot|iframe)$/;
 HTMLArea.isBlockElement = function(el) { return el && el.nodeType == 1 && HTMLArea.RE_blockTags.test(el.nodeName.toLowerCase()); };
 HTMLArea.RE_closingTags = /^(p|blockquote|a|li|ol|ul|dl|dt|td|th|tr|tbody|thead|tfoot|caption|colgroup|table|div|b|bdo|big|cite|code|del|dfn|em|i|ins|kbd|label|q|samp|small|span|strike|strong|sub|sup|tt|u|var|abbr|acronym|font|center|object|embed|style|script|title|head|clickenlarge)$/;
@@ -2649,7 +2581,9 @@ HTMLArea.getHTMLWrapper = function(root, outputRoot, editor) {
                                                value = root[a.nodeName];
                                        } else {
                                                value = a.nodeValue;
-                                               if (HTMLArea.is_ie && (name == "href" || name == "src")) value = editor.stripBaseURL(value);
+                                               if (HTMLArea.is_ie && (name == "href" || name == "src") && editor.plugins.link && editor.plugins.link.instance && editor.plugins.link.instance.stripBaseURL) {
+                                                       value = editor.plugins.link.instance.stripBaseURL(value);
+                                               }
                                        }
                                } else { // IE fails to put style in attributes list.
                                        value = root.style.cssText;
@@ -2712,20 +2646,6 @@ HTMLArea.removeFromParent = function(el) {
        return el;
 };
 
-HTMLArea.prototype.stripBaseURL = function(string) {
-       var baseurl = this.config.baseURL;
-
-       // strip to last directory in case baseurl points to a file
-       baseurl = baseurl.replace(/[^\/]+$/, '');
-       var basere = new RegExp(baseurl);
-       string = string.replace(basere, "");
-
-       // strip host-part of URL which is added by MSIE to links relative to server root
-       baseurl = baseurl.replace(/^(https?:\/\/[^\/]+)(.*)$/, '$1');
-       basere = new RegExp(baseurl);
-       return string.replace(basere, "");
-};
-
 String.prototype.trim = function() {
        return this.replace(/^\s+/, '').replace(/\s+$/, '');
 };
@@ -3566,7 +3486,7 @@ HTMLArea.Plugin = HTMLArea.Base.extend({
         * @return      string          the url
         */
        makeUrlFromModulePath : function(modulePath, parameters) {
-               return this.editor.popupURL(modulePath + "?" + RTEarea[this.editorNumber]["RTEtsConfigParams"] + "&editorNo=" + this.editorNumber + "&sys_language_content=" + this.editorConfiguration.sys_language_content + (parameters?parameters:''));
+               return this.editor.popupURL(modulePath + "?" + RTEarea[this.editorNumber]["RTEtsConfigParams"] + "&editorNo=" + this.editorNumber + "&sys_language_content=" + this.editorConfiguration.sys_language_content + "&contentTypo3Language=" + this.editorConfiguration.typo3ContentLanguage + "&contentTypo3Charset=" + encodeURIComponent(this.editorConfiguration.typo3ContentCharset) + (parameters?parameters:''));
        },
        
        /**
index 89791ea..5b0f149 100644 (file)
@@ -19,6 +19,7 @@
                        <label index="hilitecolor">Background Color</label>
                        <label index="inserthorizontalrule">Horizontal Rule</label>
                        <label index="createlink">Insert Web Link</label>
+                       <label index="unlink">Remove link</label>
                        <label index="insertimage">Insert/Modify Image</label>
                        <label index="inserttable">Insert Table</label>
                        <label index="htmlmode">Toggle HTML Source</label>
index 3c4f282..0a76197 100644 (file)
@@ -78,7 +78,7 @@ ContextMenu.tableOperationsHandler = function(editor,tbo,opcode) {
 
 ContextMenu.imageHandler = function(editor, currentTarget) {
        return (function() {
-               var obj = editor._toolbarObjects["InsertImage"];
+               var obj = editor._toolbarObjects.InsertImage;
                obj.cmd(editor, obj.name, currentTarget);
                if (HTMLArea.is_opera) {
                        editor._iframe.focus();
@@ -89,12 +89,13 @@ ContextMenu.imageHandler = function(editor, currentTarget) {
        });
 };
 
-ContextMenu.linkHandler = function(editor,link,opcode) {
+ContextMenu.linkHandler = function(editor, link, opcode) {
        switch (opcode) {
                case "MakeLink":
                case "ModifyLink":
                        return (function() {
-                               editor.execCommand("CreateLink", true);
+                               var obj = editor._toolbarObjects.CreateLink;
+                               obj.cmd(editor, "CreateLink", link);
                        });
                case "CheckLink":
                        return (function() {
@@ -104,12 +105,8 @@ ContextMenu.linkHandler = function(editor,link,opcode) {
                        return (function() {
                                if (confirm(ContextMenu.I18N["Please confirm unlink"] + "\n" +
                                        ContextMenu.I18N["Link points to:"] + " " + link.href)) {
-                                               if(typeof(editor.plugins["TYPO3Browsers"]) != "undefined") {
-                                                       editor.renderPopup_unLink();
-                                               } else {
-                                                       while(link.firstChild) link.parentNode.insertBefore(link.firstChild, link);
-                                                       link.parentNode.removeChild(link);
-                                               }
+                                               var obj = editor._toolbarObjects.CreateLink;
+                                               obj.cmd(editor, "UnLink", link);
                                }
                        });
        }
diff --git a/typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultLink/default-link.js b/typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultLink/default-link.js
new file mode 100644 (file)
index 0000000..a5c74f9
--- /dev/null
@@ -0,0 +1,209 @@
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2008 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This script is a modified version of a script published under the htmlArea License.
+*  A copy of the htmlArea License may be found in the textfile HTMLAREA_LICENSE.txt.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+/*
+ * Default Link Plugin for TYPO3 htmlArea RTE
+ *
+ * TYPO3 SVN ID: $Id$
+ */
+DefaultLink = HTMLArea.Plugin.extend({
+       
+       constructor : function(editor, pluginName) {
+               this.base(editor, pluginName);
+       },
+       
+       /*
+        * This function gets called by the class constructor
+        */
+       configurePlugin : function(editor) {
+               
+               this.baseURL = this.editorConfiguration.baseURL;
+               this.pageTSConfiguration = this.editorConfiguration.buttons.link;
+               this.stripBaseUrl = this.pageTSConfiguration && this.pageTSConfiguration.stripBaseUrl && this.pageTSConfiguration.stripBaseUrl;
+               this.showTarget = !(this.pageTSConfiguration && this.pageTSConfiguration.targetSelector && this.pageTSConfiguration.targetSelector.disabled);
+               
+               /*
+                * Registering plugin "About" information
+                */
+               var pluginInformation = {
+                       version         : "1.0",
+                       developer       : "Stanislas Rolland",
+                       developerUrl    : "http://www.fructifor.ca/",
+                       copyrightOwner  : "Stanislas Rolland",
+                       sponsor         : "Fructifor Inc.",
+                       sponsorUrl      : "http://www.fructifor.ca/",
+                       license         : "GPL"
+               };
+               this.registerPluginInformation(pluginInformation);
+               
+               /*
+                * Registering the button
+                */
+               var buttonId = "CreateLink";
+               var buttonConfiguration = {
+                       id              : buttonId,
+                       tooltip         : this.localize("createlink"),
+                       action          : "onButtonPress",
+                       context         : "a",
+                       selection       : true,
+                       dialog          : true
+               };
+               this.registerButton(buttonConfiguration);
+               
+               return true;
+        },
+        
+       /*
+        * This function gets called when the button was pressed.
+        *
+        * @param       object          editor: the editor instance
+        * @param       string          id: the button id or the key
+        * @param       object          target: the target element of the contextmenu event, when invoked from the context menu
+        *
+        * @return      boolean         false if action is completed
+        */
+       onButtonPress : function(editor, id, target) {
+               
+                       // Could be a button or its hotkey
+               var buttonId = this.translateHotKey(id);
+               buttonId = buttonId ? buttonId : id;
+               
+               if (buttonId === "UnLink") {
+                       this.unLink();
+                       return false;
+               }
+               
+               var paramameters = null;
+               this.editor.focusEditor();
+               var link = this.editor.getParentElement();
+               var el = HTMLArea.getElementObject(link, "a");
+               if (el != null && /^a$/i.test(el.nodeName)) link = el;
+               if (!link || !/^a$/i.test(link.nodeName)) {
+                       link = null;
+                       var selection = this.editor._getSelection();
+                       if (this.editor._selectionEmpty(selection)) {
+                               alert(this.localize("Select some text"));
+                               return;
+                       }
+                       paramameters = {
+                               f_href : "",
+                               f_title : "",
+                               f_target : ""
+                       };
+               } else {
+                       paramameters = {
+                               f_href   : (HTMLArea.is_ie && this.stripBaseUrl) ? this.stripBaseURL(link.href) : link.getAttribute("href"),
+                               f_title  : link.title,
+                               f_target : link.target
+                       };
+               }
+               
+               this.link = link;
+               this.dialog = this.openDialog("CreateLink", this.makeUrlFromPopupName("link"), "createLink", paramameters, {width:450, height:145});
+               return false;
+       },
+       
+       /*
+        * Create the link
+        *
+        * @param       object          param: the returned values
+        *
+        * @return      boolean         false
+        */
+       createLink : function(param) {
+               if (typeof(param) != "undefined" && typeof(param.f_href) != "undefined") {
+                       var a = this.link;
+                       if(!a) {
+                               this.editor._doc.execCommand("CreateLink", false, param.f_href);
+                               a = this.editor.getParentElement();
+                               if (HTMLArea.is_gecko && !/^a$/i.test(a.nodeName)) {
+                                       var selection = this.editor._getSelection();
+                                       var range = this.editor._createRange(selection);
+                                       try {
+                                               a = range.startContainer.childNodes[range.startOffset];
+                                       } catch(e) {}
+                               }
+                       } else {
+                               var href = param.f_href.trim();
+                               this.editor.selectNodeContents(a);
+                               if (href == "") {
+                                       this.editor._doc.execCommand("Unlink", false, null);
+                                       this.dialog.close();
+                                       return false;
+                               } else {
+                                       a.href = href;
+                               }
+                       }
+                       if (!(a && /^a$/i.test(a.nodeName))) {
+                               this.dialog.close();
+                               return false;
+                       }
+                       if (typeof(param.f_target) != "undefined") a.target = param.f_target.trim();
+                       if (typeof(param.f_title) != "undefined") a.title = param.f_title.trim();
+                       this.editor.selectNodeContents(a);
+                       this.dialog.close();
+               }
+               return false;
+       },
+       
+       /*
+        * Unlink the selection.
+        *
+        * @param       object          link: the link element to unlink
+        *
+        * @return      boolean         false
+        */
+       unLink : function () {
+               this.editor.focusEditor();
+               var node = this.editor.getParentElement();
+               var el = HTMLArea.getElementObject(node, "a");
+               if (el != null && /^a$/i.test(el.nodeName)) node = el;
+               if (node != null && /^a$/i.test(node.nodeName)) this.editor.selectNode(node);
+               this.editor._doc.execCommand("Unlink", false, "");
+       },
+       
+       /*
+        * IE makes relative links absolute. This function reverts this conversion.
+        *
+        * @param       string          url: the url
+        *
+        * @return      string          the url stripped out of the baseurl
+        */
+       stripBaseURL : function(url) {
+               var baseurl = this.baseURL;
+                       // strip to last directory in case baseurl points to a file
+               baseurl = baseurl.replace(/[^\/]+$/, '');
+               var basere = new RegExp(baseurl);
+               url = url.replace(basere, "");
+                       // strip host-part of URL which is added by MSIE to links relative to server root
+               baseurl = baseurl.replace(/^(https?:\/\/[^\/]+)(.*)$/, '$1');
+               basere = new RegExp(baseurl);
+               return url.replace(basere, "");
+       }
+});
+
diff --git a/typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultLink/locallang.xml b/typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultLink/locallang.xml
new file mode 100644 (file)
index 0000000..d9c4116
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<!-- TYPO3 SVN ID: $Id$ -->
+<T3locallang>
+       <meta type="array">
+               <description>Labels for Default Link plugin of htmlArea RTE</description>
+               <type>module</type>
+       </meta>
+       <data type="array">
+               <languageKey index="default" type="array">
+                       <label index="Select some text">You need to select some text before creating a link</label>
+               </languageKey>
+       </data>
+       <orig_hash type="array">
+               <languageKey index="default" type="array">
+               </languageKey>
+       </orig_hash>
+       <orig_text type="array">
+               <languageKey index="default" type="array">
+               </languageKey>
+       </orig_text>
+</T3locallang>
\ No newline at end of file
diff --git a/typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultLink/popups/link.html b/typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultLink/popups/link.html
new file mode 100644 (file)
index 0000000..a8848a5
--- /dev/null
@@ -0,0 +1,147 @@
+<!--
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2002-2004, interactivetools.com, inc.
+*  (c) 2003-2004 dynarch.com
+*  (c) 2004-2008 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This script is a modified version of a script published under the htmlArea License.
+*  A copy of the htmlArea License may be found in the textfile HTMLAREA_LICENSE.txt.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+/*
+ * Insert Link window for TYPO3 htmlArea RTE
+ *
+ * TYPO3 SVN ID: $Id$
+ */
+--> 
+<html class="popupwin">
+<head>
+       <title>Insert Image</title>
+       <meta http-equiv="Content-Style-Type" content="text/css" />
+       <script type="text/javascript">
+               /*<![CDATA[*/
+               <!--
+               var dialog = window.opener.HTMLArea.Dialog.DefaultLink;
+
+               function onTargetChanged() {
+                       var f = document.getElementById("f_other_target");
+                       if (this.value == "_other") {
+                               f.style.visibility = "visible";
+                               f.select();
+                               f.focus();
+                       } else {
+                               f.style.visibility = "hidden";
+                       }
+               };
+
+               function Init() {
+                       dialog.initialize(false, true);
+                       var param = dialog.arguments;
+                       var target_select = document.getElementById("f_target");
+                       if (param) {
+                               document.getElementById("f_href").value = param["f_href"];
+                               document.getElementById("f_title").value = param["f_title"];
+                               if (dialog.plugin.showTarget) {
+                                       HTMLArea.selectValue(target_select, param["f_target"]);
+                                       if (target_select.value != param.f_target) {
+                                               var opt = document.createElement("option");
+                                               opt.value = param.f_target;
+                                               opt.innerHTML = opt.value;
+                                               target_select.appendChild(opt);
+                                               opt.selected = true;
+                                       }
+                                       var opt = document.createElement("option");
+                                       opt.value = "_other";
+                                       opt.innerHTML = dialog.plugin.localize("target_other");
+                                       target_select.appendChild(opt);
+                                       target_select.onchange = onTargetChanged;
+                               } else {
+                                       document.getElementById("target").style.display = "none";
+                               }
+                       }
+                       document.getElementById("f_href").focus();
+                       document.getElementById("f_href").select();
+                       dialog.resize();
+                       return false;
+               };
+               
+               function onOK() {
+                       var required = { "f_href" : "link_url_required" };
+                       for (var i in required) {
+                               var el = document.getElementById(i);
+                               if (!el.value) {
+                                       alert(dialog.plugin.localize(required[i]));
+                                       el.focus();
+                                       return false;
+                               }
+                       }
+                       // pass data back to the calling window
+                       var fields = ["f_href", "f_title", "f_target" ];
+                       var param = new Object();
+                       for (var i in fields) {
+                               var id = fields[i];
+                               var el = document.getElementById(id);
+                               param[id] = el.value;
+                       }
+                       if (param.f_target == "_other") param.f_target = document.getElementById("f_other_target").value;
+                       dialog.performAction(param);
+                       return false;
+               };
+               
+               function onCancel() {
+                       dialog.close();
+                       return false;
+               };
+               // -->
+               /*]]>*/
+       </script>
+</head>
+<body class="popupwin" onload="Init()">
+<div id="content">
+<div class="title">Insert/Modify Link</div>
+<form action="" method="get">
+       <label for="f_href" class="field">URL:</label>
+       <input type="text" id="f_href" size="65" title="link_href_tooltip" />
+       <div class="space"></div>
+       <label for="f_title" class="field">Title (tooltip):</label>
+       <input type="text" id="f_title" size="65" title="link_title_tooltip" />
+       <div class="space"></div>
+       <div id="target">
+               <label for="f_target" class="field">Target:</label>
+               <select id="f_target" title="link_target_tooltip">
+                       <option value="">target_none</option>
+                       <option value="_blank">target_blank</option>
+                       <option value="_self">target_self</option>
+                       <option value="_top">target_top</option>
+               </select>
+               <input type="text" name="f_other_target" id="f_other_target" size="10" style="visibility: hidden" />
+       </div>
+       <div class="buttons">
+               <button type="button" name="ok" onclick="return onOK();">OK</button>
+               <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+       </div>
+</form>
+</div>
+</body>
+</html>
diff --git a/typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/locallang.xml b/typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/locallang.xml
new file mode 100644 (file)
index 0000000..75178ec
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<!-- TYPO3 SVN ID: $Id$ -->
+<T3locallang>
+       <meta type="array">
+               <description>Labels for TYPO3 Link plugin of htmlArea RTE</description>
+               <type>module</type>
+       </meta>
+       <data type="array">
+               <languageKey index="default" type="array">
+               </languageKey>
+       </data>
+       <orig_hash type="array">
+               <languageKey index="default" type="array">
+               </languageKey>
+       </orig_hash>
+       <orig_text type="array">
+               <languageKey index="default" type="array">
+               </languageKey>
+       </orig_text>
+</T3locallang>
\ No newline at end of file
diff --git a/typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js b/typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js
new file mode 100644 (file)
index 0000000..54ad27d
--- /dev/null
@@ -0,0 +1,319 @@
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2005-2008 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+/*
+ * TYPO3Link plugin for htmlArea RTE
+ *
+ * TYPO3 SVN ID: $Id$
+ */
+TYPO3Link = HTMLArea.Plugin.extend({
+       
+       constructor : function(editor, pluginName) {
+               this.base(editor, pluginName);
+       },
+       
+       /*
+        * This function gets called by the class constructor
+        */
+       configurePlugin : function(editor) {
+               
+               this.pageTSConfiguration = this.editorConfiguration.buttons.link;
+               this.modulePath = this.pageTSConfiguration.pathLinkModule;
+               this.classesAnchorUrl = this.pageTSConfiguration.classesAnchorUrl;
+               
+               /*
+                * Registering plugin "About" information
+                */
+               var pluginInformation = {
+                       version         : "1.0",
+                       developer       : "Stanislas Rolland",
+                       developerUrl    : "http://www.fructifor.ca/",
+                       copyrightOwner  : "Stanislas Rolland",
+                       sponsor         : "Fructifor Inc.",
+                       sponsorUrl      : "http://www.fructifor.ca/",
+                       license         : "GPL"
+               };
+               this.registerPluginInformation(pluginInformation);
+               
+               /*
+                * Registering the buttons
+                */
+               var buttonList = this.buttonList;
+               for (var i = 0; i < buttonList.length; ++i) {
+                       var button = buttonList[i];
+                       buttonId = button[0];
+                       var buttonConfiguration = {
+                               id              : buttonId,
+                               tooltip         : this.localize(buttonId.toLowerCase()),
+                               action          : "onButtonPress",
+                               context         : button[1],
+                               selection       : button[2],
+                               dialog          : button[3]
+                       };
+                       this.registerButton(buttonConfiguration);
+               }
+               
+               return true;
+        },
+        
+       /*
+        * The list of buttons added by this plugin
+        */
+       buttonList : [
+               ["CreateLink", "a", true, true],
+               ["UnLink", "a", false, false]
+       ],
+        
+       /*
+        * This function gets called when the button was pressed
+        *
+        * @param       object          editor: the editor instance
+        * @param       string          id: the button id or the key
+        * @param       object          target: the target element of the contextmenu event, when invoked from the context menu
+        *
+        * @return      boolean         false if action is completed
+        */
+       onButtonPress : function(editor, id, target) {
+                       // Could be a button or its hotkey
+               var buttonId = this.translateHotKey(id);
+               buttonId = buttonId ? buttonId : id;
+               
+                       // Download the definition of special anchor classes if not yet done
+               if (this.classesAnchorUrl && (typeof(HTMLArea.classesAnchorSetup) === "undefined")) {
+                       this.getJavascriptFile(this.classesAnchorUrl);
+               }
+               
+               if (buttonId === "UnLink") {
+                       this.unLink();
+                       return false;
+               }
+               
+               var additionalParameter;
+               var node = this.editor.getParentElement();
+               var el = HTMLArea.getElementObject(node, "a");
+               if (el != null && /^a$/i.test(el.nodeName)) node = el;
+               if (node != null && /^a$/i.test(node.nodeName)) {
+                       additionalParameter = "&curUrl[href]=" + encodeURIComponent(node.getAttribute("href"));
+                       if (node.target) additionalParameter += "&curUrl[target]=" + encodeURIComponent(node.target);
+                       if (node.className) additionalParameter += "&curUrl[class]=" + encodeURIComponent(node.className);
+                       if (node.title) additionalParameter += "&curUrl[title]=" + encodeURIComponent(node.title);
+               } else if (this.editor.hasSelectedText()) {
+                       var text = this.editor.getSelectedHTML();
+                       if (text && text != null) {
+                               var offset = text.toLowerCase().indexOf("<a");
+                               if (offset!=-1) {
+                                       var ATagContent = text.substring(offset+2);
+                                       offset = ATagContent.toUpperCase().indexOf(">");
+                                       ATagContent = ATagContent.substring(0,offset);
+                                       additionalParameter = "&curUrl[all]=" + encodeURIComponent(ATagContent);
+                               }
+                       }
+               }
+               this.dialog = this.openDialog("CreateLink", this.makeUrlFromModulePath(this.modulePath, additionalParameter), null, null, {width:550, height:350}, "yes");
+               return false;
+       },
+       
+       /*
+        * Add a link to the selection.
+        * This function is called from the TYPO3 link popup.
+        */
+       createLink : function(theLink,cur_target,cur_class,cur_title) {
+               var selection, range, anchorClass, imageNode = null, addIconAfterLink;
+               this.editor.focusEditor();
+               var node = this.editor.getParentElement();
+               var el = HTMLArea.getElementObject(node, "a");
+               if (el != null && /^a$/i.test(el.nodeName)) node = el;
+               if (node != null && /^a$/i.test(node.nodeName)) this.editor.selectNode(node);
+                       // Clean images from existing anchors otherwise Mozilla may create nested anchors
+               if (HTMLArea.classesAnchorSetup) {
+                       selection = this.editor._getSelection();
+                       range = this.editor._createRange(selection);
+                       this.cleanAllLinks(node, range, true);
+               }
+               
+               this.editor._doc.execCommand("CreateLink", false, theLink);
+               
+               selection = this.editor._getSelection();
+               range = this.editor._createRange(selection);
+               node = this.editor.getParentElement();
+               el = HTMLArea.getElementObject(node, "a");
+               if (el != null && /^a$/i.test(el.nodeName)) node = el;
+               if (node) {
+                       if (HTMLArea.classesAnchorSetup && cur_class) {
+                               for (var i = HTMLArea.classesAnchorSetup.length; --i >= 0;) {
+                                       anchorClass = HTMLArea.classesAnchorSetup[i];
+                                       if (anchorClass.name == cur_class && anchorClass.image) {
+                                               imageNode = this.editor._doc.createElement("img");
+                                               imageNode.src = anchorClass.image;
+                                               imageNode.alt = anchorClass.altText;
+                                               addIconAfterLink = anchorClass.addIconAfterLink;
+                                               break;
+                                       }
+                               }
+                       }
+                               // We may have created multiple links in as many blocks
+                       this.setLinkAttributes(node, range, cur_target, cur_class, cur_title, imageNode, addIconAfterLink);
+               }
+               this.dialog.close();
+       },
+       
+       /*
+       * Unlink the selection.
+       * This function is called from the TYPO3 link popup and from the context menu.
+       */
+       unLink : function() {
+               this.editor.focusEditor();
+               var node = this.editor.getParentElement();
+               var el = HTMLArea.getElementObject(node, "a");
+               if (el != null && /^a$/i.test(el.nodeName)) node = el;
+               if (node != null && /^a$/i.test(node.nodeName)) this.editor.selectNode(node);
+               if (HTMLArea.classesAnchorSetup) {
+                       var selection = this.editor._getSelection();
+                       var range = this.editor._createRange(selection);
+                       if (HTMLArea.is_gecko) {
+                               this.cleanAllLinks(node, range, false);
+                       } else {
+                               this.cleanAllLinks(node, range, true);
+                               this.editor._doc.execCommand("Unlink", false, "");
+                       }
+               } else {
+                       this.editor._doc.execCommand("Unlink", false, "");
+               }
+               if (this.dialog) {
+                       this.dialog.close();
+               }
+       },
+       
+       /*
+       * Set attributes of anchors intersecting a range in the given node
+       */
+       setLinkAttributes : function(node, range, cur_target, cur_class, cur_title, imageNode, addIconAfterLink) {
+               if (/^a$/i.test(node.nodeName)) {
+                       var nodeInRange = false;
+                       if (HTMLArea.is_gecko) {
+                               nodeInRange = this.editor.rangeIntersectsNode(range, node);
+                       } else {
+                               if (this.editor._getSelection().type.toLowerCase() == "control") {
+                                               // we assume an image is selected
+                                       nodeInRange = true;
+                               } else {
+                                       var nodeRange = this.editor._doc.body.createTextRange();
+                                       nodeRange.moveToElementText(node);
+                                       nodeInRange = range.inRange(nodeRange) || (range.compareEndPoints("StartToStart", nodeRange) == 0) || (range.compareEndPoints("EndToEnd", nodeRange) == 0);
+                               }
+                       }
+                       if (nodeInRange) {
+                               if (imageNode != null) {
+                                       if (addIconAfterLink) {
+                                               node.appendChild(imageNode.cloneNode(false));
+                                       } else {
+                                               node.insertBefore(imageNode.cloneNode(false), node.firstChild);
+                                       }
+                               }
+                               if (cur_target.trim()) node.target = cur_target.trim();
+                                       else node.removeAttribute("target");
+                               if (cur_class.trim()) {
+                                       node.className = cur_class.trim();
+                               } else { 
+                                       if (HTMLArea.is_gecko) {
+                                               node.removeAttribute('class');
+                                       } else {
+                                               node.removeAttribute('className');
+                                       }
+                               }
+                               if (cur_title.trim()) {
+                                       node.title = cur_title.trim();
+                               } else {
+                                       node.removeAttribute("title");
+                                       node.removeAttribute("rtekeep");
+                               }
+                       }
+               } else {
+                       for (var i = node.firstChild;i;i = i.nextSibling) {
+                               if (i.nodeType == 1 || i.nodeType == 11) {
+                                       this.setLinkAttributes(i, range, cur_target, cur_class, cur_title, imageNode, addIconAfterLink);
+                               }
+                       }
+               }
+       },
+       
+       /*
+        * Clean up images in special anchor classes
+        */
+       cleanClassesAnchorImages : function(node) {
+               var nodeArray = [], splitArray1 = [], splitArray2 = [];
+               for (var childNode = node.firstChild; childNode; childNode = childNode.nextSibling) {
+                       if (/^img$/i.test(childNode.nodeName)) {
+                               splitArray1 = childNode.src.split("/");
+                               for (var i = HTMLArea.classesAnchorSetup.length; --i >= 0;) {
+                                       if (HTMLArea.classesAnchorSetup[i]["image"]) {
+                                               splitArray2 = HTMLArea.classesAnchorSetup[i]["image"].split("/");
+                                               if (splitArray1[splitArray1.length-1] == splitArray2[splitArray2.length-1]) {
+                                                       nodeArray.push(childNode);
+                                                       break;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               for (i = nodeArray.length; --i >= 0;) {
+                       node.removeChild(nodeArray[i]);
+               }
+       },
+       
+       /*
+        * Clean up all anchors intesecting with the range in the given node
+        */
+       cleanAllLinks : function(node, range, keepLinks) {
+               if (/^a$/i.test(node.nodeName)) {
+                       var intersection = false;
+                       if (HTMLArea.is_gecko) {
+                               intersection = this.editor.rangeIntersectsNode(range, node);
+                       } else {
+                               if (this.editor._getSelection().type.toLowerCase() == "control") {
+                                               // we assume an image is selected
+                                       intersection = true;
+                               } else {
+                                       var nodeRange = this.editor._doc.body.createTextRange();
+                                       nodeRange.moveToElementText(node);
+                                       intersection = range.inRange(nodeRange) || ((range.compareEndPoints("StartToStart", nodeRange) > 0) && (range.compareEndPoints("StartToEnd", nodeRange) < 0)) || ((range.compareEndPoints("EndToStart", nodeRange) > 0) && (range.compareEndPoints("EndToEnd", nodeRange) < 0));
+                               }
+                       }
+                       if (intersection) {
+                               this.cleanClassesAnchorImages(node);
+                               if (!keepLinks) {
+                                       while(node.firstChild) node.parentNode.insertBefore(node.firstChild, node);
+                                       node.parentNode.removeChild(node);
+                               }
+                       }
+               } else {
+                       for (var i = node.firstChild;i;i = i.nextSibling) {
+                               if (i.nodeType == 1 || i.nodeType == 11) this.cleanAllLinks(i, range, keepLinks);
+                       }
+               }
+       }
+});
+
index 9d7adad..725df5a 100644 (file)
 /* Selectors for the Table Operations plugin */
 /* Make borders visible */
 /* Make sure we can click in empty cells without too much difficulty */
-.htmlarea-showtableborders, .htmlarea-showtableborders td, .htmlarea-showtableborders th {
+body.htmlarea-content-body .htmlarea-showtableborders, body.htmlarea-content-body .htmlarea-showtableborders td, body.htmlarea-content-body .htmlarea-showtableborders th {
        padding: 3px; border:1px dashed #316ac5 ! important;
 }
 
 /* Selectors for the Abbreviation plugin */
-abbr, acronym {
+body.htmlarea-content-body abbr, body.htmlarea-content-body acronym {
        border-bottom:1px dashed #000;
        cursor:help;
 }
\ No newline at end of file
index c420b90..d6c7d39 100644 (file)
 .htmlarea .toolbar .InsertCharacter {background-image:url("images/CharacterMap/ed_charmap.gif");}
 .htmlarea .toolbar .InsertHorizontalRule {background-image:url("images/ed_hr.gif");}
 .htmlarea .toolbar .CreateLink, .htmlarea-context-menu .CreateLink {background-image:url("images/ed_link.gif");}
-.htmlarea-context-menu .UnLink {background-image:url("images/ed_unlink.gif");}
+.htmlarea .toolbar .UnLink, .htmlarea-context-menu .UnLink {background-image:url("images/ed_unlink.gif");}
 .htmlarea .toolbar .InsertImage, .htmlarea-context-menu .InsertImage {background-image:url("images/ed_image.gif");}
-.htmlarea .toolbar .CreateLink-TYPO3Browsers, .htmlarea-context-menu .CreateLink-TYPO3Browsers {background-image:url("images/TYPO3Browsers/ed_link.gif");}
-.htmlarea-context-menu .UnLink-TYPO3Browsers {background-image:url("images/TYPO3Browsers/ed_unlink.gif");}
-.htmlarea .toolbar .InsertImage-TYPO3Browsers, .htmlarea-context-menu .InsertImage-TYPO3Browsers {background-image:url("images/TYPO3Browsers/ed_image.gif");}
 .htmlarea .toolbar .InsertTable {background-image:url("images/insert_table.gif");}
 .htmlarea .toolbar .UserElements {background-image:url("images/UserElements/ed_user.gif");}
 .htmlarea .toolbar .FindReplace {background-image:url("images/FindReplace/ed_find.gif");}
index b54f7fc..a1ae562 100644 (file)
Binary files a/typo3/sysext/rtehtmlarea/htmlarea/skins/default/images/ed_link.gif and b/typo3/sysext/rtehtmlarea/htmlarea/skins/default/images/ed_link.gif differ
index 1a4c3dc..26f7f4f 100644 (file)
Binary files a/typo3/sysext/rtehtmlarea/htmlarea/skins/default/images/ed_unlink.gif and b/typo3/sysext/rtehtmlarea/htmlarea/skins/default/images/ed_unlink.gif differ
index 8d34dd9..ee42e89 100644 (file)
@@ -56,6 +56,7 @@ $LANG->includeLLFile('EXT:rtehtmlarea/htmlarea/locallang_dialogs.xml');
  */
 class tx_rtehtmlarea_SC_browse_links {
        var $mode;
+       var $button = 'link';
        
        /**
         * Main function, detecting the current mode of the element browser and branching out to internal methods.
index 318f94a..11ca93e 100644 (file)
@@ -3,7 +3,7 @@
 *  Copyright notice
 *
 *  (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)
-*  (c) 2005-2006 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+*  (c) 2005-2008 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -209,6 +209,11 @@ class tx_rtehtmlarea_browse_links extends browse_links {
 
        var $editorNo;
        var $buttonConfig = array();
+       
+       private $classesAnchorDefault = array();
+       private $classesAnchorDefaultTitle = array();
+       private $classesAnchorJSOptions = array();
+       public $allowedItems;
 
        /**
         * Constructor:
@@ -217,7 +222,7 @@ class tx_rtehtmlarea_browse_links extends browse_links {
         * @return      void
         */
        function init() {
-               global $BE_USER,$BACK_PATH,$LANG;
+               global $BE_USER,$BACK_PATH,$LANG,$TYPO3_CONF_VARS;
 
                        // Main GPvars:
                $this->pointer = t3lib_div::_GP('pointer');
@@ -227,8 +232,8 @@ class tx_rtehtmlarea_browse_links extends browse_links {
                $this->expandPage = t3lib_div::_GP('expandPage');
                $this->expandFolder = t3lib_div::_GP('expandFolder');
                $this->PM = t3lib_div::_GP('PM');
-               $this->contentTypo3Language = t3lib_div::_GP('typo3ContentLanguage');
-               $this->contentTypo3Charset = t3lib_div::_GP('typo3ContentCharset');
+               $this->contentTypo3Language = t3lib_div::_GP('contentTypo3Language');
+               $this->contentTypo3Charset = t3lib_div::_GP('contentTypo3Charset');
                $this->editorNo = t3lib_div::_GP('editorNo');
 
                        // Find "mode"
@@ -239,14 +244,14 @@ class tx_rtehtmlarea_browse_links extends browse_links {
 
                        // init hook objects:
                $this->hookObjects = array();
-               if(is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'])) {
-                       foreach($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'] as $classData) {
+               if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'])) {
+                       foreach($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'] as $classData) {
                                $processObject = &t3lib_div::getUserObj($classData);
 
                                if(!($processObject instanceof t3lib_browseLinksHook)) {
                                        throw new UnexpectedValueException('$processObject must implement interface t3lib_browseLinksHook', 1195115652);
                                }
-
+                               
                                $parameters = array();
                                $processObject->init($this, $parameters);
                                $this->hookObjects[] = $processObject;
@@ -295,44 +300,33 @@ class tx_rtehtmlarea_browse_links extends browse_links {
                        if (is_array($this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['link.'])) {
                                $this->buttonConfig = $this->thisConfig['buttons.']['link.'];
                        }
-                       if($this->thisConfig['classesAnchor']) {
+                       if ($this->thisConfig['classesAnchor'] || $this->thisConfig['classesLinks']) {
                                $this->setClass = $this->curUrlArray['class'];
-                               $classesAnchorArray = t3lib_div::trimExplode(',',$this->thisConfig['classesAnchor'],1);
+                               if ($this->thisConfig['classesAnchor']) {
+                                       $classesAnchorArray = t3lib_div::trimExplode(',',$this->thisConfig['classesAnchor'], 1);
+                               } else {
+                                       $classesAnchorArray = t3lib_div::trimExplode(',',$this->thisConfig['classesLinks'], 1);
+                               }
                                $anchorTypes = array( 'page', 'url', 'file', 'mail', 'spec');
                                $classesAnchor = array();
-                               $classesAnchorDefault = array();
-                               $this->classesAnchorDefaultTitle = array();
                                $classesAnchor['all'] = array();
                                if (is_array($RTEsetup['properties']['classesAnchor.'])) {
                                        reset($RTEsetup['properties']['classesAnchor.']);
                                        while(list($label,$conf)=each($RTEsetup['properties']['classesAnchor.'])) {
-                                               $classesAnchor['all'][] = $conf['class'];
-                                               if (in_array($conf['type'], $anchorTypes)) {
-                                                       $classesAnchor[$conf['type']][] = $conf['class'];
-                                                       if (is_array($this->thisConfig['classesAnchor.']) && is_array($this->thisConfig['classesAnchor.']['default.']) && $this->thisConfig['classesAnchor.']['default.'][$conf['type']] == $conf['class']) {
-                                                               $classesAnchorDefault[$conf['type']] = $conf['class'];
-                                                               if ($conf['titleText']) {
-                                                                       $string = trim($conf['titleText']);
-                                                                       if (substr($string,0,4)=='LLL:') {       // language file
-                                                                               $arr = explode(':',$string);
-                                                                               if($arr[0] == 'LLL' && $arr[1] == 'EXT') {
-                                                                                       $BE_lang = $LANG->lang;
-                                                                                       $BE_origCharset = $LANG->origCharSet;
-                                                                                       $LANG->lang = $this->contentTypo3Language;
-                                                                                       $LANG->origCharSet = $LANG->csConvObj->charSetArray[$this->contentTypo3Language];
-                                                                                       $LANG->origCharSet = $LANG->origCharSet ? $LANG->origCharSet : 'iso-8859-1';
-                                                                                       $string = $LANG->getLLL($arr[3], $LANG->readLLfile($arr[1].':'.$arr[2]), true);
-                                                                                       $LANG->lang = $BE_lang;
-                                                                                       $LANG->origCharSet = $BE_origCharset;
-                                                                               }
+                                               if (in_array($conf['class'], $classesAnchorArray)) {
+                                                       $classesAnchor['all'][] = $conf['class'];
+                                                       if (in_array($conf['type'], $anchorTypes)) {
+                                                               $classesAnchor[$conf['type']][] = $conf['class'];
+                                                               if (is_array($this->thisConfig['classesAnchor.']) && is_array($this->thisConfig['classesAnchor.']['default.']) && $this->thisConfig['classesAnchor.']['default.'][$conf['type']] == $conf['class']) {
+                                                                       $this->classesAnchorDefault[$conf['type']] = $conf['class'];
+                                                                       if ($conf['titleText']) {
+                                                                               $this->classesAnchorDefaultTitle[$conf['type']] = $this->getLLContent(trim($conf['titleText']));
                                                                        }
-                                                                       $this->classesAnchorDefaultTitle[$conf['type']] = $string;
                                                                }
                                                        }
                                                }
                                        }
                                }
-                               $this->classesAnchorJSOptions = array();
                                reset($anchorTypes);
                                while (list(, $anchorType) = each($anchorTypes) ) {
                                        reset($classesAnchorArray);
@@ -340,7 +334,7 @@ class tx_rtehtmlarea_browse_links extends browse_links {
                                                if (!in_array($class, $classesAnchor['all']) || (in_array($class, $classesAnchor['all']) && is_array($classesAnchor[$anchorType]) && in_array($class, $classesAnchor[$anchorType]))) {
                                                        $selected = '';
                                                        if ($this->setClass == $class) $selected = 'selected="selected"';
-                                                       if (!$this->setClass && $classesAnchorDefault[$anchorType] == $class) {
+                                                       if (!$this->setClass && $this->classesAnchorDefault[$anchorType] == $class) {
                                                                $selected = 'selected="selected"';
                                                        }
                                                        $this->classesAnchorJSOptions[$anchorType] .= '<option ' . $selected . ' value="' .$class . '">' . $class . '</option>';
@@ -348,7 +342,7 @@ class tx_rtehtmlarea_browse_links extends browse_links {
                                        }
                                        if ($this->classesAnchorJSOptions[$anchorType]) {
                                                $selected = '';
-                                               if (!$this->setClass && !$classesAnchorDefault[$anchorType])  $selected = 'selected="selected"';
+                                               if (!$this->setClass && !$this->classesAnchorDefault[$anchorType])  $selected = 'selected="selected"';
                                                $this->classesAnchorJSOptions[$anchorType] =  '<option ' . $selected . ' value=""></option>' . $this->classesAnchorJSOptions[$anchorType];
                                        }
                                }
@@ -363,15 +357,19 @@ class tx_rtehtmlarea_browse_links extends browse_links {
 
                        // Creating backend template object:
                $this->doc = t3lib_div::makeInstance('template');
+               //$this->doc->bodyTagAdditions = 'onLoad="initDialog();"';
                $this->doc->docType= 'xhtml_trans';
                $this->doc->backPath = $BACK_PATH;
 
                        // BEGIN accumulation of header JavaScript:
                $JScode = '';
                $JScode.= '
-                       if (window.opener) {
-                               var editor = window.opener.RTEarea[' . $this->editorNo . ']["editor"];
-                               var HTMLArea = window.opener.HTMLArea;
+                       var dialog = window.opener.HTMLArea.Dialog.TYPO3Link;
+                       var plugin = dialog.plugin;
+                       var HTMLArea = window.opener.HTMLArea;
+                       
+                       function initDialog() {
+                               dialog.initialize("noLocalize", "noResize");
                        }
                                // This JavaScript is primarily for RTE/Link. jumpToUrl is used in the other cases as well...
                        var add_href="'.($this->curUrlArray['href']?'&curUrl[href]='.rawurlencode($this->curUrlArray['href']):'').'";
@@ -461,27 +459,27 @@ class tx_rtehtmlarea_browse_links extends browse_links {
                                        var theLink = \''.$this->siteURL.'?id=\'+id+(anchor?anchor:"");
                                        if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
                                        if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
-                                       editor.renderPopup_addLink(theLink,cur_target,cur_class,cur_title);
+                                       plugin.createLink(theLink,cur_target,cur_class,cur_title);
                                        return false;
                                }
                                function link_folder(folder)    {       //
                                        var theLink = \''.$this->siteURL.'\'+folder;
                                        if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
                                        if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
-                                       editor.renderPopup_addLink(theLink,cur_target,cur_class,cur_title);
+                                       plugin.createLink(theLink,cur_target,cur_class,cur_title);
                                        return false;
                                }
                                function link_spec(theLink)     {       //
                                        if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
                                        if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
-                                       editor.renderPopup_addLink(theLink,cur_target,cur_class,cur_title);
+                                       plugin.createLink(theLink,cur_target,cur_class,cur_title);
                                        return false;
                                }
                                function link_current() {       //
                                        if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
                                        if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
                                        if (cur_href!="http://" && cur_href!="mailto:") {
-                                               editor.renderPopup_addLink(cur_href,cur_target,cur_class,cur_title);
+                                               plugin.createLink(cur_href,cur_target,cur_class,cur_title);
                                        }
                                        return false;
                                }
@@ -598,56 +596,56 @@ class tx_rtehtmlarea_browse_links extends browse_links {
                $content=$this->doc->startPage($LANG->getLL('Insert/Modify Link',1));
 
                        // Initializing the action value, possibly removing blinded values etc:
-               $allowedItems = explode(',','page,file,url,mail,spec');
+               $this->allowedItems = explode(',','page,file,url,mail,spec');
 
                        //call hook for extra options
                foreach($this->hookObjects as $hookObject) {
-                       $allowedItems = $hookObject->addAllowedItems($allowedItems);
+                       $this->allowedItems = $hookObject->addAllowedItems($this->allowedItems);
                }
 
                if (is_array($this->buttonConfig['options.']) && $this->buttonConfig['options.']['removeItems']) {
-                       $allowedItems = array_diff($allowedItems,t3lib_div::trimExplode(',',$this->buttonConfig['options.']['removeItems'],1));
+                       $this->allowedItems = array_diff($this->allowedItems,t3lib_div::trimExplode(',',$this->buttonConfig['options.']['removeItems'],1));
                } else {
-                       $allowedItems = array_diff($allowedItems,t3lib_div::trimExplode(',',$this->thisConfig['blindLinkOptions'],1));
+                       $this->allowedItems = array_diff($this->allowedItems,t3lib_div::trimExplode(',',$this->thisConfig['blindLinkOptions'],1));
                }
-               reset($allowedItems);
-               if (!in_array($this->act,$allowedItems)) {
-                       $this->act = current($allowedItems);
+               reset($this->allowedItems);
+               if (!in_array($this->act,$this->allowedItems)) {
+                       $this->act = current($this->allowedItems);
                }
 
                        // Making menu in top:
                $menuDef = array();
-               if (!$wiz)      {
+               if (!$wiz && $this->curUrlArray['href'])        {
                        $menuDef['removeLink']['isActive'] = $this->act=='removeLink';
                        $menuDef['removeLink']['label'] = $LANG->getLL('removeLink',1);
                        $menuDef['removeLink']['url'] = '#';
-                       $menuDef['removeLink']['addParams'] = 'onclick="editor.renderPopup_unLink();return false;"';
+                       $menuDef['removeLink']['addParams'] = 'onclick="plugin.unLink();return false;"';
                }
-               if (in_array('page',$allowedItems)) {
+               if (in_array('page',$this->allowedItems)) {
                        $menuDef['page']['isActive'] = $this->act=='page';
                        $menuDef['page']['label'] = $LANG->getLL('page',1);
                        $menuDef['page']['url'] = '#';
                        $menuDef['page']['addParams'] = 'onclick="jumpToUrl(\'?act=page&editorNo='.$this->editorNo.'&contentTypo3Language='.$this->contentTypo3Language.'&contentTypo3Charset='.$this->contentTypo3Charset.'\');return false;"';
                }
-               if (in_array('file',$allowedItems)){
+               if (in_array('file',$this->allowedItems)){
                        $menuDef['file']['isActive'] = $this->act=='file';
                        $menuDef['file']['label'] = $LANG->getLL('file',1);
                        $menuDef['file']['url'] = '#';
                        $menuDef['file']['addParams'] = 'onclick="jumpToUrl(\'?act=file&editorNo='.$this->editorNo.'&contentTypo3Language='.$this->contentTypo3Language.'&contentTypo3Charset='.$this->contentTypo3Charset.'\');return false;"';
                }
-               if (in_array('url',$allowedItems)) {
+               if (in_array('url',$this->allowedItems)) {
                        $menuDef['url']['isActive'] = $this->act=='url';
                        $menuDef['url']['label'] = $LANG->getLL('extUrl',1);
                        $menuDef['url']['url'] = '#';
                        $menuDef['url']['addParams'] = 'onclick="jumpToUrl(\'?act=url&editorNo='.$this->editorNo.'&contentTypo3Language='.$this->contentTypo3Language.'&contentTypo3Charset='.$this->contentTypo3Charset.'\');return false;"';
                }
-               if (in_array('mail',$allowedItems)) {
+               if (in_array('mail',$this->allowedItems)) {
                        $menuDef['mail']['isActive'] = $this->act=='mail';
                        $menuDef['mail']['label'] = $LANG->getLL('email',1);
                        $menuDef['mail']['url'] = '#';
                        $menuDef['mail']['addParams'] = 'onclick="jumpToUrl(\'?act=mail&editorNo='.$this->editorNo.'&contentTypo3Language='.$this->contentTypo3Language.'&contentTypo3Charset='.$this->contentTypo3Charset.'\');return false;"';
                }
-               if (is_array($this->thisConfig['userLinks.']) && in_array('spec',$allowedItems)) {
+               if (is_array($this->thisConfig['userLinks.']) && in_array('spec',$this->allowedItems)) {
                        $menuDef['spec']['isActive'] = $this->act=='spec';
                        $menuDef['spec']['label'] = $LANG->getLL('special',1);
                        $menuDef['spec']['url'] = '#';
@@ -844,12 +842,13 @@ class tx_rtehtmlarea_browse_links extends browse_links {
 
        function addAttributesForm() {
                $ltargetForm = '';
-                       // Add target and class selector box and title field:
+                       // Add page id, target, class selector box and title field:
+               $lpageId = $this->addPageIdSelector();
                $ltarget = $this->addTargetSelector();
                $lclass = $this->addClassSelector();
                $ltitle = $this->addTitleSelector();
-               if ($ltarget || $lclass || $ltitle) {
-                       $ltargetForm = $this->wrapInForm($ltarget.$lclass.$ltitle);
+               if ($lpageId || $ltarget || $lclass || $ltitle) {
+                       $ltargetForm = $this->wrapInForm($lpageId.$ltarget.$lclass.$ltitle);
                }
                return $ltargetForm;
        }
@@ -878,6 +877,18 @@ class tx_rtehtmlarea_browse_links extends browse_links {
                                </form>';
                return $form;
        }
+       
+       function addPageIdSelector() {
+               global $LANG;
+
+               return ($this->act == 'page' && $this->buttonConfig && is_array($this->buttonConfig['pageIdSelector.']) && $this->buttonConfig['pageIdSelector.']['enabled'])?'
+                                               <tr>
+                                                       <td>'.$LANG->getLL('page_id',1).':</td>
+                                                       <td colspan="3">
+                                                               <input type="text" size="6" name="luid" />&nbsp;<input type="submit" value="'.$LANG->getLL('setLink',1).'" onclick="return link_typo3Page(document.ltargetform.luid.value);" />
+                                                       </td>
+                                               </tr>':'';
+       }
 
        function addTargetSelector() {
                global $LANG;
@@ -959,9 +970,9 @@ class tx_rtehtmlarea_browse_links extends browse_links {
                if ($this->classesAnchorJSOptions[$this->act]) {
                        $selectClassJS = '
                                        document.ltargetform.anchor_class.value = document.ltargetform.anchor_class.options[document.ltargetform.anchor_class.selectedIndex].value;
-                                       if(document.ltargetform.anchor_class.value && editor.classesAnchorSetup) {
-                                               for (var i = editor.classesAnchorSetup.length; --i >= 0;) {
-                                                       var anchorClass = editor.classesAnchorSetup[i];
+                                       if(document.ltargetform.anchor_class.value && HTMLArea.classesAnchorSetup) {
+                                               for (var i = HTMLArea.classesAnchorSetup.length; --i >= 0;) {
+                                                       var anchorClass = HTMLArea.classesAnchorSetup[i];
                                                        if (anchorClass[\'name\'] == document.ltargetform.anchor_class.value) {
                                                                if(anchorClass[\'titleText\'] && document.ltargetform.anchor_title) document.ltargetform.anchor_title.value = anchorClass[\'titleText\'];
                                                                break;
@@ -990,7 +1001,7 @@ class tx_rtehtmlarea_browse_links extends browse_links {
                                                <tr>
                                                        <td>'.$LANG->getLL('anchor_title',1).':</td>
                                                        <td colspan="3">
-                                                               <input type="text" name="anchor_title" value="' . ($this->setTitle?$this->setTitle:($this->thisConfig['classesAnchor']?$this->classesAnchorDefaultTitle[$this->act]:'')) . '" ' . $this->doc->formWidth(30) . ' />
+                                                               <input type="text" name="anchor_title" value="' . ($this->setTitle?$this->setTitle:(($this->setClass || !$this->classesAnchorDefault[$this->act])?'':$this->classesAnchorDefaultTitle[$this->act])) . '" ' . $this->doc->formWidth(30) . ' />
                                                        </td>
                                                </tr>';
        }
@@ -1091,6 +1102,25 @@ class tx_rtehtmlarea_browse_links extends browse_links {
 
                return $code;
        }
+       
+       public function getLLContent($string) {
+               global $LANG;
+               
+               $BE_lang = $LANG->lang;
+               $BE_origCharSet = $LANG->origCharSet;
+               $BE_charSet = $LANG->charSet;
+               
+               $LANG->lang = $this->contentTypo3Language;
+               $LANG->origCharSet = $LANG->csConvObj->charSetArray[$this->contentTypo3Language];
+               $LANG->origCharSet = $LANG->origCharSet ? $LANG->origCharSet : 'iso-8859-1';
+               $LANG->charSet = $this->contentTypo3Charset;
+               $LLString = $LANG->sL($string);
+               
+               $LANG->lang = $BE_lang;
+               $LANG->origCharSet = $BE_origCharSet;
+               $LANG->charSet = $BE_charSet;
+               return $LLString;
+       }
 
 }
 
diff --git a/typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_dam_browse_links.php b/typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_dam_browse_links.php
new file mode 100644 (file)
index 0000000..d56c54f
--- /dev/null
@@ -0,0 +1,903 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 2005-2008 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+/**
+ * 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
+ *
+ * $Id$
+ *
+ * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+ */
+
+require_once (PATH_t3lib.'class.t3lib_basicfilefunc.php');
+require_once(t3lib_extMgm::extPath('dam').'class.tx_dam_browse_media.php');
+
+/**
+ * Script class for the Element Browser window.
+ *
+ * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @package TYPO3
+ * @subpackage core
+ */
+class tx_rtehtmlarea_dam_browse_links extends tx_dam_browse_media {
+
+               // Internal, static:
+       var $setTarget;                 // Target (RTE specific)
+       var $setClass;                  // Class (RTE specific)
+       var $setTitle;                  // Title (RTE specific)
+
+       var $contentTypo3Language;
+       var $contentTypo3Charset;
+
+       var $editorNo;
+       var $buttonConfig = array();
+       
+       private $classesAnchorDefault = array();
+       private $classesAnchorDefaultTitle = array();
+       private $classesAnchorJSOptions = array();
+       public $allowedItems;
+       
+       
+       /**
+        * Check if this object should be rendered.
+        *
+        * @param       string          $type Type: "file", ...
+        * @param       object          $pObj Parent object.
+        * @return      boolean
+        * @see SC_browse_links::main()
+        */
+       function isValid($type, &$pObj) {
+               $isValid = false;
+               
+               $pArr = explode('|', t3lib_div::_GP('bparams'));
+               
+               if ($type=='rte' && $pObj->button == 'link') {
+                       $isValid = true;
+               }
+               
+               return $isValid;
+       }
+       
+       /**
+        * Rendering
+        * Called in SC_browse_links::main() when isValid() returns true;
+        *
+        * @param       string          $type Type: "file", ...
+        * @param       object          $pObj Parent object.
+        * @return      string          Rendered content
+        * @see SC_browse_links::main()
+        */
+       function render($type, &$pObj)  {
+               global $LANG, $BE_USER, $BACK_PATH;
+               
+               $this->pObj = &$pObj;
+               
+                       // init class browse_links
+               $this->init();
+               
+               switch((string)$this->mode)     {
+                       case 'rte':
+                               $content = $this->main_rte();
+                       break;
+                       default:
+                               $content = '';
+                       break;
+               }
+
+               return $content;
+       }
+       
+       /**
+        * Constructor:
+        * Initializes a lot of variables, setting JavaScript functions in header etc.
+        *
+        * @return      void
+        */
+       function init() {
+               global $BE_USER,$BACK_PATH,$LANG,$TYPO3_CONF_VARS;
+               
+                       // Main GPvars:
+               $this->siteUrl = t3lib_div::getIndpEnv('TYPO3_SITE_URL');
+               $this->act = t3lib_div::_GP('act');
+               $this->expandPage = t3lib_div::_GP('expandPage');
+               $this->expandFolder = t3lib_div::_GP('expandFolder');
+               $this->pointer = t3lib_div::_GP('pointer');
+               $this->P = t3lib_div::_GP('P');
+               $this->PM = t3lib_div::_GP('PM');
+               
+                       // Find RTE parameters
+               $this->bparams = t3lib_div::_GP('bparams');
+               $this->editorNo = t3lib_div::_GP('editorNo');
+               $this->sys_language_content = t3lib_div::_GP('sys_language_content');
+               $this->contentTypo3Language = t3lib_div::_GP('contentTypo3Language');
+               $this->contentTypo3Charset = t3lib_div::_GP('contentTypo3Charset');
+               $this->RTEtsConfigParams = t3lib_div::_GP('RTEtsConfigParams');
+               if (!$this->editorNo) {
+                       $pArr = explode('|', $this->bparams);
+                       $pRteArr = explode(':', $pArr[1]);
+                       $this->editorNo = $pRteArr[0];
+                       $this->sys_language_content = $pRteArr[1];
+                       $this->RTEtsConfigParams = $pArr[2];
+               }
+
+                       // Find "mode"
+               $this->mode=t3lib_div::_GP('mode');
+               if (!$this->mode)       {
+                       $this->mode='rte';
+               }
+
+                       // init hook objects:
+               $this->hookObjects = array();
+               if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'])) {
+                       foreach($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'] as $classData) {
+                               $processObject = &t3lib_div::getUserObj($classData);
+
+                               if(!($processObject instanceof t3lib_browseLinksHook)) {
+                                       throw new UnexpectedValueException('$processObject must implement interface t3lib_browseLinksHook', 1195115652);
+                               }
+                               
+                               $parameters = array();
+                               $processObject->init($this, $parameters);
+                               $this->hookObjects[] = $processObject;
+                       }
+               }
+
+                       // Site URL
+               $this->siteURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL');       // Current site url
+
+                       // the script to link to
+               $this->thisScript = t3lib_div::getIndpEnv('SCRIPT_NAME');
+
+                       // CurrentUrl - the current link url must be passed around if it exists
+               if ($this->mode=='wizard')      {
+                       $currentLinkParts = t3lib_div::trimExplode(' ',$this->P['currentValue']);
+                       $this->curUrlArray = array(
+                               'target' => $currentLinkParts[1]
+                       );
+                       $this->curUrlInfo=$this->parseCurUrl($this->siteURL.'?id='.$currentLinkParts[0],$this->siteURL);
+               } else {
+                       $this->curUrlArray = t3lib_div::_GP('curUrl');
+                       if ($this->curUrlArray['all'])  {
+                               $this->curUrlArray=t3lib_div::get_tag_attributes($this->curUrlArray['all']);
+                       }
+                       $this->curUrlInfo=$this->parseCurUrl($this->curUrlArray['href'],$this->siteURL);
+               }
+
+                       // Determine nature of current url:
+               $this->act=t3lib_div::_GP('act');
+               if (!$this->act)        {
+                       $this->act=$this->curUrlInfo['act'];
+               }
+
+                       // Initializing the titlevalue
+               $this->setTitle = $LANG->csConvObj->conv($this->curUrlArray['title'], 'utf-8', $LANG->charSet);
+
+                       // Rich Text Editor specific configuration:
+               $addPassOnParams='';
+               if ((string)$this->mode=='rte') {
+                       $RTEtsConfigParts = explode(':',$this->RTEtsConfigParams);
+                       $addPassOnParams .= '&RTEtsConfigParams='.rawurlencode($this->RTEtsConfigParams);
+                       $addPassOnParams .= ($this->contentTypo3Language ? '&typo3ContentLanguage=' . rawurlencode($this->contentTypo3Language) : '');
+                       $addPassOnParams .= ($this->contentTypo3Charset ? '&typo3ContentCharset=' . rawurlencode($this->contentTypo3Charset) : '');
+                       $RTEsetup = $BE_USER->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
+                       $this->thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'],$RTEtsConfigParts[0],$RTEtsConfigParts[2],$RTEtsConfigParts[4]);
+                       if (is_array($this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['link.'])) {
+                               $this->buttonConfig = $this->thisConfig['buttons.']['link.'];
+                       }
+                       if ($this->thisConfig['classesAnchor'] || $this->thisConfig['classesLinks']) {
+                               $this->setClass = $this->curUrlArray['class'];
+                               if ($this->thisConfig['classesAnchor']) {
+                                       $classesAnchorArray = t3lib_div::trimExplode(',',$this->thisConfig['classesAnchor'], 1);
+                               } else {
+                                       $classesAnchorArray = t3lib_div::trimExplode(',',$this->thisConfig['classesLinks'], 1);
+                               }
+                               $anchorTypes = array( 'page', 'url', 'file', 'mail', 'spec');
+                               $classesAnchor = array();
+                               $classesAnchor['all'] = array();
+                               if (is_array($RTEsetup['properties']['classesAnchor.'])) {
+                                       reset($RTEsetup['properties']['classesAnchor.']);
+                                       while(list($label,$conf)=each($RTEsetup['properties']['classesAnchor.'])) {
+                                               if (in_array($conf['class'], $classesAnchorArray)) {
+                                                       $classesAnchor['all'][] = $conf['class'];
+                                                       if (in_array($conf['type'], $anchorTypes)) {
+                                                               $classesAnchor[$conf['type']][] = $conf['class'];
+                                                               if (is_array($this->thisConfig['classesAnchor.']) && is_array($this->thisConfig['classesAnchor.']['default.']) && $this->thisConfig['classesAnchor.']['default.'][$conf['type']] == $conf['class']) {
+                                                                       $this->classesAnchorDefault[$conf['type']] = $conf['class'];
+                                                                       if ($conf['titleText']) {
+                                                                               $this->classesAnchorDefaultTitle[$conf['type']] = $this->getLLContent(trim($conf['titleText']));
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                               reset($anchorTypes);
+                               while (list(, $anchorType) = each($anchorTypes) ) {
+                                       reset($classesAnchorArray);
+                                       while(list(,$class)=each($classesAnchorArray)) {
+                                               if (!in_array($class, $classesAnchor['all']) || (in_array($class, $classesAnchor['all']) && is_array($classesAnchor[$anchorType]) && in_array($class, $classesAnchor[$anchorType]))) {
+                                                       $selected = '';
+                                                       if ($this->setClass == $class) $selected = 'selected="selected"';
+                                                       if (!$this->setClass && $this->classesAnchorDefault[$anchorType] == $class) {
+                                                               $selected = 'selected="selected"';
+                                                       }
+                                                       $this->classesAnchorJSOptions[$anchorType] .= '<option ' . $selected . ' value="' .$class . '">' . $class . '</option>';
+                                               }
+                                       }
+                                       if ($this->classesAnchorJSOptions[$anchorType]) {
+                                               $selected = '';
+                                               if (!$this->setClass && !$this->classesAnchorDefault[$anchorType])  $selected = 'selected="selected"';
+                                               $this->classesAnchorJSOptions[$anchorType] =  '<option ' . $selected . ' value=""></option>' . $this->classesAnchorJSOptions[$anchorType];
+                                       }
+                               }
+                       }
+               }
+
+                       // Initializing the target value (RTE)
+               $this->setTarget = $this->curUrlArray['target'];
+               if ($this->thisConfig['defaultLinkTarget'] && !isset($this->curUrlArray['target']))     {
+                       $this->setTarget=$this->thisConfig['defaultLinkTarget'];
+               }
+               
+                       // init the DAM object
+               $this->initDAM();
+               $this->getModSettings();
+               $this->processParams();
+               
+                       // Creating backend template object:
+               $this->doc = t3lib_div::makeInstance('template');
+               //$this->doc->bodyTagAdditions = 'onLoad="initDialog();"';
+               $this->doc->docType= 'xhtml_trans';
+               $this->doc->backPath = $BACK_PATH;
+       }
+       
+       /**
+        * [Describe function...]
+        *
+        * @return      [type]          ...
+        */
+       function getJSCode()    {
+               global $LANG,$BACK_PATH,$TYPO3_CONF_VARS;
+
+                       // BEGIN accumulation of header JavaScript:
+               $JScode = '';
+               $JScode.= '
+                       var dialog = window.opener.HTMLArea.Dialog.TYPO3Link;
+                       var plugin = dialog.plugin;
+                       var HTMLArea = window.opener.HTMLArea;
+                       function initDialog() {
+                               dialog.initialize("noLocalize", "noResize");
+                       }
+                       
+                               // This JavaScript is primarily for RTE/Link. jumpToUrl is used in the other cases as well...
+                       var add_href="'.($this->curUrlArray['href']?'&curUrl[href]='.rawurlencode($this->curUrlArray['href']):'').'";
+                       var add_target="'.($this->setTarget?'&curUrl[target]='.rawurlencode($this->setTarget):'').'";
+                       var add_class="'.($this->setClass?'&curUrl[class]='.rawurlencode($this->setClass):'').'";
+                       var add_title="'.($this->setTitle?'&curUrl[title]='.rawurlencode($this->setTitle):'').'";
+                       var add_params="'.($this->bparams?'&bparams='.rawurlencode($this->bparams):'').'";
+
+                       var cur_href="'.($this->curUrlArray['href']?$this->curUrlArray['href']:'').'";
+                       var cur_target="'.($this->setTarget?$this->setTarget:'').'";
+                       var cur_class="'.($this->setClass?$this->setClass:'').'";
+                       var cur_title="'.($this->setTitle?$this->setTitle:'').'";
+
+                       function setTarget(value)       {
+                               cur_target=value;
+                               add_target="&curUrl[target]="+encodeURIComponent(value);
+                       }
+                       function setClass(value)        {
+                               cur_class=value;
+                               add_class="&curUrl[class]="+encodeURIComponent(value);
+                       }
+                       function setTitle(value)        {
+                               cur_title=value;
+                               add_title="&curUrl[title]="+encodeURIComponent(value);
+                       }
+                       function setValue(value)        {
+                               cur_href=value;
+                               add_href="&curUrl[href]="+value;
+                       }';
+
+                               // Functions used, if the link selector is in RTE mode:
+                       $JScode.='
+                               function link_typo3Page(id,anchor)      {
+                                       var theLink = \''.$this->siteURL.'?id=\'+id+(anchor?anchor:"");
+                                       if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
+                                       if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
+                                       plugin.createLink(theLink,cur_target,cur_class,cur_title);
+                                       return false;
+                               }
+                               function link_folder(folder)    {       //
+                                       var theLink = \''.$this->siteURL.'\'+folder;
+                                       if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
+                                       if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
+                                       plugin.createLink(theLink,cur_target,cur_class,cur_title);
+                                       return false;
+                               }
+                               function link_spec(theLink)     {       //
+                                       if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
+                                       if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
+                                       plugin.createLink(theLink,cur_target,cur_class,cur_title);
+                                       return false;
+                               }
+                               function link_current() {       //
+                                       if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
+                                       if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
+                                       if (cur_href!="http://" && cur_href!="mailto:") {
+                                               plugin.createLink(cur_href,cur_target,cur_class,cur_title);
+                                       }
+                                       return false;
+                               }
+                       ';
+
+                       // General "jumpToUrl" function:
+               $JScode.='
+                       function jumpToUrl(URL,anchor)  {       //
+                               var add_editorNo = URL.indexOf("editorNo=")==-1 ? "&editorNo='.$this->editorNo.'" : "";
+                               var add_contentTypo3Language = URL.indexOf("contentTypo3Language=")==-1 ? "&contentTypo3Language='.$this->contentTypo3Language.'" : "";
+                               var add_contentTypo3Charset = URL.indexOf("contentTypo3Charset=")==-1 ? "&contentTypo3Charset='.$this->contentTypo3Charset.'" : "";
+                               var add_act = URL.indexOf("act=")==-1 ? "&act='.$this->act.'" : "";
+                               var add_mode = URL.indexOf("mode=")==-1 ? "&mode='.$this->mode.'" : "";
+                               var theLocation = URL+add_act+add_editorNo+add_contentTypo3Language+add_contentTypo3Charset+add_mode+add_href+add_target+add_class+add_title+add_params'.($addPassOnParams?'+"'.$addPassOnParams.'"':'').'+(anchor?anchor:"");
+                               window.location.href = theLocation;
+                               return false;
+                       }
+               ';
+
+                       // This is JavaScript especially for the TBE Element Browser!
+               $pArr = explode('|',$this->bparams);
+               $formFieldName = 'data['.$pArr[0].']['.$pArr[1].']['.$pArr[2].']';
+               $JScode.='
+                       var elRef="";
+                       var targetDoc="";
+
+                       function launchView(url)        {       //
+                               var thePreviewWindow="";
+                               thePreviewWindow = window.open("' . $BACK_PATH . 'show_item.php?table="+url,"ShowItem","height=300,width=410,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0");
+                               if (thePreviewWindow && thePreviewWindow.focus) {
+                                       thePreviewWindow.focus();
+                               }
+                       }
+                       function setReferences()        {       //
+                               if (parent.window.opener
+                               && parent.window.opener.content
+                               && parent.window.opener.content.document.editform
+                               && parent.window.opener.content.document.editform["'.$formFieldName.'"]
+                                               ) {
+                                       targetDoc = parent.window.opener.content.document;
+                                       elRef = targetDoc.editform["'.$formFieldName.'"];
+                                       return true;
+                               } else {
+                                       return false;
+                               }
+                       }
+                       function insertElement(table, uid, type, filename,fp,filetype,imagefile,action, close)  {       //
+                               if (1=='.($pArr[0]&&!$pArr[1]&&!$pArr[2] ? 1 : 0).')    {
+                                       addElement(filename,table+"_"+uid,fp,close);
+                               } else {
+                                       if (setReferences())    {
+                                               parent.window.opener.group_change("add","'.$pArr[0].'","'.$pArr[1].'","'.$pArr[2].'",elRef,targetDoc);
+                                       } else {
+                                               alert("Error - reference to main window is not set properly!");
+                                       }
+                                       if (close)      {
+                                               parent.window.opener.focus();
+                                               parent.close();
+                                       }
+                               }
+                               return false;
+                       }
+                       function insertElement(table, uid, type, filename,fp,filetype,imagefile,action, close)  {       //
+                               link_folder(filename);
+                               return false;
+                       }
+                       function addElement(elName,elValue,altElValue,close)    {       //
+                               if (parent.window.opener && parent.window.opener.setFormValueFromBrowseWin)     {
+                                       parent.window.opener.setFormValueFromBrowseWin("'.$pArr[0].'",altElValue?altElValue:elValue,elName);
+                                       if (close)      {
+                                               parent.window.opener.focus();
+                                               parent.close();
+                                       }
+                               } else {
+                                       alert("Error - reference to main window is not set properly!");
+                                       parent.close();
+                               }
+                       }
+               ';
+               
+                       // Finally, add the accumulated JavaScript to the template object:
+               $this->doc->JScodeArray['rtehtmlarea'] = $JScode;
+       }
+       
+       /**
+        * Return true or false whether thumbs should be displayed or not
+        *
+        * @return      boolean
+        */
+       function displayThumbs() {
+               global $BE_USER;
+               return parent::displayThumbs() && !$BE_USER->getTSConfigVal('options.noThumbsInRTEimageSelect') && ($this->act != 'dragdrop');
+       }
+       
+       /**
+        * Create HTML checkbox to enable/disable thumbnail display
+        *
+        * @return      string HTML code
+        */
+       function addDisplayOptions() {
+               global $BE_USER;
+               
+                       // Getting flag for showing/not showing thumbnails:
+               $noThumbs = $BE_USER->getTSConfigVal('options.noThumbsInEB') || ($this->mode == 'rte' && $BE_USER->getTSConfigVal('options.noThumbsInRTEimageSelect')) || ($this->act == 'dragdrop');
+               if ($noThumbs)  {
+                       $thumbNailCheckbox = '';
+               } else {
+
+                       $thumbNailCheckbox = t3lib_BEfunc::getFuncCheck('', 'SET[displayThumbs]',$this->displayThumbs(), $this->thisScript, t3lib_div::implodeArrayForUrl('',$this->addParams));
+                       $description = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:displayThumbs',1);
+                       $id = 'l'.uniqid('tx_dam_scbase');
+                       $idAttr = ' id="'.$id.'"';
+                       $thumbNailCheckbox = str_replace('<input', '<input'.$idAttr, $thumbNailCheckbox);
+                       $thumbNailCheckbox .= ' <label for="'.$id.'">'.$description.'</label>';
+                       $this->damSC->addOption('html', 'thumbnailCheckbox', $thumbNailCheckbox);
+               }
+               $this->damSC->addOption('funcCheck', 'extendedInfo', $GLOBALS['LANG']->getLL('displayExtendedInfo',1));
+       }
+       
+       /******************************************************************
+        *
+        * Main functions
+        *
+        ******************************************************************/
+       /**
+        * Rich Text Editor (RTE) link selector (MAIN function)
+        * Generates the link selector for the Rich Text Editor.
+        * Can also be used to select links for the TCEforms (see $wiz)
+        *
+        * @param       boolean         If set, the "remove link" is not shown in the menu: Used for the "Select link" wizard which is used by the TCEforms
+        * @return      string          Modified content variable.
+        */
+       function main_rte($wiz=0)       {
+               global $LANG, $BE_USER, $BACK_PATH;
+
+                       // Starting content:
+               $content=$this->doc->startPage($LANG->getLL('Insert/Modify Link',1));
+               $this->reinitParams();
+
+                       // Initializing the action value, possibly removing blinded values etc:
+               $this->allowedItems = explode(',','page,file,url,mail,spec,upload');
+
+                       //call hook for extra options
+               foreach($this->hookObjects as $hookObject) {
+                       $this->allowedItems = $hookObject->addAllowedItems($this->allowedItems);
+               }
+
+               if (is_array($this->buttonConfig['options.']) && $this->buttonConfig['options.']['removeItems']) {
+                       $this->allowedItems = array_diff($this->allowedItems,t3lib_div::trimExplode(',',$this->buttonConfig['options.']['removeItems'],1));
+               } else {
+                       $this->allowedItems = array_diff($this->allowedItems,t3lib_div::trimExplode(',',$this->thisConfig['blindLinkOptions'],1));
+               }
+               reset($this->allowedItems);
+               if (!in_array($this->act,$this->allowedItems)) {
+                       $this->act = current($this->allowedItems);
+               }
+
+                       // Making menu in top:
+               $menuDef = array();
+               if (!$wiz && $this->curUrlArray['href'])        {
+                       $menuDef['removeLink']['isActive'] = $this->act=='removeLink';
+                       $menuDef['removeLink']['label'] = $LANG->getLL('removeLink',1);
+                       $menuDef['removeLink']['url'] = '#';
+                       $menuDef['removeLink']['addParams'] = 'onclick="plugin.unLink();return false;"';
+               }
+               if (in_array('page',$this->allowedItems)) {
+                       $menuDef['page']['isActive'] = $this->act=='page';
+                       $menuDef['page']['label'] = $LANG->getLL('page',1);
+                       $menuDef['page']['url'] = '#';
+                       $menuDef['page']['addParams'] = 'onclick="jumpToUrl(\''.htmlspecialchars($this->thisScript.'?act=page&mode='.$this->mode.'&bparams='.$this->bparams).'\');return false;"';
+               }
+               if (in_array('file',$this->allowedItems)){
+                       $menuDef['file']['isActive'] = $this->act=='file';
+                       $menuDef['file']['label'] =  $LANG->sL('LLL:EXT:dam/mod_main/locallang_mod.xml:mlang_tabs_tab',1);
+                       $menuDef['file']['url'] = '#';
+                       $menuDef['file']['addParams'] = 'onclick="jumpToUrl(\''.htmlspecialchars($this->thisScript.'?act=file&mode='.$this->mode.'&bparams='.$this->bparams).'\');return false;"';
+               }
+               if (in_array('url',$this->allowedItems)) {
+                       $menuDef['url']['isActive'] = $this->act=='url';
+                       $menuDef['url']['label'] = $LANG->getLL('extUrl',1);
+                       $menuDef['url']['url'] = '#';
+                       $menuDef['url']['addParams'] = 'onclick="jumpToUrl(\''.htmlspecialchars($this->thisScript.'?act=url&mode='.$this->mode.'&bparams='.$this->bparams).'\');return false;"';
+               }
+               if (in_array('mail',$this->allowedItems)) {
+                       $menuDef['mail']['isActive'] = $this->act=='mail';
+                       $menuDef['mail']['label'] = $LANG->getLL('email',1);
+                       $menuDef['mail']['url'] = '#';
+                       $menuDef['mail']['addParams'] = 'onclick="jumpToUrl(\''.htmlspecialchars($this->thisScript.'?act=mail&mode='.$this->mode.'&bparams='.$this->bparams).'\');return false;"';
+               }
+               if (is_array($this->thisConfig['userLinks.']) && in_array('spec',$this->allowedItems)) {
+                       $menuDef['spec']['isActive'] = $this->act=='spec';
+                       $menuDef['spec']['label'] = $LANG->getLL('special',1);
+                       $menuDef['spec']['url'] = '#';
+                       $menuDef['spec']['addParams'] = 'onclick="jumpToUrl(\''.htmlspecialchars($this->thisScript.'?act=spec&mode='.$this->mode.'&bparams='.$this->bparams).'\');return false;"';
+               }
+               if (in_array('upload', $this->allowedItems)) {
+                       $menuDef['upload']['isActive'] = ($this->act === 'upload');
+                       $menuDef['upload']['label'] = $LANG->getLL('tx_dam_file_upload.title',1);
+                       $menuDef['upload']['url'] = '#';
+                       $menuDef['upload']['addParams'] = 'onclick="jumpToUrl(\''.htmlspecialchars($this->thisScript.'?act=upload&mode='.$this->mode.'&bparams='.$this->bparams).'\');return false;"';
+               }
+
+                       // call hook for extra options
+               foreach($this->hookObjects as $hookObject) {
+                       $menuDef = $hookObject->modifyMenuDefinition($menuDef);
+               }
+
+               $content .= $this->doc->getTabMenuRaw($menuDef);
+
+                       // Adding the menu and header to the top of page:
+               $content.=$this->printCurrentUrl($this->curUrlInfo['info']).'<br />';
+
+                       // Depending on the current action we will create the actual module content for selecting a link:
+               switch($this->act)      {
+                       case 'mail':
+                               $extUrl='
+                       <!--
+                               Enter mail address:
+                       -->
+                                       <form action="" name="lurlform" id="lurlform">
+                                               <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkMail">
+                                                       <tr>
+                                                               <td>'.$LANG->getLL('emailAddress',1).':</td>
+                                                               <td><input type="text" name="lemail"'.$this->doc->formWidth(20).' value="'.htmlspecialchars($this->curUrlInfo['act']=='mail'?$this->curUrlInfo['info']:'').'" /> '.
+                                                                       '<input type="submit" value="'.$LANG->getLL('setLink',1).'" onclick="setTarget(\'\');setValue(\'mailto:\'+document.lurlform.lemail.value); return link_current();" /></td>
+                                                       </tr>
+                                               </table>
+                                       </form>';
+                               $content.=$extUrl;
+                               $content.=$this->addAttributesForm();
+                       break;
+                       case 'url':
+                               $extUrl='
+                       <!--
+                               Enter External URL:
+                       -->
+                                       <form action="" name="lurlform" id="lurlform">
+                                               <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkURL">
+                                                       <tr>
+                                                               <td>URL:</td>
+                                                               <td><input type="text" name="lurl"'.$this->doc->formWidth(20).' value="'.htmlspecialchars($this->curUrlInfo['act']=='url'?$this->curUrlInfo['info']:'http://').'" /> '.
+                                                                       '<input type="submit" value="'.$LANG->getLL('setLink',1).'" onclick="setValue(document.lurlform.lurl.value); return link_current();" /></td>
+                                                       </tr>
+                                               </table>
+                                       </form>';
+                               $content.=$extUrl;
+                               $content.=$this->addAttributesForm();
+                       break;
+                       case 'file':
+                               $this->addDisplayOptions();
+                               $content.=$this->addAttributesForm();
+                               $content.= $this->dam_select($this->allowedFileTypes, $this->disallowedFileTypes);
+                               $content.= $this->damSC->getOptions();
+                               break;
+                       case 'spec':
+                               if (is_array($this->thisConfig['userLinks.']))  {
+                                       $subcats=array();
+                                       $v=$this->thisConfig['userLinks.'];
+                                       reset($v);
+                                       while(list($k2)=each($v))       {
+                                               $k2i = intval($k2);
+                                               if (substr($k2,-1)=='.' && is_array($v[$k2i.'.']))      {
+
+                                                               // Title:
+                                                       $title = trim($v[$k2i]);
+                                                       if (!$title)    {
+                                                               $title=$v[$k2i.'.']['url'];
+                                                       } else {
+                                                               $title=$LANG->sL($title);
+                                                       }
+                                                               // Description:
+                                                       $description=$v[$k2i.'.']['description'] ? $LANG->sL($v[$k2i.'.']['description'],1).'<br />' : '';
+
+                                                               // URL + onclick event:
+                                                       $onClickEvent='';
+                                                       if (isset($v[$k2i.'.']['target']))      $onClickEvent.="setTarget('".$v[$k2i.'.']['target']."');";
+                                                       $v[$k2i.'.']['url'] = str_replace('###_URL###',$this->siteURL,$v[$k2i.'.']['url']);
+                                                       if (substr($v[$k2i.'.']['url'],0,7)=="http://" || substr($v[$k2i.'.']['url'],0,7)=='mailto:')   {
+                                                               $onClickEvent.="cur_href=unescape('".rawurlencode($v[$k2i.'.']['url'])."');link_current();";
+                                                       } else {
+                                                               $onClickEvent.="link_spec(unescape('".$this->siteURL.rawurlencode($v[$k2i.'.']['url'])."'));";
+                                                       }
+
+                                                               // Link:
+                                                       $A=array('<a href="#" onclick="'.htmlspecialchars($onClickEvent).'return false;">','</a>');
+
+                                                               // Adding link to menu of user defined links:
+                                                       $subcats[$k2i]='
+                                                               <tr>
+                                                                       <td class="bgColor4">'.$A[0].'<strong>'.htmlspecialchars($title).($this->curUrlInfo['info']==$v[$k2i.'.']['url']?'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" />':'').'</strong><br />'.$description.$A[1].'</td>
+                                                               </tr>';
+                                               }
+                                       }
+
+                                               // Sort by keys:
+                                       ksort($subcats);
+
+                                               // Add menu to content:
+                                       $content.= '
+                       <!--
+                               Special userdefined menu:
+                       -->
+                                               <table border="0" cellpadding="1" cellspacing="1" id="typo3-linkSpecial">
+                                                       <tr>
+                                                               <td class="bgColor5" class="c-wCell" valign="top"><strong>'.$LANG->getLL('special',1).'</strong></td>
+                                                       </tr>
+                                                       '.implode('',$subcats).'
+                                               </table>
+                                               ';
+                               }
+                       break;
+                       case 'page':
+                               $content.=$this->addAttributesForm();
+
+                               $pagetree = t3lib_div::makeInstance('tx_rtehtmlarea_pageTree');
+                               $pagetree->ext_showNavTitle = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showNavTitle');
+                               $pagetree->addField('nav_title');
+                               $tree=$pagetree->getBrowsableTree();
+                               $cElements = $this->expandPage();
+                               $content.= '
+                       <!--
+                               Wrapper table for page tree / record list:
+                       -->
+                                       <table border="0" cellpadding="0" cellspacing="0" id="typo3-linkPages">
+                                               <tr>
+                                                       <td class="c-wCell" valign="top">'.$this->barheader($LANG->getLL('pageTree').':').$tree.'</td>
+                                                       <td class="c-wCell" valign="top">'.$cElements.'</td>
+                                               </tr>
+                                       </table>
+                                       ';
+                       break;
+                       case 'upload':
+                               $content.= $this->dam_upload($this->allowedFileTypes, $this->disallowedFileTypes);
+                               $content.= $this->damSC->getOptions();
+                               $content.='<br /><br />';
+                               if ($BE_USER->isAdmin() || $BE_USER->getTSConfigVal('options.createFoldersInEB'))       {
+                                       $content.= $this->createFolder(tx_dam::path_makeAbsolute($this->damSC->path));
+                               }
+                       break;
+                       default:
+                                       // call hook
+                               foreach($this->hookObjects as $hookObject) {
+                                       $content .= $hookObject->getTab($this->act);
+                               }
+
+                       break;
+               }
+
+                       // End page, return content:
+               $content.= $this->doc->endPage();
+               $this->getJSCode();
+               $content = $this->damSC->doc->insertStylesAndJS($content);
+               return $content;
+       }
+
+       function addAttributesForm() {
+               $ltargetForm = '';
+                       // Add page id, target, class selector box and title field:
+               $lpageId = $this->addPageIdSelector();
+               $ltarget = $this->addTargetSelector();
+               $lclass = $this->addClassSelector();
+               $ltitle = $this->addTitleSelector();
+               if ($lpageId || $ltarget || $lclass || $ltitle) {
+                       $ltargetForm = $this->wrapInForm($lpageId.$ltarget.$lclass.$ltitle);
+               }
+               return $ltargetForm;
+       }
+
+       function wrapInForm($string) {
+               global $LANG;
+
+               $form = '
+                       <!--
+                               Selecting target for link:
+                       -->
+                               <form action="" name="ltargetform" id="ltargetform">
+                                       <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTarget">'. $string;
+               if ((($this->act == 'page' && $this->curUrlInfo['act']=='page') || ($this->act == 'file' && $this->curUrlInfo['act']=='file') || ($this->act == 'url' && $this->curUrlInfo['act']!='page')) && $this->curUrlArray['href']) {
+                       $form .='
+                                               <tr>
+                                                       <td>
+                                                       </td>
+                                                       <td colspan="3">
+                                                               <input type="submit" value="'.$LANG->getLL('update',1).'" onclick="return link_current();" />
+                                                       </td>
+                                               </tr>';
+               }
+               $form .= '
+                                       </table>
+                               </form>';
+               return $form;
+       }
+       
+       function addPageIdSelector() {
+               global $LANG;
+
+               return ($this->act == 'page' && $this->buttonConfig && is_array($this->buttonConfig['pageIdSelector.']) && $this->buttonConfig['pageIdSelector.']['enabled'])?'
+                                               <tr>
+                                                       <td>'.$LANG->getLL('page_id',1).':</td>
+                                                       <td colspan="3">
+                                                               <input type="text" size="6" name="luid" />&nbsp;<input type="submit" value="'.$LANG->getLL('setLink',1).'" onclick="return link_typo3Page(document.ltargetform.luid.value);" />
+                                                       </td>
+                                               </tr>':'';
+       }
+
+       function addTargetSelector() {
+               global $LANG;
+
+               $targetSelectorConfig = array();
+               $popupSelectorConfig = array();
+               if (is_array($this->buttonConfig['targetSelector.'])) {
+                       $targetSelectorConfig = $this->buttonConfig['targetSelector.'];
+               }
+               if (is_array($this->buttonConfig['popupSelector.'])) {
+                       $popupSelectorConfig = $this->buttonConfig['popupSelector.'];
+               }
+
+               $ltarget = '';
+               if ($this->act != 'mail')       {
+                       if (!($targetSelectorConfig['disabled'] && $popupSelectorConfig['disabled'])) {
+                               $ltarget .= '
+                                               <tr>
+                                                       <td>'.$LANG->getLL('target',1).':</td>
+                                                       <td><input type="text" name="ltarget" onchange="setTarget(this.value);" value="'.htmlspecialchars($this->setTarget).'"'.$this->doc->formWidth(10).' /></td>';
+                               $ltarget .= '
+                                                       <td colspan="2">';
+                               if (!$targetSelectorConfig['disabled']) {
+                                       $ltarget .= '
+                                                               <select name="ltarget_type" onchange="setTarget(this.options[this.selectedIndex].value);document.ltargetform.ltarget.value=this.options[this.selectedIndex].value;this.selectedIndex=0;">
+                                                                       <option></option>
+                                                                       <option value="_top">'.$LANG->getLL('top',1).'</option>
+                                                                       <option value="_blank">'.$LANG->getLL('newWindow',1).'</option>
+                                                               </select>';
+                               }
+                               $ltarget .= '
+                                                       </td>';
+                       }
+
+                       $ltarget .= '
+                                               </tr>';
+                       if (!$popupSelectorConfig['disabled']) {
+
+                               $selectJS = 'if (document.ltargetform.popup_width.options[document.ltargetform.popup_width.selectedIndex].value>0 && document.ltargetform.popup_height.options[document.ltargetform.popup_height.selectedIndex].value>0)        {
+                                       document.ltargetform.ltarget.value = document.ltargetform.popup_width.options[document.ltargetform.popup_width.selectedIndex].value+\'x\'+document.ltargetform.popup_height.options[document.ltargetform.popup_height.selectedIndex].value;
+                                       setTarget(document.ltargetform.ltarget.value);
+                                       document.ltargetform.popup_width.selectedIndex=0;
+                                       document.ltargetform.popup_height.selectedIndex=0;
+                               }';
+
+                               $ltarget.='
+                                               <tr>
+                                                       <td>'.$LANG->getLL('target_popUpWindow',1).':</td>
+                                                       <td colspan="3">
+                                                               <select name="popup_width" onchange="'.$selectJS.'">
+                                                                       <option value="0">'.$LANG->getLL('target_popUpWindow_width',1).'</option>
+                                                                       <option value="300">300</option>
+                                                                       <option value="400">400</option>
+                                                                       <option value="500">500</option>
+                                                                       <option value="600">600</option>
+                                                                       <option value="700">700</option>
+                                                                       <option value="800">800</option>
+                                                               </select>
+                                                               x
+                                                               <select name="popup_height" onchange="'.$selectJS.'">
+                                                                       <option value="0">'.$LANG->getLL('target_popUpWindow_height',1).'</option>
+                                                                       <option value="200">200</option>
+                                                                       <option value="300">300</option>
+                                                                       <option value="400">400</option>
+                                                                       <option value="500">500</option>
+                                                                       <option value="600">600</option>
+                                                               </select>
+                                                       </td>
+                                               </tr>';
+                       }
+               }
+               return $ltarget;
+       }
+
+       function addClassSelector() {
+               global $LANG;
+
+               $selectClass = '';
+               if ($this->classesAnchorJSOptions[$this->act]) {
+                       $selectClassJS = '
+                                       document.ltargetform.anchor_class.value = document.ltargetform.anchor_class.options[document.ltargetform.anchor_class.selectedIndex].value;
+                                       if(document.ltargetform.anchor_class.value && HTMLArea.classesAnchorSetup) {
+                                               for (var i = HTMLArea.classesAnchorSetup.length; --i >= 0;) {
+                                                       var anchorClass = HTMLArea.classesAnchorSetup[i];
+                                                       if (anchorClass[\'name\'] == document.ltargetform.anchor_class.value) {
+                                                               if(anchorClass[\'titleText\'] && document.ltargetform.anchor_title) document.ltargetform.anchor_title.value = anchorClass[\'titleText\'];
+                                                               break;
+                                                       }
+                                               }
+                                       }
+                                       setClass(document.ltargetform.anchor_class.value);
+                               ';
+                       $selectClass ='
+                                               <tr>
+                                                       <td>'.$LANG->getLL('anchor_class',1).':</td>
+                                                       <td colspan="3">
+                                                               <select name="anchor_class" onchange="'.$selectClassJS.'">
+                                                                       ' . $this->classesAnchorJSOptions[$this->act] . '
+                                                               </select>
+                                                       </td>
+                                               </tr>';
+               }
+               return $selectClass;
+       }
+
+       function addTitleSelector() {
+               global $LANG;
+
+               return '
+                                               <tr>
+                                                       <td>'.$LANG->getLL('anchor_title',1).':</td>
+                                                       <td colspan="3">
+                                                               <input type="text" name="anchor_title" value="' . ($this->setTitle?$this->setTitle:(($this->setClass || !$this->classesAnchorDefault[$this->act])?'':$this->classesAnchorDefaultTitle[$this->act])) . '" ' . $this->doc->formWidth(30) . ' />
+                                                       </td>
+                                               </tr>';
+       }
+       
+       public function getLLContent($string) {
+               global $LANG;
+               
+               $BE_lang = $LANG->lang;
+               $BE_origCharSet = $LANG->origCharSet;
+               $BE_charSet = $LANG->charSet;
+               
+               $LANG->lang = $this->contentTypo3Language;
+               $LANG->origCharSet = $LANG->csConvObj->charSetArray[$this->contentTypo3Language];
+               $LANG->origCharSet = $LANG->origCharSet ? $LANG->origCharSet : 'iso-8859-1';
+               $LANG->charSet = $this->contentTypo3Charset;
+               $LLString = $LANG->sL($string);
+               
+               $LANG->lang = $BE_lang;
+               $LANG->origCharSet = $BE_origCharSet;
+               $LANG->charSet = $BE_charSet;
+               return $LLString;
+       }
+
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod3/class.tx_rtehtmlarea_dam_browse_links.php']) {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod3/class.tx_rtehtmlarea_dam_browse_links.php']);
+}
+
+?>
\ No newline at end of file
index 0ae5efb..f93cf7b 100644 (file)
@@ -38,6 +38,7 @@
                        <label index="noWebFolder">You cannot drag images from this folder (yellow) because it is internal on the server.</label>
                        <label index="currentLink">Current Link</label>
                        <label index="invalidChar">ERROR: Invalid character found in file path (%s). Cannot add the file!</label>
+                       <label index="page_id">Page Id</label>
                </languageKey>
        </data>
        <orig_hash type="array">
index e4741f3..aeddfe8 100644 (file)
@@ -246,6 +246,7 @@ class tx_rtehtmlarea_dam_browse_media extends tx_dam_browse_media {
                
                        // Creating backend template object:
                $this->doc = t3lib_div::makeInstance('template');
+               //$this->doc->bodyTagAdditions = 'onLoad="initDialog();"';
                $this->doc->docType= 'xhtml_trans';
                $this->doc->backPath = $BACK_PATH;
                
@@ -364,9 +365,13 @@ class tx_rtehtmlarea_dam_browse_media extends tx_dam_browse_media {
                global $LANG,$BACK_PATH,$TYPO3_CONF_VARS;
                
                $JScode='
-                       var dialog = window.opener.HTMLArea.Dialog["TYPO3Image"];
+                       var dialog = window.opener.HTMLArea.Dialog.TYPO3Image;
                        var plugin = dialog.plugin;
                        var HTMLArea = window.opener.HTMLArea;
+                       
+                       function initDialog() {
+                               dialog.initialize("noLocalize", "noResize");
+                       }
                        function insertElement(table, uid, type, filename,fp,filetype,imagefile,action, close)  {
                                return jumpToUrl(\''.$this->thisScript.'?act='.$this->act.'&mode='.$this->mode.'&bparams='.$this->bparams.'&insertImage='.'\'+fp);
                        }
@@ -445,16 +450,12 @@ class tx_rtehtmlarea_dam_browse_media extends tx_dam_browse_media {
                                                if (document.imageData.iWidth.value && parseInt(document.imageData.iWidth.value)) {
                                                        selectedImageRef.style.width = "";
                                                        selectedImageRef.width = parseInt(document.imageData.iWidth.value);
-                                               } else {
-                                                       selectedImageRef.style.width = "auto";
                                                }
                                        }
                                        if (document.imageData.iHeight) {
                                                if (document.imageData.iHeight.value && parseInt(document.imageData.iHeight.value)) {
                                                        selectedImageRef.style.height = "";
                                                        selectedImageRef.height = parseInt(document.imageData.iHeight.value);
-                                               } else {
-                                                       selectedImageRef.style.height = "auto";
                                                }
                                        }
                                        if (document.imageData.iPaddingTop) {
@@ -549,14 +550,16 @@ class tx_rtehtmlarea_dam_browse_media extends tx_dam_browse_media {
                                        if (document.imageData.iWidth) {
                                                styleWidth = selectedImageRef.style.width ? selectedImageRef.style.width : selectedImageRef.width;
                                                styleWidth = parseInt(styleWidth);
-                                               if (isNaN(styleWidth) || styleWidth == 0) { styleWidth = "auto"; }
-                                               document.imageData.iWidth.value = styleWidth;
+                                               if (!(isNaN(styleWidth) || styleWidth == 0)) {
+                                                       document.imageData.iWidth.value = styleWidth;
+                                               }
                                        }
                                        if (document.imageData.iHeight) {
                                                styleHeight = selectedImageRef.style.height ? selectedImageRef.style.height : selectedImageRef.height;
                                                styleHeight = parseInt(styleHeight);
-                                               if (isNaN(styleHeight) || styleHeight == 0) { styleHeight = "auto"; }
-                                               document.imageData.iHeight.value = styleHeight;
+                                               if (!(isNaN(styleHeight) || styleHeight == 0)) {
+                                                       document.imageData.iHeight.value = styleHeight;
+                                               }
                                        }
                                        if (document.imageData.iPaddingTop) {
                                                var padding = selectedImageRef.style.paddingTop ? selectedImageRef.style.paddingTop : selectedImageRef.vspace;
index 2401bf7..21f4f0a 100644 (file)
@@ -250,6 +250,7 @@ class tx_rtehtmlarea_select_image extends browse_links {
                
                        // Creating backend template object:
                $this->doc = t3lib_div::makeInstance('template');
+               //$this->doc->bodyTagAdditions = 'onLoad="initDialog();"';
                $this->doc->docType= 'xhtml_trans';
                $this->doc->backPath = $BACK_PATH;
                
@@ -356,6 +357,11 @@ class tx_rtehtmlarea_select_image extends browse_links {
                        var dialog = window.opener.HTMLArea.Dialog["TYPO3Image"];
                        var plugin = dialog.plugin;
                        var HTMLArea = window.opener.HTMLArea;
+                       
+
+                       function initDialog() {
+                               dialog.initialize("noLocalize", "noResize");
+                       }
                        function jumpToUrl(URL,anchor)  {
                                var add_act = URL.indexOf("act=")==-1 ? "&act='.$this->act.'" : "";
                                var add_editorNo = URL.indexOf("editorNo=")==-1 ? "&editorNo='.$this->editorNo.'" : "";
@@ -433,16 +439,12 @@ class tx_rtehtmlarea_select_image extends browse_links {
                                                if (document.imageData.iWidth.value && parseInt(document.imageData.iWidth.value)) {
                                                        selectedImageRef.style.width = "";
                                                        selectedImageRef.width = parseInt(document.imageData.iWidth.value);
-                                               } else {
-                                                       selectedImageRef.style.width = "auto";
                                                }
                                        }
                                        if (document.imageData.iHeight) {
                                                if (document.imageData.iHeight.value && parseInt(document.imageData.iHeight.value)) {
                                                        selectedImageRef.style.height = "";
                                                        selectedImageRef.height = parseInt(document.imageData.iHeight.value);
-                                               } else {
-                                                       selectedImageRef.style.height = "auto";
                                                }
                                        }
                                        if (document.imageData.iPaddingTop) {
@@ -537,14 +539,16 @@ class tx_rtehtmlarea_select_image extends browse_links {
                                        if (document.imageData.iWidth) {
                                                styleWidth = selectedImageRef.style.width ? selectedImageRef.style.width : selectedImageRef.width;
                                                styleWidth = parseInt(styleWidth);
-                                               if (isNaN(styleWidth) || styleWidth == 0) { styleWidth = "auto"; }
-                                               document.imageData.iWidth.value = styleWidth;
+                                               if (!(isNaN(styleWidth) || styleWidth == 0)) {
+                                                       document.imageData.iWidth.value = styleWidth;
+                                               }
                                        }
                                        if (document.imageData.iHeight) {
                                                styleHeight = selectedImageRef.style.height ? selectedImageRef.style.height : selectedImageRef.height;
                                                styleHeight = parseInt(styleHeight);
-                                               if (isNaN(styleHeight) || styleHeight == 0) { styleHeight = "auto"; }
-                                               document.imageData.iHeight.value = styleHeight;
+                                               if (!(isNaN(styleHeight) || styleHeight == 0)) {
+                                                       document.imageData.iHeight.value = styleHeight;
+                                               }
                                        }
                                        if (document.imageData.iPaddingTop) {
                                                var padding = selectedImageRef.style.paddingTop ? selectedImageRef.style.paddingTop : selectedImageRef.vspace;
diff --git a/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/download.gif b/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/download.gif
new file mode 100644 (file)
index 0000000..d325e95
Binary files /dev/null and b/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/download.gif differ
diff --git a/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/external_link.gif b/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/external_link.gif
new file mode 100644 (file)
index 0000000..7e8c82b
Binary files /dev/null and b/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/external_link.gif differ
diff --git a/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/external_link_new_window.gif b/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/external_link_new_window.gif
new file mode 100644 (file)
index 0000000..d99dd15
Binary files /dev/null and b/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/external_link_new_window.gif differ
diff --git a/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/internal_link.gif b/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/internal_link.gif
new file mode 100644 (file)
index 0000000..c9fb3eb
Binary files /dev/null and b/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/internal_link.gif differ
diff --git a/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/internal_link_new_window.gif b/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/internal_link_new_window.gif
new file mode 100644 (file)
index 0000000..b0a873e
Binary files /dev/null and b/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/internal_link_new_window.gif differ
diff --git a/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/mail.gif b/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/mail.gif
new file mode 100644 (file)
index 0000000..7aff662
Binary files /dev/null and b/typo3/sysext/rtehtmlarea/res/accessibilityicons/img/mail.gif differ
diff --git a/typo3/sysext/rtehtmlarea/res/accessibilityicons/locallang.xml b/typo3/sysext/rtehtmlarea/res/accessibilityicons/locallang.xml
new file mode 100644 (file)
index 0000000..05f39c0
--- /dev/null
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<!-- TYPO3 SVN ID: $Id$ -->
+<T3locallang>
+       <meta type="array">
+               <description>Labels for anchor accessibility feature of htmlArea RTE</description>
+               <type>module</type>
+       </meta>
+       <data type="array">
+               <languageKey index="default" type="array">
+                       <label index="external_link_altText">Opens external link in current window</label>
+                       <label index="external_link_titleText">Opens external link in current window</label>
+                       <label index="external_link_new_window_altText">Opens external link in new window</label>
+                       <label index="external_link_new_window_titleText">Opens external link in new window</label>
+                       <label index="internal_link_altText">Opens internal link in current window</label>
+                       <label index="internal_link_titleText">Opens internal link in current window</label>
+                       <label index="internal_link_new_window_altText">Opens internal link in new window</label>
+                       <label index="internal_link_new_window_titleText">Opens internal link in new window</label>
+                       <label index="download_altText">Initiates file download</label>
+                       <label index="download_titleText">Initiates file download</label>
+                       <label index="mail_altText">Opens window for sending email</label>
+                       <label index="mail_titleText">Opens window for sending email</label>
+               </languageKey>
+       </data>
+       <orig_hash type="array">
+               <languageKey index="default" type="array">
+                       <label index="external_link_altText" type="integer">127279570</label>
+                       <label index="external_link_titleText" type="integer">127279570</label>
+                       <label index="external_link_new_window_altText" type="integer">159183899</label>
+                       <label index="external_link_new_window_titleText" type="integer">159183899</label>
+                       <label index="internal_link_altText" type="integer">7332359</label>
+                       <label index="internal_link_titleText" type="integer">7332359</label>
+                       <label index="internal_link_new_window_altText" type="integer">198474674</label>
+                       <label index="internal_link_new_window_titleText" type="integer">198474674</label>
+                       <label index="download_altText" type="integer">27837997</label>
+                       <label index="download_titleText" type="integer">27837997</label>
+                       <label index="mail_altText" type="integer">210920015</label>
+                       <label index="mail_titleText" type="integer">210920015</label>
+               </languageKey>
+       </orig_hash>
+       <orig_text type="array">
+               <languageKey index="default" type="array">
+               </languageKey>
+       </orig_text>
+</T3locallang>
\ No newline at end of file
index 5e2ad67..8176769 100644 (file)
@@ -9,28 +9,28 @@
        ## Add inline icons to the links
 RTE.classesAnchor {
        externalLink {
-               image = EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/img/external_link.gif
-               altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:external_link_altText
+               image = EXT:rtehtmlarea/res/accessibilityicons/img/external_link.gif
+               altText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_altText
        }
        externalLinkInNewWindow {
-               image = EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/img/external_link_new_window.gif
-               altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:external_link_new_window_altText
+               image = EXT:rtehtmlarea/res/accessibilityicons/img/external_link_new_window.gif
+               altText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_new_window_altText
        }
        internalLink {
-               image = EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/img/internal_link.gif
-               altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:internal_link_altText
+               image = EXT:rtehtmlarea/res/accessibilityicons/img/internal_link.gif
+               altText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_altText
        }
        internalLinkInNewWindow {
-               image = EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/img/internal_link_new_window.gif
-               altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:internal_link_new_window_altText
+               image = EXT:rtehtmlarea/res/accessibilityicons/img/internal_link_new_window.gif
+               altText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_new_window_altText
        }
        download {
-               image = EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/img/download.gif
-               altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:download_altText
+               image = EXT:rtehtmlarea/res/accessibilityicons/img/download.gif
+               altText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:download_altText
        }
        mail {
-               image = EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/img/mail.gif
-               altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:mail_altText
+               image = EXT:rtehtmlarea/res/accessibilityicons/img/mail.gif
+               altText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:mail_altText
        }
 }
 
index da0cf33..ab878bf 100644 (file)
@@ -22,39 +22,39 @@ RTE.classes {
                value = text-align: right;
        }
        csc-frame-frame1 {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:frame-frame1
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:frame-frame1
                value = background-color: #EDEBF1; border: 1px solid #333333;
        }
        csc-frame-frame2 {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:frame-frame2
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:frame-frame2
                value = background-color: #F5FFAA; border: 1px solid #333333;
        }
        important {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:important
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:important
                value = color: #8A0020;
        }
        name-of-person {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:name-of-person
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:name-of-person
                value = color: #10007B;
        }
        detail {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:detail
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:detail
                value = color: #186900;
        }
        component-items {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:component-items
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:component-items
                value = color: #186900;
        }
        action-items {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:action-items
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:action-items
                value = color: #8A0020;
        }
        component-items-ordered {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:component-items
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:component-items
                value = color: #186900;
        }
        action-items-ordered {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:action-items
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:action-items
                value = color: #8A0020;
        }
 }
@@ -64,44 +64,44 @@ RTE.classesAnchor {
        externalLink {
                class = external-link
                type = url
-               image = EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/img/external_link.gif
-               altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:external_link_altText
-               titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:external_link_titleText
+               image = EXT:rtehtmlarea/res/accessibilityicons/img/external_link.gif
+               altText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_altText
+               titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_titleText
        }
        externalLinkInNewWindow {
                class = external-link-new-window
                type = url
-               image = EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/img/external_link_new_window.gif
-               altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:external_link_new_window_altText
-               titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:external_link_new_window_titleText
+               image = EXT:rtehtmlarea/res/accessibilityicons/img/external_link_new_window.gif
+               altText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_new_window_altText
+               titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_new_window_titleText
        }
        internalLink {
                class = internal-link
                type = page
-               image = EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/img/internal_link.gif
-               altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:internal_link_altText
-               titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:internal_link_titleText
+               image = EXT:rtehtmlarea/res/accessibilityicons/img/internal_link.gif
+               altText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_altText
+               titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_titleText
        }
        internalLinkInNewWindow {
                class = internal-link-new-window
                type = page
-               image = EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/img/internal_link_new_window.gif
-               altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:internal_link_new_window_altText
-               titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:internal_link_new_window_titleText
+               image = EXT:rtehtmlarea/res/accessibilityicons/img/internal_link_new_window.gif
+               altText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_new_window_altText
+               titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_new_window_titleText
        }
        download {
                class = download
                type = file
-               image = EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/img/download.gif
-               altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:download_altText
-               titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:download_titleText
+               image = EXT:rtehtmlarea/res/accessibilityicons/img/download.gif
+               altText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:download_altText
+               titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:download_titleText
        }
        mail {
                class = mail
                type = mail
-               image = EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/img/mail.gif
-               altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:mail_altText
-               titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:mail_titleText
+               image = EXT:rtehtmlarea/res/accessibilityicons/img/mail.gif
+               altText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:mail_altText
+               titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:mail_titleText
        }
 }
 
index b3bd30b..6d137d1 100644 (file)
@@ -24,39 +24,39 @@ RTE.classes {
                value = text-align: right;
        }
        csc-frame-frame1 {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:frame-frame1
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:frame-frame1
                value = background-color: #EDEBF1; border: 1px solid #333333;
        }
        csc-frame-frame2 {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:frame-frame2
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:frame-frame2
                value = background-color: #F5FFAA; border: 1px solid #333333;
        }
        important {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:important
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:important
                value = color: #8A0020;
        }
        name-of-person {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:name-of-person
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:name-of-person
                value = color: #10007B;
        }
        detail {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:detail
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:detail
                value = color: #186900;
        }
        component-items {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:component-items
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:component-items
                value = color: #186900;
        }
        action-items {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:action-items
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:action-items
                value = color: #8A0020;
        }
        component-items-ordered {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:component-items
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:component-items
                value = color: #186900;
        }
        action-items-ordered {
-               name = LLL:EXT:rtehtmlarea/htmlarea/plugins/DynamicCSS/locallang.xml:action-items
+               name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:action-items
                value = color: #8A0020;
        }
 }
@@ -66,32 +66,32 @@ RTE.classesAnchor {
        externalLink {
                class = external-link
                type = url
-               titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:external_link_titleText
+               titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_titleText
        }
        externalLinkInNewWindow {
                class = external-link-new-window
                type = url
-               titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:external_link_new_window_titleText
+               titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_new_window_titleText
        }
        internalLink {
                class = internal-link
                type = page
-               titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:internal_link_titleText
+               titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_titleText
        }
        internalLinkInNewWindow {
                class = internal-link-new-window
                type = page
-               titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:internal_link_new_window_titleText
+               titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_new_window_titleText
        }
        download {
                class = download
                type = file
-               titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:download_titleText
+               titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:download_titleText
        }
        mail {
                class = mail
                type = mail
-               titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.xml:mail_titleText
+               titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:mail_titleText
        }
 }
 
index 9d7adad..725df5a 100644 (file)
 /* Selectors for the Table Operations plugin */
 /* Make borders visible */
 /* Make sure we can click in empty cells without too much difficulty */
-.htmlarea-showtableborders, .htmlarea-showtableborders td, .htmlarea-showtableborders th {
+body.htmlarea-content-body .htmlarea-showtableborders, body.htmlarea-content-body .htmlarea-showtableborders td, body.htmlarea-content-body .htmlarea-showtableborders th {
        padding: 3px; border:1px dashed #316ac5 ! important;
 }
 
 /* Selectors for the Abbreviation plugin */
-abbr, acronym {
+body.htmlarea-content-body abbr, body.htmlarea-content-body acronym {
        border-bottom:1px dashed #000;
        cursor:help;
 }
\ No newline at end of file
index 57a325c..8c2d99d 100644 (file)
 .htmlarea .toolbar .InsertCharacter {background-image:url("images/CharacterMap/ed_charmap.gif");}
 .htmlarea .toolbar .InsertHorizontalRule {background-image:url("images/ed_hr.gif");}
 .htmlarea .toolbar .CreateLink, .htmlarea-context-menu .CreateLink {background-image:url("images/ed_link.gif");}
-.htmlarea-context-menu .UnLink {background-image:url("images/ed_unlink.gif");}
+.htmlarea .toolbar .UnLink, .htmlarea-context-menu .UnLink {background-image:url("images/ed_unlink.gif");}
 .htmlarea .toolbar .InsertImage, .htmlarea-context-menu .InsertImage {background-image:url("images/ed_image.gif");}
-.htmlarea .toolbar .CreateLink-TYPO3Browsers, .htmlarea-context-menu .CreateLink-TYPO3Browsers {background-image:url("images/TYPO3Browsers/ed_link.gif");}
-.htmlarea-context-menu .UnLink-TYPO3Browsers {background-image:url("images/TYPO3Browsers/ed_unlink.gif");}
-.htmlarea .toolbar .InsertImage-TYPO3Browsers, .htmlarea-context-menu .InsertImage-TYPO3Browsers {background-image:url("images/TYPO3Browsers/ed_image.gif");}
 .htmlarea .toolbar .InsertTable {background-image:url("images/insert_table.gif");}
 .htmlarea .toolbar .UserElements {background-image:url("images/UserElements/ed_user.gif");}
 .htmlarea .toolbar .FindReplace {background-image:url("images/FindReplace/ed_find.gif");}
index b54f7fc..a1ae562 100644 (file)
Binary files a/typo3/sysext/t3skin/rtehtmlarea/images/ed_link.gif and b/typo3/sysext/t3skin/rtehtmlarea/images/ed_link.gif differ
index 1a4c3dc..26f7f4f 100644 (file)
Binary files a/typo3/sysext/t3skin/rtehtmlarea/images/ed_unlink.gif and b/typo3/sysext/t3skin/rtehtmlarea/images/ed_unlink.gif differ