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