[TASK] RTE: Move hooks and softref config to Configuration directory 65/33865/2
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 6 Nov 2014 22:46:55 +0000 (17:46 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 6 Nov 2014 22:49:01 +0000 (23:49 +0100)
Releases: master
Resolves: #62759
Change-Id: I198a7ad5a131dc96c0dc4d669125061097867f5d
Reviewed-on: http://review.typo3.org/33865
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/Configuration/Hook/SoftReferences/ext_localconf.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Configuration/Hook/StatusReport/ext_localconf.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Configuration/TCA/Overrides/pages.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/Configuration/TCA/Overrides/tt_content.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/ext_localconf.php
typo3/sysext/rtehtmlarea/ext_tables.php
typo3/sysext/rtehtmlarea/hooks/softref/ext_localconf.php [deleted file]
typo3/sysext/rtehtmlarea/hooks/softref/ext_tables.php [deleted file]
typo3/sysext/rtehtmlarea/hooks/statusreport/ext_localconf.php [deleted file]

diff --git a/typo3/sysext/rtehtmlarea/Configuration/Hook/SoftReferences/ext_localconf.php b/typo3/sysext/rtehtmlarea/Configuration/Hook/SoftReferences/ext_localconf.php
new file mode 100644 (file)
index 0000000..de8706a
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+// Registering soft reference parser for img tags in RTE content
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser']['rtehtmlarea_images'] = '&TYPO3\\CMS\\Rtehtmlarea\\Hook\\SoftReferenceHook';
diff --git a/typo3/sysext/rtehtmlarea/Configuration/Hook/StatusReport/ext_localconf.php b/typo3/sysext/rtehtmlarea/Configuration/Hook/StatusReport/ext_localconf.php
new file mode 100644 (file)
index 0000000..8d54017
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+if (TYPO3_MODE === 'BE') {
+       // Take note of conflicting extensions
+       $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['conflicts'] = $EM_CONF[$_EXTKEY]['constraints']['conflicts'];
+       // Register Status Report Hook
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['htmlArea RTE'][] = 'TYPO3\\CMS\\Rtehtmlarea\\Hook\\StatusReportConflictsCheckHook';
+}
diff --git a/typo3/sysext/rtehtmlarea/Configuration/TCA/Overrides/pages.php b/typo3/sysext/rtehtmlarea/Configuration/TCA/Overrides/pages.php
new file mode 100644 (file)
index 0000000..9d0319e
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+// Adding soft reference keys in pages configuration
+// htmlArea RTE soft reference keys are inserted in front so that their tokens are inserted first
+foreach ($GLOBALS['TCA']['pages']['columns'] as $column => $config) {
+       if ($config['config']['softref']) {
+               if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($config['config']['softref'], 'images')) {
+                       // Remove obsolete soft reference key 'images'
+                       // The references from RTE content to the original images are handled with the key 'rtehtmlarea_images'.
+                       $softReferences = 'rtehtmlarea_images,' . \TYPO3\CMS\Core\Utility\GeneralUtility::rmFromList('images', $config['config']['softref']);
+                       $GLOBALS['TCA']['pages']['columns'][$column]['config']['softref'] = $softReferences;
+               }
+       } else {
+               if ($config['config']['type'] === 'text') {
+                       $GLOBALS['TCA']['pages']['columns'][$column]['config']['softref'] = 'rtehtmlarea_images,typolink_tag';
+               }
+       }
+}
diff --git a/typo3/sysext/rtehtmlarea/Configuration/TCA/Overrides/tt_content.php b/typo3/sysext/rtehtmlarea/Configuration/TCA/Overrides/tt_content.php
new file mode 100644 (file)
index 0000000..d5bb872
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+// Adding soft reference keys in tt_content configuration
+// htmlArea RTE soft reference keys are inserted in front so that their tokens are inserted first
+$GLOBALS['TCA']['tt_content']['columns']['header']['config']['softref'] = 'typolink_tag' . ($GLOBALS['TCA']['tt_content']['columns']['header']['config']['softref'] ? ',' . $GLOBALS['TCA']['tt_content']['columns']['header']['config']['softref'] : '');
+
+foreach ($GLOBALS['TCA']['tt_content']['columns'] as $column => $config) {
+       if ($config['config']['softref']) {
+               if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($config['config']['softref'], 'images')) {
+                       // Remove obsolete soft reference key 'images'
+                       // The references from RTE content to the original images are handled with the key 'rtehtmlarea_images'.
+                       $softReferences = 'rtehtmlarea_images,' . \TYPO3\CMS\Core\Utility\GeneralUtility::rmFromList('images', $config['config']['softref']);
+                       $GLOBALS['TCA']['tt_content']['columns'][$column]['config']['softref'] = $softReferences;
+               }
+       } else {
+               if ($config['config']['type'] === 'text') {
+                       $GLOBALS['TCA']['tt_content']['columns'][$column]['config']['softref'] = 'rtehtmlarea_images,typolink_tag';
+               }
+       }
+}
index 307c98c..c8d3f43 100644 (file)
@@ -32,9 +32,9 @@ if (strstr($_EXTCONF['defaultConfiguration'], 'Minimal')) {
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/Configuration/UserTS/' . $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['defaultConfiguration'] . '/userTSConfig.txt">');
 
 // Add processing of soft references on image tags in RTE content
-require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'hooks/softref/ext_localconf.php';
+require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/Hook/SoftReferences/ext_localconf.php';
 // Add Status Report about Conflicting Extensions
-require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'hooks/statusreport/ext_localconf.php';
+require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/Hook/StatusReport/ext_localconf.php';
 // Add frontend hook to add meta tag when rtehtmlarea is present and user agent is IE 11+
 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/Hook/Frontend/Controller/ext_localconf.php';
 
index 2c49542..603793f 100644 (file)
@@ -3,8 +3,6 @@ defined('TYPO3_MODE') or die();
 
 // Add static template for Click-enlarge rendering
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'static/clickenlarge/', 'Clickenlarge Rendering');
-// Add configuration of soft references on image tags in RTE content
-require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'hooks/softref/ext_tables.php';
 
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_rtehtmlarea_acronym');
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_rtehtmlarea_acronym', 'EXT:' . $_EXTKEY . '/locallang_csh_abbreviation.xlf');
diff --git a/typo3/sysext/rtehtmlarea/hooks/softref/ext_localconf.php b/typo3/sysext/rtehtmlarea/hooks/softref/ext_localconf.php
deleted file mode 100644 (file)
index de8706a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-defined('TYPO3_MODE') or die();
-
-// Registering soft reference parser for img tags in RTE content
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser']['rtehtmlarea_images'] = '&TYPO3\\CMS\\Rtehtmlarea\\Hook\\SoftReferenceHook';
diff --git a/typo3/sysext/rtehtmlarea/hooks/softref/ext_tables.php b/typo3/sysext/rtehtmlarea/hooks/softref/ext_tables.php
deleted file mode 100644 (file)
index ca915a4..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-defined('TYPO3_MODE') or die();
-
-// Adding soft reference keys in tt_content configuration
-// htmlArea RTE soft reference keys are inserted in front so that their tokens are inserted first
-$GLOBALS['TCA']['tt_content']['columns']['header']['config']['softref'] = 'typolink_tag' . ($GLOBALS['TCA']['tt_content']['columns']['header']['config']['softref'] ? ',' . $GLOBALS['TCA']['tt_content']['columns']['header']['config']['softref'] : '');
-$tempTables = array('pages', 'tt_content');
-foreach ($tempTables as $table) {
-       foreach ($GLOBALS['TCA'][$table]['columns'] as $column => $config) {
-               if ($config['config']['softref']) {
-                       if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($config['config']['softref'], 'images')) {
-                               // Remove obsolete soft reference key 'images'
-                               // The references from RTE content to the original images are handled with the key 'rtehtmlarea_images'.
-                               $softReferences = 'rtehtmlarea_images,' . \TYPO3\CMS\Core\Utility\GeneralUtility::rmFromList('images', $config['config']['softref']);
-                               $GLOBALS['TCA'][$table]['columns'][$column]['config']['softref'] = $softReferences;
-                       }
-               } else {
-                       if ($config['config']['type'] == 'text') {
-                               $GLOBALS['TCA'][$table]['columns'][$column]['config']['softref'] = 'rtehtmlarea_images,typolink_tag';
-                       }
-               }
-       }
-}
-unset($tempTables);
diff --git a/typo3/sysext/rtehtmlarea/hooks/statusreport/ext_localconf.php b/typo3/sysext/rtehtmlarea/hooks/statusreport/ext_localconf.php
deleted file mode 100644 (file)
index d915cb3..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php
-defined('TYPO3_MODE') or die();
-
-if (TYPO3_MODE === 'BE') {
-       // Take note of conflicting extensions
-       $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['conflicts'] = $EM_CONF[$_EXTKEY]['constraints']['conflicts'];
-       // Register Status Report Hook
-       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['htmlArea RTE'][] = 'TYPO3\\CMS\\Rtehtmlarea\\Hook\\StatusReportConflictsCheckHook';
-}