diff --git a/Classes/Xclass/Realurl/Utility.php b/Classes/Xclass/Realurl/Utility.php new file mode 100644 index 00000000..ab0d504c --- /dev/null +++ b/Classes/Xclass/Realurl/Utility.php @@ -0,0 +1,76 @@ + 'a', + 'å' => 'a', + 'ö' => 'o', + 'Å' => 'a', + 'Ä' => 'a', + 'Ö' => 'o' + ]; + + /** + * Xclass standard Reaurl utility to remove some specials characters + * + * @param string $processedTitle + * @param string $spaceCharacter + * @param bool $strToLower + * @return string + */ + public function convertToSafeString($processedTitle, $spaceCharacter = '-', $strToLower = true) + { + $processedTitle = str_replace( + array_keys($this->getFinalCharsReplacements()), + $this->getFinalCharsReplacements(), + $processedTitle + ); + + return parent::convertToSafeString($processedTitle, $spaceCharacter, $strToLower); + } + + /** + * Check in extension configuration for additional replacements + * + * @return array|null + */ + protected function getFinalCharsReplacements() + { + static $finalReplacements = null; + + if ($finalReplacements === null) { + $t3kitExtToolConf = HelperUtility::getExtConf(); + $additionalChars = []; + + if (!empty($t3kitExtToolConf['additionalCharacters'])) { + + $charsSet = GeneralUtility::trimExplode(',', $t3kitExtToolConf['additionalCharacters']); + + foreach ($charsSet as $charSet) { + list($find, $replace) = GeneralUtility::trimExplode('=>', $charSet, true); + $additionalChars[$find] = $replace; + } + } + + $finalReplacements = array_merge(self::$replacements, $additionalChars); + } + + return $finalReplacements; + } +} diff --git a/ext_localconf.php b/ext_localconf.php index 3db3c2e5..57ed9cfc 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -43,9 +43,13 @@ */ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['imageTextLink'] - = \T3kit\themeT3kit\Hooks\ImageTextLinkPreviewRenderer::class; + = \T3kit\themeT3kit\Hooks\ImageTextLinkPreviewRenderer::class; $GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['t3kit'][] = 'T3kit\\themeT3kit\\ViewHelpers'; -$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['t3kit_default'] = 'EXT:theme_t3kit/Resources/Private/Extensions/RTE/Default.yaml'; +$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['t3kit_default'] + = 'EXT:theme_t3kit/Resources/Private/Extensions/RTE/Default.yaml'; + +$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\DmitryDulepov\Realurl\Utility::class]['className'] + = \T3kit\themeT3kit\Xclass\Realurl\Utility::class;