diff options
| author | fukachan <fukachan> | 2003-09-27 06:58:16 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-09-27 06:58:16 +0000 |
| commit | 32f4e1fb081fc99091cd353ba074772cfdedd5e2 (patch) | |
| tree | d115d32cd542f7e2ca712c0d1293ddf145880463 /fml/lib/FML/CGI | |
| parent | d068c70d1814ea6bb4c43672552a87a29f7db071 (diff) | |
| download | fml8-32f4e1fb081fc99091cd353ba074772cfdedd5e2.tar.gz fml8-32f4e1fb081fc99091cd353ba074772cfdedd5e2.tar.bz2 fml8-32f4e1fb081fc99091cd353ba074772cfdedd5e2.zip | |
natural language extension in cgi menu.
Diffstat (limited to 'fml/lib/FML/CGI')
| -rw-r--r-- | fml/lib/FML/CGI/List.pm | 17 | ||||
| -rw-r--r-- | fml/lib/FML/CGI/Menu.pm | 27 | ||||
| -rw-r--r-- | fml/lib/FML/CGI/User.pm | 16 |
3 files changed, 39 insertions, 21 deletions
diff --git a/fml/lib/FML/CGI/List.pm b/fml/lib/FML/CGI/List.pm index d834c73e..a2b00abd 100644 --- a/fml/lib/FML/CGI/List.pm +++ b/fml/lib/FML/CGI/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.3 2003/09/27 04:06:53 fukachan Exp $ +# $FML: List.pm,v 1.4 2003/09/27 04:30:56 fukachan Exp $ # package FML::CGI::List; @@ -37,6 +37,7 @@ sub new sub cgi_menu { my ($self, $curproc, $args, $command_args) = @_; + my $config = $curproc->config(); my $target = $curproc->cgi_var_frame_target(); my $action = $curproc->cgi_var_action(); my $map_default = $curproc->cgi_var_address_map(); @@ -54,19 +55,25 @@ sub cgi_menu croak("invalid map: $map_default"); } + # natural language-ed name + my $name_ml_name = $curproc->message_nl('term.ml_name', 'ml_name'); + my $name_map = $curproc->message_nl('term.map', 'map'); + my $name_show = $curproc->message_nl('term.show', 'show'); + my $name_reset = $curproc->message_nl('term.reset', 'reset'); + print start_form(-action=>$action, -target=>$target); print hidden(-name => 'command', -default => 'list'); print table( { -border => undef }, Tr( undef, td([ - "ML:", + $name_ml_name, textfield(-name => 'ml_name', -default => $ml_name), ]) ), Tr( undef, td([ - "map", + $name_map, scrolling_list(-name => 'map', -values => $map_list, -default => $map_default, @@ -75,8 +82,8 @@ sub cgi_menu ) ); - print submit(-name => 'show'); - print reset(-name => 'reset'); + print submit(-name => $name_show); + print reset(-name => $name_reset); print end_form; } diff --git a/fml/lib/FML/CGI/Menu.pm b/fml/lib/FML/CGI/Menu.pm index a303cfc9..e8261f68 100644 --- a/fml/lib/FML/CGI/Menu.pm +++ b/fml/lib/FML/CGI/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.26 2003/08/29 15:33:56 fukachan Exp $ +# $FML: Menu.pm,v 1.1 2003/09/25 11:40:57 fukachan Exp $ # package FML::CGI::Menu; @@ -121,7 +121,7 @@ sub run_cgi_main # specified command, we need to identify # the command specifined in the cgi_navigation and cgi_mein. my $navi_command = $curproc->safe_param_navi_command() || ''; - my $command = $curproc->safe_param_command() || ''; + my $command = $curproc->safe_param_command() || ''; # updat config: $ml_name is found now (get $ml_name from CGI). $config->set('ml_name', $ml_name); @@ -211,19 +211,24 @@ sub run_cgi_main sub run_cgi_navigator { my ($curproc, $args) = @_; - my $config = $curproc->config(); - my $action = $curproc->safe_cgi_action_name(); - my $target = '_top'; + my $target = $curproc->cgi_var_frame_target(); + my $action = $curproc->cgi_var_action(); + + # natural language-ed name + my $name_ml_name = $curproc->message_nl('term.ml_name', 'ml_name'); + my $name_command = $curproc->message_nl('term.command', 'command'); + my $name_change = $curproc->message_nl('term.change', 'change'); + my $name_reset = $curproc->message_nl('term.reset', 'reset'); # 1. ML my $ml_name = $curproc->cgi_var_ml_name(); my $ml_list = $curproc->cgi_var_ml_name_list(); - my $fml_url = '<A HREF="http://www.fml.org/software/fml-devel/">fml</A>'; - print "<B>$fml_url admin menu</B>\n<BR>\n"; + my $title = $curproc->cgi_var_navigator_title(); + print $title, "\n"; print start_form(-action=>$action, -target=>$target); - print "mailing list:\n"; + print $name_ml_name, ":\n"; print scrolling_list(-name => 'ml_name', -values => $ml_list, -default => [ $ml_name ], @@ -236,7 +241,7 @@ sub run_cgi_navigator my $command_default = $navi_command || $command; my $command_list = $curproc->cgi_var_available_command_list(); - print " command:\n"; + print $name_command, ":\n"; print scrolling_list(-name => 'navi_command', -values => $command_list, -default => [ $command_default ], @@ -245,8 +250,8 @@ sub run_cgi_navigator # 3. submit - print submit(-name => 'submit'); - print reset(-name => 'reset'); + print submit(-name => $name_change); + print reset(-name => $name_reset); print end_form; } diff --git a/fml/lib/FML/CGI/User.pm b/fml/lib/FML/CGI/User.pm index 99466f43..a657846c 100644 --- a/fml/lib/FML/CGI/User.pm +++ b/fml/lib/FML/CGI/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.2 2003/09/27 03:44:05 fukachan Exp $ +# $FML: User.pm,v 1.3 2003/09/27 04:08:14 fukachan Exp $ # package FML::CGI::User; @@ -77,13 +77,19 @@ sub cgi_menu croak("not allowed command"); } + # natural language-ed name + my $name_ml_name = $curproc->message_nl('term.ml_name', 'ml_name'); + my $name_command = $curproc->message_nl('term.command', 'command'); + my $name_submit = $curproc->message_nl('term.submit', 'submit'); + my $name_reset = $curproc->message_nl('term.reset', 'reset'); + # create <FORM ... > ... by (start_form() ... end_form()) print start_form(-action=>$action, -target=>$target); print table( { -border => undef }, Tr( undef, td([ - "ML: ", + $name_ml_name, textfield(-name => 'ml_name', -default => $ml_name, -size => 32) @@ -91,7 +97,7 @@ sub cgi_menu ), Tr( undef, td([ - "command: ", + $name_command, textfield(-name => 'command', -default => $comname, -size => 32) @@ -119,8 +125,8 @@ sub cgi_menu ); - print submit(-name => 'submit'); - print reset(-name => 'reset'); + print submit(-name => $name_submit); + print reset(-name => $name_reset); print end_form; } |
