[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

patch for denis new navbar



Hi,

I am using Denis multilevel navbar on www.ee.ethz.ch/stud2

it works very well, except that the button epilog does not get printed
after a button with an active submenu ... 

I have fixed this with the following patch ... the patch also added a new
argument called imgstarsep which allows to configure the separator used in
the imgstar parameter (I need this because I am using multilingual
arguments)

cheers
tobi


-- 
 ______    __   _
/_  __/_  / /  (_) Oetiker, Timelord & SysMgr @ EE-Dept ETH-Zurich
 / // _ \/ _ \/ / TEL: +41(0)1-6325286  FAX:...1194  ICQ: 10419518 
/_/ \.__/_.__/_/ oetiker@ee.ethz.ch http://ee-staff.ethz.ch/~oetiker
--- navbar.src~	Fri Apr  9 11:51:18 1999
+++ navbar.src	Wed Apr 14 13:06:16 1999
@@ -14,6 +14,7 @@
 #
 <define-container navbar:define>
 <preserve name>
+<preserve imgstarsep>
 <preserve imgstar>
 <preserve imgbase>
 <preserve urlbase>
@@ -23,6 +24,7 @@
 <set-var %attributes>
 <if <get-var name>    "" <set-var name="unknown-navbar">>
 <if <get-var imgstar> "" <set-var imgstar="n:s:o">>
+<if <get-var imgstarsep> "" <set-var imgstarsep=":">>
 <set-var __countbuttons=1>
 <: 
 {
@@ -35,6 +37,7 @@
     $CFG->{NAME} = '<get-var name>';
 
     $CFG->{IMGSTAR}  = '<get-var imgstar>';
+    $CFG->{IMGSTARSEP}  = quotemeta "<get-var imgstarsep>";
     $CFG->{IMGBASE}  = '<get-var imgbase>';
     $CFG->{URLBASE}  = '<get-var urlbase>';
     $CFG->{TARGET}   = '<get-var target>';
@@ -120,6 +123,7 @@
 <restore urlbase>
 <restore imgbase>
 <restore imgstar>
+<restore imgstarsep>
 <restore name>
 </define-container>
 
@@ -383,7 +387,7 @@
     my $CFG = $NAVBAR{"$name"};
 
     #   retrieve parts of config
-    my @imgstar  = split(':', $CFG->{IMGSTAR});
+    my @imgstar  = split(/$CFG->{IMGSTARSEP}/, $CFG->{IMGSTAR});
     my $imgbase  = $CFG->{IMGBASE};
     my $urlbase  = $CFG->{URLBASE};
     my $target   = $CFG->{TARGET};
@@ -413,7 +417,7 @@
         my $alias  = $B->{ALIAS};
         my $txt    = $B->{TXT};
         my $alt    = $B->{ALT};
-        my @img    = split(':', $B->{IMG});
+        my @img    = split(/$CFG->{IMGSTARSEP}/, $B->{IMG});
         my $url    = $B->{URL};
         my $target = $B->{TARGET};
         my $hint   = $B->{HINT};
@@ -552,10 +552,6 @@
             }
         }
 
-        if ($menu ne '' and $NAVBAR{"$menu"}->{OPEN}) {
-            $O .= &navbar_render($menu, $select, $subselected,
-                                 $txtonly, $nohints, $nbcount);
-        }
 
         
         #
@@ -574,6 +570,11 @@
                 }
             }
         }
+        if ($menu ne '' and $NAVBAR{"$menu"}->{OPEN}) {
+            $O .= &navbar_render($menu, $select, $subselected,
+                                 $txtonly, $nohints, $nbcount);
+        }
+
 
     }