1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2009 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/licenses/old-licenses/gpl-2.0.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
61 <& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &>
73 <ul id="page-menu"<% (($actions && %$actions) || ($subactions && %$subactions)) && q[ class="actions-present"] | n %>>
76 % foreach my $tab (sort keys %{$page_tabs}) {
77 % next if $tab =~ /^(?:current_toptab|this)$/;
80 % my $current = $page_tabs->{current_toptab} || "";
81 % my $path = $page_tabs->{$tab}->{'path'} || "";
83 % $path =~ s#/index.html$##gi;
84 % $current =~ s#/index.html$##gi;
86 % $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0;
88 % $class->{a} = $path eq $current ? ' class="selected"' : undef;
94 % push @li, 'pre-separator'
97 % push @li, 'post-separator'
100 % $class->{li} = join ' ', @li;
103 <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>
106 <li class="separator">···</li>
116 % if (($actions && %$actions) || ($subactions && %$subactions)) {
117 <ul id="actions-menu">
124 % for my $type ($actions, $subactions) {
126 % if ($type && %$type) {
127 % foreach my $action (sort keys %{$type}) {
130 % $sep = $type->{$action}->{'separator'} ? 1 : 0;
136 % push @li, 'pre-separator'
139 % push @li, 'post-separator'
142 % $class->{li} = join ' ', @li;
144 <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && qq[<span class="bullet">· </span>]|n%>
145 % if ($type->{"$action"}->{'html'}) {
146 <% $type->{"$action"}->{'html'} | n %>
148 <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>
152 <li class="separator">···</li>
164 <& /Elements/Callback, _CallbackName => 'BeforeBody', %ARGS &>
165 %$m->flush_buffer(); # we've got the page laid out, let's flush the buffer;
168 foreach my $tab (sort keys %{$toptabs}) {
169 if ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) {
170 $toptabs->{$tab}->{"subtabs"} = $tabs;
171 $toptabs->{$tab}->{"current_subtab"} = $current_tab;
175 if (! defined($AppName)) {
176 $AppName = loc("RT for [_1]", $RT::rtname);
179 my ($menu_depth, $almost_last, $page_tabs);
181 if ($RT::WebDefaultStylesheet ne '3.4-compat') {
182 ($menu_depth, $almost_last) = @{$m->comp('.menu_recurse', data => $toptabs)};
184 if (defined $almost_last->{subtabs} and %{$almost_last->{subtabs}}) {
186 current_toptab => $almost_last->{current_subtab},
187 %{$almost_last->{subtabs}},
190 delete $almost_last->{subtabs};
191 delete $almost_last->{current_subtab};
196 %# There's probably a better way to do this that involves three times as
197 %# much work and redoing the whole menu/tab system... which would seem a
200 %# This function recurses through the menu and returns the second to
201 %# last menu, that is, the menu holding the last reference to
202 %# and submenu. It also returns the number of menu levels minus
212 for my $key (keys %$data) {
213 return $m->comp('.menu_recurse', data => $data->{$key}->{subtabs},
214 pdata => $data->{$key},
217 if ref($data->{$key}) eq 'HASH'
218 and defined $data->{$key}->{subtabs}
219 and %{$data->{$key}->{subtabs}};
221 $ppdata->{last_system_menu_level}++;
222 return [$level, $pdata];
227 $current_toptab => undef
228 $current_tab => undef
234 $title => $m->callers(-1)->path