Skip to content
Snippets Groups Projects
Commit efac5c45 authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[FEATURE] Add realurl auto configuration

parent affcfca0
No related branches found
No related tags found
No related merge requests found
<?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,
],
],
],
],
]
);
}
}
......@@ -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';
}
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