diff options
| author | fukachan <fukachan> | 2002-06-24 11:06:11 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-06-24 11:06:11 +0000 |
| commit | 145cd78c50e748732a4218359fb00ca0a71b275f (patch) | |
| tree | 41e0d4e077aacbcb746d377736a8a5fd8314e908 | |
| parent | 4927c490fe46bf2a6cc8de27a29c8e0efd67ecee (diff) | |
| download | fml8-145cd78c50e748732a4218359fb00ca0a71b275f.tar.gz fml8-145cd78c50e748732a4218359fb00ca0a71b275f.tar.bz2 fml8-145cd78c50e748732a4218359fb00ca0a71b275f.zip | |
clean up menu, bug fix run_cgi_menu() args
| -rw-r--r-- | fml/lib/FML/CGI/Admin/ML.pm | 87 | ||||
| -rw-r--r-- | fml/lib/FML/CGI/Admin/Menu.pm | 44 | ||||
| -rw-r--r-- | fml/lib/FML/CGI/Admin/User.pm | 18 | ||||
| -rw-r--r-- | fml/lib/FML/Process/CGI/Kernel.pm | 102 |
4 files changed, 195 insertions, 56 deletions
diff --git a/fml/lib/FML/CGI/Admin/ML.pm b/fml/lib/FML/CGI/Admin/ML.pm index 65e43a68..7b2048d6 100644 --- a/fml/lib/FML/CGI/Admin/ML.pm +++ b/fml/lib/FML/CGI/Admin/ML.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: ML.pm,v 1.1 2002/04/23 09:32:34 fukachan Exp $ +# $FML: ML.pm,v 1.2 2002/06/22 14:37:23 fukachan Exp $ # package FML::CGI::Admin::ML; @@ -52,36 +52,61 @@ sub cgi_menu print start_form(-action=>$action, -target=>$target); - print table( { -border => undef }, - Tr( undef, - td([ - "ML: ", - scrolling_list(-name => 'ml_name', - -values => $ml_list, - -size => 5) - ]) - ), - Tr( undef, - td([ - "", - textfield(-name => 'ml_name_specified', - -default => '', - -override => 1, - -size => 32, - -maxlength => 64, - ) - ]) - ), - Tr( undef, - td([ - "command: ", - scrolling_list(-name => 'command', - -values => $command_list, - -default => $comname, - -size => 1) - ]) - ), - ); + if ($comname eq 'newml') { + print table( { -border => undef }, + Tr( undef, + td([ + "ML:", + textfield(-name => 'ml_name_specified', + -default => '', + -override => 1, + -size => 32, + -maxlength => 64, + ) + ]) + ), + Tr( undef, + td([ + "command: ", + textfield(-name => 'command', + -default => $comname, + -size => 32) + ]) + ), + ); + + } + elsif ($comname eq 'rmml') { + print table( { -border => undef }, + Tr( undef, + td([ + "ML: ", + scrolling_list(-name => 'ml_name', + -values => $ml_list, + -size => 5) + ]) + ), + Tr( undef, + td([ + "", + textfield(-name => 'ml_name_specified', + -default => '', + -override => 1, + -size => 32, + -maxlength => 64, + ) + ]) + ), + Tr( undef, + td([ + "command: ", + textfield(-name => 'command', + -default => $comname, + -size => 32) + ]) + ), + ); + } print submit(-name => 'submit'); diff --git a/fml/lib/FML/CGI/Admin/Menu.pm b/fml/lib/FML/CGI/Admin/Menu.pm index 71571c97..8f85beaf 100644 --- a/fml/lib/FML/CGI/Admin/Menu.pm +++ b/fml/lib/FML/CGI/Admin/Menu.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: Menu.pm,v 1.14 2002/06/21 09:28:12 fukachan Exp $ +# $FML: Menu.pm,v 1.15 2002/06/22 14:37:48 fukachan Exp $ # package FML::CGI::Admin::Menu; @@ -17,6 +17,8 @@ use CGI qw/:standard/; # load standard CGI routines use FML::Process::CGI; @ISA = qw(FML::Process::CGI); +my $debug = 0; + =head1 NAME @@ -117,6 +119,8 @@ sub run_cgi_main my $navi_command = $curproc->safe_param_navi_command() || ''; my $command = $curproc->safe_param_command() || ''; + print "command = $command, navi_command = $navi_command<br>\n" if $debug; + # update config on memory to hadlne # 1. ml_name specified here # 2. virtual domain @@ -128,6 +132,7 @@ sub run_cgi_main if (($command eq 'newml' && $ml_name) || ($command eq 'rmml' && $ml_name)) { + print "<br>* case 1 <br>\n" if $debug; my $command_args = { command_mode => 'admin', comname => $command, @@ -141,9 +146,10 @@ sub run_cgi_main $curproc->cgi_execute_command($args, $command_args); print hr; - $curproc->run_cgi_menu($args, $command); + $curproc->run_cgi_menu($args, $command, $command_args); } elsif ($command && $address) { + print "<br>* case 2 <br>\n" if $debug; my $ml_name = $curproc->safe_param_ml_name(); my $command_args = { command_mode => 'admin', @@ -157,15 +163,39 @@ sub run_cgi_main $curproc->cgi_execute_command($args, $command_args); print hr; - $curproc->run_cgi_menu($args, $command); + $curproc->run_cgi_menu($args, $command, $command_args); } elsif ($navi_command) { - $curproc->run_cgi_menu($args, $navi_command); + print "<br>* case 3 <br>\n" if $debug; + + my $ml_name = $curproc->safe_param_ml_name(); + my $command_args = { + command_mode => 'admin', + comname => $navi_command, + command => $navi_command, + ml_name => $ml_name, + argv => undef, + args => undef, + }; + $curproc->run_cgi_menu($args, $navi_command, $command_args); } elsif ($command) { - $curproc->run_cgi_menu($args, $command); + print "<br>* case 4 <br>\n" if $debug; + + my $ml_name = $curproc->safe_param_ml_name(); + my $command_args = { + command_mode => 'admin', + comname => $command, + command => $command, + ml_name => $ml_name, + argv => undef, + args => undef, + }; + $curproc->run_cgi_menu($args, $command, $command_args); } else { + print "<br>* case 5 <br>\n" if $debug; + my $ml_name = $curproc->safe_param_ml_name(); if ($ml_name) { @@ -194,7 +224,7 @@ sub run_cgi_navigator $config->get_as_array_ref('commands_for_admin_cgi'); # main menu - my $ml_name = $curproc->safe_param_ml_name() || '?'; + my $ml_name = $curproc->cgi_try_get_ml_name($args); my $fml_url = '<A HREF="http://www.fml.org/software/fml-devel/">fml</A>'; print "<B>$fml_url admin menu</B>\n<BR>\n"; @@ -203,7 +233,7 @@ sub run_cgi_navigator print "mailing list:\n"; print scrolling_list(-name => 'ml_name', -values => $ml_list, - -default => $ml_name, + -default => [ $ml_name ], -size => 5); print "\n<BR>\n"; diff --git a/fml/lib/FML/CGI/Admin/User.pm b/fml/lib/FML/CGI/Admin/User.pm index b4462206..2bfbc136 100644 --- a/fml/lib/FML/CGI/Admin/User.pm +++ b/fml/lib/FML/CGI/Admin/User.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: User.pm,v 1.3 2002/04/10 09:51:25 fukachan Exp $ +# $FML: User.pm,v 1.7 2002/04/25 04:15:19 fukachan Exp $ # package FML::CGI::Admin::User; @@ -46,6 +46,7 @@ sub cgi_menu # my $address_list = $curproc->get_recipient_list(); + my $ml_name = $command_args->{ ml_name }; my $comname = $command_args->{ comname }; my $command_list = $config->get_as_array_ref('commands_for_admin_cgi'); @@ -57,18 +58,17 @@ sub cgi_menu Tr( undef, td([ "ML: ", - scrolling_list(-name => 'ml_name', - -values => $ml_list, - -size => 5) - ]) + textfield(-name => 'ml_name', + -default => $ml_name, + -size => 32) + ]) ), Tr( undef, td([ "command: ", - scrolling_list(-name => 'command', - -values => $command_list, - -default => $comname, - -size => 1) + textfield(-name => 'command', + -default => $comname, + -size => 32) ]) ), Tr( undef, diff --git a/fml/lib/FML/Process/CGI/Kernel.pm b/fml/lib/FML/Process/CGI/Kernel.pm index 082c9094..bc04308a 100644 --- a/fml/lib/FML/Process/CGI/Kernel.pm +++ b/fml/lib/FML/Process/CGI/Kernel.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: Kernel.pm,v 1.31 2002/06/22 14:39:56 fukachan Exp $ +# $FML: Kernel.pm,v 1.32 2002/06/24 09:43:25 fukachan Exp $ # package FML::Process::CGI::Kernel; @@ -255,7 +255,7 @@ sub _drive_cgi_by_table 'center' => 'run_cgi_main', 'east' => 'run_cgi_options', - 'sw' => '', + 'sw' => 'run_cgi_command_help', 'south' => '', 'se' => '', }; @@ -269,21 +269,28 @@ sub _drive_cgi_by_table 'center' => 'rowspan=2 valign="top"', 'east' => 'rowspan=2 valign="top"', - 'sw' => '', - 'south' => '', - 'se' => '', + 'sw' => 'valign="top"', + 'south' => 'rowspan=2 valign="top"', + 'se' => 'rowspan=2 valign="top"', }; print "<table border=0 cellspacing=\"0\" cellpadding=\"5\">\n"; - print "<tr>\n"; + print "\n<!-- new line -->\n"; + print "\n<tr>\n"; for my $pos ('nw', 'north', 'ne', '!', 'west', 'center', 'east', '!', 'sw', 'south', 'se') { - if ($pos eq '!') { print "</tr>\n\n<tr>\n"; next;} + if ($pos eq '!') { + print "</tr>\n"; + print "\n<!-- new line -->\n"; + print "\n<tr>\n"; + next; + } my $attr = $td_attr->{ $pos }; + print "\n<!-- $pos -->\n"; print $attr ? "<td $attr>\n" : "<td>\n"; my $fp = $function_table->{ $pos }; @@ -291,9 +298,9 @@ sub _drive_cgi_by_table eval q{ $curproc->$fp($args);}; if ($r = $@) { _error_string($curproc, $r);} } - print "</td>\n"; + print "\n</td>\n"; } - print "</tr>\n"; + print "\n</tr>\n"; print "</table>\n"; } @@ -386,6 +393,83 @@ sub run_cgi_help } +=head2 run_cgi_log($args) + +log. + +=cut + + +# Descriptions: show log +# Arguments: OBJ($curproc) HASH_REF($args) +# Side Effects: none +# Return Value: none +sub run_cgi_log +{ + my ($curproc, $args) = @_; + + print "log"; +} + + +=head2 run_cgi_dummy($args) + +dummy. + +=cut + + +# Descriptions: show dummy +# Arguments: OBJ($curproc) HASH_REF($args) +# Side Effects: none +# Return Value: none +sub run_cgi_dummy +{ + my ($curproc, $args) = @_; + + print "dummy\n"; +} + + +=head2 run_cgi_date($args) + +date. + +=cut + + +# Descriptions: show date +# Arguments: OBJ($curproc) HASH_REF($args) +# Side Effects: none +# Return Value: none +sub run_cgi_date +{ + my ($curproc, $args) = @_; + + print `date`; +} + + +=head2 run_cgi_command_help($args) + +command_help. + +=cut + + +# Descriptions: show command_dependent help +# Arguments: OBJ($curproc) HASH_REF($args) +# Side Effects: none +# Return Value: none +sub run_cgi_command_help +{ + my ($curproc, $args) = @_; + my $buf = $curproc->message_nl("cgi.top"); + + print $buf; +} + + =head2 run_cgi_options($args) show options. |
