summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
authorAdrian Lang <lang@cosmocode.de>2011-08-19 15:48:22 +0200
committerAdrian Lang <lang@cosmocode.de>2011-08-19 15:50:01 +0200
commit9e4f7880b1e2dfece064b313f5ad1c56b0fdc3d6 (patch)
treec29c363f65b9c57b0543d934f13ff041c4195342 /inc/html.php
parent26fc53c6a8fe022cd60b5df5474cfbe35afd34e4 (diff)
downloadrpg-9e4f7880b1e2dfece064b313f5ad1c56b0fdc3d6.tar.gz
rpg-9e4f7880b1e2dfece064b313f5ad1c56b0fdc3d6.tar.bz2
Fix tree HTML (closes FS#2299)
Diffstat (limited to 'inc/html.php')
-rw-r--r--inc/html.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/inc/html.php b/inc/html.php
index 64999ed98..6e9cce7df 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -782,16 +782,17 @@ function html_buildlist($data,$class,$func,$lifunc='html_li_default'){
return '';
}
- $level = $data[0]['level'];
- $opens = 0;
+ $start_level = $data[0]['level'];
$ret = '';
- if ($level < 2) {
+ if ($start_level < 2) {
// Trigger building a wrapper ul if the first level is
// 0 (we have a root object) or 1 (just the root content)
- --$level;
+ --$start_level;
}
+ $level = $start_level;
+
foreach ($data as $item){
if( $item['level'] > $level ){
@@ -824,7 +825,7 @@ function html_buildlist($data,$class,$func,$lifunc='html_li_default'){
}
//close remaining items and lists
- for ($i=0; $i < $level; $i++){
+ while(--$level >= $start_level) {
$ret .= "</li></ul>\n";
}