- bug fixed: UL/LI tags were not correctly closed in category menu tree.

git-svn-id: http://piwigo.org/svn/branches/branch-1_5@940 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall 2005-11-18 22:42:35 +00:00
parent f280ff4b17
commit db658fcbe1

View file

@ -346,25 +346,21 @@ function get_html_menu_category($categories)
$level = substr_count($category['global_rank'], '.') + 1; $level = substr_count($category['global_rank'], '.') + 1;
if ($level > $ref_level) if ($level > $ref_level)
{ {
$menu.= ' $menu.= "\n<ul>";
<ul>';
} }
else if ($level == $ref_level) else if ($level == $ref_level)
{ {
$menu.= ' $menu.= "\n</li>";
</li>';
} }
else if ($level < $ref_level) else if ($level < $ref_level)
{ {
// we may have to close more than one level at the same time... // we may have to close more than one level at the same time...
$menu.= str_repeat("\n</ul>",($ref_level-$level));
$menu.= "\n</li>"; $menu.= "\n</li>";
$menu.= str_repeat("\n</ul></li>",($ref_level-$level));
} }
$ref_level = $level; $ref_level = $level;
$menu.= ' $menu.= "\n\n".'<li';
<li';
if (isset($page['cat']) if (isset($page['cat'])
and is_numeric($page['cat']) and is_numeric($page['cat'])
and $category['id'] == $page['cat']) and $category['id'] == $page['cat'])
@ -374,13 +370,11 @@ function get_html_menu_category($categories)
$menu.= '>'; $menu.= '>';
$url = add_session_id(PHPWG_ROOT_PATH.'category.php?cat='.$category['id']); $url = add_session_id(PHPWG_ROOT_PATH.'category.php?cat='.$category['id']);
$menu.= ' $menu.= "\n".'<a href="'.$url.'">'.$category['name'].'</a>';
<a href="'.$url.'">'.$category['name'].'</a>';
if ($category['nb_images'] > 0) if ($category['nb_images'] > 0)
{ {
$menu.= ' $menu.= "\n".'<span class="menuInfoCat"';
<span class="menuInfoCat"';
$menu.= ' title="'.$category['nb_images']; $menu.= ' title="'.$category['nb_images'];
$menu.= ' '.$lang['images_available'].'">'; $menu.= ' '.$lang['images_available'].'">';
$menu.= '['.$category['nb_images'].']'; $menu.= '['.$category['nb_images'].']';
@ -388,9 +382,8 @@ function get_html_menu_category($categories)
$menu.= get_icon($category['date_last']); $menu.= get_icon($category['date_last']);
} }
} }
$menu.= '</li> $menu.= str_repeat("\n</li></ul>",($level));
</ul>';
return $menu; return $menu;
} }