invoice_sections_with_taxes per-agent, RT#79636
[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    <DIV CLASS="fstabs">
24    <% join('', @html ) %>
25    </DIV>
26
27 %} else {
28
29    <% join(' | ', @html) %>
30
31 %}
32 <%init>
33
34 my $opt = ref($_[0]) ? shift : {};
35
36 my $url_base = $opt->{'url_base'};
37
38 my @html;
39 while (@_) {
40
41   my ($item, $url) = splice(@_,0,2);
42   next if $item =~ /^\s*Main\s+Menu\s*$/i;
43
44   my $style = '';
45   if ( $opt->{'newstyle'} ) {
46
47     my $dclass = $item eq $opt->{'selected'}
48                    ? 'fstabselected'
49                    : 'fstab';
50
51     $style = qq( CLASS="$dclass" );
52
53   }
54
55   push @html, qq!<A HREF="$url_base$url" $style>$item</A>!;
56
57 }
58
59 </%init>