Apache-PSP

 view release on metacpan or  search on metacpan

lib/Template/PSP/autoform.psp  view on Meta::CPAN

<perl>
# 
# Automatic Form Fill tag library
# 
# Copyright 2003 Console Inc. 
# All rights reserved
#
# Version 1.1 - December 2003
# 
# Last updated 01 Dec 2003 (CCR)
#

use Date::Calc qw(Today);

</perl>

<tag name="autoformfill" body="1" global="1" 
     accepts="module, method, values">
<perl>

=head2 AutoFill form fill tag

The C<autoformfill> tag gets values from the specified module and method in order to fill AutoFill form fields.

Usage: 

  <autoformfill module="My::Test" method="filltestform" />
  
  or
  
  <autoformfill values="$values" />

=cut

if ($values)
{
  setpvar('autofill_data', $values);
}
else
{
  # include the specified module
  eval qq{use $module;};
  
  if ($@)
  {
    die "The autoformfill tag can't load module ($module): $@\n";
  }
  
  my $autofill_data = $module->$method;
  
  # check for errors
  unless ($autofill_data)
  {
  }
  
  setpvar( 'autofill_data', $autofill_data );
}

</perl>
</tag>

<tag name="autotext" body="1" global="1" 
     accepts="name, diff, size, maxlength">
<perl>

=head2 AutoFill text tag

The C<autotext> tag fills in a form field.

Usage: 



( run in 2.708 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )