diff options
| author | fukachan <fukachan> | 2002-06-25 07:52:12 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-06-25 07:52:12 +0000 |
| commit | 25dc165815c8dbb19382a0b4f6e7bc374f69af3a (patch) | |
| tree | 60ed7111bcbad9c4a7aab08425905348713cbd2a /fml | |
| parent | 4fe2abfb0bd2d94b0ba308ccdfe147dfdc2dfbc7 (diff) | |
| download | fml8-25dc165815c8dbb19382a0b4f6e7bc374f69af3a.tar.gz fml8-25dc165815c8dbb19382a0b4f6e7bc374f69af3a.tar.bz2 fml8-25dc165815c8dbb19382a0b4f6e7bc374f69af3a.zip | |
enhance list: select $map et.al.
Diffstat (limited to 'fml')
| -rw-r--r-- | fml/lib/FML/CGI/Admin/List.pm | 97 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/list.pm | 26 |
2 files changed, 115 insertions, 8 deletions
diff --git a/fml/lib/FML/CGI/Admin/List.pm b/fml/lib/FML/CGI/Admin/List.pm new file mode 100644 index 00000000..55197ef2 --- /dev/null +++ b/fml/lib/FML/CGI/Admin/List.pm @@ -0,0 +1,97 @@ +#-*- perl -*- +# +# Copyright (C) 2002 Ken'ichi Fukamachi +# All rights reserved. This program is free software; you can +# redistribute it and/or modify it under the same terms as Perl itself. +# +# $FML: List.pm,v 1.9 2002/06/25 04:02:11 fukachan Exp $ +# + +package FML::CGI::Admin::List; +use strict; +use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); +use Carp; + +use CGI qw/:standard/; # load standard CGI routines + + +# Descriptions: standard constructor +# Arguments: OBJ($self) +# Side Effects: none +# Return Value: OBJ +sub new +{ + my ($self) = @_; + my ($type) = ref($self) || $self; + my $me = {}; + return bless $me, $type; +} + + +# Descriptions: show address list +# Arguments: OBJ($self) +# OBJ($curproc) +# HASH_REF($args) +# HASH_REF($command_args) +# Side Effects: none +# Return Value: none +sub cgi_menu +{ + my ($self, $curproc, $args, $command_args) = @_; + my $action = $curproc->myname(); + my $target = '_top'; + my $ml_name = $command_args->{ ml_name }; + my $comname = $command_args->{ comname }; + my $map_list = [ 'member', 'recipient', 'admin_member' ]; + my $map_default = $curproc->safe_param_map() || 'member'; + + # create <FORM ... > ... by (start_form() ... end_form()) + print start_form(-action=>$action, -target=>$target); + + print hidden(-name => 'command', -default => 'list'); + + print table( { -border => undef }, + Tr( undef, + td([ + "ML:", + textfield(-name => 'ml_name', + -default => $ml_name), + ]) + ), + Tr( undef, + td([ + "map", + scrolling_list(-name => 'map', + -values => $map_list, + -default => $map_default, + -size => 2) + ]), + ) + ); + + + print submit(-name => 'show'); + print end_form; +} + + +=head1 AUTHOR + +Ken'ichi Fukamachi + +=head1 COPYRIGHT + +Copyright (C) 2002 Ken'ichi Fukamachi + +All rights reserved. This program is free software; you can +redistribute it and/or modify it under the same terms as Perl itself. + +=head1 HISTORY + +FML::CGI::Admin::List appeared in fml5 mailing list driver package. +See C<http://www.fml.org/> for more details. + +=cut + + +1; diff --git a/fml/lib/FML/Command/Admin/list.pm b/fml/lib/FML/Command/Admin/list.pm index 6a259d69..3c3ace7a 100644 --- a/fml/lib/FML/Command/Admin/list.pm +++ b/fml/lib/FML/Command/Admin/list.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: list.pm,v 1.4 2002/04/07 05:01:33 fukachan Exp $ +# $FML: list.pm,v 1.5 2002/06/25 03:53:31 fukachan Exp $ # package FML::Command::Admin::list; @@ -126,21 +126,31 @@ sub _show_list sub cgi_menu { my ($self, $curproc, $args, $command_args) = @_; - my $options = [ 'member' ]; - my $r = ''; - - # navigation bar - print "<p> \"@$options\" address list\n"; - print "<hr>\n"; + my $map_default = $curproc->safe_param_map() || 'member'; + my $options = [ $map_default ]; + my $ml_name = $curproc->cgi_try_get_ml_name($args); + my $r = ''; # declare CGI mode $command_args->{ is_cgi } = 1; + # navigation bar + eval q{ + use FML::CGI::Admin::List; + my $obj = new FML::CGI::Admin::List; + $obj->cgi_menu($curproc, $args, $command_args); + }; + if ($r = $@) { + print $r; + croak($r); + } + + print "<hr>\n"; + eval q{ $self->_show_list($curproc, $command_args, $options); }; if ($r = $@) { - print $r; croak($r); } } |
