style nits
[freeside.git] / httemplate / elements / menubar.html
1 <%doc>
2
3 Example:
4
5   include( '/elements/menubar.html',
6            
7            #options hashref (optional)
8            { 'newstyle' => 1,  #may become the default at some point
9              'url_base' => '', #prepended to menubar URLs, for convenience
10              'selected' => '', #currently selected label
11            },
12
13            #menubar entries (required)
14            'label'  => $url,
15            'label2' => $url2,
16            #etc.
17
18          );
19
20 </%doc>
21 %if ( $opt->{'newstyle'} ) {
22
23 %  #false laziness w/header.html... shouldn't these just go in freeside.css?
24
25    <style type="text/css">
26    a.fsblackbutton {
27             background-color:#333333;
28             color: #ffffff;
29             border:1px solid;
30             border-top-color:#cccccc;
31             border-left-color:#cccccc;
32             border-right-color:#aaaaaa;
33             border-bottom-color:#aaaaaa;
34             /*font-weight:bold;*/
35             /*padding-left:12px;
36             padding-right:12px;*/
37             padding-left:4px;
38             padding-right:4px;
39             text-decoration:none;
40             overflow:visible;
41             filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff333333',EndColorStr='#ff666666')
42    }
43    
44    a.fsblackbuttonselected {
45             background-color:#7e0079;
46             color: #ffffff;
47             border:1px solid;
48             border-top-color:#cccccc;
49             border-left-color:#cccccc;
50             border-right-color:#aaaaaa;
51             border-bottom-color:#aaaaaa;
52             /*font-weight:bold;*/
53             /*padding-left:12px;
54             padding-right:12px;*/
55             padding-left:4px;
56             padding-right:4px;
57             text-decoration:none;
58             overflow:visible;
59             filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff330033',EndColorStr='#ff7e0079')
60    }
61    </style>
62
63    <TABLE BGCOLOR="#000000" BORDER=0 CELLSPACING=0 CELLPADDING=0>
64      <TR>
65        <TD><IMG SRC="<%$fsurl%>images/gray-black-side.png" WIDTH=13 HEIGHT=25></TD>
66        <TD>
67          <% join(' ', @html ) %>
68        </TD>
69        <TD><IMG SRC="<%$fsurl%>images/black-gray-side.png" WIDTH=13 HEIGHT=25></TD>
70        </TD>
71      </TR>
72    </TABLE>
73
74 %} else {
75
76    <% join(' | ', @html) %>
77
78 %}
79 <%init>
80
81 my $opt = ref($_[0]) ? shift : {};
82
83 my $url_base = $opt->{'url_base'};
84
85 my @html;
86 while (@_) {
87
88   my ($item, $url) = splice(@_,0,2);
89   next if $item =~ /^\s*Main\s+Menu\s*$/i;
90
91   my $style = '';
92   if ( $opt->{'newstyle'} ) {
93
94     my $dclass = $item eq $opt->{'selected'}
95                    ? 'fsblackbuttonselected'
96                    : 'fsblackbutton';
97
98     $style =
99       qq( CLASS="$dclass" ).
100       qq( onMouseOver="this.className='fsblackbuttonselected'; return true;" ).
101       qq( onMouseOut="this.className='$dclass'; return true;" );
102   }
103
104   push @html, qq!<A HREF="$url_base$url" $style>$item</A>!;
105
106 }
107
108 </%init>