[TASK] RTE: Rename "acronym" plugin and button to "abbreviation" 93/33993/3
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 11 Nov 2014 22:33:35 +0000 (17:33 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Wed, 12 Nov 2014 17:06:20 +0000 (18:06 +0100)
The acronym tag being deprecated, the RTE "acronym" plugin and button
are renamed to "abbreviation".

Releases: master
Resolves: #54409
Change-Id: I7b8335e6aac298650f83055e060c752d0d896038
Reviewed-on: http://review.typo3.org/33993
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
20 files changed:
typo3/sysext/core/Documentation/Changelog/master/Breaking-54409-RteAcronymButtonRenamedAbbreviation.rst [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Classes/Extension/Abbreviation.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Classes/Extension/Acronym.php [deleted file]
typo3/sysext/rtehtmlarea/Classes/Hook/Install/RteAcronymButtonRenamedToAbbreviation.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Classes/RteHtmlAreaBase.php
typo3/sysext/rtehtmlarea/Configuration/TCA/Overrides/tx_rtehtmlarea_acronym.php
typo3/sysext/rtehtmlarea/Configuration/TCA/tx_rtehtmlarea_acronym.php
typo3/sysext/rtehtmlarea/Documentation/Configuration/PageTsconfig/interfaceConfiguration/Index.rst
typo3/sysext/rtehtmlarea/Migrations/Code/ClassAliasMap.php
typo3/sysext/rtehtmlarea/Resources/Public/Css/Skin/Plugins/abbreviation.css [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Resources/Public/Css/Skin/Plugins/acronym.css [deleted file]
typo3/sysext/rtehtmlarea/Resources/Public/Images/Plugins/Abbreviation/abbreviation.gif [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Resources/Public/Images/Plugins/Acronym/acronym.gif [deleted file]
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/abbreviation.js [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/acronym.js [deleted file]
typo3/sysext/rtehtmlarea/ext_localconf.php
typo3/sysext/rtehtmlarea/ext_tables.php
typo3/sysext/rtehtmlarea/extensions/Abbreviation/locallang_csh.xlf [new file with mode: 0644]
typo3/sysext/rtehtmlarea/htmlarea/plugins/Abbreviation/locallang.xlf [new file with mode: 0644]
typo3/sysext/rtehtmlarea/locallang_csh_abbreviation.xlf

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-54409-RteAcronymButtonRenamedAbbreviation.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-54409-RteAcronymButtonRenamedAbbreviation.rst
new file mode 100644 (file)
index 0000000..5c75e76
--- /dev/null
@@ -0,0 +1,41 @@
+==================================================================
+Breaking: #54409 - RTE "acronym" button was renamed "abbreviation"
+==================================================================
+
+Description
+===========
+
+The "acronym" tag being deprecated, the RTE "acronym" button was renamed "abbreviation".
+Accordingly, the RTE Acronym plugin was renamed Abbreviation.
+
+
+Impact
+======
+
+The "abbreviation" button may not appear in the RTE toolbar, if configured as "acronym" in Page TSconfig, TCA special configuration options and/or User TSconfig.
+Possible undefined PHP class errors.
+Possible Javascript or file not found errors.
+
+
+Affected installations
+======================
+
+An installation is affected if the "acronym" button was configured in Page TSconfig and/or User TSconfig.
+An installation is affected if a 3rd party extension refers to the "acronym" button in TCA special configuration options.
+An installation is affected if a 3rd party extension refers to class TYPO3\CMS\Rtehtmlarea\Extension\Acronym
+An installation is affected if a 3rd party extension loads the JavaScript file of the Acronym plugin: EXT:rtehtmlarea/Resources/Public/Javascript/Plugins/Acronym.js
+
+
+Migration
+=========
+
+There is no immediate impact on the RTE configuration in Page TSconfig and TCA special configuration options until the automatic conversion of existing references to "acronym" is removed in TYPO3 CMS 8.0.
+Intallations may run the upgrade wizard of the Install tool to migrate the contents of Page TSconfig, replacing "acronym" by "abbreviation".
+Note that this string replacement will apply to all contents of PageTSconfig.
+The migration of PageTSconfig may also be done manually.
+
+User TSconfig must be modified to refer to "abbreviation" instead of "acronym".
+
+Any affected 3rd party extension must be modified to refer to the "abbreviation" button rather than "acronym" in TCA special configuration options.
+Any affected 3rd party extension must be modified to refer to class TYPO3\CMS\Rtehtmlarea\Extension\Abbreviation rather than TYPO3\CMS\Rtehtmlarea\Extension\Acronym
+Any affected 3rd party extension must be modified to load EXT:rtehtmlarea/Resources/Public/Javascript/Plugins/Abbreviation.js rather than EXT:rtehtmlarea/Resources/Public/Javascript/Plugins/Acronym.js
\ No newline at end of file
diff --git a/typo3/sysext/rtehtmlarea/Classes/Extension/Abbreviation.php b/typo3/sysext/rtehtmlarea/Classes/Extension/Abbreviation.php
new file mode 100644 (file)
index 0000000..c1f02ce
--- /dev/null
@@ -0,0 +1,251 @@
+<?php
+namespace TYPO3\CMS\Rtehtmlarea\Extension;
+
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Backend\Utility\BackendUtility;
+
+/**
+ * Abbreviation extension for htmlArea RTE
+ *
+ * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
+ */
+class Abbreviation extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi {
+
+       /**
+        * The key of the extension that is extending htmlArea RTE
+        *
+        * @var string
+        */
+       protected $extensionKey = 'rtehtmlarea';
+
+       /**
+        * The name of the plugin registered by the extension
+        *
+        * @var string
+        */
+       protected $pluginName = 'Abbreviation';
+
+       /**
+        * Path to this main locallang file of the extension relative to the extension directory
+        *
+        * @var string
+        */
+       protected $relativePathToLocallangFile = '';
+
+       /**
+        * Path to the skin file relative to the extension directory
+        *
+        * @var string
+        */
+       protected $relativePathToSkin = 'Resources/Public/Css/Skin/Plugins/abbreviation.css';
+
+       /**
+        * Reference to the invoking object
+        *
+        * @var \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase
+        */
+       protected $htmlAreaRTE;
+
+       protected $thisConfig;
+
+       // Reference to RTE PageTSConfig
+       protected $toolbar;
+
+       // Reference to RTE toolbar array
+       protected $LOCAL_LANG;
+
+       // Frontend language array
+
+       /**
+        * Comma-separated list of button names that the registered plugin is adding to the htmlArea RTE toolbar
+        *
+        * @var string
+        */
+       protected $pluginButtons = 'abbreviation';
+
+       /**
+        * Name-converting array, converting the button names used in the RTE PageTSConfing to the button id's used by the JS scripts
+        *
+        * @var array
+        */
+       protected $convertToolbarForHtmlAreaArray = array(
+               'abbreviation' => 'Abbreviation'
+       );
+
+       protected $acronymIndex = 0;
+
+       protected $abbreviationIndex = 0;
+
+       /**
+        * Returns TRUE if the plugin is available and correctly initialized
+        *
+        * @param \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase Reference to parent object
+        * @return bool TRUE if this plugin should be made available in the current environment and is correctly initialized
+        */
+       public function main(\TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase $parentObject) {
+               // acronym button is deprecated as of TYPO3 CMS 7.0, use abbreviation instead
+               // Convert the acronym button configuration
+               if (isset($this->thisConfig['buttons.']['acronym.']) && is_array($this->thisConfig['buttons.']['acronym.'])) {
+                       if (!isset($this->thisConfig['buttons.']['abbreviation.']) || !is_array($this->thisConfig['buttons.']['abbreviation.'])) {
+                               $this->thisConfig['buttons.']['abbreviation.'] = $this->thisConfig['buttons.']['acronym.'];
+                       }
+                       unset($this->thisConfig['buttons.']['acronym.']);
+               }
+               // Convert any other reference to acronym two levels down in Page TSconfig, except in processing options
+               foreach ($parentObject->thisConfig as $key => $config) {
+                       if ($key !== 'proc.') {
+                               if (is_array($config)) {
+                                       foreach ($config as $subKey => $subConfig) {
+                                               $parentObject->thisConfig[$key][$subKey] = str_replace('acronym', 'abbreviation', $subConfig);
+                                       }
+                               } else {
+                                       $parentObject->thisConfig[$key] = str_replace('acronym', 'abbreviation', $config);
+                               }
+                       }
+               }
+               // Convert any reference to acronym in special configuration options
+               if (is_array($parentObject->specConf['richtext']['parameters'])) {
+                       foreach ($parentObject->specConf['richtext']['parameters'] as $key => $config) {
+                               $parentObject->specConf['richtext']['parameters'][$key] = str_replace('acronym', 'abbreviation', $config);
+                       }
+               }
+               // Convert any reference to acronym in user TSconfig
+               if (is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->userTS['options.']['RTEkeyList'])) {
+                       $GLOBALS['BE_USER']->userTS['options.']['RTEkeyList'] = str_replace('acronym', 'abbreviation', $GLOBALS['BE_USER']->userTS['options.']['RTEkeyList']);
+               }
+               return parent::main($parentObject) && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables');
+       }
+
+       /**
+        * Return tranformed content
+        *
+        * @param string $content: The content that is about to be sent to the RTE
+        * @return string the transformed content
+        */
+       public function transformContent($content) {
+               // <abbr> was not supported by IE before version 7
+               if ($this->htmlAreaRTE->client['browser'] == 'msie' && $this->htmlAreaRTE->client['version'] < 7) {
+                       // change <abbr> to <acronym>
+                       $content = preg_replace('/<(\\/?)abbr/i', '<$1acronym', $content);
+               }
+               return $content;
+       }
+
+       /**
+        * Return JS configuration of the htmlArea plugins registered by the extension
+        *
+        * @param int 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
+        */
+       public function buildJavascriptConfiguration($RTEcounter) {
+               $registerRTEinJavascriptString = '';
+               $button = 'abbreviation';
+               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 . '.abbreviationUrl = "' . $this->htmlAreaRTE->writeTemporaryFile('', ('abbreviation_' . $this->htmlAreaRTE->contentLanguageUid), 'js', $this->buildJSAbbreviationArray($this->htmlAreaRTE->contentLanguageUid)) . '";';
+                       // <abbr> was not supported by IE before version 7
+                       if ($this->htmlAreaRTE->client['browser'] == 'msie' && $this->htmlAreaRTE->client['version'] < 7) {
+                               $this->abbreviationIndex = 0;
+                       }
+                       $registerRTEinJavascriptString .= '
+                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.noAcronym = ' . ($this->acronymIndex ? 'false' : 'true') . ';
+                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.noAbbr =  ' . ($this->abbreviationIndex ? 'false' : 'true') . ';';
+               }
+               return $registerRTEinJavascriptString;
+       }
+
+       /**
+        * Return an abbreviation array for the Abbreviation plugin
+        *
+        * @return string abbreviation Javascript array
+        */
+       protected function buildJSAbbreviationArray($languageUid) {
+               $button = 'abbreviation';
+               $acronymArray = array();
+               $abbrArray = array();
+               $tableA = 'tx_rtehtmlarea_acronym';
+               $tableB = 'static_languages';
+               $fields = $tableA . '.type,' . $tableA . '.term,' . $tableA . '.acronym,' . $tableB . '.lg_iso_2,' . $tableB . '.lg_country_iso_2';
+               $tableAB = $tableA . ' LEFT JOIN ' . $tableB . ' ON ' . $tableA . '.static_lang_isocode=' . $tableB . '.uid';
+               $whereClause = '1=1';
+               // Get all abbreviations on pages to which the user has access
+               $lockBeUserToDBmounts = isset($this->thisConfig['buttons.'][$button . '.']['lockBeUserToDBmounts']) ? $this->thisConfig['buttons.'][$button . '.']['lockBeUserToDBmounts'] : $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts'];
+               if (!$GLOBALS['BE_USER']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts'] && $lockBeUserToDBmounts) {
+                       // Temporarily setting alternative web browsing mounts
+                       $altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.altElementBrowserMountPoints'));
+                       if ($altMountPoints) {
+                               $savedGroupDataWebmounts = $GLOBALS['BE_USER']->groupData['webmounts'];
+                               $GLOBALS['BE_USER']->groupData['webmounts'] = implode(',', array_unique(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $altMountPoints)));
+                               $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
+                       }
+                       $webMounts = $GLOBALS['BE_USER']->returnWebmounts();
+                       $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
+                       $recursive = isset($this->thisConfig['buttons.'][$button . '.']['recursive']) ? (int)$this->thisConfig['buttons.'][$button . '.']['recursive'] : 0;
+                       if (trim($this->thisConfig['buttons.'][$button . '.']['pages'])) {
+                               $pids = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->thisConfig['buttons.'][$button . '.']['pages'], TRUE);
+                               foreach ($pids as $key => $val) {
+                                       if (!$GLOBALS['BE_USER']->isInWebMount($val, $perms_clause)) {
+                                               unset($pids[$key]);
+                                       }
+                               }
+                       } else {
+                               $pids = $webMounts;
+                       }
+                       // Restoring webmounts
+                       if ($altMountPoints) {
+                               $GLOBALS['BE_USER']->groupData['webmounts'] = $savedGroupDataWebmounts;
+                               $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
+                       }
+                       $queryGenerator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\QueryGenerator');
+                       foreach ($pids as $key => $val) {
+                               if ($pageTree) {
+                                       $pageTreePrefix = ',';
+                               }
+                               $pageTree .= $pageTreePrefix . $queryGenerator->getTreeList($val, $recursive, ($begin = 0), $perms_clause);
+                       }
+                       $whereClause .= ' AND ' . $tableA . '.pid IN (' . $GLOBALS['TYPO3_DB']->fullQuoteStr(($pageTree ?: ''), $tableA) . ')';
+               }
+               // Restrict to abbreviations applicable to the language of current content element
+               if ($this->htmlAreaRTE->contentLanguageUid > -1) {
+                       $whereClause .= ' AND (' . $tableA . '.sys_language_uid=' . $this->htmlAreaRTE->contentLanguageUid . ' OR ' . $tableA . '.sys_language_uid=-1) ';
+               }
+               // Restrict to abbreviations in certain languages
+               if (is_array($this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['language.']) && isset($this->thisConfig['buttons.']['language.']['restrictToItems'])) {
+                       $languageList = implode('\',\'', \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_DB']->fullQuoteStr(strtoupper($this->thisConfig['buttons.']['language.']['restrictToItems']), $tableB)));
+                       $whereClause .= ' AND ' . $tableB . '.lg_iso_2 IN (' . $languageList . ') ';
+               }
+               $whereClause .= BackendUtility::BEenableFields($tableA);
+               $whereClause .= BackendUtility::deleteClause($tableA);
+               $whereClause .= BackendUtility::BEenableFields($tableB);
+               $whereClause .= BackendUtility::deleteClause($tableB);
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $tableAB, $whereClause);
+               while ($abbreviationRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $item = array('term' => $abbreviationRow['term'], 'abbr' => $abbreviationRow['acronym'], 'language' => strtolower($abbreviationRow['lg_iso_2']) . ($abbreviationRow['lg_country_iso_2'] ? '-' . $abbreviationRow['lg_country_iso_2'] : ''));
+                       if ($abbreviationRow['type'] == 1) {
+                               $acronymArray[] = $item;
+                       } elseif ($abbreviationRow['type'] == 2) {
+                               $abbrArray[] = $item;
+                       }
+               }
+               $this->acronymIndex = count($acronymArray);
+               $this->abbreviationIndex = count($abbrArray);
+               return json_encode(array('abbr' => $abbrArray, 'acronym' => $acronymArray));
+       }
+
+}
diff --git a/typo3/sysext/rtehtmlarea/Classes/Extension/Acronym.php b/typo3/sysext/rtehtmlarea/Classes/Extension/Acronym.php
deleted file mode 100644 (file)
index 19fb93e..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-<?php
-namespace TYPO3\CMS\Rtehtmlarea\Extension;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Backend\Utility\BackendUtility;
-
-/**
- * Acronym extension for htmlArea RTE
- *
- * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
- */
-class Acronym extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi {
-
-       /**
-        * The key of the extension that is extending htmlArea RTE
-        *
-        * @var string
-        */
-       protected $extensionKey = 'rtehtmlarea';
-
-       /**
-        * The name of the plugin registered by the extension
-        *
-        * @var string
-        */
-       protected $pluginName = 'Acronym';
-
-       /**
-        * Path to this main locallang file of the extension relative to the extension directory
-        *
-        * @var string
-        */
-       protected $relativePathToLocallangFile = '';
-
-       /**
-        * Path to the skin file relative to the extension directory
-        *
-        * @var string
-        */
-       protected $relativePathToSkin = 'Resources/Public/Css/Skin/Plugins/acronym.css';
-
-       /**
-        * Reference to the invoking object
-        *
-        * @var \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase
-        */
-       protected $htmlAreaRTE;
-
-       protected $thisConfig;
-
-       // Reference to RTE PageTSConfig
-       protected $toolbar;
-
-       // Reference to RTE toolbar array
-       protected $LOCAL_LANG;
-
-       // Frontend language array
-       protected $pluginButtons = 'acronym';
-
-       protected $convertToolbarForHtmlAreaArray = array(
-               'acronym' => 'Acronym'
-       );
-
-       protected $acronymIndex = 0;
-
-       protected $abbreviationIndex = 0;
-
-       public function main($parentObject) {
-               return parent::main($parentObject) && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables');
-       }
-
-       /**
-        * Return tranformed content
-        *
-        * @param string $content: The content that is about to be sent to the RTE
-        * @return string the transformed content
-        */
-       public function transformContent($content) {
-               // <abbr> was not supported by IE before verison 7
-               if ($this->htmlAreaRTE->client['browser'] == 'msie' && $this->htmlAreaRTE->client['version'] < 7) {
-                       // change <abbr> to <acronym>
-                       $content = preg_replace('/<(\\/?)abbr/i', '<$1acronym', $content);
-               }
-               return $content;
-       }
-
-       /**
-        * Return JS configuration of the htmlArea plugins registered by the extension
-        *
-        * @param int 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
-        */
-       public function buildJavascriptConfiguration($RTEcounter) {
-               $registerRTEinJavascriptString = '';
-               $button = 'acronym';
-               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 . '.acronymUrl = "' . $this->htmlAreaRTE->writeTemporaryFile('', ('acronym_' . $this->htmlAreaRTE->contentLanguageUid), 'js', $this->buildJSAcronymArray($this->htmlAreaRTE->contentLanguageUid)) . '";';
-                       // <abbr> was not supported by IE before version 7
-                       if ($this->htmlAreaRTE->client['browser'] == 'msie' && $this->htmlAreaRTE->client['version'] < 7) {
-                               $this->abbreviationIndex = 0;
-                       }
-                       $registerRTEinJavascriptString .= '
-                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.noAcronym = ' . ($this->acronymIndex ? 'false' : 'true') . ';
-                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.noAbbr =  ' . ($this->abbreviationIndex ? 'false' : 'true') . ';';
-               }
-               return $registerRTEinJavascriptString;
-       }
-
-       /**
-        * Return an acronym array for the Acronym plugin
-        *
-        * @return string acronym Javascript array
-        */
-       public function buildJSAcronymArray($languageUid) {
-               $button = 'acronym';
-               $acronymArray = array();
-               $abbrArray = array();
-               $tableA = 'tx_rtehtmlarea_acronym';
-               $tableB = 'static_languages';
-               $fields = $tableA . '.type,' . $tableA . '.term,' . $tableA . '.acronym,' . $tableB . '.lg_iso_2,' . $tableB . '.lg_country_iso_2';
-               $tableAB = $tableA . ' LEFT JOIN ' . $tableB . ' ON ' . $tableA . '.static_lang_isocode=' . $tableB . '.uid';
-               $whereClause = '1=1';
-               // Get all acronyms on pages to which the user has access
-               $lockBeUserToDBmounts = isset($this->thisConfig['buttons.'][$button . '.']['lockBeUserToDBmounts']) ? $this->thisConfig['buttons.'][$button . '.']['lockBeUserToDBmounts'] : $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts'];
-               if (!$GLOBALS['BE_USER']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts'] && $lockBeUserToDBmounts) {
-                       // Temporarily setting alternative web browsing mounts
-                       $altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.altElementBrowserMountPoints'));
-                       if ($altMountPoints) {
-                               $savedGroupDataWebmounts = $GLOBALS['BE_USER']->groupData['webmounts'];
-                               $GLOBALS['BE_USER']->groupData['webmounts'] = implode(',', array_unique(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $altMountPoints)));
-                               $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
-                       }
-                       $webMounts = $GLOBALS['BE_USER']->returnWebmounts();
-                       $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
-                       $recursive = isset($this->thisConfig['buttons.'][$button . '.']['recursive']) ? (int)$this->thisConfig['buttons.'][$button . '.']['recursive'] : 0;
-                       if (trim($this->thisConfig['buttons.'][$button . '.']['pages'])) {
-                               $pids = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->thisConfig['buttons.'][$button . '.']['pages'], TRUE);
-                               foreach ($pids as $key => $val) {
-                                       if (!$GLOBALS['BE_USER']->isInWebMount($val, $perms_clause)) {
-                                               unset($pids[$key]);
-                                       }
-                               }
-                       } else {
-                               $pids = $webMounts;
-                       }
-                       // Restoring webmounts
-                       if ($altMountPoints) {
-                               $GLOBALS['BE_USER']->groupData['webmounts'] = $savedGroupDataWebmounts;
-                               $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
-                       }
-                       $queryGenerator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\QueryGenerator');
-                       foreach ($pids as $key => $val) {
-                               if ($pageTree) {
-                                       $pageTreePrefix = ',';
-                               }
-                               $pageTree .= $pageTreePrefix . $queryGenerator->getTreeList($val, $recursive, ($begin = 0), $perms_clause);
-                       }
-                       $whereClause .= ' AND ' . $tableA . '.pid IN (' . $GLOBALS['TYPO3_DB']->fullQuoteStr(($pageTree ?: ''), $tableA) . ')';
-               }
-               // Restrict to acronyms applicable to the language of current content element
-               if ($this->htmlAreaRTE->contentLanguageUid > -1) {
-                       $whereClause .= ' AND (' . $tableA . '.sys_language_uid=' . $this->htmlAreaRTE->contentLanguageUid . ' OR ' . $tableA . '.sys_language_uid=-1) ';
-               }
-               // Restrict to acronyms in certain languages
-               if (is_array($this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['language.']) && isset($this->thisConfig['buttons.']['language.']['restrictToItems'])) {
-                       $languageList = implode('\',\'', \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_DB']->fullQuoteStr(strtoupper($this->thisConfig['buttons.']['language.']['restrictToItems']), $tableB)));
-                       $whereClause .= ' AND ' . $tableB . '.lg_iso_2 IN (' . $languageList . ') ';
-               }
-               $whereClause .= BackendUtility::BEenableFields($tableA);
-               $whereClause .= BackendUtility::deleteClause($tableA);
-               $whereClause .= BackendUtility::BEenableFields($tableB);
-               $whereClause .= BackendUtility::deleteClause($tableB);
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $tableAB, $whereClause);
-               while ($acronymRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $item = array('term' => $acronymRow['term'], 'abbr' => $acronymRow['acronym'], 'language' => strtolower($acronymRow['lg_iso_2']) . ($acronymRow['lg_country_iso_2'] ? '-' . $acronymRow['lg_country_iso_2'] : ''));
-                       if ($acronymRow['type'] == 1) {
-                               $acronymArray[] = $item;
-                       } elseif ($acronymRow['type'] == 2) {
-                               $abbrArray[] = $item;
-                       }
-               }
-               $this->acronymIndex = count($acronymArray);
-               $this->abbreviationIndex = count($abbrArray);
-               return json_encode(array('abbr' => $abbrArray, 'acronym' => $acronymArray));
-       }
-
-}
diff --git a/typo3/sysext/rtehtmlarea/Classes/Hook/Install/RteAcronymButtonRenamedToAbbreviation.php b/typo3/sysext/rtehtmlarea/Classes/Hook/Install/RteAcronymButtonRenamedToAbbreviation.php
new file mode 100644 (file)
index 0000000..c27f879
--- /dev/null
@@ -0,0 +1,165 @@
+<?php
+namespace TYPO3\CMS\Rtehtmlarea\Hook\Install;
+
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Install\Updates\AbstractUpdate;
+
+/**
+ * Contains the update class for the replacement of deprecated acronym button by abbreviation button in Page TSconfig.
+ * Used by the upgrade wizard in the install tool.
+ */
+class RteAcronymButtonRenamedToAbbreviation extends AbstractUpdate {
+
+       /**
+        * @var string
+        */
+       protected $title = 'Rte "acronym" button renamed to "abbreviation"';
+
+       /**
+        * Function which checks if update is needed. Called in the beginning of an update process.
+        *
+        * @param string $description Pointer to description for the update
+        * @return bool TRUE if update is needs to be performed, FALSE otherwise.
+        */
+       public function checkForUpdate(&$description) {
+               $result = FALSE;
+
+               $pages = $this->getPagesWithDeprecatedRteProperties($dbQueries, $customMessages);
+               $pagesCount = count($pages);
+               $description = '<p>The RTE "acronym" button is deprecated and replaced by the "abbreviation" button since TYPO3 CMS 7.0.</p>' . LF . '<p>Page TSconfig currently includes the string "acronym" on <strong>' . strval($pagesCount) . '&nbsp;pages</strong>  (including deleted and hidden pages).</p>' . LF;
+               if ($pagesCount) {
+                       $pagesUids = array();
+                       foreach ($pages as $page) {
+                               $pagesUids[] = $page['uid'];
+                       }
+                       $description .= '<p>Pages id\'s: ' . implode(', ', $pagesUids) . '</p>';
+               }
+               if ($pagesCount) {
+                       $updateablePages = $this->findUpdateablePagesWithDeprecatedRteProperties($pages);
+                       if (count($updateablePages)) {
+                               $description .= '<p>This wizard will perform automatic replacement of the string "acronym" by the string "abbreviation" on the Page TSconfig of <strong>' . strval(count($updateablePages)) . '&nbsp;pages</strong> (including deleted and hidden):</p>' . LF;
+                       }
+                       $result = TRUE;
+               } else {
+                       // if we found no occurrence of deprecated settings and wizard was already executed, then
+                       // we do not show up anymore
+                       if ($this->isWizardDone()) {
+                               $result = FALSE;
+                       }
+               }
+               $description .= '<p>Only page records are searched for the string "acronym". However, such string may also be used in BE group and BE user records. These are not searched nor updated by this wizard.</p>'
+                       . LF . '<p>Page TSconfig may also be included from external files. These are not updated by this wizard. If required, the update will need to be done manually.</p>'
+                       . LF . '<p>Note that this string replacement will apply to all contents of PageTSconfig.</p>'
+                       . LF . '<p>Note that the configuration of RTE processing options (RTE.default.proc) may also include the string "acronym".</p>';
+
+               return $result;
+       }
+
+       /**
+        * Performs the update itself
+        *
+        * @param array $dbQueries Pointer where to insert all DB queries made, so they can be shown to the user if wanted
+        * @param string $customMessages Pointer to output custom messages
+        * @return bool TRUE if update succeeded, FALSE otherwise
+        */
+       public function performUpdate(array &$dbQueries, &$customMessages) {
+               $customMessages = '';
+               $pages = $this->getPagesWithDeprecatedRteProperties($dbQueries, $customMessages);
+               if (empty($customMessages)) {
+                       $pagesCount = count($pages);
+                       if ($pagesCount) {
+                               $updateablePages = $this->findUpdateablePagesWithDeprecatedRteProperties($pages);
+                               if (count($updateablePages)) {
+                                       $this->updatePages($updateablePages, $dbQueries, $customMessages);
+                                       // If the update was successful
+                                       if (empty($customMessages)) {
+                                               if (count($updateablePages) !== $pagesCount) {
+                                                       $customMessages = 'Some deprecated Page TSconfig properties were found. However, the wizard was unable to automatically replace all the deprecated properties found. Some properties will have to be replaced manually.';
+                                               }
+                                       }
+                               } else {
+                                       $customMessages = 'Some deprecated Page TSconfig properties were found. However, the wizard was unable to automatically replace any of the deprecated properties found. These properties will have to be replaced manually.';
+                               }
+                       }
+               }
+               $this->markWizardAsDone();
+               return empty($customMessages);
+       }
+
+       /**
+        * Gets the pages with deprecated RTE properties in TSConfig column
+        *
+        * @param array $dbQueries Pointer where to insert all DB queries made, so they can be shown to the user if wanted
+        * @param string $customMessages Pointer to output custom messages
+        * @return array uid and inclusion string for the pages with deprecated RTE properties in TSConfig column
+        */
+       protected function getPagesWithDeprecatedRteProperties(&$dbQueries, &$customMessages) {
+               $fields = 'uid, TSconfig';
+               $table = 'pages';
+               $where = 'TSConfig LIKE BINARY "%acronym%"';
+               $db = $this->getDatabaseConnection();
+               $res = $db->exec_SELECTquery($fields, $table, $where);
+               $dbQueries[] = str_replace(chr(10), ' ', $db->debug_lastBuiltQuery);
+               if ($db->sql_error()) {
+                       $customMessages = 'SQL-ERROR: ' . htmlspecialchars($db->sql_error());
+               }
+               $pages = array();
+               while ($row = $db->sql_fetch_assoc($res)) {
+                       $pages[] = $row;
+               }
+               return $pages;
+       }
+
+       /**
+        * Gets the pages with updateable deprecated RTE properties in TSConfig column
+        *
+        * @param array $pages reference to pages with deprecated property
+        * @return array uid and inclusion string for the pages with deprecated RTE properties in TSConfig column
+        */
+       protected function findUpdateablePagesWithDeprecatedRteProperties(&$pages) {
+               foreach ($pages as $index => $page) {
+                       $updatedPageTSConfig = str_replace('acronym', 'abbreviation', $page['TSconfig']);
+                       if ($updatedPageTSConfig == $page['TSconfig']) {
+                               unset($pages[$index]);
+                       } else {
+                               $pages[$index]['TSconfig'] = $updatedPageTSConfig;
+                       }
+               }
+               return $pages;
+       }
+
+       /**
+        * updates the pages records with updateable Page TSconfig properties
+        *
+        * @param array $pages Page records to update, fetched by getTemplates() and filtered by
+        * @param array $dbQueries Pointer where to insert all DB queries made, so they can be shown to the user if wanted
+        * @param string $customMessages Pointer to output custom messages
+        */
+       protected function updatePages($pages, &$dbQueries, &$customMessages) {
+               $db = $this->getDatabaseConnection();
+               foreach ($pages as $page) {
+                       $table = 'pages';
+                       $where = 'uid =' . $page['uid'];
+                       $field_values = array(
+                               'TSconfig' => $page['TSconfig']
+                       );
+                       $db->exec_UPDATEquery($table, $where, $field_values);
+                       $dbQueries[] = str_replace(chr(10), ' ', $db->debug_lastBuiltQuery);
+                       if ($db->sql_error()) {
+                               $customMessages .= 'SQL-ERROR: ' . htmlspecialchars($db->sql_error()) . LF . LF;
+                       }
+               }
+       }
+}
index d8e7560..d970b64 100644 (file)
@@ -657,7 +657,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                        bar, left, center, right, justifyfull,
                        bar, orderedlist, unorderedlist, definitionlist, definitionitem, outdent, indent,  bar, lefttoright, righttoleft, language, showlanguagemarks,
                        bar, textcolor, bgcolor, textindicator,
