[interchange-cvs] interchange - jon modified 2 files

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Thu Jan 3 20:07:00 2002


User:      jon
Date:      2002-01-04 01:06:20 GMT
Modified:  dist/lib/UI/vars Tag: STABLE_4_8-branch UI_STD_FOOTER
Modified:           UI_STD_HEAD
Log:
Add HTML charset header, taken either from current locale, or possibly
from CGI variable (in case custom UI needs to have tables in different
encoding than UI itself).

Revision  Changes    Path
No                   revision



No                   revision



2.0.2.2   +6 -1      interchange/dist/lib/UI/vars/UI_STD_FOOTER


rev 2.0.2.2, prev_rev 2.0.2.1
Index: UI_STD_FOOTER
===================================================================
RCS file: /var/cvs/interchange/dist/lib/UI/vars/UI_STD_FOOTER,v
retrieving revision 2.0.2.1
retrieving revision 2.0.2.2
diff -u -u -r2.0.2.1 -r2.0.2.2
--- UI_STD_FOOTER	2001/08/30 09:43:12	2.0.2.1
+++ UI_STD_FOOTER	2002/01/04 01:06:19	2.0.2.2
@@ -57,5 +57,10 @@
 
 </body>
 </html>
-[set ui_checklist][/set]
+[calc]
+	# restore character set if it was overridden by CGI
+	$Scratch->{mv_charset} = delete $Scratch->{mv_charset_save}
+		if $Scratch->{mv_charset_save};
+	delete $Scratch->{ui_checklist};
+[/calc]
 EOV



2.3.2.9   +16 -0     interchange/dist/lib/UI/vars/UI_STD_HEAD


rev 2.3.2.9, prev_rev 2.3.2.8
Index: UI_STD_HEAD
===================================================================
RCS file: /var/cvs/interchange/dist/lib/UI/vars/UI_STD_HEAD,v
retrieving revision 2.3.2.8
retrieving revision 2.3.2.9
diff -u -u -r2.3.2.8 -r2.3.2.9
--- UI_STD_HEAD	2002/01/03 21:10:22	2.3.2.8
+++ UI_STD_HEAD	2002/01/04 01:06:19	2.3.2.9
@@ -21,6 +21,19 @@
 		$Config->{VendURL} = $Config->{SecureURL};
 	}
 
+	# allow CGI setting to override locale for this page
+	my $c = delete $CGI->{mv_charset};
+	if ($c) {
+		$Scratch->{mv_charset_save} = $Scratch->{mv_charset}
+			if $Scratch->{mv_charset};
+		$Scratch->{mv_charset} = $c;
+	}
+	else {
+		# default charset encoding should normally match current locale
+		$Scratch->{mv_charset} = $Config->{Locale}{MV_CHARSET} || 'iso-8859-1'
+			unless $Scratch->{mv_charset_keep};
+	}
+
 	''
 [/perl]
 EOV
@@ -91,6 +104,9 @@
 [/if]
 <html[scratch ui_language_direction]>
 <head>
+[if scratch mv_charset]
+	<meta http-equiv="content-type" content="text/html; charset=[scratch mv_charset]">
+[/if]
 <title>[scratch page_title]</title>
 <script language="JavaScript">
 <!--