From 7972a1398462162fbeb2283a32e5e1e0247a8d04 Mon Sep 17 00:00:00 2001 From: pcanterino <> Date: Wed, 22 Oct 2003 09:43:19 +0000 Subject: [PATCH] - Added default colors for text and links - Error messages can now show a link to a directory --- modules/Output.pm | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/modules/Output.pm b/modules/Output.pm index 6139430..e30dd83 100644 --- a/modules/Output.pm +++ b/modules/Output.pm @@ -6,7 +6,7 @@ package Output; # HTML generating routines # # Author: Patrick Canterino -# Last modified: 09-23-2003 +# Last modified: 2003-10-13 # use strict; @@ -53,7 +53,7 @@ sub htmlhead($) $title - +

$title

@@ -79,17 +79,27 @@ sub htmlfoot # # Format an error message # -# Params: Error message +# Params: 1. Error message +# 2. Virtual path to which a link should be displayed (optional) # # Return: Formatted message (Scalar Reference) -sub error($) +sub error($;$) { - my $message = shift; + my ($message,$path) = @_; my $output = htmlhead("Error"); $output .= "

$message

"; - $output .= htmlfoot; + + if($path) + { + $path = encode_entities($path); + + $output .= "\n\n"; + $output .= "

Back to $path

"; + } + + $output .= htmlfoot; return \$output; } @@ -118,15 +128,9 @@ sub abort($) sub error_in_use($) { - my $file = encode_entities(shift); - my $dir = upper_path($file); - - my $message = htmlhead("File in use"); - $message .= "

The file '$file' is currently editet by someone else.

\n\n"; - $message .= "

Back to $dir

"; - $message .= htmlfoot; + my $file = shift; - return \$message; + return error("The file '".encode_entities($file)."' is currently editet by someone else.",upper_path($file)); } # equal_url() -- 2.34.1