# $FreeBSD: www/en/cgi/cgi-style.pl,v 1.16 2000/12/18 04:44:38 knu Exp $ # # Perl routines to encapsulate various elements of HTML page style. # For future reference, when is now? ($se,$mn,$hr,$md,$mo,$yr,$wd,$yd,$dst) = localtime(time); $yr += 1900; $mo += 1; $timestamp = "$mo-$md-$yr"; # Colors for the body $t_body = ""; if (!defined($hsty_base)) { $hsty_base = ".."; } if (!defined($hsty_email)) { $hsty_email = "www\@FreeBSD.org"; } if (!defined($hsty_author)) { $hsty_author = "$hsty_email"; } if (!defined($hsty_date)) { $hsty_date = ""; } $i_topbar = "\"Navigation \"Top\" \"Applications\" \"Support\" \"Documentation\" \"Vendors\" \"Search\" \"Index\" \"Top\" \"Top\" "; if (!defined($hsty_home)) { $hsty_home = "\"FreeBSD"; } sub html_header { local ($title) = @_; return "Content-type: text/html\n\n" . "\n$title\n" . "\n\n$t_body\n" . "$i_topbar

$title

\n"; } sub short_html_header { local ($title) = @_; return "Content-type: text/html\n\n" . "\n$title\n" . "\n\n$t_body\n" . "$i_topbar"; } sub html_footer { return "
$hsty_author
$hsty_date
\n"; } sub get_the_source { return if $ENV{'PATH_INFO'} ne '/get_the_source'; open(R, $0) || do { print "Oops! open $0: $!\n"; # should not reached exit; }; print "Content-type: text/plain\n\n"; while() { print } close R; exit; } 1;