RealURL replace segments encode and decode

Funzioni di replace nel RealURL, inserire le seguenti righe nel file realurl_userconf.php

// put this two function at the begin of realurl_userconf.php file

function user_encodeSpURL_postProc(&$params, &$ref) {
//   $params['URL'] = str_replace('calendar/location/tx_cal_location/location/', 'calendar/location/', $params['URL']);
//   $params['URL'] = str_replace('calendar/organizer/tx_cal_organizer/organizer/', 'calendar/organizer/', $params['URL']);
//   $params['URL'] = str_replace('calendar/tx_cal_phpicalendar/event/2011/', 'calendar/2011/', $params['URL']);
//   $params['URL'] = str_replace('calendar/tx_cal_phpicalendar/event/2012/', 'calendar/2012/', $params['URL']);
//   $params['URL'] = str_replace('calendar/tx_cal_phpicalendar/event/2013/', 'calendar/2013/', $params['URL']);
  $params['URL'] = str_replace('event/tx_cal_phpicalendar/', 'evento/', $params['URL']);
  $params['URL'] = str_replace('news/news-detail/news/', 'dettaglio-news/', $params['URL']);
}
function user_decodeSpURL_preProc(&$params, &$ref) {
//   $params['URL'] = str_replace('calendar/location/', 'calendar/location/tx_cal_location/location/', $params['URL']);
//   $params['URL'] = str_replace('calendar/organizer/', 'calendar/organizer/tx_cal_organizer/organizer/', $params['URL']);
//   $params['URL'] = str_replace('calendar/2011/', 'calendar/tx_cal_phpicalendar/event/2011/', $params['URL']);
//   $params['URL'] = str_replace('calendar/2012/', 'calendar/tx_cal_phpicalendar/event/2012/', $params['URL']);
//   $params['URL'] = str_replace('calendar/2013/', 'calendar/tx_cal_phpicalendar/event/2013/', $params['URL']);
  $params['URL'] = str_replace('evento/', 'event/tx_cal_phpicalendar/', $params['URL']);
  $params['URL'] = str_replace('dettaglio-news/', 'news/news-detail/news/', $params['URL']);
}


$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
// put this two encode/decode at the begin of realurl conf array
  'encodeSpURL_postProc' => array('user_encodeSpURL_postProc'),
  'decodeSpURL_preProc' => array('user_decodeSpURL_preProc'),
// begin of default realurl conf array
  '_DEFAULT' => 
...

Leave a Reply