summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2006-02-05 01:22:26 +0000
committerIan C <ianc@noddybox.co.uk>2006-02-05 01:22:26 +0000
commitf979303813d03180456b68681ba588af6ccc1207 (patch)
treed3f4f366028f042a4896df881ed61c3a8665863d
parent2c59d3233865c8eedcc567acad0d5aa54123ed59 (diff)
Fixed so that generated lists are a bit more proper. Also works properly in IE.HEADmaster
-rw-r--r--php/leftbar.php27
1 files changed, 24 insertions, 3 deletions
diff --git a/php/leftbar.php b/php/leftbar.php
index f2eb7bd..080243c 100644
--- a/php/leftbar.php
+++ b/php/leftbar.php
@@ -43,7 +43,7 @@ function LB_LeftHeader($hdr)
function LB_TopLink($url,$txt)
{
- printf('<li class="lb_toplink"><a class="lb_toplink" href="%s">%s</a></li>',$url,$txt);
+ printf('<a class="lb_toplink" href="%s">%s</a>',$url,$txt);
}
function LB_SubLink($url,$txt)
@@ -60,12 +60,20 @@ function LB_OpenLink(&$is_open)
}
}
-function LB_OpenSub(&$is_open)
+function LB_OpenLinkItem(&$is_open)
{
if (!$is_open)
{
$is_open = TRUE;
echo '<li class="lb_toplink">';
+ }
+}
+
+function LB_OpenSub(&$is_open)
+{
+ if (!$is_open)
+ {
+ $is_open = TRUE;
echo '<ul class="lb_sublink">';
}
}
@@ -79,13 +87,21 @@ function LB_CloseLink(&$is_open)
}
}
+function LB_CloseLinkItem(&$is_open)
+{
+ if ($is_open)
+ {
+ $is_open = FALSE;
+ echo '</li>';
+ }
+}
+
function LB_CloseSub(&$is_open)
{
if ($is_open)
{
$is_open = FALSE;
echo '</ul>';
- echo '</li>';
}
}
@@ -103,6 +119,7 @@ function LeftBar($file, $context = '')
$curcontext = '';
$in_link = FALSE;
$in_sub = FALSE;
+ $in_linkitem = FALSE;
while (!feof($fp))
{
@@ -131,6 +148,7 @@ function LeftBar($file, $context = '')
if (count($tok)==2)
{
LB_CloseSub($in_sub);
+ LB_CloseLinkItem($in_linkitem);
LB_CloseLink($in_link);
LB_LeftHeader($tok[1]);
}
@@ -144,7 +162,9 @@ function LeftBar($file, $context = '')
if (count($tok)==3)
{
LB_CloseSub($in_sub);
+ LB_CloseLinkItem($in_linkitem);
LB_OpenLink($in_link);
+ LB_OpenLinkItem($in_linkitem);
$ldef = $links[$tok[1]];
$curcontext = $tok[2];
LB_TopLink($ldef->url,$ldef->text);
@@ -179,6 +199,7 @@ function LeftBar($file, $context = '')
}
LB_CloseSub($in_sub);
+ LB_CloseLinkItem($in_linkitem);
LB_CloseLink($in_link);
fclose($fp);