]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 140993 - Pass javascript correctly into header; templatise the rest of the header...
authorgerv%gerv.net <>
Tue, 7 May 2002 02:30:12 +0000 (02:30 +0000)
committergerv%gerv.net <>
Tue, 7 May 2002 02:30:12 +0000 (02:30 +0000)
CGI.pl
template/en/default/attachment/create.html.tmpl
template/en/default/bug/edit.html.tmpl
template/en/default/global/header.html.tmpl
template/en/default/search/search-advanced.html.tmpl
template/en/default/search/search.html.tmpl

diff --git a/CGI.pl b/CGI.pl
index bcbb08d256b3d4bd51b08d1e7dbfc2850263330b..b62913d365ab567c4593b5ef82334745885b3da9 100644 (file)
--- a/CGI.pl
+++ b/CGI.pl
@@ -332,8 +332,8 @@ sub value_quote {
 }
 
 # Adds <link> elements for bug lists. These can be inserted into the header by
-# (ab)using the "jscript" parameter to PutHeader, which inserts an arbitrary
-# string into the header. This is currently used only in
+# 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) = @_;
@@ -849,8 +849,7 @@ Content-type: text/html
 }
 
 sub PutHeader {
-    ($vars->{'title'}, $vars->{'h1'}, $vars->{'h2'}, 
-     $vars->{'extra'}, $vars->{'jscript'}) = (@_);
+    ($vars->{'title'}, $vars->{'h1'}, $vars->{'h2'}) = (@_);
      
     $::template->process("global/header.html.tmpl", $::vars)
       || ThrowTemplateError($::template->error());
index 414639c22b0f9387588ce7ea050d44dd59fe888b..cb979b0c8ee3f9af101b62458d6ff45269a27d7e 100644 (file)
@@ -32,7 +32,7 @@
     th { text-align: right; vertical-align: baseline; white-space: nowrap; }
     td { text-align: left; vertical-align: baseline; padding-bottom: 5px; }
   "
-  extra = "onload=\"setContentTypeDisabledState();\""
+  body_attributes = "onload=\"setContentTypeDisabledState();\""
 %]
 
 <form name="entryform" method="post" action="attachment.cgi" enctype="multipart/form-data">
index e7abc19506e867d5fd9b6a569abe1a7e77b5c4c5..335c599ef74924415fc2b93d7d0dd47b13b23c81 100644 (file)
@@ -25,7 +25,7 @@
     title = "Bug $bug.bug_id - $bug.short_desc"
     h1 = "Bugzilla Bug $bug.bug_id"
     h2 = filtered_desc
-    extra = navigation_links()
+    header_html = navigation_links()
    %]
 [% END %]
 
index f77649ae3a1cd5921b447fb77b63791cda455ccc..3c79e22d1357e6a253b31a7f6d5cea81db5fc4ce 100644 (file)
@@ -16,7 +16,7 @@
   # Copyright (C) 1998 Netscape Communications Corporation. All
   # Rights Reserved.
   #
-  # Contributor(s):
+  # Contributor(s): Gervase Markham <gerv@gerv.net>
   #%]
 
 [%# INTERFACE:
   #%]
 
 [% DEFAULT
-  title = ""
   h1 = title
   h2 = ""
-  extra = ""
-  jscript = ""
-  style = ""
-  message = ""
 %]
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
   <head>
     <title>[% title FILTER html %]</title>
     
-    [% Param('headerhtml') %]
+[%# Migration note: contents of the old Param 'headerhtml' would go here %]
+
+    [% header_html %]
     
-    [% jscript %]
+    [% IF javascript %]
+      <script type="text/javascript" language="JavaScript">
+        [% javascript %]
+      </script>
+    [% END %]
     
     [% IF style %]
       <style type="text/css">
   
   </head>
   
-  <body [% Param('bodyhtml') %][% " " %][% extra %]>
+[%# Migration note: contents of the old Param 'bodyhtml' go in the body tag %]
+
+  <body [% body_attributes %]>
+
+[%# Migration note: this section corresponds to the old Param 'bannerhtml' %]
+
+    <table bgcolor="#000000" width="100%" border="0" cellpadding="0"
+           cellspacing="0">
+      <tr>
+        <td>
+          <a href="http://www.mozilla.org/">
+            <img src="http://www.mozilla.org/images/mozilla-banner.gif" alt=""
+                 border="0" width="600" height="58">
+          </a>
+        </td>
+      </tr>
+    </table>
+    
+    <center>
+      <small>Bugzilla version [% Param("version") %]</small>
+    </center>
 
-  [% PerformSubsts(Param('bannerhtml')) %]
+[%# End section %]
     
 [% IF h1 || h2 %]
     <table border="0" cellspacing="0">
index 6284ec516baca47d5afff457fe0f9a5db763f94a..d5961ebd22b753f5034f018515757ecfc8fdf98f 100644 (file)
@@ -27,7 +27,7 @@
 
 [% PROCESS global/header.html.tmpl 
   title = "Search for bugs"
-  extra = " onLoad=\"selectProduct(document.forms['queryform']);\""
+  body_attributes = "onload=\"selectProduct(document.forms['queryform']);\""
 %]
 
 [% button_name = "Search" %]
index 6284ec516baca47d5afff457fe0f9a5db763f94a..d5961ebd22b753f5034f018515757ecfc8fdf98f 100644 (file)
@@ -27,7 +27,7 @@
 
 [% PROCESS global/header.html.tmpl 
   title = "Search for bugs"
-  extra = " onLoad=\"selectProduct(document.forms['queryform']);\""
+  body_attributes = "onload=\"selectProduct(document.forms['queryform']);\""
 %]
 
 [% button_name = "Search" %]