r1573 - in packages/libhtml-fillinform-perl/tags: .
debian_version_1_06-1 debian_version_1_06-1/debian
debian_version_1_06-1/lib/HTML
Gunnar Wolf
gwolf at costa.debian.org
Mon Dec 5 18:16:09 UTC 2005
Author: gwolf
Date: 2005-12-05 18:16:08 +0000 (Mon, 05 Dec 2005)
New Revision: 1573
Added:
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/Changes
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/META.yml
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/Makefile.PL
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/changelog
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/control
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/rules
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/lib/HTML/FillInForm.pm
Removed:
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/Changes
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/META.yml
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/Makefile.PL
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/changelog
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/compat
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/control
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/rules
packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/lib/HTML/FillInForm.pm
Log:
Uploaded version 1.06-1
Copied: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1 (from rev 1565, packages/libhtml-fillinform-perl/trunk)
Deleted: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/Changes
===================================================================
--- packages/libhtml-fillinform-perl/trunk/Changes 2005-12-05 17:42:25 UTC (rev 1565)
+++ packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/Changes 2005-12-05 18:16:08 UTC (rev 1573)
@@ -1,187 +0,0 @@
-1.05 - December 19th, 2004
-
-Added new tests in 19_extra.t (Vsevolod (Simon) Ilyushchenko)
-as part of Phalanx
-
-Make it clearer that doesn't have a CGI.pm dependency.
-
-1.04 - March 8th, 2004
-
-Now queries passed objects for form fields as it encounters them instead of
-asking for all fields up front. This allows the type of object passed
-to not have to return all the fields in a empty ->param() call.
-(Dave Rolsky)
-
-Generate XHTML-compliant tags (Dave Rolsky)
-
-Documented behavior when passing undef values.
-
-Fixed bug when HTML form has two or more radio buttons and second or
-higher radio button is selected. (Dan Kubb)
-
-Made ignore_fields work with fdat, included new test script
-18_ignore_fdat.t (James Tolley)
-
-1.03 - October 15th 2003
-
-Fixed warning messages when textarea doesn't have a name attribute
-(Rob Brown)
-
-1.02 - June 10th 2003
-
-Updated required version number for HTML::Parser to 3.26 in Makefile.PL
-(Ken Williams)
-
-1.01 - December 31st 2002
-
-Fixed issue with HTML::Parser decoding high-bit entities, by setting
-attr_encoded option, now requires HTML::Parser >= 3.26. (Jonathan Swartz)
-
-1.00 - August 28th 2002
-
-Workaround for Opera 6.01/02 bug with selected radio boxes -
-place space before ending "/>" in <input .. /> (Bill Moseley)
-
-0.29 - May 5th 2002
-
-Added ignore_fields option (Boris Zentner)
-
-0.28 - April 27th 2002
-
-Added missing ! in declaration handler (Boris Zentner)
-
-Fill all values with the same name if one value is passed
-(Boris Zentner, Gabriel Burka)
-
-0.27 - April 20th 2002
-
-Fixes to pass through comments, processing instructions, and
-declarations (Boris Zentner)
-
-0.26 - April 16th 2002
-
-Added fill_password option (Tatsuhiko Miyagawa)
-
-0.25 - April 3rd 2002
-
-Fixed bug with passing single value to multi-valued fields
-(Maurice Aubrey)
-
-0.24 - March 3rd 2002
-
-Added no_debug to use CGI in t/13_warning.t
-
-0.23 - January 4th 2002
-
-Cleaned up warning messages for input fields without a name (Boris Zentner)
-
-0.22 - November 10th 2001
-
-Fixed bug with multiple inputs (Mark Stosberg)
-
-0.21 - October 16th 2001
-
-Updated credits section
-
-0.20 - October 16th 2001
-
-Fixed bug where selected value of '0' were skipped (Trevor Schellhorn)
-
-0.19 - August 25th 2001
-
-Fixed bug where option values between tags had trailing or leading
-whitespace (Ade Olonoh)
-
-Fixed bug for <input ... /> type tags (Andrew Creer)
-
-Fix for error message (object -> fobject) (Mark Stosberg)
-
-0.18 - July 7th 2001
-
-Fix for test on HTML escaping (thanks to Jost Krieger for report)
-
-0.17 - June 29th 2001
-
-Added "fill in target form" feature (Tatsuhiko Miyagawa)
-
-0.16 - June 28th 2001
-
-Fixed problems with HTML escaping (Tatsuhiko Miyagawa)
-
-0.15 - June 18th 2001
-
-Works with checkbox tags that don't have value attribute. (Philip Mak)
-
-0.14 - May 17th 2001
-
-Removed warning message for submit tags. (Joseph Yanni)
-
-0.13 - May 13th 2001
-
-Fixed bug when TYPE attr of input tag not set (Martin H. Sluka)
-
-Added docs on password caching (Mark Stosberg)
-
-0.12 - May 11th 2001
-
-Support for multiple fobjects.
-
-Fixed bug where new documents were feed into a used $fif object.
-
-0.11 - March 16th 2001
-
-Fixed problem when fdat maps the name of a textarea to an
-empty string (''). Thanks to Jim Miner for the patch!
-
-0.10 - January 19th 2001
-
-Fixed problem with empty option tags (e.g. <select name="x"><option></select>)
-Thanks to Ade Olonoh for the patch!
-
-0.09 - January 15th 2001
-
-Text in textarea is now escaped.
-
-0.08 - January 15th 2001
-
-Option tags without "value" attribute get filled in correctly.
-
-Will not croak anymore if fobject's param method returns undef.
-
-0.07 - January 5th 2001
-
-Added support for multiple checkboxes and select fields, thanks
-to Patrick Michael Kane for the patch and test script for checkboxes!
-
-0.06 - October 9th 2000
-
-Fixed bug with "0" value in (hidden) fields
-
-Added docs from using HTML::FillInForm from Apache::ASP and Apache::PageKit
-
-0.05 - August 28th 2000
-
-Added better support for checkboxes.
-
-0.04 - August 10th 2000
-
-Fixed bug with hidden fields
-
-0.03 - August 10th 2000
-
-FillInForm now forces hidden fields to have a value. So <input type="hidden" name="foo">
-is transformed to <input type="hidden" name="foo" value=""> if no value is set for 'foo'.
-
-Fixed bug with case-sensitivity and missing checkbox. Thanks to
-Tom Lancaster for this bug report and fix!
-
-Added some test scripts.
-
-0.02 - June 27th 2000
-
-Fixed bug with option tags. Now displays all 'option' tag attributes, in addition to selected and value.
-Better support for boolean attributes.
-
-0.01 - June 18th 2000
-
-Initial Release of Module.
Copied: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/Changes (from rev 1566, packages/libhtml-fillinform-perl/trunk/Changes)
Deleted: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/META.yml
===================================================================
--- packages/libhtml-fillinform-perl/trunk/META.yml 2005-12-05 17:42:25 UTC (rev 1565)
+++ packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/META.yml 2005-12-05 18:16:08 UTC (rev 1573)
@@ -1,11 +0,0 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: HTML-FillInForm
-version: 1.05
-version_from: lib/HTML/FillInForm.pm
-installdirs: site
-requires:
- HTML::Parser: 3.26
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
Copied: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/META.yml (from rev 1566, packages/libhtml-fillinform-perl/trunk/META.yml)
Deleted: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/Makefile.PL
===================================================================
--- packages/libhtml-fillinform-perl/trunk/Makefile.PL 2005-12-05 17:42:25 UTC (rev 1565)
+++ packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/Makefile.PL 2005-12-05 18:16:08 UTC (rev 1573)
@@ -1,8 +0,0 @@
-use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
-WriteMakefile(
- 'NAME' => 'HTML::FillInForm',
- 'VERSION_FROM' => 'lib/HTML/FillInForm.pm', # finds $VERSION
- 'PREREQ_PM' => {HTML::Parser => 3.26}, # e.g., Module::Name => 1.1
-);
Copied: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/Makefile.PL (from rev 1566, packages/libhtml-fillinform-perl/trunk/Makefile.PL)
Deleted: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/changelog
===================================================================
--- packages/libhtml-fillinform-perl/trunk/debian/changelog 2005-12-05 17:42:25 UTC (rev 1565)
+++ packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/changelog 2005-12-05 18:16:08 UTC (rev 1573)
@@ -1,12 +0,0 @@
-libhtml-fillinform-perl (1.05-2) unstable; urgency=low
-
- * Added debian/watch
-
- -- Gunnar Wolf <gwolf at debian.org> Tue, 12 Apr 2005 13:52:25 -0500
-
-libhtml-fillinform-perl (1.05-1) unstable; urgency=low
-
- * Initial Release. (Closes: #299650)
-
- -- Gunnar Wolf <gwolf at debian.org> Tue, 15 Mar 2005 10:10:32 -0600
-
Copied: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/changelog (from rev 1571, packages/libhtml-fillinform-perl/trunk/debian/changelog)
Deleted: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/compat
===================================================================
--- packages/libhtml-fillinform-perl/trunk/debian/compat 2005-12-05 17:42:25 UTC (rev 1565)
+++ packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/compat 2005-12-05 18:16:08 UTC (rev 1573)
@@ -1 +0,0 @@
-4
Deleted: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/control
===================================================================
--- packages/libhtml-fillinform-perl/trunk/debian/control 2005-12-05 17:42:25 UTC (rev 1565)
+++ packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/control 2005-12-05 18:16:08 UTC (rev 1573)
@@ -1,21 +0,0 @@
-Source: libhtml-fillinform-perl
-Section: perl
-Priority: optional
-Build-Depends: debhelper (>= 4.0.2)
-Build-Depends-Indep: perl (>= 5.8.0-7), libhtml-parser-perl
-Maintainer: Gunnar Wolf <gwolf at debian.org>
-Standards-Version: 3.6.1
-
-Package: libhtml-fillinform-perl
-Architecture: all
-Depends: ${perl:Depends}, libhtml-parser-perl
-Description: populates HTML Forms with data
- This module automatically inserts data from a previous HTML form into
- the HTML input, textarea, radio buttons, checkboxes and select
- tags. It is a subclass of HTML::Parser and uses it to parse the HTML
- and insert the values into the form tags.
- .
- One useful application is after a user submits an HTML form without
- filling out a required field. HTML::FillInForm can be used to
- redisplay the HTML form with all the form elements containing the
- submitted info.
Copied: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/control (from rev 1569, packages/libhtml-fillinform-perl/trunk/debian/control)
Deleted: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/rules
===================================================================
--- packages/libhtml-fillinform-perl/trunk/debian/rules 2005-12-05 17:42:25 UTC (rev 1565)
+++ packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/rules 2005-12-05 18:16:08 UTC (rev 1573)
@@ -1,89 +0,0 @@
-#!/usr/bin/make -f
-# This debian/rules file is provided as a template for normal perl
-# packages. It was created by Marc Brockschmidt <marc at dch-faq.de> for
-# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may
-# be used freely wherever it is useful.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# If set to a true value then MakeMaker's prompt function will
-# always return the default without waiting for user input.
-export PERL_MM_USE_DEFAULT=1
-
-PACKAGE=$(shell dh_listpackages)
-
-ifndef PERL
-PERL = /usr/bin/perl
-endif
-
-TMP =$(CURDIR)/debian/$(PACKAGE)
-
-# Allow disabling build optimation by setting noopt in
-# $DEB_BUILD_OPTIONS
-CFLAGS = -Wall -g
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -O0
-else
- CFLAGS += -O2
-endif
-
-build: build-stamp
-build-stamp:
- dh_testdir
-
- # Add commands to compile the package here
- $(PERL) Makefile.PL INSTALLDIRS=vendor
- $(MAKE) OPTIMIZE="$(CFLAGS)"
-
- touch build-stamp
-
-clean:
- dh_testdir
- dh_testroot
-
- # Add commands to clean up after the build process here
- dh_clean build-stamp install-stamp
- [ ! -e Makefile ] || $(MAKE) distclean
-
-install: install-stamp
-install-stamp: build-stamp
- dh_testdir
- dh_testroot
- dh_clean -k
-
- $(MAKE) test
- $(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
-
- # As this is a architecture independent package, we are not supposed to install
- # stuff to /usr/lib. MakeMaker creates the dirs, we delete them from the deb:
- rmdir --ignore-fail-on-non-empty --parents $(TMP)/usr/lib/perl5
-
- touch install-stamp
-
-binary-arch:
-# We have nothing to do by default.
-
-binary-indep: build install
- dh_testdir
- dh_testroot
-# dh_installcron
-# dh_installmenu
-# dh_installexamples
- dh_installdocs README
- dh_installchangelogs Changes
- dh_perl
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-source diff:
- @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary
Copied: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/debian/rules (from rev 1568, packages/libhtml-fillinform-perl/trunk/debian/rules)
Deleted: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/lib/HTML/FillInForm.pm
===================================================================
--- packages/libhtml-fillinform-perl/trunk/lib/HTML/FillInForm.pm 2005-12-05 17:42:25 UTC (rev 1565)
+++ packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/lib/HTML/FillInForm.pm 2005-12-05 18:16:08 UTC (rev 1573)
@@ -1,535 +0,0 @@
-package HTML::FillInForm;
-
-use integer; # no floating point math so far!
-use strict; # and no funny business, either.
-
-use Carp; # generate better errors with more context
-
-# required for attr_encoded
-use HTML::Parser 3.26;
-
-# required for UNIVERSAL->can
-require 5.005;
-
-use vars qw($VERSION @ISA);
-$VERSION = '1.05';
-
- at ISA = qw(HTML::Parser);
-
-sub new {
- my ($class) = @_;
- my $self = bless {}, $class;
- $self->init;
- # tell HTML::Parser not to decode attributes
- $self->attr_encoded(1);
- return $self;
-}
-
-# a few shortcuts to fill()
-sub fill_file { my $self = shift; return $self->fill('file', at _); }
-sub fill_arrayref { my $self = shift; return $self->fill('arrayref', at _); }
-sub fill_scalarref { my $self = shift; return $self->fill('scalarref', at _); }
-
-sub fill {
- my ($self, %option) = @_;
-
- my %ignore_fields;
- %ignore_fields = map { $_ => 1 } ( ref $option{'ignore_fields'} eq 'ARRAY' )
- ? @{ $option{ignore_fields} } : $option{ignore_fields} if exists( $option{ignore_fields} );
- $self->{ignore_fields} = \%ignore_fields;
-
- if (my $fdat = $option{fdat}){
- # Copy the structure to prevent side-effects.
- my %copy;
- while(my($key, $val) = each %$fdat) {
- next if exists $ignore_fields{$key};
- $copy{ $key } = ref $val eq 'ARRAY' ? [ @$val ] : $val;
- }
- $self->{fdat} = \%copy;
- }
-
- # We want the reference to these objects to go out of scope at the
- # end of the method.
- local $self->{objects} = [];
- if(my $objects = $option{fobject}){
- unless(ref($objects) eq 'ARRAY'){
- $objects = [ $objects ];
- }
- for my $object (@$objects){
- # make sure objects in 'param_object' parameter support param()
- defined($object->can('param')) or
- croak("HTML::FillInForm->fill called with fobject option, containing object of type " . ref($object) . " which lacks a param() method!");
- }
-
- $self->{objects} = $objects;
- }
- if (my $target = $option{target}){
- $self->{'target'} = $target;
- }
-
- if (defined($option{fill_password})){
- $self->{fill_password} = $option{fill_password};
- } else {
- $self->{fill_password} = 1;
- }
-
- # make sure method has data to fill in HTML form with!
- unless(exists $self->{fdat} || $self->{objects}){
- croak("HTML::FillInForm->fillInForm() called without 'fobject' or 'fdat' parameter set");
- }
-
- local $self->{object_param_cache};
-
- if(my $file = $option{file}){
- $self->parse_file($file);
- } elsif (my $scalarref = $option{scalarref}){
- $self->parse($$scalarref);
- } elsif (my $arrayref = $option{arrayref}){
- for (@$arrayref){
- $self->parse($_);
- }
- }
- return delete $self->{output};
-}
-
-# handles opening HTML tags such as <input ...>
-sub start {
- my ($self, $tagname, $attr, $attrseq, $origtext) = @_;
-
- # set the current form
- if ($tagname eq 'form') {
- $self->{object_param_cache} = {};
- if (exists $attr->{'name'}) {
- $self->{'current_form'} = $attr->{'name'};
- } else {
- # in case of previous one without </FORM>
- delete $self->{'current_form'};
- }
- }
-
- # This form is not my target.
- if (exists $self->{'target'} &&
- (! exists $self->{'current_form'} ||
- $self->{'current_form'} ne $self->{'target'})) {
- $self->{'output'} .= $origtext;
- return;
- }
-
- # HTML::Parser converts tagname to lowercase, so we don't need /i
- if ($self->{option_no_value}) {
- $self->{output} .= '>';
- delete $self->{option_no_value};
- }
- if ($tagname eq 'input'){
- my $value = exists $attr->{'name'} ? $self->_get_param($attr->{'name'}) : undef;
- # force hidden fields to have a value
- $value = '' if exists($attr->{'type'}) && $attr->{'type'} eq 'hidden' && ! exists $attr->{'value'} && ! defined $value;
- if (defined($value)){
- $value = $self->escapeHTMLStringOrList($value);
- # check for input type, noting that default type is text
- if (!exists $attr->{'type'} ||
- $attr->{'type'} =~ /^(text|textfield|hidden|)$/i){
- $value = (shift @$value || '') if ref($value) eq 'ARRAY';
- $attr->{'value'} = $value;
- } elsif (lc $attr->{'type'} eq 'password' && $self->{fill_password}) {
- $value = (shift @$value || '') if ref($value) eq 'ARRAY';
- $attr->{'value'} = $value;
- } elsif (lc $attr->{'type'} eq 'radio'){
- $value = ($value->[0] || '') if ref($value) eq 'ARRAY';
- # value for radio boxes default to 'on', works with netscape
- $attr->{'value'} = 'on' unless exists $attr->{'value'};
- if ($attr->{'value'} eq $value){
- $attr->{'checked'} = 'checked';
- } else {
- delete $attr->{'checked'};
- }
- } elsif (lc $attr->{'type'} eq 'checkbox'){
- # value for checkboxes default to 'on', works with netscape
- $attr->{'value'} = 'on' unless exists $attr->{'value'};
-
- delete $attr->{'checked'}; # Everything is unchecked to start
- $value = [ $value ] unless ref($value) eq 'ARRAY';
- foreach my $v ( @$value ) {
- if ( $attr->{'value'} eq $v ) {
- $attr->{'checked'} = 'checked';
- }
- }
-# } else {
-# warn(qq(Input field of unknown type "$attr->{type}": $origtext));
- }
- }
- $self->{output} .= "<$tagname";
- while (my ($key, $value) = each %$attr) {
- next if $key eq '/';
- $self->{output} .= sprintf qq( %s="%s"), $key, $value;
- }
- # extra space put here to work around Opera 6.01/6.02 bug
- $self->{output} .= ' /' if $attr->{'/'};
- $self->{output} .= ">";
- } elsif ($tagname eq 'option'){
- my $value = $self->_get_param($self->{selectName});
-
- if (defined($value)){
- $value = $self->escapeHTMLStringOrList($value);
- $value = [ $value ] unless ( ref($value) eq 'ARRAY' );
- delete $attr->{selected} if exists $attr->{selected};
-
- if(defined($attr->{'value'})){
- # option tag has value attr - <OPTION VALUE="foo">bar</OPTION>
- foreach my $v ( @$value ) {
- if ( $attr->{'value'} eq $v ) {
- $attr->{selected} = 'selected';
- }
- }
- } else {
- # option tag has no value attr - <OPTION>bar</OPTION>
- # save for processing under text handler
- $self->{option_no_value} = $value;
- }
- }
- $self->{output} .= "<$tagname";
- while (my ($key, $value) = each %$attr) {
- $self->{output} .= sprintf qq( %s="%s"), $key, $value;
- }
- unless ($self->{option_no_value}){
- # we can close option tag here
- $self->{output} .= ">";
- }
- } elsif ($tagname eq 'textarea'){
- if ($attr->{'name'} and defined (my $value = $self->_get_param($attr->{'name'}))){
- $value = $self->escapeHTMLStringOrList($value);
- $value = (shift @$value || '') if ref($value) eq 'ARRAY';
- # <textarea> foobar </textarea> -> <textarea> $value </textarea>
- # we need to set outputText to 'no' so that 'foobar' won't be printed
- $self->{outputText} = 'no';
- $self->{output} .= $origtext . $value;
- } else {
- $self->{output} .= $origtext;
- }
- } elsif ($tagname eq 'select'){
- $self->{selectName} = $attr->{'name'};
- $self->{output} .= $origtext;
- } else {
- $self->{output} .= $origtext;
- }
-}
-
-sub _get_param {
- my ($self, $param) = @_;
-
- return undef if $self->{ignore_fields}{$param};
-
- return $self->{fdat}{$param} if exists $self->{fdat}{$param};
-
- return $self->{object_param_cache}{$param} if exists $self->{object_param_cache}{$param};
-
- # traverse the list in reverse order for backwards compatibility
- # with the previous implementation.
- for my $o (reverse @{$self->{objects}}) {
- my @v = $o->param($param);
-
- next unless @v;
-
- return $self->{object_param_cache}{$param} = @v > 1 ? \@v : $v[0];
- }
-
- return undef;
-}
-
-# handles non-html text
-sub text {
- my ($self, $origtext) = @_;
- # just output text, unless replaced value of <textarea> tag
- unless(exists $self->{outputText} && $self->{outputText} eq 'no'){
- if(exists $self->{option_no_value}){
- # dealing with option tag with no value - <OPTION>bar</OPTION>
- my $values = $self->{option_no_value};
- my $value = $origtext;
- $value =~ s/^\s+//;
- $value =~ s/\s+$//;
- foreach my $v ( @$values ) {
- if ( $value eq $v ) {
- $self->{output} .= ' selected="selected"';
- }
- }
- # close <OPTION> tag
- $self->{output} .= ">$origtext";
- delete $self->{option_no_value};
- } else {
- $self->{output} .= $origtext;
- }
- }
-}
-
-# handles closing HTML tags such as </textarea>
-sub end {
- my ($self, $tagname, $origtext) = @_;
- if ($self->{option_no_value}) {
- $self->{output} .= '>';
- delete $self->{option_no_value};
- }
- if($tagname eq 'select'){
- delete $self->{selectName};
- } elsif ($tagname eq 'textarea'){
- delete $self->{outputText};
- } elsif ($tagname eq 'form') {
- delete $self->{'current_form'};
- }
- $self->{output} .= $origtext;
-}
-
-sub escapeHTMLStringOrList {
- my ($self, $toencode) = @_;
-
- if (ref($toencode) eq 'ARRAY') {
- foreach my $elem (@$toencode) {
- $elem = $self->escapeHTML($elem);
- }
- return $toencode;
- } else {
- return $self->escapeHTML($toencode);
- }
-}
-
-sub escapeHTML {
- my ($self, $toencode) = @_;
-
- return undef unless defined($toencode);
- $toencode =~ s/&/&/g;
- $toencode =~ s/\"/"/g;
- $toencode =~ s/>/>/g;
- $toencode =~ s/</</g;
- return $toencode;
-}
-
-sub comment {
- my ( $self, $text ) = @_;
- $self->{output} .= '<!--' . $text . '-->';
-}
-
-sub process {
- my ( $self, $token0, $text ) = @_;
- $self->{output} .= $text;
-}
-
-sub declaration {
- my ( $self, $text ) = @_;
- $self->{output} .= '<!' . $text . '>';
-}
-
-1;
-
-__END__
-
-=head1 NAME
-
-HTML::FillInForm - Populates HTML Forms with data.
-
-=head1 DESCRIPTION
-
-This module automatically inserts data from a previous HTML form into the HTML input, textarea,
-radio buttons, checkboxes and select tags.
-It is a subclass of L<HTML::Parser> and uses it to parse the HTML and insert the values into the form tags.
-
-One useful application is after a user submits an HTML form without filling out a
-required field. HTML::FillInForm can be used to redisplay the HTML form
-with all the form elements containing the submitted info.
-
-=head1 SYNOPSIS
-
-This examples fills data into a HTML form stored in C<$htmlForm> from CGI parameters that are stored
-in C<$q>. For example, it will set the value of any "name" textfield to "John Smith".
-
- my $q = new CGI;
-
- $q->param("name","John Smith");
-
- my $fif = new HTML::FillInForm;
- my $output = $fif->fill(scalarref => \$html,
- fobject => $q);
-
-Note CGI.pm is B<not> required - see using fdat below. Also you can use a CGI.pm-like object such as Apache::Request.
-
-=head1 METHODS
-
-=over 4
-
-=item new
-
-Call C<new()> to create a new FillInForm object:
-
- $fif = new HTML::FillInForm;
-
-=item fill
-
-To fill in a HTML form contained in a scalar C<$html>:
-
- $output = $fif->fill(scalarref => \$html,
- fobject => $q);
-
-Returns filled in HTML form contained in C<$html> with data from C<$q>.
-C<$q> is required to have a C<param()> method that works like
-CGI's C<param()>.
-
- $output = $fif->fill(scalarref => \$html,
- fobject => [$q1, $q2]);
-
-As of 1.04 the object passed does not need to return all its keys with
-a empty param() call.
-
-Note that you can pass multiple objects as an array reference.
-
- $output = $fif->fill(scalarref => \$html,
- fdat => \%fdat);
-
-Returns filled in HTML form contained in C<$html> with data from C<%fdat>.
-To pass multiple values using C<%fdat> use an array reference.
-
-Alternately you can use
-
- $output = $fif->fill(arrayref => \@array_of_lines,
- fobject => $q);
-
-and
-
- $output = $fif->fill(file => 'form.tmpl',
- fobject => $q);
-
-Suppose you have multiple forms in a html and among them there is only
-one form you want to fill in, specify target.
-
- $output = $fif->fill(scalarref => \$html,
- fobject => $q,
- target => 'form1');
-
-This will fill in only the form inside
-
- <FORM name="form1"> ... </FORM>
-
-Note that this method fills in password fields by default. To disable, pass
-
- fill_password => 0
-
-To disable the filling of some fields, use the C<ignore_fields> option:
-
- $output = $fif->fill(scalarref => \$html,
- fobject => $q,
- ignore_fields => ['prev','next']);
-
-Note that this module does not clear fields if you set the value to undef.
-It will clear fields if you set the value to an empty array or an empty string. For example:
-
- # this will leave the form element foo untouched
- $output = $fif->fill(scalarref => \$html,
- fdat => { foo => undef });
-
- # this will set clear the form element foo
- $output = $fif->fill(scalarref => \$html,
- fdat => { foo => "" });
-
-It has been suggested to add a option to the new constructer to change the behavior
-so that undef values will clear the form elements. Patches welcome.
-
-=back
-
-=head1 CALLING FROM OTHER MODULES
-
-=head2 Apache::PageKit
-
-To use HTML::FillInForm in L<Apache::PageKit> is easy. It is
-automatically called for any page that includes a <form> tag.
-It can be turned on or off by using the C<fill_in_form> configuration
-option.
-
-=head2 Apache::ASP v2.09 and above
-
-HTML::FillInForm is now integrated with Apache::ASP. To activate, use
-
- PerlSetVar FormFill 1
- $Response->{FormFill} = 1
-
-=head2 HTML::Mason
-
-Using HTML::FillInForm from HTML::Mason is covered in the FAQ on
-the masonhq.com website at
-L<http://www.masonhq.com/docs/faq/#how_can_i_integrate_html_fillin>
-
-=head1 VERSION
-
-This documentation describes HTML::FillInForm module version 1.04.
-
-=head1 SECURITY
-
-Note that you might want to think about caching issues if you have password
-fields on your page. There is a discussion of this issue at
-
-http://www.perlmonks.org/index.pl?node_id=70482
-
-In summary, some browsers will cache the output of CGI scripts, and you
-can control this by setting the Expires header. For example, use
-C<-expires> in L<CGI.pm> or set C<browser_cache> to I<no> in
-Config.xml file of L<Apache::PageKit>.
-
-=head1 TRANSLATION
-
-Kato Atsushi has translated these docs into Japanese, available from
-
-http://perldoc.jp
-
-=head1 BUGS
-
-Please submit any bug reports to tjmather at maxmind.com.
-
-=head1 NOTES
-
-Requires Perl 5.005 and L<HTML::Parser> version 3.26.
-
-I wrote this module because I wanted to be able to insert CGI data
-into HTML forms,
-but without combining the HTML and Perl code. CGI.pm and Embperl allow you so
-insert CGI data into forms, but require that you mix HTML with Perl.
-
-There is a nice review of the module available here:
-http://www.perlmonks.org/index.pl?node_id=274534
-
-=head1 AUTHOR
-
-(c) 2004 TJ Mather, Maxmind LLC, tjmather at maxmind.com
-
-All rights reserved. This package is free software; you can
-redistribute it and/or modify it under the same terms as Perl itself.
-
-Paid support is available from directly from the author of this package.
-Please see L<http://www.maxmind.com/app/opensourceservices> for more details.
-
-=head1 SEE ALSO
-
-L<HTML::Parser>, L<Data::FormValidator>, L<HTML::Template>, L<Apache::PageKit>
-
-=head1 CREDITS
-
-Fixes, Bug Reports, Docs have been generously provided by:
-
- Tatsuhiko Miyagawa
- Boris Zentner
- Dave Rolsky
- Patrick Michael Kane
- Ade Olonoh
- Tom Lancaster
- Martin H Sluka
- Mark Stosberg
- Jonathan Swartz
- Trevor Schellhorn
- Jim Miner
- Paul Lindner
- Maurice Aubrey
- Andrew Creer
- Joseph Yanni
- Philip Mak
- Jost Krieger
- Gabriel Burka
- Bill Moseley
- James Tolley
- Dan Kubb
-
-Thanks!
Copied: packages/libhtml-fillinform-perl/tags/debian_version_1_06-1/lib/HTML/FillInForm.pm (from rev 1566, packages/libhtml-fillinform-perl/trunk/lib/HTML/FillInForm.pm)
More information about the Pkg-perl-cvs-commits
mailing list