Index: pi1/class.tx_cssstyledcontent_pi1.php =================================================================== --- pi1/class.tx_cssstyledcontent_pi1.php (revision 2352) +++ pi1/class.tx_cssstyledcontent_pi1.php (working copy) @@ -99,32 +99,96 @@ if ($hookObj = &$this->hookRequest('render_bullets')) { return $hookObj->render_bullets($content,$conf); } else { - // Get bodytext field content, returning blank if empty: $content = trim($this->cObj->data['bodytext']); if (!strcmp($content,'')) return ''; - + // Split into single lines: $lines = t3lib_div::trimExplode(chr(10),$content); + + //How many lines do we have reduced of one, because the array numbering begins with 0 + $linecount = count($lines)-1; + + //On which level was the previous entry in this List + $prelevel=0; + + while(list($k)=each($lines)) { - $lines[$k]=' -
  • '.$this->cObj->stdWrap($lines[$k],$conf['innerStdWrap.']).'
  • '; + //On which Level in the Bulletlist are we now + $level=0; + while ($lines[$k]{$level} == '|') { + $level++; + } + + $pre = ''; + $post = ''; + + if ($level > $prelevel) { + //The Level of the current Entry deeper than of the Entry before + $i = $level; + $pre.=chr(10); + while ($i > $prelevel) { + if ($i == $level && $k != 0) { + //If we are at the same level like the previous entry, there is already an opening
  • tag (Except this is the very first entry on this bulletlist) + $pre.=''; + $i++; + $openLiTags--; + $openUlTags--; + } + $post.='
  • '; + } + + $prelevel = $level; + + $lines[$k]=$this->cObj->stdWrap($pre.substr($lines[$k],$level).$post,$conf['innerStdWrap.']); } - + // Set header type: $type = intval($this->cObj->data['layout']); - + // Compile list: $out = ' '; - + // Calling stdWrap: if ($conf['stdWrap.']) { $out = $this->cObj->stdWrap($out, $conf['stdWrap.']); } - // Return value return $out; }