Advertisement
cutgah

RealUrlConf.php

Jun 2nd, 2017
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.87 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Micke\RieSitepack;
  4.  
  5. class RealUrlConf {
  6.  
  7.     protected function mergeAndReturn($config, $overrule) {
  8.         \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($config, $overrule, TRUE, TRUE, TRUE);
  9.         return $config;
  10.     }
  11.  
  12.     /**
  13.      * Function creating or altering the postVarSets conf section of RealURL
  14.      * Define the page parameter for paginations
  15.      *
  16.      * @param array                  $conf  The original config array
  17.      * @param tx_realurl_autoconfgen $pObj  The realurl autoConf object
  18.      * @return array                        The realurl conf array
  19.      */
  20.     public function realUrlConfigurer($conf, &$pObj) {
  21.  
  22.         // Set pageIDs
  23.         $newsDetailPids = ['24', '33'];
  24.         $newsFilterPids = ['36'];
  25.         $newsCategoryPids = ['30'];
  26.         $newsTagPids = [];
  27.  
  28.  
  29.         // Apply configuration (defined in core) to existing, non-empty pageID arrays
  30.         if (!empty($newsDetailPids)) {
  31.             foreach ($newsDetailPids as $pid) {
  32.                 $configuration['fixedPostVars'][$pid] = 'newsDetailConfiguration';
  33.             }
  34.         };
  35.         if (!empty($newsFilterPids)) {
  36.             foreach ($newsFilterPids as $pid) {
  37.                 $configuration['fixedPostVars'][$pid] = 'newsFilterConfiguration';
  38.             }
  39.         };
  40.         if (!empty($newsCategoryPids)) {
  41.             foreach ($newsCategoryPids as $pid) {
  42.                 $configuration['fixedPostVars'][$pid] = 'newsCategoryConfiguration';
  43.             }
  44.         };
  45.         if (!empty($newsCategoryPids)) {
  46.             foreach ($newsCategoryPids as $pid) {
  47.                 $configuration['fixedPostVars'][$pid] = 'newsTagConfiguration';
  48.             }
  49.         };
  50.  
  51.         // Merge with conf from RealURL
  52.         $overrule = $configuration;
  53.         return $this->mergeAndReturn($conf['config'], $overrule);
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement