From ca842229d2d58c85517a8fc8e5a2bc9414752dae Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Thu, 3 Oct 2002 14:04:02 +0000 Subject: Bug 155389 - More elements & templatization of navigation_links. Patch by gerv; r=bbaetz. --- CGI.pl | 43 --------- bug_form.pl | 3 - template/en/default/bug/edit.html.tmpl | 1 - template/en/default/global/header.html.tmpl | 3 +- .../en/default/global/site-navigation.html.tmpl | 103 +++++++++++++++++++++ 5 files changed, 104 insertions(+), 49 deletions(-) create mode 100644 template/en/default/global/site-navigation.html.tmpl diff --git a/CGI.pl b/CGI.pl index 1e534b384..6e121b273 100644 --- a/CGI.pl +++ b/CGI.pl @@ -308,49 +308,6 @@ sub ValidateComment { } } -# Adds elements for bug lists. These can be inserted into the header by -# using the "header_html" parameter to PutHeader, which inserts an arbitrary -# string into the header. This function is currently used only in -# template/en/default/bug/edit.html.tmpl. -sub navigation_links($) { - my ($buglist) = @_; - - my $retval = ""; - - # We need to be able to pass in a buglist because when you sort on a column - # the bugs in the cookie you are given will still be in the old order. - # If a buglist isn't passed, we just use the cookie. - $buglist ||= $::COOKIE{"BUGLIST"}; - - if (defined $buglist && $buglist ne "") { - my @bugs = split(/:/, $buglist); - - if (defined $::FORM{'id'}) { - # We are on an individual bug - my $cur = lsearch(\@bugs, $::FORM{"id"}); - - if ($cur > 0) { - $retval .= "\n"; - $retval .= "\n"; - } - if ($cur < $#bugs) { - $retval .= "\n"; - $retval .= "\n"; - } - - $retval .= "\n"; - $retval .= "\n"; - } else { - # We are on a bug list - $retval .= "\n"; - $retval .= "\n"; - $retval .= "\n"; - } - } - - return $retval; -} - $::CheckOptionValues = 1; # This sub is still used in reports.cgi. diff --git a/bug_form.pl b/bug_form.pl index d087b4db2..c664f2de1 100644 --- a/bug_form.pl +++ b/bug_form.pl @@ -368,9 +368,6 @@ sub show_bug { $vars->{'bug'} = \%bug; $vars->{'user'} = \%user; - # Create the elements for browsing bug lists - $vars->{'navigation_links'} = navigation_links(join(':',@bug_list)); - # Generate and return the UI (HTML page) from the appropriate template. $template->process("bug/edit.html.tmpl", $vars) || ThrowTemplateError($template->error()); diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index ef9ec2d7f..152852169 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -27,7 +27,6 @@ h1 = "Bugzilla Bug $bug.bug_id" h2 = filtered_desc h3 = "Last modified: $bug.calc_disp_date" - header_html = navigation_links style_urls = [ "css/edit_bug.css" ] %] [% END %] diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl index 889d63d0b..ed133140d 100644 --- a/template/en/default/global/header.html.tmpl +++ b/template/en/default/global/header.html.tmpl @@ -28,7 +28,6 @@ # h3: string. Right-aligned subheader. # bgcolor: string. the page's background color ("#rrggbb"). # onload: string. JavaScript code to run when the page finishes loading. - # header_html: string. Any other HTML to go inside the tags. # javascript: string. Javascript to go in the header. # style: string. CSS style. # style_urls: list. List of URLs to CSS style sheets. @@ -62,7 +61,7 @@ [%# Migration note: contents of the old Param 'headerhtml' would go here %] - [% header_html %] + [% PROCESS "global/site-navigation.html.tmpl" %] [% IF javascript %]