Project

General

Profile

Bug #18516 » 7961_headlisttags2.diff

Administrator Admin, 2008-04-01 22:30

View differences:

t3lib/class.t3lib_parsehtml_proc.php (working copy)
class t3lib_parsehtml_proc extends t3lib_parsehtml {
// Static:
var $headListTags = 'PRE,UL,OL,H1,H2,H3,H4,H5,H6,HR,ADDRESS,DL,DD'; // List of tags for these elements
var $blockElementList = 'PRE,UL,OL,H1,H2,H3,H4,H5,H6,HR,ADDRESS,DL,DD'; // List of tags for these elements
// Internal, static:
var $recPid = 0; // Set this to the pid of the record manipulated by the class.
......
// Init:
$this->procOptions = $thisConfig['proc.'];
$this->preserveTags = strtoupper(implode(',',t3lib_div::trimExplode(',',$this->procOptions['preserveTags'])));
// dynamic configuration of blockElementList
if ($this->procOptions['blockElementList']) {
$this->blockElementList = $this->procOptions['blockElementList'];
}
// Get parameters for rte_transformation:
$p = $this->rte_p = t3lib_BEfunc::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
......
if ($this->TS_transform_db_safecounter<0) return $value;
// Split the content from RTE by the occurence of these blocks:
$blockSplit = $this->splitIntoBlock('TABLE,BLOCKQUOTE,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->headListTags,$value);
$blockSplit = $this->splitIntoBlock('TABLE,BLOCKQUOTE,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->blockElementList,$value);
$cc=0;
$aC = count($blockSplit);
......
function TS_transform_rte($value,$css=0) {
// Split the content from Database by the occurence of these blocks:
$blockSplit = $this->splitIntoBlock('TABLE,BLOCKQUOTE,TYPOLIST,TYPOHEAD,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->headListTags,$value);
$blockSplit = $this->splitIntoBlock('TABLE,BLOCKQUOTE,TYPOLIST,TYPOHEAD,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->blockElementList,$value);
// Traverse the blocks
foreach($blockSplit as $k => $v) {
......
} else { // NON-block:
$nextFTN = $this->getFirstTagName($blockSplit[$k+1]);
$singleLineBreak = $blockSplit[$k]==chr(10);
if (t3lib_div::inList('TABLE,BLOCKQUOTE,TYPOLIST,TYPOHEAD,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->headListTags,$nextFTN)) { // Removing linebreak if typolist/typohead
if (t3lib_div::inList('TABLE,BLOCKQUOTE,TYPOLIST,TYPOHEAD,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->blockElementList,$nextFTN)) { // Removing linebreak if typolist/typohead
$blockSplit[$k] = ereg_replace(chr(10).'[ ]*$','',$blockSplit[$k]);
}
// If $blockSplit[$k] is blank then unset the line. UNLESS the line happend to be a single line break.
(2-2/2)