package utils::fapg_html;
#Author:Fernando A. P. Gomes
#Email: fapg@eurotux.com
#Package Utils
#Version 0.5.3
# Copyright (C) 2001-2002 Fernando Gomes
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
use strict;
use utils::language;
use utils::util;
use vars qw(@VERSION @ISA @EXPORT);
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(begin_html end_html begin_table end_table begin_tr end_tr begin_td end_td begin_th end_th img br error method begin_p end_p begin_font end_font begin_b end_b begin_ul end_ul li begin_a end_a begin_div end_div tab enter begin_form end_form input begin_center end_center);
@VERSION = getfile("version");
my $prog_name = "index.pl";
############################################################
# Determine the method
sub method {
my $vars = "";
#
# Determinar o método: GET, POST, ...
#
if ($ENV{REQUEST_METHOD} eq "GET") {
$vars = $ENV{QUERY_STRING};
} elsif ($ENV{REQUEST_METHOD} eq "POST") {
read(STDIN, $vars, $ENV{CONTENT_LENGTH}) or print "Problema a ler dados";
} else {
print "Métodos não suportado";
}
return $vars;
}
# Abre o formato HTML
# -name
# -bgcolor
# -text
sub begin_html {
my %defaults = (
-title => &title(),
-bgcolor => &bgcolor(),
-text => &text(),
);
my %params = (%defaults, @_);
my $TITLE = $params{-title};
my $BGCOLOR = $params{-bgcolor};
my $TEXT = $params{-text};
my $LINK = "#0000FF";
my $ALINK = "#0000FF";
my $VLINK = "#0000FF";
print <<__BEGIN_HTML__;
Content-Type: text/html
$TITLE
__BEGIN_HTML__
}
# Fecha o formato HTML
sub end_html {
&br();
print <<__END_HTML__;