From: <fr...@us...> - 2006-10-26 05:37:22
|
Update of /cvsroot/tikiwiki/tiki/lib/structures In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1790/lib/structures Modified Files: structlib.php Log Message: {toc} ul list fixed... Index: structlib.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/lib/structures/structlib.php,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- structlib.php 22 Oct 2006 03:21:39 -0000 1.67 +++ structlib.php 26 Oct 2006 05:37:15 -0000 1.68 @@ -366,7 +366,7 @@ function get_toc($page_ref_id,$order='asc',$showdesc=false,$numbering=true,$numberPrefix='',$type='plain',$page='',$maxdepth=0) { global $smarty; $structure_tree = $this->build_subtree_toc($page_ref_id,false,$order,$numberPrefix); - return $this->fetch_toc($structure_tree,$showdesc,$numbering,$type,$page,$maxdepth)."\n".$smarty->fetch("structures_toc-endul.tpl"); + return $this->fetch_toc($structure_tree,$showdesc,$numbering,$type,$page,$maxdepth)."\n"; } function fetch_toc($structure_tree,$showdesc,$numbering,$type='plain',$page='',$maxdepth=0,$cur_depth=0) { @@ -375,13 +375,8 @@ if ($structure_tree != '') { if (($maxdepth <= 0) || ($cur_depth < $maxdepth)) { - $leafspace=$cur_depth; - if ($leafspace!=0) { - $smarty->assign('leafspace',str_repeat("\t",$leafspace*2)); - } else { - $smarty->assign('leafspace',''); - } - $ret.="<!--depth: $cur_depth-->\n".$smarty->fetch('structures_toc-startul.tpl'); + $smarty->assign('leafspace',str_repeat("\t",$cur_depth*2)); + $ret.="<!--depth: $cur_depth-->\n".$smarty->fetch('structures_toc-startul.tpl')."\n"; foreach($structure_tree as $leaf) { @@ -395,17 +390,16 @@ $smarty->assign('showdesc',$showdesc); $smarty->assign('numbering',$numbering); $smarty->assign('toc_type',$type); - $ret.="\n".$smarty->fetch('structures_toc-leaf.tpl'); + $smarty->assign('leafspace',str_repeat("\t",$cur_depth*2)); + $ret.=$smarty->fetch('structures_toc-leaf.tpl'); if(isset($leaf['sub']) && is_array($leaf['sub'])) { $ret.=$this->fetch_toc($leaf['sub'],$showdesc,$numbering,$type,$page,$maxdepth,$cur_depth+1); - } else { - $ret.=str_repeat("</li></ul>\n",$leafspace).'<!--END OF SUBLEVELS--></li>'; - } - } + } + } + $smarty->assign('leafspace',str_repeat("\t",$cur_depth*2)); + $ret.=$smarty->fetch('structures_toc-endul.tpl')."\n"; } - $ret.=$smarty->fetch('structures_toc-endul.tpl'); } - return $ret; } // end of replacement |