[Typo3] alt_plaintext/sitemap
Chris Paige
chris at ready-set-go.biz
Wed Sep 21 05:45:35 CEST 2005
Well, I don't know if there's a better way, but I found a hack for this one
too.
I found the file: media/scripts/plaintextLib.inc
I added these two functions (which are just slight variations on two of the
original functions:
***************
function parseBodySitemap($str) {
// First, regular parsing:
$str = eregi_replace('<br[ /]*>',chr(10),$str);
$str = $this->cObj->stdWrap($str,$this->conf['bodytext.']['stdWrap.']);
// Then all a-tags:
$aConf = array();
$aConf['parseFunc.']['tags.']['a']='USER';
$aConf['parseFunc.']['tags.']['a.']['userFunc']='user_plaintext->atagremove';
$aConf['parseFunc.']['tags.']['a.']['siteUrl'] = " ";
$str = $this->cObj->stdWrap($str,$aConf);
$str = str_replace(' ',' ',t3lib_div::htmlspecialchars_decode($str));
return $str;
}
***************
function atagremove($content,$conf) {
$this->conf = $conf;
$this->siteUrl=$conf['siteUrl'];
$theLink = trim($this->cObj->parameters['href']);
if (strtolower(substr($theLink,0,7))=='mailto:') {
$theLink=substr($theLink,7);
} elseif (substr($theLink,0,4)!='http') {
$theLink=$this->siteUrl.$theLink;
}
return $this->cObj->getCurrentVal().chr(10);
}
***************
Then I found the function: getMenuSitemap()
I removed this line:
$str = $this->breakBulletlist(trim(strip_tags(eregi_replace('<br[
/]*>',chr(10),$this->parseBody($str)))));
And replaced it with this line:
$str = $this->breakBulletlist(trim(strip_tags(eregi_replace('<br[
/]*>',chr(10),$this->parseBodySitemap($str)))));
***************
It's working for me.
Chris
More information about the TYPO3-english
mailing list