1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
<%doc>
Example:
include( '/elements/menubar.html',
#options hashref (optional)
{ 'newstyle' => 1, #may become the default at some point
'url_base' => '', #prepended to menubar URLs, for convenience
'selected' => '', #currently selected label
},
#menubar entries (required)
'label' => $url,
'label2' => $url2,
#etc.
);
</%doc>
%if ( $opt->{'newstyle'} ) {
<TABLE BGCOLOR="#000000" BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR>
<TD><IMG SRC="<%$fsurl%>images/gray-black-side.png" WIDTH=13 HEIGHT=25></TD>
<TD>
<% join(' ', @html ) %>
</TD>
<TD><IMG SRC="<%$fsurl%>images/black-gray-side.png" WIDTH=13 HEIGHT=25></TD>
</TD>
</TR>
</TABLE>
%} else {
<% join(' | ', @html) %>
%}
<%init>
my $opt = ref($_[0]) ? shift : {};
my $url_base = $opt->{'url_base'};
my @html;
while (@_) {
my ($item, $url) = splice(@_,0,2);
next if $item =~ /^\s*Main\s+Menu\s*$/i;
my $style = '';
if ( $opt->{'newstyle'} ) {
my $dclass = $item eq $opt->{'selected'}
? 'fsblackbuttonselected'
: 'fsblackbutton';
$style =
qq( CLASS="$dclass" ).
qq( onMouseOver="this.className='fsblackbuttonselected'; return true;" ).
qq( onMouseOut="this.className='$dclass'; return true;" );
}
push @html, qq!<A HREF="$url_base$url" $style>$item</A>!;
}
</%init>
|