1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
6 %# <jesse@bestpractical.com>
8 %# (Except where explicitly superseded by other copyright notices)
13 %# This work is made available to you under the terms of Version 2 of
14 %# the GNU General Public License. A copy of that license should have
15 %# been provided with this software, but in any event can be snarfed
18 %# This work is distributed in the hope that it will be useful, but
19 %# WITHOUT ANY WARRANTY; without even the implied warranty of
20 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 %# General Public License for more details.
23 %# You should have received a copy of the GNU General Public License
24 %# along with this program; if not, write to the Free Software
25 %# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 %# 02110-1301 or visit their web page on the internet at
27 %# http://www.gnu.org/copyleft/gpl.html.
30 %# CONTRIBUTION SUBMISSION POLICY:
32 %# (The following paragraph is not intended to limit the rights granted
33 %# to you to modify and distribute this software under the terms of
34 %# the GNU General Public License and is only of importance to you if
35 %# you choose to contribute your changes and enhancements to the
36 %# community by submitting them to Best Practical Solutions, LLC.)
38 %# By intentionally submitting any modifications, corrections or
39 %# derivatives to this work, or any other work intended for use with
40 %# Request Tracker, to Best Practical Solutions, LLC, you confirm that
41 %# you are the copyright holder for those contributions and you grant
42 %# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
43 %# royalty-free, perpetual, license to use, copy, create derivative
44 %# works based on those contributions, and sublicense and distribute
45 %# those contributions and any derivatives thereof.
47 %# END BPS TAGGED BLOCK }}}
49 <table class="black" border=0 cellspacing=0 cellpadding=0 width="100%">
51 <TD colspan=5 WIDTH="100%" STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>/images/black-gradient.png" HEIGHT="13" WIDTH="100%"></TD>
56 % my $notfirst = 0; foreach my $action (sort keys %{$topactions}) {
57 <span class="topaction">
58 <td class="blackright" ALIGN="right" VALIGN="center">
59 % $m->out($topactions->{"$action"}->{'html'});
68 %# End of div#quickbar from /Elements/Header
71 <table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%">
73 <TD STYLE="padding:0" WIDTH="100%"><IMG BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>/images/black-gray-top.png" HEIGHT="13" WIDTH="100%"></TD>
80 <& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &>
92 <ul id="page-menu"<% (($actions && %$actions) || ($subactions && %$subactions)) && q[ class="actions-present"] | n %>>
95 % foreach my $tab (sort keys %{$page_tabs}) {
96 % next if $tab =~ /^(?:current_toptab|this)$/;
99 % my $current = $page_tabs->{current_toptab} || "";
100 % my $path = $page_tabs->{$tab}->{'path'} || "";
102 % $path =~ s#/index.html$##gi;
103 % $current =~ s#/index.html$##gi;
105 % $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0;
107 % $class->{a} = $path eq $current ? ' class="selected"' : undef;
113 % push @li, 'pre-separator'
116 % push @li, 'post-separator'
119 % $class->{li} = join ' ', @li;
122 <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && "· "|n%><a href="<%$RT::WebPath%>/<%$page_tabs->{$tab}->{'path'}%>"<%$class->{a}|n%><% $class->{a} ? ' name="focus"' : ''|n %>><% $page_tabs->{$tab}->{'title'} %></a></li>
125 <li class="separator">···</li>
135 % if (($actions && %$actions) || ($subactions && %$subactions)) {
136 <ul id="actions-menu">
143 % for my $type ($actions, $subactions) {
145 % if ($type && %$type) {
146 % foreach my $action (sort keys %{$type}) {
149 % $sep = $type->{$action}->{'separator'} ? 1 : 0;
155 % push @li, 'pre-separator'
158 % push @li, 'post-separator'
161 % $class->{li} = join ' ', @li;
163 <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && qq[<span class="bullet">· </span>]|n%>
164 % if ($type->{"$action"}->{'html'}) {
165 <% $type->{"$action"}->{'html'} | n %>
167 <a href="<%$RT::WebPath%>/<%$type->{$action}->{'path'}%>"<% $type->{$action}->{class} && ' class="'.$type->{$action}->{class}.'"' |n %><% $type->{$action}->{id} && ' id="'.$type->{$action}->{id}.'"' |n %>><%$type->{$action}->{'title'}%></a>
171 <li class="separator">···</li>
183 <& /Elements/Callback, _CallbackName => 'BeforeBody', %ARGS &>
184 %$m->flush_buffer(); # we've got the page laid out, let's flush the buffer;
187 foreach my $tab (sort keys %{$toptabs}) {
188 if ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) {
189 $toptabs->{$tab}->{"subtabs"} = $tabs;
190 $toptabs->{$tab}->{"current_subtab"} = $current_tab;
194 if (! defined($AppName)) {
195 $AppName = loc("RT for [_1]", $RT::rtname);
198 my ($menu_depth, $almost_last, $page_tabs);
200 if ($RT::WebDefaultStylesheet ne '3.4-compat') {
201 ($menu_depth, $almost_last) = @{$m->comp('.menu_recurse', data => $toptabs)};
203 if (defined $almost_last->{subtabs} and %{$almost_last->{subtabs}}) {
205 current_toptab => $almost_last->{current_subtab},
206 %{$almost_last->{subtabs}},
209 delete $almost_last->{subtabs};
210 delete $almost_last->{current_subtab};
215 %# There's probably a better way to do this that involves three times as
216 %# much work and redoing the whole menu/tab system... which would seem a
219 %# This function recurses through the menu and returns the second to
220 %# last menu, that is, the menu holding the last reference to
221 %# and submenu. It also returns the number of menu levels minus
231 for my $key (keys %$data) {
232 return $m->comp('.menu_recurse', data => $data->{$key}->{subtabs},
233 pdata => $data->{$key},
236 if ref($data->{$key}) eq 'HASH'
237 and defined $data->{$key}->{subtabs}
238 and %{$data->{$key}->{subtabs}};
240 $ppdata->{last_system_menu_level}++;
241 return [$level, $pdata];
246 $current_toptab => undef
247 $current_tab => undef
253 $title => $m->callers(-1)->path