finish up initial work on customer view tabs (ensure links back to customer view...
[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=4>
64      <TR>
65        <TD STYLE="background-image:url(<%$fsurl%>images/gray-black-side.png); background-repeat:repeat-y;padding-left:0px">
66          &nbsp;&nbsp;
67        </TD>
68        <TD>
69          <% join(' ', @html ) %>
70        </TD>
71        <TD STYLE="background-image:url(<%$fsurl%>images/black-gray-side.png); background-repeat:repeat-y;padding-right:0px">
72          &nbsp;&nbsp;
73        </TD>
74      </TR>
75    </TABLE>
76
77 %} else {
78
79    <% join(' | ', @html) %>
80
81 %}
82 <%init>
83
84 my $opt = ref($_[0]) ? shift : {};
85
86 my $url_base = $opt->{'url_base'};
87
88 my @html;
89 while (@_) {
90
91   my ($item, $url) = splice(@_,0,2);
92   next if $item =~ /^\s*Main\s+Menu\s*$/i;
93
94   my $style = '';
95   if ( $opt->{'newstyle'} ) {
96
97     my $dclass = $item eq $opt->{'selected'}
98                    ? 'fsblackbuttonselected'
99                    : 'fsblackbutton';
100
101     $style =
102       qq( CLASS="$dclass" ).
103       qq( onMouseOver="this.className='fsblackbuttonselected'; return true;" ).
104       qq( onMouseOut="this.className='$dclass'; return true;" );
105   }
106
107   push @html, qq!<A HREF="$url_base$url" $style>$item</A>!;
108
109 }
110
111 </%init>