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 % #false laziness w/menubar.html... shouldn't these just go in freeside.css?
49 <style type="text/css">
51 background-color:#333333;
54 border-top-color:#cccccc;
55 border-left-color:#cccccc;
56 border-right-color:#aaaaaa;
57 border-bottom-color:#aaaaaa;
66 filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff333333',EndColorStr='#ff666666')
69 a.fsblackbuttonselected,
70 a:link:hover.fsblackbutton,
71 a:visited:hover.fsblackbutton {
72 background-color:#7e0079;
75 border-top-color:#cccccc;
76 border-left-color:#cccccc;
77 border-right-color:#aaaaaa;
78 border-bottom-color:#aaaaaa;
87 filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff330033',EndColorStr='#ff7e0079')
91 background-color:#555555;
94 border-top-color:#cccccc;
95 border-left-color:#cccccc;
96 border-right-color:#aaaaaa;
97 border-bottom-color:#aaaaaa;
100 padding-right:12px;*/
104 text-decoration:none;
106 filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff555555',EndColorStr='#ff666666')
109 a.fsdarkbuttonselected,
110 a:link:hover.fsdarkbutton,
111 a:visited:hover.fsdarkbutton {
112 background-color:#7e0079;
115 border-top-color:#cccccc;
116 border-left-color:#cccccc;
117 border-right-color:#aaaaaa;
118 border-bottom-color:#aaaaaa;
119 /*font-weight:bold;*/
121 padding-right:12px;*/
125 text-decoration:none;
127 filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff330033',EndColorStr='#ff7e0079')
130 <table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%">
134 % if (0) { ##FREESIDE MENUS INSTEAD## if ( $show_menu ) {
135 %# if ( $show_menu ) {
137 <& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &>
141 %#already shown <h1><%$title%></h1>
149 <TABLE BGCOLOR="#000000" BORDER=0 CELLSPACING=0 CELLPADDING=0>
151 <TD><IMG SRC="<%$fsurl%>images/gray-black-side.png" WIDTH=13 HEIGHT=25></TD>
154 %# <ul id="page-menu"<% (($actions && %$actions) || ($subactions && %$subactions)) && q[ class="actions-present"] | n %>>
157 % foreach my $tab (sort keys %{$page_tabs}) {
158 % next if $tab =~ /^(?:current_toptab|this)$/;
161 % my $current = $page_tabs->{current_toptab} || "";
162 % my $path = $page_tabs->{$tab}->{'path'} || "";
164 % $path =~ s#/index.html$##gi;
165 % $current =~ s#/index.html$##gi;
167 % $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0;
169 % $class->{a} = $path eq $current ? ' class="selected"' : undef;
175 % push @li, 'pre-separator'
178 % push @li, 'post-separator'
181 % $class->{li} = join ' ', @li;
185 %# <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>
187 % $class->{a} = $path eq $current ? ' class="fsblackbuttonselected"' : ' class="fsblackbutton"';
188 <a href="<%$RT::WebPath%>/<%$page_tabs->{$tab}->{'path'}%>"<%$class->{a}|n%><% $class->{a} =~ 'selected' ? ' name="focus"' : ''|n %>><% $page_tabs->{$tab}->{'title'} %></a>
195 % if (($actions && %$actions) || ($subactions && %$subactions)) {
197 <TD><IMG SRC="<%$fsurl%>images/black-gray-side.png" WIDTH=13 HEIGHT=25></TD>
198 <TD BGCOLOR="#333333"> </TD>
199 <TD BGCOLOR="#333333">
205 % for my $type ($actions, $subactions) {
207 % if ($type && %$type) {
208 % foreach my $action (sort keys %{$type}) {
211 % $sep = $type->{$action}->{'separator'} ? 1 : 0;
217 % push @li, 'pre-separator'
220 % push @li, 'post-separator'
223 % $class->{li} = join ' ', @li;
226 %# <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && qq[<span class="bullet">· </span>]|n%>
228 % #$class->{a} = $path eq $current ? ' class="fsblackbuttonselected"' : ' class="fsblackbutton"';
229 % $type->{$action}->{class} ||= 'fsdarkbutton';
231 % if ($type->{"$action"}->{'html'}) {
232 <% $type->{"$action"}->{'html'} | n %>
234 <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>
243 <TD><IMG SRC="<%$fsurl%>images/black-gray-side.png" WIDTH=13 HEIGHT=25></TD>
249 <& /Elements/Callback, _CallbackName => 'BeforeBody', %ARGS &>
250 %$m->flush_buffer(); # we've got the page laid out, let's flush the buffer;
253 foreach my $tab (sort keys %{$toptabs}) {
254 if ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) {
255 $toptabs->{$tab}->{"subtabs"} = $tabs;
256 $toptabs->{$tab}->{"current_subtab"} = $current_tab;
260 if (! defined($AppName)) {
261 $AppName = loc("RT for [_1]", $RT::rtname);
264 my ($menu_depth, $almost_last, $page_tabs);
266 if ($RT::WebDefaultStylesheet ne '3.4-compat') {
267 ($menu_depth, $almost_last) = @{$m->comp('.menu_recurse', data => $toptabs)};
269 if (defined $almost_last->{subtabs} and %{$almost_last->{subtabs}}) {
271 current_toptab => $almost_last->{current_subtab},
272 %{$almost_last->{subtabs}},
275 delete $almost_last->{subtabs};
276 delete $almost_last->{current_subtab};
281 %# There's probably a better way to do this that involves three times as
282 %# much work and redoing the whole menu/tab system... which would seem a
285 %# This function recurses through the menu and returns the second to
286 %# last menu, that is, the menu holding the last reference to
287 %# and submenu. It also returns the number of menu levels minus
297 for my $key (keys %$data) {
298 return $m->comp('.menu_recurse', data => $data->{$key}->{subtabs},
299 pdata => $data->{$key},
302 if ref($data->{$key}) eq 'HASH'
303 and defined $data->{$key}->{subtabs}
304 and %{$data->{$key}->{subtabs}};
306 $ppdata->{last_system_menu_level}++;
307 return [$level, $pdata];
312 $current_toptab => undef
313 $current_tab => undef
319 $title => $m->callers(-1)->path