diff --git a/en/cgi/cgi-style.pl b/en/cgi/cgi-style.pl index c3b002e6f5..25d8fd2136 100644 --- a/en/cgi/cgi-style.pl +++ b/en/cgi/cgi-style.pl @@ -1,88 +1,205 @@ -# $FreeBSD: www/en/cgi/cgi-style.pl,v 1.21 2005/09/13 17:36:15 remko Exp $ +# $FreeBSD: www/en/cgi/cgi-style.pl,v 1.22 2005/09/17 15:48:23 remko 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"; 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 = ''; } # This can be set to either a string containing an inline CSS stylesheet # or to a element that references an external CSS stylesheet, to # make local modifications to the style of a CGI script's output. -$t_style = ""; - -$i_topbar = "Navigation Bar - -Site Root -Applications -Support -Documentation -Vendors -Search -Site Index -Site Root -Site Root -"; +$t_style = ""; # Don't allow script to override completely, just + # let the script's setting cascade with the master. +$i_topbar = qq` +
+
+ Skip site + navigation (1)Skip section navigation (2) + +
+ + +

Site Navigation

+ + +
+ +
+`; + +#XXX does anyone use this? I don't know what it should be in the new style. if (!defined($hsty_home)) { $hsty_home = "FreeBSD Home Page"; } sub html_header { - local ($title) = @_; - - return "Content-type: text/html\n\n" . - '' . - "\n\n\n$title\n" . - "\n" . - "\n$t_style\n\n\n" . - "$i_topbar\n

$title

\n"; + local ($title, $xhtml) = @_; + + return short_html_header($title, $xhtml) . "

$title

\n"; } sub short_html_header { - local ($title) = @_; - - return "Content-type: text/html\n\n" . - '' . - "\n\n$title\n" . - "\n" . - "\n\n\n" . - "$i_topbar\n"; + local ($title, $xhtml) = @_; + + $xhtml = 1 unless defined($xhtml); + $doctype = $xhtml ? '' : ''; + $endslash = $xhtml ? '/' : ''; + $csshack = $xhtml ? '' : q` +`; + + return qq`Content-type: text/html + +$doctype + + +$title + + + + +$csshack + +$t_style + + +$i_topbar +`; } sub html_footer { - return "
$hsty_author
$hsty_date
\n\n"; + return qq` +
+ +
+
+ + +`; + + } 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;