Skip to content
Snippets Groups Projects
Commit ab8fb846 authored by Marco Huber's avatar Marco Huber
Browse files

New RTE API in TYPO3 7.4 part 1

parent 0862cfec
No related branches found
No related tags found
1 merge request!3TYPO3 7.4 compatibility
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
// Registering soft reference parser for img tags in RTE content
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser']['rtehtmlarea_images'] =
'&SGalinski\Tinymce4Rte\Hook\SoftReferenceHook';
?>
\ No newline at end of file
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
// 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);
?>
\ No newline at end of file
<?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';
}
}
}
<?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';
}
}
}
......@@ -26,12 +26,14 @@ $GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_reg']['tinymce'] = array(
// load default typoscript config
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript(
'tinymce4_rte', 'setup',
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:tinymce4_rte/Configuration/TypoScript/ImageRendering/setup.ts">', 43
'tinymce4_rte',
'setup',
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:tinymce4_rte/Configuration/TypoScript/ImageRendering/setup.ts">',
'defaultContentRendering'
);
// Add processing of soft references on image tags in RTE content
require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('tinymce4_rte') .
'Configuration/Hooks/SoftRef/ext_localconf.php';
// Registering soft reference parser for img tags in RTE content
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser']['rtehtmlarea_images'] =
\SGalinski\Tinymce4Rte\Hook\SoftReferenceHook::class;
?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment