1 <style type="text/css">
8 #<% $opt{id} %> .ui-state-active {
10 background-color: transparent;
11 border-color: transparent;
19 /* #<% $opt{id} %> .ui-menu-item */
20 #<% $opt{id} %> > li {
24 /* #<% $opt{id} %> .ui-menu-item */
25 #<% $opt{id} %> > li.ui-state-focus {
26 border: 1px solid transparent;
29 #<% $opt{id} %> > li.ui-state-active {
30 border: 1px solid transparent;
33 #<% $opt{id} %> > li.ui-state-active > a {
35 /* if i could find something light enough that didn't look pink?
36 or is this too visually distracting and not the useful hint i think it is?
46 border: 1px solid #7e0079;
48 box-shadow: #333333 1px 1px 2px;
51 #<% $opt{id} %> ul li {
57 #<% $opt{id} %> ul a {
61 #<% $opt{id} %> li.ui-menu-divider {
62 border-color: #7e0079;
65 #<% $opt{id} %> a:hover {
66 text-decoration: underline;
70 #<% $opt{id} %> ul li.ui-state-focus {
71 background: transparent;
72 border: 1px solid transparent;
77 #<% $opt{id} %> ul li.ui-state-active {
79 border: 1px solid #7e0079;
85 #<% $opt{id} %> a .arrow {
87 background-image: url("<% $p %>images/arrow.right.black.png");
94 @-moz-document url-prefix() {
95 #<% $opt{id} %> a .arrow {
102 <ul id="<% $opt{id} %>">
103 % foreach my $submenu (@processed_menu) {
104 <li <% $opt{bgcolor} ? 'STYLE="background:'. $opt{bgcolor}.'"' : '' %>>
105 <% shift @$submenu %>
107 <ul class="<% $opt{class} %>">
108 % foreach my $link ( @$submenu ) {
117 <script type="text/javascript">
119 $("#<% $opt{id} %>").menu({
120 position: { my: "left top", at: "left+1 bottom+3" },
121 icons: { submenu: "ui-icon-blank" },
123 $(this).menu("option", "position", { my:"left top", at:"left+1 bottom+3" } );
125 focus: function(e,ui) {
126 if ($("#<% $opt{id} %>").get(0) !== $(ui).get(0).item.parent().get(0)) {
127 $(this).menu("option", "position", { my:"left top", at:"right+2 top"} );
137 #my $cust_main = $opt{'cust_main'};
138 #my $custnum = $cust_main->custnum;
139 #my $curuser = $FS::CurrentUser::CurrentUser;
140 #my $conf = FS::Conf->new;
142 #my %payby = map { $_ => 1 } $conf->config('payby');
144 ## cached for conditions, to avoid looking it up twice
145 #my $invoicing_list_emailonly = $cust_main->invoicing_list_emailonly;
148 foreach my $submenu (@{ $opt{menu} }) {
152 foreach my $entry ( @$submenu ) {
153 # if the menu head was skipped, skip the whole menu
154 last if (!$first and !@links);
157 my $a = entry2link($entry, \%opt);
158 push @links, $a if length($a);
163 push @processed_menu, \@links;
169 my( $entry, $opt ) = @_;
172 if ( $entry->{acl} ) {
174 unless $FS::CurrentUser::CurrentUser->access_right( $entry->{acl} );
176 if ( $entry->{confexists} ) {
177 if ( $entry->{confexists} =~ /^!(.*)/ ) {
178 # confexists => !foo, a negative condition
179 return '' if FS::Conf->new->exists( $1 );
181 return '' unless FS::Conf->new->exists( $entry->{confexists} );
184 if ( $entry->{condition} ) {
185 return '' unless &{ $entry->{condition} }($opt->{cust_main});
188 my $label = emt($entry->{label});
190 if ( $entry->{submenu} ) {
192 my $a = '<a href="javascript:void(0);">'. $label.
193 '<span class="arrow"></span>'.
194 '</a><ul class="customer_subsubmenu">';
195 foreach my $submenu (@{ $entry->{submenu} }) {
196 $a .= '<li>'. entry2link($submenu, $opt->{cust_main}, $opt->{show}), '</li>';
203 my $target = $entry->{content}
207 if ( ref($target) eq 'CODE' ) {
208 $target = &$target($opt->{cust_main});
211 return $target if $entry->{content}; #the coderef specified the whole thing
213 if ( $entry->{show} ) {
215 $target = $opt->{self_url}. $entry->{show};
217 my $a = qq[ <A HREF="$target"];
218 $a .= ' class="current_show"' if $opt->{show} eq $entry->{show};
219 return $a. qq[>$label</A> ];
221 } elsif ( $entry->{popup} ) {
223 #$target =~ s/\$custnum/$custnum/g;
224 $target = $p.$target;
226 return include('/elements/popup_link.html',
234 } elsif ( $entry->{url} ) {
236 #$target =~ s/\$custnum/$custnum/g;
237 $target = $p.$target;
239 return qq[ <A HREF="$target">$label</A> ];
242 die "bad entry ". join(',',%$entry). " in menu: no url, popup or content";