#!/usr/bin/perl # -- # This subroutine generates the Layout of a normal page. # # Additionally it contains some general purpose functions # # $Header: /suse/sdb/devel/cgi/RCS/sdblayout.pm,v 1.1 2000/09/06 21:12:52 sdb Exp sdb $ # # -- ## -- ## Convert from URL '%' encoding to real latin1 encoding, ## remove all garbage characters ## expects 1 argument: encoded string, ## returns decoded uppercased string, if $lang=de uppercase also äöü ## -- sub simpleconvertURL { my ($string) = @_; # Convert % URL encoding $string =~ s/%([0-9A-Fa-f][0-9A-Fa-f])/pack("c", hex($1))/eg; $string =~ s/\+/ /g; # Remove all whitespace garbage #$string =~ s/\s+/ /g; return $string; } # First of all: Generate the Header, the HTML HEAD and first part of the # body sub sdblayout { my ($SDB_LANGUAGE, $type)=@_; my $line; if ( $type eq "EXT") { print <
EOF # Include TOP Navigation header open (FH, "<$ENV{\"DOCUMENT_ROOT\"}/$SDB_LANGUAGE/navigation/sdb-header.html") or die "Cannot find/stat $ENV{\"DOCUMENT_ROOT\"}/$SDB_LANGUAGE/navigation/sdb-header.html"; while (my $line=) { print $line; }; print <
EOF # and now the navigation bar on the left open (FH, "<$ENV{\"DOCUMENT_ROOT\"}/$SDB_LANGUAGE/navigation/cgi-left-side-nav.html") or die "Cannot find/stat $ENV{\"DOCUMENT_ROOT\"}/$SDB_LANGUAGE/navigation/cgi-left-side-nav.html"; while (my $line=) { print $line; }; print <
EOF } elsif ($type eq "INT" ) { print < EOF # Include TOP Navigation header open (FH, "<$ENV{\"DOCUMENT_ROOT\"}/$SDB_LANGUAGE/navigation/sdb-header.html") or die "Cannot find/stat $ENV{\"DOCUMENT_ROOT\"}/$SDB_LANGUAGE/navigation/sdb-header.html"; while (my $line=) { print $line; }; } # External SDB: Not all tables are closed. We MUST CLOSE one table with #
}; # -- # Generate the "end of page" # Funktion is here for completeness # -- sub sdblayoutfooter { my ($SDB_LANGUAGE, $type)= @_; if ( $type eq "EXT" ) { open (FH, "<$ENV{\"DOCUMENT_ROOT\"}/$SDB_LANGUAGE/navigation/sdb-footer.html") or die "Cannot find/stat $ENV{\"DOCUMENT_ROOT\"}/$SDB_LANGUAGE/navigation/sdb-footer.html"; while (my $line=) { print $line; }; print < EOF } else { print < EOF } } 1;