Wolfgang Sourdeau > CGI-Listman-0.05 > CGI::Listman::selection

Download:
CGI-Listman-0.05.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

CGI::Listman::selection - managing CGI::Listman::line's in batch

SYNOPSIS ^

    use CGI;
    use CGI::Listman;
    use CGI::Listman::selection;

    my $cgi = CGI->new ();
    my $list_manager = CGI::Listman->new ();

    [...]

    my $selection = CGI::Listman::selection->new ();
    foreach my $param ($cgi->param ()) {
      if ($param =~ m/^select_([0-9].*$)/) {
        $selection->add_line_by_number ($listman, $1);
      }
    }

DESCRIPTION ^

A CGI::Listman::selection encapsulates an array of selected lines for further batch processing. This is handy for example in an administration interface when the developer wants to export or erase several lines at a time from the database.

API ^

new

Creates, initializes and returns a new instance of CGI::Listman::selection for you to enjoy and work with.

Parameters

This method takes no parameter.

Return values

A blessed instance of CGI::Listman::selection.

add_line

Use this method to add a CGI::Listman::line to your selection.

Parameters
line

A single instance of CGI::Listman::line to be exported.

Return values

This method returns nothing.

add_line_by_number

This method helps you adding a line by number. The first parameter has to be its contextual instance of CGI::Listman. Without it, a line cannot be guaranteed to be numbered since line numbers make no sense when they are not part of a CGI::Listman.

Parameters
list_manager

An instance of CGI::Listman.

number

An integer representing the CGI::Listman::line you want to add to your selection.

Return values

This method returns nothing.

add_lines_by_number

Same as above, except that it takes a reference to an ARRAY of numbers.

Parameters
list_manager

An instance of CGI::Listman.

numbers

A reference to an ARRAY of integers representing the CGI::Listman::line's you want to add to your selection.

Return values

This method returns nothing.

AUTHOR ^

Wolfgang Sourdeau, <Wolfgang@Contre.COM>

COPYRIGHT ^

Copyright (C) 2002 iScream multimédia <info@iScream.ca>

This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

CGI::Listman::line(3) CGI::Listman::exporter(3)

syntax highlighting: