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 }}}
48 <table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%">
52 % if (0) { ##FREESIDE MENUS INSTEAD## if ( $show_menu ) {
53 %# if ( $show_menu ) {
55 <& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &>
60 %#already shown <h1><%$title%></h1>
67 <ul id="page-menu"<% (($actions && %$actions) || ($subactions && %$subactions)) && q[ class="actions-present"] | n %>>
70 % foreach my $tab (sort keys %{$page_tabs}) {
71 % next if $tab =~ /^(?:current_toptab|this)$/;
74 % my $current = $page_tabs->{current_toptab} || "";
75 % my $path = $page_tabs->{$tab}->{'path'} || "";
77 % $path =~ s#/index.html$##gi;
78 % $current =~ s#/index.html$##gi;
80 % $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0;
82 % $class->{a} = $path eq $current ? ' class="selected"' : undef;
88 % push @li, 'pre-separator'
91 % push @li, 'post-separator'
94 % $class->{li} = join ' ', @li;
97 <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>
100 <li class="separator">···</li>
110 % if (($actions && %$actions) || ($subactions && %$subactions)) {
111 <ul id="actions-menu">
118 % for my $type ($actions, $subactions) {
120 % if ($type && %$type) {
121 % foreach my $action (sort keys %{$type}) {
124 % $sep = $type->{$action}->{'separator'} ? 1 : 0;
130 % push @li, 'pre-separator'
133 % push @li, 'post-separator'
136 % $class->{li} = join ' ', @li;
138 <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && qq[<span class="bullet">· </span>]|n%>
139 % if ($type->{"$action"}->{'html'}) {
140 <% $type->{"$action"}->{'html'} | n %>
142 <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>
146 <li class="separator">···</li>
158 <& /Elements/Callback, _CallbackName => 'BeforeBody', %ARGS &>
159 %$m->flush_buffer(); # we've got the page laid out, let's flush the buffer;
162 foreach my $tab (sort keys %{$toptabs}) {
163 if ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) {
164 $toptabs->{$tab}->{"subtabs"} = $tabs;
165 $toptabs->{$tab}->{"current_subtab"} = $current_tab;
169 if (! defined($AppName)) {
170 $AppName = loc("RT for [_1]", $RT::rtname);
173 my ($menu_depth, $almost_last, $page_tabs);
175 if ($RT::WebDefaultStylesheet ne '3.4-compat') {
176 ($menu_depth, $almost_last) = @{$m->comp('.menu_recurse', data => $toptabs)};
178 if (defined $almost_last->{subtabs} and %{$almost_last->{subtabs}}) {
180 current_toptab => $almost_last->{current_subtab},
181 %{$almost_last->{subtabs}},
184 delete $almost_last->{subtabs};
185 delete $almost_last->{current_subtab};
190 %# There's probably a better way to do this that involves three times as
191 %# much work and redoing the whole menu/tab system... which would seem a
194 %# This function recurses through the menu and returns the second to
195 %# last menu, that is, the menu holding the last reference to
196 %# and submenu. It also returns the number of menu levels minus
206 for my $key (keys %$data) {
207 return $m->comp('.menu_recurse', data => $data->{$key}->{subtabs},
208 pdata => $data->{$key},
211 if ref($data->{$key}) eq 'HASH'
212 and defined $data->{$key}->{subtabs}
213 and %{$data->{$key}->{subtabs}};
215 $ppdata->{last_system_menu_level}++;
216 return [$level, $pdata];
221 $current_toptab => undef
222 $current_tab => undef
228 $title => $m->callers(-1)->path