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 % foreach my $action (reverse sort keys %{$topactions}) {
50 <span class="topaction">
51 % $m->out($topactions->{"$action"}->{'html'});
56 %# End of div#quickbar from /Elements/Header
60 <& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &>
71 <ul id="page-menu"<% (($actions && %$actions) || ($subactions && %$subactions)) && q[ class="actions-present"] | n %>>
74 % foreach my $tab (sort keys %{$page_tabs}) {
75 % next if $tab =~ /^(?:current_toptab|this)$/;
78 % my $current = $page_tabs->{current_toptab} || "";
79 % my $path = $page_tabs->{$tab}->{'path'} || "";
81 % $path =~ s#/index.html$##gi;
82 % $current =~ s#/index.html$##gi;
84 % $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0;
86 % $class->{a} = $path eq $current ? ' class="selected"' : undef;
92 % push @li, 'pre-separator'
95 % push @li, 'post-separator'
98 % $class->{li} = join ' ', @li;
101 <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>
104 <li class="separator">···</li>
114 % if (($actions && %$actions) || ($subactions && %$subactions)) {
115 <ul id="actions-menu">
122 % for my $type ($actions, $subactions) {
124 % if ($type && %$type) {
125 % foreach my $action (sort keys %{$type}) {
128 % $sep = $type->{$action}->{'separator'} ? 1 : 0;
134 % push @li, 'pre-separator'
137 % push @li, 'post-separator'
140 % $class->{li} = join ' ', @li;
142 <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && qq[<span class="bullet">· </span>]|n%>
143 % if ($type->{"$action"}->{'html'}) {
144 <% $type->{"$action"}->{'html'} | n %>
146 <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>
150 <li class="separator">···</li>
162 <& /Elements/Callback, _CallbackName => 'BeforeBody', %ARGS &>
163 %$m->flush_buffer(); # we've got the page laid out, let's flush the buffer;
166 foreach my $tab (sort keys %{$toptabs}) {
167 if ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) {
168 $toptabs->{$tab}->{"subtabs"} = $tabs;
169 $toptabs->{$tab}->{"current_subtab"} = $current_tab;
173 if (! defined($AppName)) {
174 $AppName = loc("RT for [_1]", $RT::rtname);
177 my ($menu_depth, $almost_last, $page_tabs);
179 if ($RT::WebDefaultStylesheet ne '3.4-compat') {
180 ($menu_depth, $almost_last) = @{$m->comp('.menu_recurse', data => $toptabs)};
182 if (defined $almost_last->{subtabs} and %{$almost_last->{subtabs}}) {
184 current_toptab => $almost_last->{current_subtab},
185 %{$almost_last->{subtabs}},
188 delete $almost_last->{subtabs};
189 delete $almost_last->{current_subtab};
194 %# There's probably a better way to do this that involves three times as
195 %# much work and redoing the whole menu/tab system... which would seem a
198 %# This function recurses through the menu and returns the second to
199 %# last menu, that is, the menu holding the last reference to
200 %# and submenu. It also returns the number of menu levels minus
210 for my $key (keys %$data) {
211 return $m->comp('.menu_recurse', data => $data->{$key}->{subtabs},
212 pdata => $data->{$key},
215 if ref($data->{$key}) eq 'HASH'
216 and defined $data->{$key}->{subtabs}
217 and %{$data->{$key}->{subtabs}};
219 $ppdata->{last_system_menu_level}++;
220 return [$level, $pdata];
225 $current_toptab => undef
226 $current_tab => undef
232 $title => $m->callers(-1)->path