diff --git a/Classes/Hooks/RealUrlAutoConfiguration.php b/Classes/Hooks/RealUrlAutoConfiguration.php new file mode 100644 index 0000000000000000000000000000000000000000..84c6f7ee786a0f7c3389349971c91716521778c6 --- /dev/null +++ b/Classes/Hooks/RealUrlAutoConfiguration.php @@ -0,0 +1,62 @@ +<?php + +namespace SGalinski\SgNews\Hooks; + +/*************************************************************** + * Copyright notice + * + * (c) sgalinski Internet Services (https://www.sgalinski.de) + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +/** + * AutoConfiguration-Hook for RealURL + */ +class RealUrlAutoConfiguration { + /** + * Generates additional RealURL configuration and merges it with provided configuration + * + * @param array $params Default configuration + * @return array Updated configuration + */ + public function addNewsConfig($params) { + return array_merge_recursive( + $params['config'], [ + 'postVarSets' => [ + '_DEFAULT' => [ + 'page' => [ + [ + 'GETvar' => 'tx_sgnews_pagebrowser[currentPage]', + ], + ], + ] + ], + 'fileName' => [ + 'index' => [ + 'news.xml' => [ + 'keyValues' => [ + 'type' => 78906523, + ], + ], + ], + ], + ] + ); + } +} diff --git a/ext_localconf.php b/ext_localconf.php index 5ba6ec1d4f131184c898d26b0e2c7b39f2e882a5..4b4bdb16c05634319abc12725e3b96815c6ec2fc 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -71,4 +71,8 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['proc $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\CMS\Core\Page\PageRenderer'] = ['className' => 'SGalinski\SgNews\Xclass\PageRenderer']; -?> +// add realurl configuration +if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('realurl')) { + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/realurl/class.tx_realurl_autoconfgen.php']['extensionConfiguration']['sgnews'] = + \SGalinski\SgNews\Hooks\RealUrlAutoConfiguration::class . '->addNewsConfig'; +}