Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Micke\GenCore;
- class RealUrlConf {
- protected function mergeAndReturn($config, $overrule) {
- \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($config, $overrule, TRUE, TRUE, TRUE);
- return $config;
- }
- /**
- * Function creating or altering the postVarSets conf section of RealURL
- * Define the page parameter for paginations
- *
- * @param array $conf The original config array
- * @param tx_realurl_autoconfgen $pObj The realurl autoConf object
- * @return array The realurl conf array
- */
- public function realUrlConfigurer($conf, &$pObj) {
- // $newsDetailPids = ['60', '71', '24'];
- // $newsFilterPids = ['72'];
- // $newsCategoryPids = ['61'];
- // $newsTagPids = [];
- $configuration = array(
- 'fixedPostVars' => array(
- 'newsFilterConfiguration' => array(
- array(
- 'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
- ),
- array(
- 'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
- ),
- ),
- 'newsDetailConfiguration' => array(
- array(
- 'GETvar' => 'tx_news_pi1[year]',
- ),
- array(
- 'GETvar' => 'tx_news_pi1[month]',
- 'noMatch' => 'bypass',
- ),
- array(
- 'GETvar' => 'tx_news_pi1[day]',
- 'noMatch' => 'bypass',
- ),
- array(
- 'GETvar' => 'tx_news_pi1[action]',
- 'noMatch' => 'bypass',
- ),
- array(
- 'GETvar' => 'tx_news_pi1[controller]',
- 'noMatch' => 'bypass',
- ),
- array(
- 'GETvar' => 'tx_news_pi1[mode]',
- 'noMatch' => 'bypass',
- ),
- array(
- 'GETvar' => 'tx_news_pi1[news]',
- 'lookUpTable' => array(
- 'table' => 'tx_news_domain_model_news',
- 'id_field' => 'uid',
- 'alias_field' => 'title',
- 'addWhereClause' => ' AND NOT deleted',
- 'useUniqueCache' => 1,
- 'useUniqueCache_conf' => array(
- 'strtolower' => 1,
- 'spaceCharacter' => '-',
- ),
- 'languageGetVar' => 'L',
- 'languageExceptionUids' => '',
- 'languageField' => 'sys_language_uid',
- 'transOrigPointerField' => 'l10n_parent',
- 'expireDays' => 180,
- ),
- ),
- ),
- 'newsCategoryConfiguration' => array(
- array(
- 'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
- 'noMatch' => 'bypass',
- 'lookUpTable' => array(
- 'table' => 'sys_category',
- 'id_field' => 'uid',
- 'alias_field' => 'title',
- 'addWhereClause' => ' AND NOT deleted',
- 'useUniqueCache' => 1,
- 'useUniqueCache_conf' => array(
- 'strtolower' => 1,
- 'spaceCharacter' => '-'
- )
- )
- )
- ),
- 'newsTagConfiguration' => array(
- array(
- 'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
- 'lookUpTable' => array(
- 'table' => 'tx_news_domain_model_tag',
- 'id_field' => 'uid',
- 'alias_field' => 'title',
- 'addWhereClause' => ' AND NOT deleted',
- 'useUniqueCache' => 1,
- 'useUniqueCache_conf' => array(
- 'strtolower' => 1,
- 'spaceCharacter' => '-'
- )
- )
- )
- ),
- ),
- 'postVarSets' => array(
- '_DEFAULT' => array(
- 'controller' => array(
- array(
- 'GETvar' => 'tx_news_pi1[action]',
- 'noMatch' => 'bypass'
- ),
- array(
- 'GETvar' => 'tx_news_pi1[controller]',
- 'noMatch' => 'bypass'
- ),
- ),
- 'page' => array(
- array(
- 'GETvar' => 'tx_news_pi1[@widget_0][currentPage]',
- ),
- ),
- ),
- ),
- );
- // Apply postFixedVars configuration to pages
- // if (!empty($newsDetailPids)) {
- // foreach ($newsDetailPids as $pid) {
- // $configuration['fixedPostVars'][$pid] = 'newsDetailConfiguration';
- // }
- // };
- // if (!empty($newsFilterPids)) {
- // foreach ($newsFilterPids as $pid) {
- // $configuration['fixedPostVars'][$pid] = 'newsFilterConfiguration';
- // }
- // };
- // if (!empty($newsCategoryPids)) {
- // foreach ($newsCategoryPids as $pid) {
- // $configuration['fixedPostVars'][$pid] = 'newsCategoryConfiguration';
- // }
- // };
- // if (!empty($newsCategoryPids)) {
- // foreach ($newsCategoryPids as $pid) {
- // $configuration['fixedPostVars'][$pid] = 'newsTagConfiguration';
- // }
- // };
- // Merge with conf from RealURL
- $overrule = $configuration;
- return $this->mergeAndReturn($conf['config'], $overrule);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement