[interchange-cvs] interchange - racke modified dist/lib/UI/pages/admin/page_preview.html

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Tue May 21 10:07:00 2002


User:      racke
Date:      2002-05-21 14:06:09 GMT
Modified:  dist/lib/UI/pages/admin Tag: STABLE_4_8-branch
Modified:           page_preview.html
Log:
enable locale parsing
resurrecting an old patch from the LINUXIA branch to allow preview of
a page even if the page has no signatures like the ones in the foundation
catalog like UI_CONTENT etc.

Revision  Changes    Path
No                   revision



No                   revision



2.0.2.1   +16 -12    interchange/dist/lib/UI/pages/admin/Attic/page_preview.html


rev 2.0.2.1, prev_rev 2.0
Index: page_preview.html
===================================================================
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/pages/admin/Attic/page_preview.html,v
retrieving revision 2.0
retrieving revision 2.0.2.1
diff -u -r2.0 -r2.0.2.1
--- page_preview.html	18 Jul 2001 02:22:00 -0000	2.0
+++ page_preview.html	21 May 2002 14:06:09 -0000	2.0.2.1
@@ -38,19 +38,23 @@
 		my $k = $1;
 		unshift @layout, "[set $k]" . $CGI->{$_} . '[/set]';
 	}
-	foreach $one (@layout) {
-		if( $one eq 'UI_CONTENT') {
-			my $content = shift @insert;
+	if (@layout) {
+		foreach $one (@layout) {
+			if( $one eq 'UI_CONTENT') {
+				my $content = shift @insert;
 #Log("inserting $content");
-			$content =~ s/\r?\n/\n/g;
-			push @out, $content;
-		}
-		elsif ($one =~ /^[A-Z]\w+$/) {
-			push @out, '@_' . $one . '_@';
-		}
-		else {
-			push @out, $one;
+				$content =~ s/\r?\n/\n/g;
+				push @out, $content;
+			}
+			elsif ($one =~ /^[A-Z]\w+$/) {
+				push @out, '@_' . $one . '_@';
+			}
+			else {
+				push @out, $one;
+			}
 		}
+	} else {
+		push @out, $CGI->{ui_content};
 	}
 	$Scratch->{ui_output_page} = "tmp/$Session->{id}.preview";
 	$Tag->write_relative_file($Scratch->{ui_output_page}, (join "\n", @out));
@@ -59,4 +63,4 @@
 [if cgi ui_page_preview]
 [include include/page_save]
 [/if]
-[include file="[scratch ui_output_page]"]
+[include file="[scratch ui_output_page]" locale=1]