-                       bar, editelement, showmicrodata, emoticon, insertcharacter, insertsofthyphen, 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, editelement, showmicrodata, emoticon, insertcharacter, insertsofthyphen, 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, abbreviation, bar, findreplace, spellcheck,
                        bar, chMode, inserttag, removeformat, bar, copy, cut, paste, pastetoggle, pastebehaviour, bar, undo, redo, bar, showhelp, about, linebreak,
                        ' . ($this->thisConfig['hideTableOperationsInToolbar'] ? '' : 'bar, toggleborders,') . ' bar, tableproperties, tablerestyle, bar, rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit, bar,
                        columnproperties, columninsertbefore, columninsertafter, columndelete, columnsplit, bar,
index ac3e3cc..856cb93 100644 (file)
@@ -2,4 +2,3 @@
 defined('TYPO3_MODE') or die();
 
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_rtehtmlarea_acronym');
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_rtehtmlarea_acronym', 'EXT:rtehtmlarea/locallang_csh_abbreviation.xlf');
index ef87b36..3bf8a09 100644 (file)
@@ -11,7 +11,7 @@ return array(
                        'starttime' => 'starttime',
                        'endtime' => 'endtime'
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('rtehtmlarea') . 'Resources/Public/Images/Plugins/Acronym/acronym.gif'
+               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('rtehtmlarea') . 'Resources/Public/Images/Plugins/Abbreviation/abbreviation.gif'
        ),
        'interface' => array(
                'showRecordFieldList' => 'hidden,sys_language_uid,term,acronym'
index 478b930..d89649c 100644 (file)
@@ -104,7 +104,7 @@ showButtons
          monospaced, quotation, sample, small, span, strikethrough, strong,
          subscript, superscript, underline, variable, textcolor, bgcolor,
          textindicator, editelement, showmicrodata, emoticon, insertcharacter,
-         insertsofthyphen, line, link, unlink, image, table, user, acronym,
+         insertsofthyphen, line, link, unlink, image, table, user, abbreviation,
          findreplace, spellcheck, chMode, inserttag, removeformat, copy, cut,
          paste, pastetoggle, pastebehaviour, undo, redo, about, toggleborders,
          tableproperties, tablerestyle, rowproperties, rowinsertabove,
@@ -118,20 +118,20 @@ showButtons
          the extension manager.
          
          Note: If extension static\_info\_tables is not installed, the
-         spellcheck, language and acronym buttons are not enabled.
+         spellcheck, language and abbreviation buttons are not enabled.
          
          Note: If the encoding of the content element is not either iso-8859-1
          or utf-8, the spellcheck button is not enabled.
          
-         Note: Buttons user and acronym are never available in the front end.
+         Note: Buttons user and abbreviation are never available in the front end.
          
          Note: Button unlink is not available if button link is not available.
          
          Note: None of the table operations buttons is available if the button
          table is not available.
          
-         Note: Opera, Safari 5+ and Chrome 6+ do not support the copy, cut and
-         paste buttons.
+         Note: Firefox 29+, Opera, Safari 5+ and Chrome 6+ do not support the copy,
+         cut and paste buttons.
 
 
 
@@ -185,7 +185,7 @@ toolbarOrder
          orderedlist, unorderedlist, definitionlist, definitionitem, outdent,
          indent, bar, textcolor, bgcolor, textindicator, bar, editelement,
          showmicrodata, emoticon, insertcharacter, insertsofthyphen, line,
-         link, unlink, image, table, user, acronym, bar, findreplace,
+         link, unlink, image, table, user, abbreviation, bar, findreplace,
          spellcheck, bar, chMode, inserttag, removeformat, bar, copy, cut,
          paste, pastetoggle, pastebehaviour, bar, undo, redo, bar, about,
          linebreak, toggleborders, bar, tableproperties, tablerestyle, bar,
@@ -1899,75 +1899,75 @@ buttons.link.properties.target.default
 
 
 
-.. _buttons-acronym-pages:
+.. _buttons-abbreviation-pages:
 
-buttons.acronym.pages
-~~~~~~~~~~~~~~~~~~~~~
+buttons.abbreviation.pages
+~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 .. container:: table-row
 
    Property
-         buttons.acronym.pages
+         buttons.abbreviation.pages
    
    Data type
          list of page id's
    
    Description
-         List of page id's from which to obtain the acronym records.
+         List of page id's from which to obtain the abbreviation records.
          
          Note: If not set, the list of current webmounts is used.
          
-         Note: If no acronym records are found in the specified page id's, the
-         acronym button will not be present in the toolbar. If no records of
-         type acronym or abreviation are found, the corresponding tab of the
-         acronym dialogue will not be disabled.
+         Note: If no abbreviation records are found in the specified page id's, the
+         abbreviation button will not be present in the toolbar. If no abbreviation
+         records of type acronym or abreviation are found, the corresponding tab of the
+         abbreviation dialogue will not be enabled.
          
-         Note: In IE, before IE7, the abreviation tab of the acronym dialogue
+         Note: In IE, before IE7, the abreviation tab of the abbreviation dialogue
          is never shown.
 
 
 
-.. _buttons-acronym-recursive:
+.. _buttons-abbreviation-recursive:
 
-buttons.acronym.recursive
-~~~~~~~~~~~~~~~~~~~~~~~~~
+buttons.abbreviation.recursive
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 .. container:: table-row
 
    Property
-         buttons.acronym.recursive
+         buttons.abbreviation.recursive
    
    Data type
          int
    
    Description
          The number of levels in the page tree, under each page listed in
-         buttons.acronym.pages or under each webmount, from which acronyms are
-         retrieved.
+         buttons.abbreviation.pages or under each webmount, from which abbreviations
+         are retrieved.
          
          Default: 0
 
 
 
-.. _buttons-acronym-lockbeusertodbmounts:
+.. _buttons-abbreviation-lockbeusertodbmounts:
 
-buttons.acronym. lockBeUserToDBmounts
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+buttons.abbreviation.lockBeUserToDBmounts
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 .. container:: table-row
 
    Property
-         buttons.acronym. lockBeUserToDBmounts
+         buttons.abbreviation.lockBeUserToDBmounts
    
    Data type
          boolean
    
    Description
-         If set, the pid's listed under buttons.acronym.pages (see above) are
+         If set, the pid's listed under buttons.abbreviation.pages (see above) are
          validated against the user's current webmounts.
          
-         If not set or if the user is admin, buttons.acronym.pages is ignored
-         and acronyms from all pages are retrieved.
+         If not set or if the user is admin, buttons.abbreviation.pages is ignored
+         and abbreviations from all pages are retrieved.
          
          Default: The default value of this property is the value of the
          property with same name in the backend section of theTYPO3
@@ -1975,6 +1975,42 @@ buttons.acronym. lockBeUserToDBmounts
 
 
 
+.. _buttons-acronym-pages:
+
+buttons.acronym.pages
+~~~~~~~~~~~~~~~~~~~~~
+
+.. container:: table-row
+
+   Property
+         This property is deprecated. Use :ref:`buttons.abbreviation.pages <buttons-abbreviation-pages>`
+
+
+
+.. _buttons-acronym-recursive:
+
+buttons.acronym.recursive
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. container:: table-row
+
+   Property
+         This property is deprecated. Use :ref:`buttons.abbreviation.recursive <buttons-abbreviation-recursive>`
+
+
+
+.. _buttons-acronym-lockbeusertodbmounts:
+
+buttons.acronym.lockBeUserToDBmounts
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. container:: table-row
+
+   Property
+         This property is deprecated. Use :ref:`buttons.abbreviation.lockBeUserToDBmounts <buttons-abbreviation-lockBeUserToDBmounts>`
+
+
+
 .. _colors:
 
 colors
index 2c204cd..0ec4f61 100644 (file)
@@ -8,7 +8,8 @@ return array(
        'tx_rtehtmlarea_SC_select_image' => 'TYPO3\\CMS\\Rtehtmlarea\\Controller\\SelectImageController',
        'tx_rtehtmlarea_pi1' => 'TYPO3\\CMS\\Rtehtmlarea\\Controller\\SpellCheckingController',
        'tx_rtehtmlarea_abouteditor' => 'TYPO3\\CMS\\Rtehtmlarea\\Extension\\AboutEditor',
-       'tx_rtehtmlarea_acronym' => 'TYPO3\\CMS\\Rtehtmlarea\\Extension\\Acronym',
+       'tx_rtehtmlarea_acronym' => 'TYPO3\\CMS\\Rtehtmlarea\\Extension\\Abbreviation',
+       'TYPO3\\CMS\\Rtehtmlarea\\Extension\\Acronym' => 'TYPO3\\CMS\\Rtehtmlarea\\Extension\\Abbreviation',
        'tx_rtehtmlarea_blockelements' => 'TYPO3\\CMS\\Rtehtmlarea\\Extension\\BlockElements',
        'tx_rtehtmlarea_blockstyle' => 'TYPO3\\CMS\\Rtehtmlarea\\Extension\\BlockStyle',
        'tx_rtehtmlarea_charactermap' => 'TYPO3\\CMS\\Rtehtmlarea\\Extension\\CharacterMap',
diff --git a/typo3/sysext/rtehtmlarea/Resources/Public/Css/Skin/Plugins/abbreviation.css b/typo3/sysext/rtehtmlarea/Resources/Public/Css/Skin/Plugins/abbreviation.css
new file mode 100644 (file)
index 0000000..a9bd3b6
--- /dev/null
@@ -0,0 +1,5 @@
+/* Selectors for the Acronym extension of htmlArea RTE */
+.htmlarea-action-abbreviation-edit {
+       background-image: url('../../../Images/Plugins/Abbreviation/abbreviation.gif') !important;
+       background-position: 0 0 !important;
+}
diff --git a/typo3/sysext/rtehtmlarea/Resources/Public/Css/Skin/Plugins/acronym.css b/typo3/sysext/rtehtmlarea/Resources/Public/Css/Skin/Plugins/acronym.css
deleted file mode 100644 (file)
index 18dc92d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Selectors for the Acronym extension of htmlArea RTE */
-.htmlarea-action-abbreviation-edit {
-       background-image: url('../../../Images/Plugins/Acronym/acronym.gif') !important;
-       background-position: 0 0 !important;
-}
diff --git a/typo3/sysext/rtehtmlarea/Resources/Public/Images/Plugins/Abbreviation/abbreviation.gif b/typo3/sysext/rtehtmlarea/Resources/Public/Images/Plugins/Abbreviation/abbreviation.gif
new file mode 100644 (file)
index 0000000..7d76a61
Binary files /dev/null and b/typo3/sysext/rtehtmlarea/Resources/Public/Images/Plugins/Abbreviation/abbreviation.gif differ
diff --git a/typo3/sysext/rtehtmlarea/Resources/Public/Images/Plugins/Acronym/acronym.gif b/typo3/sysext/rtehtmlarea/Resources/Public/Images/Plugins/Acronym/acronym.gif
deleted file mode 100644 (file)
index 7d76a61..0000000
Binary files a/typo3/sysext/rtehtmlarea/Resources/Public/Images/Plugins/Acronym/acronym.gif and /dev/null differ
diff --git a/typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/abbreviation.js b/typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/abbreviation.js
new file mode 100644 (file)
index 0000000..d74e8fe
--- /dev/null
@@ -0,0 +1,554 @@
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+/*
+ * Abbreviation plugin for htmlArea RTE
+ */
+HTMLArea.Abbreviation = Ext.extend(HTMLArea.Plugin, {
+       /*
+        * This function gets called by the class constructor
+        */
+       configurePlugin: function(editor) {
+               this.pageTSConfiguration = this.editorConfiguration.buttons.abbreviation;
+               /*
+                * Registering plugin "About" information
+                */
+               var pluginInformation = {
+                       version         : '7.0',
+                       developer       : 'Stanislas Rolland',
+                       developerUrl    : 'http://www.sjbr.ca/',
+                       copyrightOwner  : 'Stanislas Rolland',
+                       sponsor         : 'SJBR',
+                       sponsorUrl      : 'http://www.sjbr.ca/',
+                       license         : 'GPL'
+               };
+               this.registerPluginInformation(pluginInformation);
+               /*
+                * Registering the button
+                */
+               var buttonId = 'Abbreviation';
+               var buttonConfiguration = {
+                       id              : buttonId,
+                       tooltip         : this.localize('Insert abbreviation'),
+                       action          : 'onButtonPress',
+                       hide            : (this.pageTSConfiguration.noAcronym && this.pageTSConfiguration.noAbbr),
+                       dialog          : true,
+                       iconCls         : 'htmlarea-action-abbreviation-edit',
+                       contextMenuTitle: this.localize(buttonId + '-contextMenuTitle')
+               };
+               this.registerButton(buttonConfiguration);
+               return true;
+        },
+       /*
+        * Sets of default configuration values for dialogue form fields
+        */
+       configDefaults: {
+               combo: {
+                       editable: true,
+                       selectOnFocus: true,
+                       typeAhead: true,
+                       triggerAction: 'all',
+                       forceSelection: true,
+                       mode: 'local'
+               }
+       },
+       /*
+        * This function gets called when the button was pressed
+        *
+        * @param       object          editor: the editor instance
+        * @param       string          id: the button id or the key
+        *
+        * @return      boolean         false if action is completed
+        */
+       onButtonPress: function(editor, id) {
+                       // Could be a button or its hotkey
+               var buttonId = this.translateHotKey(id);
+               buttonId = buttonId ? buttonId : id;
+               var abbr = editor.getSelection().getParentElement();
+                       // Working around Safari issue
+               if (!abbr && this.editor.statusBar && this.editor.statusBar.getSelection()) {
+                       abbr = this.editor.statusBar.getSelection();
+               }
+               if (!abbr || !/^(acronym|abbr)$/i.test(abbr.nodeName)) {
+                       abbr = editor.getSelection().getFirstAncestorOfType(['acronym', 'abbr']);
+               }
+               var type = typeof abbr === 'object' && abbr !== null ? abbr.nodeName.toLowerCase() : '';
+               this.params = {
+                       abbr: abbr,
+                       title: typeof abbr === 'object' && abbr !== null ? abbr.title : '',
+                       text: typeof abbr === 'object' && abbr !== null ? abbr.innerHTML : this.editor.getSelection().getHtml()
+               };
+                       // Open the dialogue window
+               this.openDialogue(
+                       this.getButton(buttonId).tooltip.title,
+                       buttonId,
+                       this.getWindowDimensions({ width: 580}, buttonId),
+                       this.buildTabItemsConfig(abbr),
+                       this.buildButtonsConfig(abbr, this.okHandler, this.deleteHandler),
+                       (type == 'acronym') ? 1 : 0
+               );
+               return false;
+       },
+       /*
+        * Open the dialogue window
+        *
+        * @param       string          title: the window title
+        * @param       string          buttonId: the itemId of the button that was pressed
+        * @param       integer         dimensions: the opening width of the window
+        * @param       object          tabItems: the configuration of the tabbed panel
+        * @param       object          buttonsConfig: the configuration of the buttons
+        * @param       number          activeTab: index of the opening tab
+        *
+        * @return      void
+        */
+       openDialogue: function (title, buttonId, dimensions, tabItems, buttonsConfig, activeTab) {
+               this.dialog = new Ext.Window({
+                       title: this.getHelpTip('', title),
+                       cls: 'htmlarea-window',
+                       border: false,
+                       width: dimensions.width,
+                       height: 'auto',
+                       iconCls: this.getButton(buttonId).iconCls,
+                       listeners: {
+                               close: {
+                                       fn: this.onClose,
+                                       scope: this
+                               }
+                       },
+                       items: {
+                               xtype: 'tabpanel',
+                               activeTab: activeTab ? activeTab : 0,
+                               defaults: {
+                                       xtype: 'container',
+                                       layout: 'form',
+                                       defaults: {
+                                               labelWidth: 150
+                                       }
+                               },
+                               listeners: {
+                                       tabchange: {
+                                               fn: this.syncHeight,
+                                               scope: this
+                                       }
+                               },
+                               items: tabItems
+                       },
+                       buttons: buttonsConfig
+               });
+               this.show();
+       },
+       /*
+        * Build the dialogue tab items config
+        *
+        * @param       object          element: the element being edited, if any
+        *
+        * @return      object          the tab items configuration
+        */
+       buildTabItemsConfig: function (element) {
+               var type = typeof element === 'object' && element !== null ? element.nodeName.toLowerCase() : '';
+               var tabItems = [];
+               var abbrTabItems = [];
+                       // abbr tab not shown if the current selection is an acronym
+               if (type !== 'acronym') {
+                       if (!this.pageTSConfiguration.noAbbr) {
+                               this.addConfigElement(this.buildDefinedTermFieldsetConfig((type == 'abbr') ? element : null, 'abbr'), abbrTabItems);
+                       }
+                       this.addConfigElement(this.buildUseTermFieldsetConfig((type == 'abbr') ? element : null, 'abbr'), abbrTabItems);
+               }
+               if (abbrTabItems.length > 0) {
+                       tabItems.push({
+                               title: this.localize('Abbreviation'),
+                               itemId: 'abbr',
+                               items: abbrTabItems
+                       });
+               }
+               var acronymTabItems = [];
+                       // acronym tab not shown if the current selection is an abbr
+               if (type !== 'abbr') {
+                       if (!this.pageTSConfiguration.noAcronym) {
+                               this.addConfigElement(this.buildDefinedTermFieldsetConfig((type == 'acronym') ? element : null, 'acronym'), acronymTabItems);
+                       }
+                       this.addConfigElement(this.buildUseTermFieldsetConfig((type == 'abbr') ? element : null, 'abbr'), acronymTabItems);
+               }
+               if (acronymTabItems.length > 0) {
+                       tabItems.push({
+                               title: this.localize('Acronym'),
+                               itemId: 'acronym',
+                               items: acronymTabItems
+                       });
+               }
+               return tabItems;
+       },
+       /*
+        * Build the dialogue buttons config
+        *
+        * @param       object          element: the element being edited, if any
+        * @param       function        okHandler: the handler for the ok button
+        * @param       function        deleteHandler: the handler for the delete button
+        *
+        * @return      object          the buttons configuration
+        */
+       buildButtonsConfig: function (element, okHandler, deleteHandler) {
+               var buttonsConfig = [this.buildButtonConfig('OK', okHandler)];
+               if (element) {
+                       buttonsConfig.push(this.buildButtonConfig('Delete', deleteHandler));
+               }
+               buttonsConfig.push(this.buildButtonConfig('Cancel', this.onCancel));
+               return buttonsConfig;
+       },
+
+       /**
+        * This function builds the configuration object for the defined Abbreviation or Acronym fieldset
+        *
+        * @param object element: the element being edited, if any
+        * @param string type: 'abbr' or 'acronym'
+        *
+        * @return object the fieldset configuration object
+        */
+       buildDefinedTermFieldsetConfig: function (element, type) {
+               var itemsConfig = [];
+               itemsConfig.push(Ext.apply({
+                       xtype: 'combo',
+                       displayField: 'term',
+                       valueField: 'term',
+                       fieldLabel: this.getHelpTip('unabridgedTerm', 'Unabridged_term'),
+                       itemId: 'termSelector',
+                       tpl: '<tpl for="."><div ext:qtip="{abbr}" style="text-align:left;font-size:11px;" class="x-combo-list-item">{term}</div></tpl>',
+                       store: new Ext.data.JsonStore({
+                               autoDestroy:  true,
+                               autoLoad: true,
+                               root: type,
+                               fields: [ { name: 'term'}, { name: 'abbr'},  { name: 'language'}],
+                               url: this.pageTSConfiguration.abbreviationUrl
+                       }),
+                       width: 350,
+                       listeners: {
+                               beforerender: {
+                                       fn: function (combo) {
+                                                       // Ensure the store is loaded
+                                               combo.getStore().load({
+                                                       callback: function () { this.onSelectorRender(combo); },
+                                                       scope: this
+                                               });
+                                       },
+                                       scope: this
+                               },
+                               select: {
+                                       fn: this.onTermSelect,
+                                       scope: this
+                               }
+                       }
+               }, this.configDefaults['combo']));
+               itemsConfig.push(Ext.apply({
+                       xtype: 'combo',
+                       displayField: 'abbr',
+                       valueField: 'abbr',
+                       tpl: '<tpl for="."><div ext:qtip="{language}" style="text-align:left;font-size:11px;" class="x-combo-list-item">{abbr}</div></tpl>',
+                       fieldLabel: this.getHelpTip('abridgedTerm', 'Abridged_term'),
+                       itemId: 'abbrSelector',
+                       store: new Ext.data.JsonStore({
+                               autoDestroy:  true,
+                               autoLoad: true,
+                               root: type,
+                               fields: [ { name: 'term'}, { name: 'abbr'},  { name: 'language'}],
+                               url: this.pageTSConfiguration.abbreviationUrl
+                       }),
+                       width: 100,
+                       listeners: {
+                               beforerender: {
+                                       fn: function (combo) {
+                                                       // Ensure the store is loaded
+                                               combo.getStore().load({
+                                                       callback: function () { this.onSelectorRender(combo); },
+                                                       scope: this
+                                               });
+                                       },
+                                       scope: this
+                               },
+                               select: {
+                                       fn: this.onAbbrSelect,
+                                       scope: this
+                               }
+                       }
+               }, this.configDefaults['combo']));
+               var languageObject = this.getPluginInstance('Language');
+               if (this.getButton('Language')) {
+                       var selectedLanguage = typeof element === 'object' && element !== null ? languageObject.getLanguageAttribute(element) : 'none';
+                       function initLanguageStore (store) {
+                               if (selectedLanguage !== 'none') {
+                                       store.removeAt(0);
+                                       store.insert(0, new store.recordType({
+                                               text: languageObject.localize('Remove language mark'),
+                                               value: 'none'
+                                       }));
+                               }
+                               this.getButton('Language').setValue('none');
+                       }
+                       var languageStore = new Ext.data.JsonStore({
+                               autoDestroy:  true,
+                               autoLoad: true,
+                               root: 'options',
+                               fields: [ { name: 'text'}, { name: 'value'} ],
+                               url: this.getDropDownConfiguration('Language').dataUrl,
+                               listeners: {
+                                       load: {
+                                               fn: initLanguageStore,
+                                               scope: this
+                                       }
+                               }
+                       });
+                       itemsConfig.push(Ext.apply({
+                               xtype: 'combo',
+                               fieldLabel: this.getHelpTip('language', 'Language'),
+                               itemId: 'language',
+                               valueField: 'value',
+                               displayField: 'text',
+                               tpl: '<tpl for="."><div ext:qtip="{value}" style="text-align:left;font-size:11px;" class="x-combo-list-item">{text}</div></tpl>',
+                               store: languageStore,
+                               width: 200,
+                               value: selectedLanguage,
+                               listeners: {
+                                       render: {
+                                               fn: function (combo) {
+                                                               // Load the language dropdown
+                                                       combo.getStore().load({
+                                                               callback: function () { combo.setValue(selectedLanguage); }
+                                                       });
+                                               }
+                                       }
+                               }
+                       }, this.configDefaults['combo']));
+               }
+               return {
+                       xtype: 'fieldset',
+                       title: this.getHelpTip('preDefined' + ((type == 'abbr') ? 'Abbreviation' : 'Acronym'), 'Defined_' + type),
+                       items: itemsConfig,
+                       listeners: {
+                               render: {
+                                       fn: this.onDefinedTermFieldsetRender,
+                                       scope: this
+                               }
+                       }
+               };
+       },
+       /*
+        * Handler on rendering the defined abbreviation fieldset
+        * If an abbr is selected but no term is selected, select any corresponding term with the correct language value, if any
+        */
+       onDefinedTermFieldsetRender: function (fieldset) {
+               var termSelector = fieldset.find('itemId', 'termSelector')[0];
+               var term = termSelector.getValue();
+               var abbrSelector = fieldset.find('itemId', 'abbrSelector')[0];
+               var abbr = abbrSelector.getValue();
+               var language = '';
+               var languageSelector = fieldset.find('itemId', 'language')[0];
+               if (languageSelector) {
+                       var language = languageSelector.getValue();
+                       if (language == 'none') {
+                               language = '';
+                       }
+               }
+               if (abbr && !term) {
+                       var abbrStore = abbrSelector.getStore();
+                       var index = abbrStore.findBy(function (record) {
+                               return record.get('abbr') == abbr && (!languageSelector || record.get('language') == language);
+                       }, this);
+                       if (index !== -1) {
+                               term = abbrStore.getAt(index).get('term');
+                               termSelector.setValue(term);
+                               fieldset.ownerCt.find('itemId', 'useTerm')[0].setValue(term);
+                       }
+               }
+       },
+       /*
+        * Filter the term and abbr selector lists
+        * Set initial values
+        * If there is already an abbr and the filtered list has only one or no element, hide the fieldset
+        */
+       onSelectorRender: function (combo) {
+               var store = combo.getStore();
+               store.filterBy(function (record) {
+                       return !this.params.text || !this.params.title || this.params.text == record.get('term') || this.params.title == record.get('term') || this.params.title == record.get('abbr');
+               }, this);
+                       // Make sure the combo list is filtered
+               store.snapshot = store.data;
+               var store = combo.getStore();
+                       // Initialize the term and abbr combos
+               if (combo.getItemId() == 'termSelector') {
+                       if (this.params.title) {
+                               var index = store.findExact('term', this.params.title);
+                               if (index !== -1) {
+                                       var record = store.getAt(index);
+                                       combo.setValue(record.get('term'));
+                                       this.onTermSelect(combo, record, index);
+                               }
+                       } else if (this.params.text) {
+                               var index = store.findExact('term', this.params.text);
+                               if (index !== -1) {
+                                       var record = store.getAt(index);
+                                       combo.setValue(record.get('term'));
+                                       this.onTermSelect(combo, record, index);
+                               }
+                       }
+               } else if (combo.getItemId() == 'abbrSelector' && this.params.text) {
+                       var index = store.findExact('abbr', this.params.text);
+                       if (index !== -1) {
+                               var record = store.getAt(index);
+                               combo.setValue(record.get('abbr'));
+                               this.onAbbrSelect(combo, record, index);
+                       }
+               }
+       },
+       /*
+        * Handler when a term is selected
+        */
+       onTermSelect: function (combo, record, index) {
+               var fieldset = combo.findParentByType('fieldset');
+               var tab = fieldset.findParentByType('container');
+               var term = record.get('term');
+               var abbr = record.get('abbr');
+               var language = record.get('language');
+                       // Update the abbreviation selector
+               var abbrSelector = tab.find('itemId', 'abbrSelector')[0];
+               abbrSelector.setValue(abbr);
+                       // Update the language selector
+               var languageSelector = tab.find('itemId', 'language');
+               if (languageSelector.length > 0) {
+                       if (language) {
+                               languageSelector[0].setValue(language);
+                       } else {
+                               languageSelector[0].setValue('none');
+                       }
+               }
+                       // Update the term to use
+               tab.find('itemId', 'useTerm')[0].setValue(term);
+       },
+       /*
+        * Handler when an abbreviation or acronym is selected
+        */
+       onAbbrSelect: function (combo, record, index) {
+               var fieldset = combo.findParentByType('fieldset');
+               var tab = fieldset.findParentByType('container');
+               var term = record.get('term');
+               var language = record.get('language');
+                       // Update the term selector
+               var termSelector = tab.find('itemId', 'termSelector')[0];
+               termSelector.setValue(term);
+                       // Update the language selector
+               var languageSelector = tab.find('itemId', 'language');
+               if (languageSelector.length > 0) {
+                       if (language) {
+                               languageSelector[0].setValue(language);
+                       } else {
+                               languageSelector[0].setValue('none');
+                       }
+               }
+                       // Update the term to use
+               tab.find('itemId', 'useTerm')[0].setValue(term);
+       },
+       /*
+        * This function builds the configuration object for the Abbreviation or Acronym to use fieldset
+        *
+        * @param       object          element: the element being edited, if any
+        *
+        * @return      object          the fieldset configuration object
+        */
+       buildUseTermFieldsetConfig: function (element, type) {
+               var itemsConfig = [];
+               itemsConfig.push({
+                       fieldLabel: this.getHelpTip('useThisTerm', 'Use_this_term'),
+                       labelSeparator: '',
+                       itemId: 'useTerm',
+                       value: element ? element.title : '',
+                       width: 300
+               });
+               return {
+                       xtype: 'fieldset',
+                       title: this.getHelpTip('termToAbridge', 'Term_to_abridge'),
+                       defaultType: 'textfield',
+                       items: itemsConfig
+               };
+       },
+       /*
+        * Handler when the ok button is pressed
+        */
+       okHandler: function (button, event) {
+               this.restoreSelection();
+               var tab = this.dialog.findByType('tabpanel')[0].getActiveTab();
+               var type = tab.getItemId();
+               var languageSelector = tab.find('itemId', 'language');
+               var language = languageSelector.length > 0 ? languageSelector[0].getValue() : '';
+               var term = tab.find('itemId', 'termSelector')[0].getValue();
+               if (!this.params.abbr) {
+                       var abbr = this.editor.document.createElement(type);
+                       abbr.title = tab.find('itemId', 'useTerm')[0].getValue();
+                       if (term == abbr.title) {
+                               abbr.innerHTML = tab.find('itemId', 'abbrSelector')[0].getValue();
+                       } else {
+                               abbr.innerHTML = this.params.text;
+                       }
+                       if (language) {
+                               this.getPluginInstance('Language').setLanguageAttributes(abbr, language);
+                       }
+                       this.editor.getSelection().insertNode(abbr);
+                       // Position the cursor just after the inserted abbreviation
+                       abbr = this.editor.getSelection().getParentElement();
+                       if (abbr.nextSibling) {
+                               this.editor.getSelection().selectNodeContents(abbr.nextSibling, true);
+                       } else {
+                               this.editor.getSelection().selectNodeContents(abbr.parentNode, false);
+                       }
+               } else {
+                       var abbr = this.params.abbr;
+                       abbr.title = tab.find('itemId', 'useTerm')[0].getValue();
+                       if (language) {
+                               this.getPluginInstance('Language').setLanguageAttributes(abbr, language);
+                       }
+                       if (term == abbr.title) {
+                               abbr.innerHTML = tab.find('itemId', 'abbrSelector')[0].getValue();
+                       }
+               }
+               this.close();
+               event.stopEvent();
+       },
+       /*
+        * Handler when the delete button is pressed
+        */
+       deleteHandler: function (button, event) {
+               this.restoreSelection();
+               var abbr = this.params.abbr;
+               if (abbr) {
+                       this.editor.getDomNode().removeMarkup(abbr);
+               }
+               this.close();
+               event.stopEvent();
+       },
+       /*
+        * This function gets called when the toolbar is updated
+        */
+       onUpdateToolbar: function (button, mode, selectionEmpty, ancestors) {
+               if ((mode === 'wysiwyg') && this.editor.isEditable()) {
+                       var el = this.editor.getSelection().getParentElement();
+                       if (el) {
+                               button.setDisabled(((el.nodeName.toLowerCase() == 'acronym' && this.pageTSConfiguration.noAcronym) || (el.nodeName.toLowerCase() == 'abbr' && this.pageTSConfiguration.noAbbr)));
+                               button.setInactive(!(el.nodeName.toLowerCase() == 'acronym' && !this.pageTSConfiguration.noAcronym) && !(el.nodeName.toLowerCase() == 'abbr' && !this.pageTSConfiguration.noAbbr));
+                       }
+                       button.setTooltip({
+                               title: this.localize((button.disabled || button.inactive) ? 'Insert abbreviation' : 'Edit abbreviation')
+                       });
+                       button.contextMenuTitle = '';
+                       if (this.dialog) {
+                               this.dialog.focus();
+                       }
+               }
+       }
+});
diff --git a/typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/acronym.js b/typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/acronym.js
deleted file mode 100644 (file)
index b309cca..0000000
+++ /dev/null
@@ -1,552 +0,0 @@
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-/*
- * Acronym plugin for htmlArea RTE
- */
-HTMLArea.Acronym = Ext.extend(HTMLArea.Plugin, {
-       /*
-        * This function gets called by the class constructor
-        */
-       configurePlugin: function(editor) {
-               this.pageTSConfiguration = this.editorConfiguration.buttons.acronym;
-               /*
-                * Registering plugin "About" information
-                */
-               var pluginInformation = {
-                       version         : '3.0',
-                       developer       : 'Stanislas Rolland',
-                       developerUrl    : 'http://www.sjbr.ca/',
-                       copyrightOwner  : 'Stanislas Rolland',
-                       sponsor         : 'SJBR',
-                       sponsorUrl      : 'http://www.sjbr.ca/',
-                       license         : 'GPL'
-               };
-               this.registerPluginInformation(pluginInformation);
-               /*
-                * Registering the button
-                */
-               var buttonId = 'Acronym';
-               var buttonConfiguration = {
-                       id              : buttonId,
-                       tooltip         : this.localize('Insert/Modify Acronym'),
-                       action          : 'onButtonPress',
-                       hide            : (this.pageTSConfiguration.noAcronym && this.pageTSConfiguration.noAbbr),
-                       dialog          : true,
-                       iconCls         : 'htmlarea-action-abbreviation-edit',
-                       contextMenuTitle: this.localize(buttonId + '-contextMenuTitle')
-               };
-               this.registerButton(buttonConfiguration);
-               return true;
-        },
-       /*
-        * Sets of default configuration values for dialogue form fields
-        */
-       configDefaults: {
-               combo: {
-                       editable: true,
-                       selectOnFocus: true,
-                       typeAhead: true,
-                       triggerAction: 'all',
-                       forceSelection: true,
-                       mode: 'local'
-               }
-       },
-       /*
-        * This function gets called when the button was pressed
-        *
-        * @param       object          editor: the editor instance
-        * @param       string          id: the button id or the key
-        *
-        * @return      boolean         false if action is completed
-        */
-       onButtonPress: function(editor, id) {
-                       // Could be a button or its hotkey
-               var buttonId = this.translateHotKey(id);
-               buttonId = buttonId ? buttonId : id;
-               var abbr = editor.getSelection().getParentElement();
-                       // Working around Safari issue
-               if (!abbr && this.editor.statusBar && this.editor.statusBar.getSelection()) {
-                       abbr = this.editor.statusBar.getSelection();
-               }
-               if (!abbr || !/^(acronym|abbr)$/i.test(abbr.nodeName)) {
-                       abbr = editor.getSelection().getFirstAncestorOfType(['acronym', 'abbr']);
-               }
-               var type = typeof abbr === 'object' && abbr !== null ? abbr.nodeName.toLowerCase() : '';
-               this.params = {
-                       abbr: abbr,
-                       title: typeof abbr === 'object' && abbr !== null ? abbr.title : '',
-                       text: typeof abbr === 'object' && abbr !== null ? abbr.innerHTML : this.editor.getSelection().getHtml()
-               };
-                       // Open the dialogue window
-               this.openDialogue(
-                       this.getButton(buttonId).tooltip.title,
-                       buttonId,
-                       this.getWindowDimensions({ width: 580}, buttonId),
-                       this.buildTabItemsConfig(abbr),
-                       this.buildButtonsConfig(abbr, this.okHandler, this.deleteHandler),
-                       (type == 'acronym') ? 1 : 0
-               );
-               return false;
-       },
-       /*
-        * Open the dialogue window
-        *
-        * @param       string          title: the window title
-        * @param       string          buttonId: the itemId of the button that was pressed
-        * @param       integer         dimensions: the opening width of the window
-        * @param       object          tabItems: the configuration of the tabbed panel
-        * @param       object          buttonsConfig: the configuration of the buttons
-        * @param       number          activeTab: index of the opening tab
-        *
-        * @return      void
-        */
-       openDialogue: function (title, buttonId, dimensions, tabItems, buttonsConfig, activeTab) {
-               this.dialog = new Ext.Window({
-                       title: this.getHelpTip('', title),
-                       cls: 'htmlarea-window',
-                       border: false,
-                       width: dimensions.width,
-                       height: 'auto',
-                       iconCls: this.getButton(buttonId).iconCls,
-                       listeners: {
-                               close: {
-                                       fn: this.onClose,
-                                       scope: this
-                               }
-                       },
-                       items: {
-                               xtype: 'tabpanel',
-                               activeTab: activeTab ? activeTab : 0,
-                               defaults: {
-                                       xtype: 'container',
-                                       layout: 'form',
-                                       defaults: {
-                                               labelWidth: 150
-                                       }
-                               },
-                               listeners: {
-                                       tabchange: {
-                                               fn: this.syncHeight,
-                                               scope: this
-                                       }
-                               },
-                               items: tabItems
-                       },
-                       buttons: buttonsConfig
-               });
-               this.show();
-       },
-       /*
-        * Build the dialogue tab items config
-        *
-        * @param       object          element: the element being edited, if any
-        *
-        * @return      object          the tab items configuration
-        */
-       buildTabItemsConfig: function (element) {
-               var type = typeof element === 'object' && element !== null ? element.nodeName.toLowerCase() : '';
-               var tabItems = [];
-               var abbrTabItems = [];
-                       // abbr tab not shown if the current selection is an acronym
-               if (type !== 'acronym') {
-                       if (!this.pageTSConfiguration.noAbbr) {
-                               this.addConfigElement(this.buildDefinedTermFieldsetConfig((type == 'abbr') ? element : null, 'abbr'), abbrTabItems);
-                       }
-                       this.addConfigElement(this.buildUseTermFieldsetConfig((type == 'abbr') ? element : null, 'abbr'), abbrTabItems);
-               }
-               if (abbrTabItems.length > 0) {
-                       tabItems.push({
-                               title: this.localize('Abbreviation'),
-                               itemId: 'abbr',
-                               items: abbrTabItems
-                       });
-               }
-               var acronymTabItems = [];
-                       // acronym tab not shown if the current selection is an abbr
-               if (type !== 'abbr') {
-                       if (!this.pageTSConfiguration.noAcronym) {
-                               this.addConfigElement(this.buildDefinedTermFieldsetConfig((type == 'acronym') ? element : null, 'acronym'), acronymTabItems);
-                       }
-                       this.addConfigElement(this.buildUseTermFieldsetConfig((type == 'abbr') ? element : null, 'abbr'), acronymTabItems);
-               }
-               if (acronymTabItems.length > 0) {
-                       tabItems.push({
-                               title: this.localize('Acronym'),
-                               itemId: 'acronym',
-                               items: acronymTabItems
-                       });
-               }
-               return tabItems;
-       },
-       /*
-        * Build the dialogue buttons config
-        *
-        * @param       object          element: the element being edited, if any
-        * @param       function        okHandler: the handler for the ok button
-        * @param       function        deleteHandler: the handler for the delete button
-        *
-        * @return      object          the buttons configuration
-        */
-       buildButtonsConfig: function (element, okHandler, deleteHandler) {
-               var buttonsConfig = [this.buildButtonConfig('OK', okHandler)];
-               if (element) {
-                       buttonsConfig.push(this.buildButtonConfig('Delete', deleteHandler));
-               }
-               buttonsConfig.push(this.buildButtonConfig('Cancel', this.onCancel));
-               return buttonsConfig;
-       },
-       /*
-        * This function builds the configuration object for the defined Abbreviation or Acronym fieldset
-        *
-        * @param       object          element: the element being edited, if any
-        *
-        * @return      object          the fieldset configuration object
-        */
-       buildDefinedTermFieldsetConfig: function (element, type) {
-               var itemsConfig = [];
-               itemsConfig.push(Ext.apply({
-                       xtype: 'combo',
-                       displayField: 'term',
-                       valueField: 'term',
-                       fieldLabel: this.getHelpTip('unabridgedTerm', 'Unabridged_term'),
-                       itemId: 'termSelector',
-                       tpl: '<tpl for="."><div ext:qtip="{abbr}" style="text-align:left;font-size:11px;" class="x-combo-list-item">{term}</div></tpl>',
-                       store: new Ext.data.JsonStore({
-                               autoDestroy:  true,
-                               autoLoad: true,
-                               root: type,
-                               fields: [ { name: 'term'}, { name: 'abbr'},  { name: 'language'}],
-                               url: this.pageTSConfiguration.acronymUrl
-                       }),
-                       width: 350,
-                       listeners: {
-                               beforerender: {
-                                       fn: function (combo) {
-                                                       // Ensure the store is loaded
-                                               combo.getStore().load({
-                                                       callback: function () { this.onSelectorRender(combo); },
-                                                       scope: this
-                                               });
-                                       },
-                                       scope: this
-                               },
-                               select: {
-                                       fn: this.onTermSelect,
-                                       scope: this
-                               }
-                       }
-               }, this.configDefaults['combo']));
-               itemsConfig.push(Ext.apply({
-                       xtype: 'combo',
-                       displayField: 'abbr',
-                       valueField: 'abbr',
-                       tpl: '<tpl for="."><div ext:qtip="{language}" style="text-align:left;font-size:11px;" class="x-combo-list-item">{abbr}</div></tpl>',
-                       fieldLabel: this.getHelpTip('abridgedTerm', 'Abridged_term'),
-                       itemId: 'abbrSelector',
-                       store: new Ext.data.JsonStore({
-                               autoDestroy:  true,
-                               autoLoad: true,
-                               root: type,
-                               fields: [ { name: 'term'}, { name: 'abbr'},  { name: 'language'}],
-                               url: this.pageTSConfiguration.acronymUrl
-                       }),
-                       width: 100,
-                       listeners: {
-                               beforerender: {
-                                       fn: function (combo) {
-                                                       // Ensure the store is loaded
-                                               combo.getStore().load({
-                                                       callback: function () { this.onSelectorRender(combo); },
-                                                       scope: this
-                                               });
-                                       },
-                                       scope: this
-                               },
-                               select: {
-                                       fn: this.onAbbrSelect,
-                                       scope: this
-                               }
-                       }
-               }, this.configDefaults['combo']));
-               var languageObject = this.getPluginInstance('Language');
-               if (this.getButton('Language')) {
-                       var selectedLanguage = typeof element === 'object' && element !== null ? languageObject.getLanguageAttribute(element) : 'none';
-                       function initLanguageStore (store) {
-                               if (selectedLanguage !== 'none') {
-                                       store.removeAt(0);
-                                       store.insert(0, new store.recordType({
-                                               text: languageObject.localize('Remove language mark'),
-                                               value: 'none'
-                                       }));
-                               }
-                               this.getButton('Language').setValue('none');
-                       }
-                       var languageStore = new Ext.data.JsonStore({
-                               autoDestroy:  true,
-                               autoLoad: true,
-                               root: 'options',
-                               fields: [ { name: 'text'}, { name: 'value'} ],
-                               url: this.getDropDownConfiguration('Language').dataUrl,
-                               listeners: {
-                                       load: {
-                                               fn: initLanguageStore,
-                                               scope: this
-                                       }
-                               }
-                       });
-                       itemsConfig.push(Ext.apply({
-                               xtype: 'combo',
-                               fieldLabel: this.getHelpTip('language', 'Language'),
-                               itemId: 'language',
-                               valueField: 'value',
-                               displayField: 'text',
-                               tpl: '<tpl for="."><div ext:qtip="{value}" style="text-align:left;font-size:11px;" class="x-combo-list-item">{text}</div></tpl>',
-                               store: languageStore,
-                               width: 200,
-                               value: selectedLanguage,
-                               listeners: {
-                                       render: {
-                                               fn: function (combo) {
-                                                               // Load the language dropdown
-                                                       combo.getStore().load({
-                                                               callback: function () { combo.setValue(selectedLanguage); }
-                                                       });
-                                               }
-                                       }
-                               }
-                       }, this.configDefaults['combo']));
-               }
-               return {
-                       xtype: 'fieldset',
-                       title: this.getHelpTip('preDefined' + ((type == 'abbr') ? 'Abbreviation' : 'Acronym'), 'Defined_' + type),
-                       items: itemsConfig,
-                       listeners: {
-                               render: {
-                                       fn: this.onDefinedTermFieldsetRender,
-                                       scope: this
-                               }
-                       }
-               };
-       },
-       /*
-        * Handler on rendering the defined abbreviation fieldset
-        * If an abbr is selected but no term is selected, select any corresponding term with the correct language value, if any
-        */
-       onDefinedTermFieldsetRender: function (fieldset) {
-               var termSelector = fieldset.find('itemId', 'termSelector')[0];
-               var term = termSelector.getValue();
-               var abbrSelector = fieldset.find('itemId', 'abbrSelector')[0];
-               var abbr = abbrSelector.getValue();
-               var language = '';
-               var languageSelector = fieldset.find('itemId', 'language')[0];
-               if (languageSelector) {
-                       var language = languageSelector.getValue();
-                       if (language == 'none') {
-                               language = '';
-                       }
-               }
-               if (abbr && !term) {
-                       var abbrStore = abbrSelector.getStore();
-                       var index = abbrStore.findBy(function (record) {
-                               return record.get('abbr') == abbr && (!languageSelector || record.get('language') == language);
-                       }, this);
-                       if (index !== -1) {
-                               term = abbrStore.getAt(index).get('term');
-                               termSelector.setValue(term);
-                               fieldset.ownerCt.find('itemId', 'useTerm')[0].setValue(term);
-                       }
-               }
-       },
-       /*
-        * Filter the term and abbr selector lists
-        * Set initial values
-        * If there is already an abbr and the filtered list has only one or no element, hide the fieldset
-        */
-       onSelectorRender: function (combo) {
-               var store = combo.getStore();
-               store.filterBy(function (record) {
-                       return !this.params.text || !this.params.title || this.params.text == record.get('term') || this.params.title == record.get('term') || this.params.title == record.get('abbr');
-               }, this);
-                       // Make sure the combo list is filtered
-               store.snapshot = store.data;
-               var store = combo.getStore();
-                       // Initialize the term and abbr combos
-               if (combo.getItemId() == 'termSelector') {
-                       if (this.params.title) {
-                               var index = store.findExact('term', this.params.title);
-                               if (index !== -1) {
-                                       var record = store.getAt(index);
-                                       combo.setValue(record.get('term'));
-                                       this.onTermSelect(combo, record, index);
-                               }
-                       } else if (this.params.text) {
-                               var index = store.findExact('term', this.params.text);
-                               if (index !== -1) {
-                                       var record = store.getAt(index);
-                                       combo.setValue(record.get('term'));
-                                       this.onTermSelect(combo, record, index);
-                               }
-                       }
-               } else if (combo.getItemId() == 'abbrSelector' && this.params.text) {
-                       var index = store.findExact('abbr', this.params.text);
-                       if (index !== -1) {
-                               var record = store.getAt(index);
-                               combo.setValue(record.get('abbr'));
-                               this.onAbbrSelect(combo, record, index);
-                       }
-               }
-       },
-       /*
-        * Handler when a term is selected
-        */
-       onTermSelect: function (combo, record, index) {
-               var fieldset = combo.findParentByType('fieldset');
-               var tab = fieldset.findParentByType('container');
-               var term = record.get('term');
-               var abbr = record.get('abbr');
-               var language = record.get('language');
-                       // Update the abbreviation selector
-               var abbrSelector = tab.find('itemId', 'abbrSelector')[0];
-               abbrSelector.setValue(abbr);
-                       // Update the language selector
-               var languageSelector = tab.find('itemId', 'language');
-               if (languageSelector.length > 0) {
-                       if (language) {
-                               languageSelector[0].setValue(language);
-                       } else {
-                               languageSelector[0].setValue('none');
-                       }
-               }
-                       // Update the term to use
-               tab.find('itemId', 'useTerm')[0].setValue(term);
-       },
-       /*
-        * Handler when an abbreviation or acronym is selected
-        */
-       onAbbrSelect: function (combo, record, index) {
-               var fieldset = combo.findParentByType('fieldset');
-               var tab = fieldset.findParentByType('container');
-               var term = record.get('term');
-               var language = record.get('language');
-                       // Update the term selector
-               var termSelector = tab.find('itemId', 'termSelector')[0];
-               termSelector.setValue(term);
-                       // Update the language selector
-               var languageSelector = tab.find('itemId', 'language');
-               if (languageSelector.length > 0) {
-                       if (language) {
-                               languageSelector[0].setValue(language);
-                       } else {
-                               languageSelector[0].setValue('none');
-                       }
-               }
-                       // Update the term to use
-               tab.find('itemId', 'useTerm')[0].setValue(term);
-       },
-       /*
-        * This function builds the configuration object for the Abbreviation or Acronym to use fieldset
-        *
-        * @param       object          element: the element being edited, if any
-        *
-        * @return      object          the fieldset configuration object
-        */
-       buildUseTermFieldsetConfig: function (element, type) {
-               var itemsConfig = [];
-               itemsConfig.push({
-                       fieldLabel: this.getHelpTip('useThisTerm', 'Use_this_term'),
-                       labelSeparator: '',
-                       itemId: 'useTerm',
-                       value: element ? element.title : '',
-                       width: 300
-               });
-               return {
-                       xtype: 'fieldset',
-                       title: this.getHelpTip('termToAbridge', 'Term_to_abridge'),
-                       defaultType: 'textfield',
-                       items: itemsConfig
-               };
-       },
-       /*
-        * Handler when the ok button is pressed
-        */
-       okHandler: function (button, event) {
-               this.restoreSelection();
-               var tab = this.dialog.findByType('tabpanel')[0].getActiveTab();
-               var type = tab.getItemId();
-               var languageSelector = tab.find('itemId', 'language');
-               var language = languageSelector.length > 0 ? languageSelector[0].getValue() : '';
-               var term = tab.find('itemId', 'termSelector')[0].getValue();
-               if (!this.params.abbr) {
-                       var abbr = this.editor.document.createElement(type);
-                       abbr.title = tab.find('itemId', 'useTerm')[0].getValue();
-                       if (term == abbr.title) {
-                               abbr.innerHTML = tab.find('itemId', 'abbrSelector')[0].getValue();
-                       } else {
-                               abbr.innerHTML = this.params.text;
-                       }
-                       if (language) {
-                               this.getPluginInstance('Language').setLanguageAttributes(abbr, language);
-                       }
-                       this.editor.getSelection().insertNode(abbr);
-                       // Position the cursor just after the inserted abbreviation
-                       abbr = this.editor.getSelection().getParentElement();
-                       if (abbr.nextSibling) {
-                               this.editor.getSelection().selectNodeContents(abbr.nextSibling, true);
-                       } else {
-                               this.editor.getSelection().selectNodeContents(abbr.parentNode, false);
-                       }
-               } else {
-                       var abbr = this.params.abbr;
-                       abbr.title = tab.find('itemId', 'useTerm')[0].getValue();
-                       if (language) {
-                               this.getPluginInstance('Language').setLanguageAttributes(abbr, language);
-                       }
-                       if (term == abbr.title) {
-                               abbr.innerHTML = tab.find('itemId', 'abbrSelector')[0].getValue();
-                       }
-               }
-               this.close();
-               event.stopEvent();
-       },
-       /*
-        * Handler when the delete button is pressed
-        */
-       deleteHandler: function (button, event) {
-               this.restoreSelection();
-               var abbr = this.params.abbr;
-               if (abbr) {
-                       this.editor.getDomNode().removeMarkup(abbr);
-               }
-               this.close();
-               event.stopEvent();
-       },
-       /*
-        * This function gets called when the toolbar is updated
-        */
-       onUpdateToolbar: function (button, mode, selectionEmpty, ancestors) {
-               if ((mode === 'wysiwyg') && this.editor.isEditable()) {
-                       var el = this.editor.getSelection().getParentElement();
-                       if (el) {
-                               button.setDisabled(((el.nodeName.toLowerCase() == 'acronym' && this.pageTSConfiguration.noAcronym) || (el.nodeName.toLowerCase() == 'abbr' && this.pageTSConfiguration.noAbbr)));
-                               button.setInactive(!(el.nodeName.toLowerCase() == 'acronym' && !this.pageTSConfiguration.noAcronym) && !(el.nodeName.toLowerCase() == 'abbr' && !this.pageTSConfiguration.noAbbr));
-                       }
-                       button.setTooltip({
-                               title: this.localize((button.disabled || button.inactive) ? 'Insert abbreviation' : 'Edit abbreviation')
-                       });
-                       button.contextMenuTitle = '';
-                       if (this.dialog) {
-                               this.dialog.focus();
-                       }
-               }
-       }
-});
index 4767006..77becf4 100644 (file)
@@ -40,6 +40,8 @@ require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKE
 
 // Set warning in the Update Wizard of the Install Tool for deprecated Page TS Config properties
 $TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['checkForDeprecatedRtePageTSConfigProperties'] = 'TYPO3\\CMS\\Rtehtmlarea\\Hook\\Install\\DeprecatedRteProperties';
+// Set warning in the Update Wizard of the Install Tool for replacement of "acronym" button by "abbreviation" button
+$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['checkForRteAcronymButtonRenamedToAbbreviation'] = 'TYPO3\\CMS\\Rtehtmlarea\\Hook\\Install\\RteAcronymButtonRenamedToAbbreviation';
 
 // Initialize plugin registration array
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins'] = array();
@@ -86,10 +88,10 @@ $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['CharacterMap'] = array();
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['CharacterMap']['objectReference'] = '&TYPO3\\CMS\\Rtehtmlarea\\Extension\\CharacterMap';
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['CharacterMap']['addIconsToSkin'] = 0;
 
-$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['Acronym'] = array();
-$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['Acronym']['objectReference'] = '&TYPO3\\CMS\\Rtehtmlarea\\Extension\\Acronym';
-$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['Acronym']['addIconsToSkin'] = 0;
-$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['Acronym']['disableInFE'] = 1;
+$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['Abbreviation'] = array();
+$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['Abbreviation']['objectReference'] = '&TYPO3\\CMS\\Rtehtmlarea\\Extension\\Abbreviation';
+$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['Abbreviation']['addIconsToSkin'] = 0;
+$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['Abbreviation']['disableInFE'] = 1;
 
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['UserElements'] = array();
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['UserElements']['objectReference'] = '&TYPO3\\CMS\\Rtehtmlarea\\Extension\\UserElements';
index 5ddb66a..7a271b5 100644 (file)
@@ -5,9 +5,10 @@ defined('TYPO3_MODE') or die();
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'static/clickenlarge/', 'Clickenlarge Rendering');
 
 // Add contextual help files
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_rtehtmlarea_acronym', 'EXT:' . $_EXTKEY . '/locallang_csh_abbreviation.xlf');
 $htmlAreaRteContextHelpFiles = array(
        'General' => 'EXT:' . $_EXTKEY . '/locallang_csh.xlf',
-       'Acronym' => 'EXT:' . $_EXTKEY . '/extensions/Acronym/locallang_csh.xlf',
+       'Abbreviation' => 'EXT:' . $_EXTKEY . '/extensions/Abbreviation/locallang_csh.xlf',
        'EditElement' => 'EXT:' . $_EXTKEY . '/extensions/EditElement/locallang_csh.xlf',
        'Language' => 'EXT:' . $_EXTKEY . '/extensions/Language/locallang_csh.xlf',
        'MicrodataSchema' => 'EXT:' . $_EXTKEY . '/extensions/MicrodataSchema/locallang_csh.xlf',
diff --git a/typo3/sysext/rtehtmlarea/extensions/Abbreviation/locallang_csh.xlf b/typo3/sysext/rtehtmlarea/extensions/Abbreviation/locallang_csh.xlf
new file mode 100644 (file)
index 0000000..cca9cba
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xliff version="1.0">
+       <file source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:35Z" product-name="rtehtmlarea">
+               <header/>
+               <body>
+                       <trans-unit id=".alttitle" xml:space="preserve">
+                               <source>htmlArea RTE &gt; Abbreviation</source>
+                       </trans-unit>
+                       <trans-unit id=".description" xml:space="preserve">
+                               <source>The "Abbreviation" dialogue allows to associate an abbreviation to a term.</source>
+                       </trans-unit>
+                       <trans-unit id=".details" xml:space="preserve">
+                               <source>Clicking the "Insert abbreviation" icon in the RTE tool bar opens a dialogue that allows to insert an abbreviation or to edit one that already exists in the content.
+Any existing abbreviation is underlined with a broken line and the cursor changes to a question mark when the mouse goes over it.
+The dialogue allows to associate an abbreviation to a term. The abbreviation may be selected among abbreviations that have been pre-defined in the database or may be entered directly in the dialogue.</source>
+                       </trans-unit>
+                       <trans-unit id=".image" xml:space="preserve">
+                               <source>EXT:rtehtmlarea/Resources/Public/Images/Plugins/Abbreviation/abbreviation.gif</source>
+                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
+                       </trans-unit>
+                       <trans-unit id=".image_descr" xml:space="preserve">
+                               <source>"Insert abbreviation" icon in the editor tool bar.</source>
+                       </trans-unit>
+                       <trans-unit id=".seeAlso" xml:space="preserve">
+                               <source>xEXT_rtehtmlarea_Abbreviation:preDefinedAbbreviation,
+xEXT_rtehtmlarea_Abbreviation:unabridgedTerm,
+xEXT_rtehtmlarea_Abbreviation:abridgedTerm,
+xEXT_rtehtmlarea_Abbreviation:language,
+xEXT_rtehtmlarea_Abbreviation:termToAbridge,
+xEXT_rtehtmlarea_Abbreviation:useThisTerm
+tx_rtehtmlarea_acronym</source>
+                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
+                       </trans-unit>
+                       <trans-unit id="preDefinedAbbreviation.alttitle" xml:space="preserve">
+                               <source>Pre-defined abbreviations</source>
+                       </trans-unit>
+                       <trans-unit id="preDefinedAbbreviation.description" xml:space="preserve">
+                               <source>This section lets you select abbreviations already defined in the database.</source>
+                       </trans-unit>
+                       <trans-unit id="preDefinedAbbreviation.seeAlso" xml:space="preserve">
+                               <source>tx_rtehtmlarea_acronym</source>
+                       </trans-unit>
+                       <trans-unit id="preDefinedAcronym.alttitle" xml:space="preserve">
+                               <source>Pre-defined acronyms</source>
+                       </trans-unit>
+                       <trans-unit id="preDefinedAcronym.description" xml:space="preserve">
+                               <source>This section lets you select acronyms already defined in the database.</source>
+                       </trans-unit>
+                       <trans-unit id="preDefinedAcronym.seeAlso" xml:space="preserve">
+                               <source>tx_rtehtmlarea_acronym</source>
+                       </trans-unit>
+                       <trans-unit id="unabridgedTerm.alttitle" xml:space="preserve">
+                               <source>Unabbreviated term</source>
+                       </trans-unit>
+                       <trans-unit id="unabridgedTerm.description" xml:space="preserve">
+                               <source>Select the unabbreviated form of the term.</source>
+                       </trans-unit>
+                       <trans-unit id="unabridgedTerm.details" xml:space="preserve">
+                               <source>The selected term will be set as the title attribute of the abbreviation (or acronym) element.</source>
+                       </trans-unit>
+                       <trans-unit id="abridgedTerm.alttitle" xml:space="preserve">
+                               <source>Abbreviation</source>
+                       </trans-unit>
+                       <trans-unit id="abridgedTerm.description" xml:space="preserve">
+                               <source>Select the short form of the term.</source>
+                       </trans-unit>
+                       <trans-unit id="language.alttitle" xml:space="preserve">
+                               <source>Language</source>
+                       </trans-unit>
+                       <trans-unit id="language.description" xml:space="preserve">
+                               <source>Select the language for which the abbreviation is defined.</source>
+                       </trans-unit>
+                       <trans-unit id="language.details" xml:space="preserve">
+                               <source>The selected language will be set as the language attribute of the abbreviation (or acronym) element.
+If a pre-defined abbreviation (or acronym) is selected, the language for which it is defined, if any, is initially selected.</source>
+                       </trans-unit>
+                       <trans-unit id="termToAbridge.alttitle" xml:space="preserve">
+                               <source>Term to abbreviate</source>
+                       </trans-unit>
+                       <trans-unit id="termToAbridge.description" xml:space="preserve">
+                               <source>This section lets you enter a term for which the current selection will be the short form.</source>
+                       </trans-unit>
+                       <trans-unit id="useThisTerm.alttitle" xml:space="preserve">
+                               <source>Use this term</source>
+                       </trans-unit>
+                       <trans-unit id="useThisTerm.description" xml:space="preserve">
+                               <source>Enter the term that you want to associate as the unabbreviated form of the current selection.</source>
+                       </trans-unit>
+                       <trans-unit id="useThisTerm.details" xml:space="preserve">
+                               <source>The entered term will be set as the title attribute of the abbreviation (or acronym) element.</source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
diff --git a/typo3/sysext/rtehtmlarea/htmlarea/plugins/Abbreviation/locallang.xlf b/typo3/sysext/rtehtmlarea/htmlarea/plugins/Abbreviation/locallang.xlf
new file mode 100644 (file)
index 0000000..ea6779c
--- /dev/null
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xliff version="1.0">
+       <file source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:35Z" product-name="rtehtmlarea">
+               <header/>
+               <body>
+                       <trans-unit id="Insert/Modify Acronym" xml:space="preserve">
+                               <source>Insert/edit abbreviation</source>
+                       </trans-unit>
+                       <trans-unit id="Insert abbreviation" xml:space="preserve">
+                               <source>Insert abbreviation</source>
+                       </trans-unit>
+                       <trans-unit id="Edit abbreviation" xml:space="preserve">
+                               <source>Edit abbreviation</source>
+                       </trans-unit>
+                       <trans-unit id="Term_to_abridge" xml:space="preserve">
+                               <source>Term to abbreviate</source>
+                       </trans-unit>
+                       <trans-unit id="Defined_acronym" xml:space="preserve">
+                               <source>Pre-defined acronyms</source>
+                       </trans-unit>
+                       <trans-unit id="Defined_abbr" xml:space="preserve">
+                               <source>Pre-defined abbreviations</source>
+                       </trans-unit>
+                       <trans-unit id="Term" xml:space="preserve">
+                               <source>Term</source>
+                       </trans-unit>
+                       <trans-unit id="Unabridged_term" xml:space="preserve">
+                               <source>Term</source>
+                       </trans-unit>
+                       <trans-unit id="Select_a_term" xml:space="preserve">
+                               <source>Select a term</source>
+                       </trans-unit>
+                       <trans-unit id="Abridged_term" xml:space="preserve">
+                               <source>Short form</source>
+                       </trans-unit>
+                       <trans-unit id="Acronym" xml:space="preserve">
+                               <source>Acronym</source>
+                       </trans-unit>
+                       <trans-unit id="Abbreviation" xml:space="preserve">
+                               <source>Abbreviation</source>
+                       </trans-unit>
+                       <trans-unit id="Select_an_acronym" xml:space="preserve">
+                               <source>Select an acronym</source>
+                       </trans-unit>
+                       <trans-unit id="Select_an_abbr" xml:space="preserve">
+                               <source>Select an abbreviation</source>
+                       </trans-unit>
+                       <trans-unit id="Use_this_term" xml:space="preserve">
+                               <source>Use this term</source>
+                       </trans-unit>
+                       <trans-unit id="Use_this_term_explain" xml:space="preserve">
+                               <source>Associate this term to the current selection</source>
+                       </trans-unit>
+                       <trans-unit id="Delete" xml:space="preserve">
+                               <source>Delete</source>
+                       </trans-unit>
+                       <trans-unit id="Select_a_language" xml:space="preserve">
+                               <source>Select a language</source>
+                       </trans-unit>
+                       <trans-unit id="Language_abbr_helpText" xml:space="preserve">
+                               <source>This is the language for which the abbreviation is defined</source>
+                       </trans-unit>
+                       <trans-unit id="Language_acronym_helpText" xml:space="preserve">
+                               <source>This is the language for which the acronym is defined</source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
index 7539c0f..a769e82 100644 (file)
@@ -11,7 +11,7 @@
 A defined abbreviation may further be configured so as to be made available only when editing content in a given language.</source>
                        </trans-unit>
                        <trans-unit id=".seeAlso" xml:space="preserve">
-                               <source>xEXT_rtehtmlarea_Acronym</source>
+                               <source>xEXT_rtehtmlarea_Abbreviation</source>
                                <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
                        </trans-unit>
                        <trans-unit id="term.description" xml:space="preserve">