]>
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-23-2003
22 use base
qw(Exporter);
34 # Generate the head of a HTML document
35 # (a text/html HTTP header will also be created)
37 # Params: Title and heading
39 # Return: Head for the HTML document
45 my $html = header
(-type
=> "text/html");
48 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
49 "http://www.w3.org/TR/html4/loose.dtd">
54 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
56 <body bgcolor="#FFFFFF">
67 # Generate the foot of a HTML document
71 # Return: Foot for the HTML document
75 return "\n</body>\n</html>";
80 # Format an error message
82 # Params: Error message
84 # Return: Formatted message (Scalar Reference)
90 my $output = htmlhead
("Error");
91 $output .= "<p>$message</p>";
99 # Print an error message and exit script
102 # Params: Error message
106 my $output = error
(shift);
113 # Create a message, that a file is currently in use
115 # Params: File, which is in use
117 # Return: Formatted message (Scalar Reference)
121 my $file = encode_entities
(shift);
122 my $dir = upper_path
($file);
124 my $message = htmlhead
("File in use");
125 $message .= "<p>The file '$file' is currently editet by someone else.</p>\n\n";
126 $message .= "<a href=\"$ENV{'SCRIPT_NAME'}?command=show&file=$dir\"><p>Back to $dir</a></p>";
127 $message .= htmlfoot
;
134 # Create an "equals"-link and print it out
136 # Params: 1. HTTP root
139 # Return: Formatted link (String)
143 my ($root,$path) = @_;
148 $url = $root."/".$path;
149 $url = encode_entities
($url);
151 return "<p>(equals <a href=\"$url\" target=\"_blank\">$url</a>)</p>\n\n";
156 # Create the link to the directory of a file and
161 # Return: Formatted link (String)
165 my $dir = upper_path
(shift);
166 $dir = encode_entities
($dir);
168 return "<p><a href=\"$ENV{'SCRIPT_NAME'}?command=show&file=$dir\">Back to $dir</a></p>\n\n";
171 # it's true, baby ;-)
patrick-canterino.de