]>
git.p6c8.net - devedit.git/blob - modules/Output.pm
4 # Dev-Editor - Module Output
6 # HTML generating routines
8 # Author: Patrick Canterino <patshaping@gmx.net>
9 # Last modified: 09-22-2003
22 use base
qw(Exporter);
34 # Generate the head of a HTML document
36 # Params: Title and heading
38 # Return: Head for the HTML document
44 my $html = header
(-type
=> "text/html");
47 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
48 "http://www.w3.org/TR/html4/loose.dtd">
53 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
55 <body bgcolor="#FFFFFF">
66 # Generate the foot of a HTML document
70 # Return: Foot for the HTML document
74 return "\n</body>\n</html>";
79 # Format an error message
81 # Params: Error message
83 # Return: Formatted message (Scalar Reference)
89 my $output = htmlhead
("Error");
90 $output .= "<p>$message</p>";
98 # Print and error message and exit script
100 # Params: Error message
104 my $output = error
(shift);
111 # Create a message, that a file is currently in use
113 # Params: File, which is in use
115 # Return: Formatted message (Scalar Reference)
119 my $file = encode_entities
(shift);
120 my $dir = upper_path
($file);
122 my $message = htmlhead
("File in use");
123 $message .= "<p>The file '$file' is currently editet by someone else.</p>\n\n";
124 $message .= "<a href=\"$ENV{'SCRIPT_NAME'}?command=show&file=$dir\"><p>Back to $dir</a></p>";
125 $message .= htmlfoot
;
132 # Create an "equals"-link and print it out
134 # Params: 1. HTTP root
137 # Return: Formatted link (String)
141 my ($root,$path) = @_;
146 $url = $root."/".$path;
147 $url = encode_entities
($url);
149 return "<p>(equals <a href=\"$url\" target=\"_blank\">$url</a>)</p>\n\n";
154 # Create the link to the directory of a file and
159 # Return: Formatted link (String)
163 my $dir = upper_path
(shift);
164 $dir = encode_entities
($dir);
166 return "<p><a href=\"$ENV{'SCRIPT_NAME'}?command=show&file=$dir\">Back to $dir</a></p>\n\n";
169 # it's true, baby ;-)
patrick-canterino.de