~ubuntu-branches/ubuntu/hardy/libcgi-formbuilder-perl/hardy

« back to all changes in this revision

Viewing changes to lib/CGI/FormBuilder/Multi.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2007-04-21 21:48:43 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070421214843-1x9e3c92nio0ktvi
Tags: 3.05.01-1
* New upstream release.
  + Fix memory leak affecting Catalyst users.
* Update local cdbs snippets:
  + Add upstream-tarball.mk adding get-orig-source rule and more.
  + Fix overloading buildcore.mk.
  + Check copyrights in prebuild (in clean it may choke on not yet
    cleaned stuff), and make sure it runs only once.
  + List non-binary files affected if discovering new copyrights.
  + Update documentation in debian/README.cdbs-tweaks.
* Fix debian/watch file:
  + Fix version mangling (regex implicitly matches against full ver).
  + Extend main regex to match both tar.gz and tgz used in most recent
    release (using horrible regex due to limitations in file format).

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
use CGI::FormBuilder;
104
104
use CGI::FormBuilder::Util;
105
105
 
106
 
our $REVISION = do { (my $r='$Revision: 91 $') =~ s/\D+//g; $r };
107
 
our $VERSION = '3.05';
 
106
our $REVISION = do { (my $r='$Revision: 100 $') =~ s/\D+//g; $r };
 
107
our $VERSION = '3.0501';
108
108
 
109
109
our %DEFAULT = (
110
110
    pagename => '_page',
121
121
    while (ref $_[0]) {
122
122
        push @forms, shift;
123
123
    }
124
 
    puke "Must specify at least one form to ::Multi" unless @forms;
125
124
 
126
125
    # Remaining options are form opts
127
126
    my %opt  = arghash(@_);
128
127
 
 
128
    # If no forms, and specified number of pages, use that instead
 
129
    if ($opt{pages}) {
 
130
        puke "Can't specify pages and form hashrefs" if @forms;
 
131
        my $p = 0;
 
132
        push @forms, {} while $p++ < $opt{pages};
 
133
    }
 
134
    puke "Must specify at least one form or 'pages' option for ::Multi" unless @forms;
 
135
 
129
136
    # Check for CGI params
130
137
    # This is duplicated code straight out of FormBuilder.pm,
131
138
    # but it's needed here as well so we can get our _page
286
293
individual settings like C<fields> and C<validate> on a per-form
287
294
basis.
288
295
 
 
296
If you do not wish to specify any options for your forms, you
 
297
can instead just specify the C<pages> option, for example:
 
298
 
 
299
    my $multi = CGI::FormBuilder::Multi->new(pages => 3);
 
300
 
 
301
With this approach, you will have to dynamically assemble each
 
302
page as you come to them. The mailing list can help.
 
303
 
289
304
The L</"SYNOPSIS"> above is very representative of typical usage.
290
305
 
291
306
=head2 form()
348
363
 
349
364
=head1 REVISION
350
365
 
351
 
$Id: Multi.pm 91 2006-12-18 10:27:01Z nwiger $
 
366
$Id: Multi.pm 100 2007-03-02 18:13:13Z nwiger $
352
367
 
353
368
=head1 AUTHOR
354
369