X-Git-Url: https://git.p6c8.net/devedit.git/blobdiff_plain/89269f652fc46e65006b9aead5eb1ae61ebc311e..6f588e8b3a25f4ff562e0294e0a6a507c1a094d2:/modules/Output.pm?ds=inline 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()