diff options
| author | fukachan <fukachan> | 2004-03-31 05:28:17 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2004-03-31 05:28:17 +0000 |
| commit | ec7961cb88db3a2e8d954d6d286e4037af6c6f51 (patch) | |
| tree | 51f55a1bb22f0fbb16eac3e87ad76f0ae6b1ea84 /fml | |
| parent | 44c6ec5c13a03e19541127f35b1a88947a12b958 (diff) | |
| download | fml8-ec7961cb88db3a2e8d954d6d286e4037af6c6f51.tar.gz fml8-ec7961cb88db3a2e8d954d6d286e4037af6c6f51.tar.bz2 fml8-ec7961cb88db3a2e8d954d6d286e4037af6c6f51.zip | |
move config.cgi specific methods run_*() from
FML::Process::CGI::Kernel to FML::CGI::Menu.
Diffstat (limited to 'fml')
| -rw-r--r-- | fml/lib/FML/CGI/Menu.pm | 120 | ||||
| -rw-r--r-- | fml/lib/FML/Process/CGI/Kernel.pm | 103 |
2 files changed, 121 insertions, 102 deletions
diff --git a/fml/lib/FML/CGI/Menu.pm b/fml/lib/FML/CGI/Menu.pm index 4a2deacb..4747623c 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.8 2004/01/02 14:50:29 fukachan Exp $ +# $FML: Menu.pm,v 1.9 2004/01/18 13:56:04 fukachan Exp $ # package FML::CGI::Menu; @@ -258,6 +258,124 @@ sub run_cgi_navigator } +=head2 run_cgi_menu() + +execute cgi_menu() given as FML::Command::* + +=cut + + +# Descriptions: execute FML::Command +# Arguments: OBJ($curproc) +# Side Effects: load module +# Return Value: none +sub run_cgi_menu +{ + my ($curproc) = @_; + + $curproc->cgi_execute_cgi_menu(); +} + + +=head2 run_cgi_help() + +help. + +=cut + + +# Descriptions: show help +# Arguments: OBJ($curproc) +# Side Effects: none +# Return Value: none +sub run_cgi_help +{ + my ($curproc) = @_; + my $ml_name = $curproc->cgi_var_ml_name(); + my $ml_domain = $curproc->cgi_var_ml_domain(); + my $mode = $curproc->cgi_var_cgi_mode(); + my $role = $curproc->message_nl('term.config_interface'); + my $msg_args = $curproc->_gen_msg_args(); + + print "<B>\n<CENTER>\n"; + if ($mode eq 'admin') { + print "fml CGI $role for \@$ml_domain ML's\n"; + } + else { + print "fml CGI $role for $ml_name\@$ml_domain ML\n"; + } + print "</CENTER><BR>\n</B>\n"; + + # top level help message + my $buf = ''; + if ($mode eq 'admin') { + $buf = $curproc->message_nl("cgi.admin.top", "", $msg_args); + } + else { + $buf = $curproc->message_nl("cgi.ml-admin.top", "", $msg_args); + } + + print $buf; +} + + +=head2 run_cgi_command_help() + +command_help. + +=cut + + +# Descriptions: show command_dependent help +# Arguments: OBJ($curproc) +# Side Effects: none +# Return Value: none +sub run_cgi_command_help +{ + my ($curproc) = @_; + my $buf = ''; + my $navi_command = $curproc->safe_param_navi_command(); + my $command = $curproc->safe_param_command(); + my $msg_args = $curproc->_gen_msg_args(); + + # natural language-ed name + my $name_usage = $curproc->message_nl('term.usage', 'usage'); + + if ($navi_command) { + print "[$name_usage]<br> <b> $navi_command </b> <br>\n"; + $buf = $curproc->message_nl("cgi.$navi_command", '', $msg_args); + } + elsif ($command) { + print "[$name_usage]<br> <b> $command </b> <br>\n"; + $buf = $curproc->message_nl("cgi.$command", '', $msg_args); + } + + print $buf; +} + + +# Descriptions: prepare arguemnts for message handling. +# Arguments: OBJ($curproc) +# Side Effects: none +# Return Value: HASH_REF +sub _gen_msg_args +{ + my ($curproc) = @_; + + # natural language-ed name + my $name_submit = $curproc->message_nl('term.submit', 'submit'); + my $name_show = $curproc->message_nl('term.show', 'show'); + my $name_map = $curproc->message_nl('term.map', 'map'); + my $msg_args = { + _arg_button_submit => $name_submit, + _arg_button_show => $name_show, + _arg_scroll_map => $name_map, + }; + + return $msg_args; +} + + =head1 SEE ALSO L<CGI>, diff --git a/fml/lib/FML/Process/CGI/Kernel.pm b/fml/lib/FML/Process/CGI/Kernel.pm index e57be30e..3157f869 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.76 2004/01/31 04:06:34 fukachan Exp $ +# $FML: Kernel.pm,v 1.77 2004/03/12 11:45:53 fukachan Exp $ # package FML::Process::CGI::Kernel; @@ -502,105 +502,6 @@ sub run_cgi_title } -=head2 run_cgi_help() - -help. - -=cut - - -# Descriptions: show help -# Arguments: OBJ($curproc) -# Side Effects: none -# Return Value: none -sub run_cgi_help -{ - my ($curproc) = @_; - my $ml_name = $curproc->cgi_var_ml_name(); - my $ml_domain = $curproc->cgi_var_ml_domain(); - my $mode = $curproc->cgi_var_cgi_mode(); - my $role = $curproc->message_nl('term.config_interface'); - my $msg_args = $curproc->_gen_msg_args(); - - print "<B>\n<CENTER>\n"; - if ($mode eq 'admin') { - print "fml CGI $role for \@$ml_domain ML's\n"; - } - else { - print "fml CGI $role for $ml_name\@$ml_domain ML\n"; - } - print "</CENTER><BR>\n</B>\n"; - - # top level help message - my $buf = ''; - if ($mode eq 'admin') { - $buf = $curproc->message_nl("cgi.admin.top", "", $msg_args); - } - else { - $buf = $curproc->message_nl("cgi.ml-admin.top", "", $msg_args); - } - - print $buf; -} - - -=head2 run_cgi_command_help() - -command_help. - -=cut - - -# Descriptions: show command_dependent help -# Arguments: OBJ($curproc) -# Side Effects: none -# Return Value: none -sub run_cgi_command_help -{ - my ($curproc) = @_; - my $buf = ''; - my $navi_command = $curproc->safe_param_navi_command(); - my $command = $curproc->safe_param_command(); - my $msg_args = $curproc->_gen_msg_args(); - - # natural language-ed name - my $name_usage = $curproc->message_nl('term.usage', 'usage'); - - if ($navi_command) { - print "[$name_usage]<br> <b> $navi_command </b> <br>\n"; - $buf = $curproc->message_nl("cgi.$navi_command", '', $msg_args); - } - elsif ($command) { - print "[$name_usage]<br> <b> $command </b> <br>\n"; - $buf = $curproc->message_nl("cgi.$command", '', $msg_args); - } - - print $buf; -} - - -# Descriptions: prepare arguemnts for message handling. -# Arguments: OBJ($curproc) -# Side Effects: none -# Return Value: HASH_REF -sub _gen_msg_args -{ - my ($curproc) = @_; - - # natural language-ed name - my $name_submit = $curproc->message_nl('term.submit', 'submit'); - my $name_show = $curproc->message_nl('term.show', 'show'); - my $name_map = $curproc->message_nl('term.map', 'map'); - my $msg_args = { - _arg_button_submit => $name_submit, - _arg_button_show => $name_show, - _arg_scroll_map => $name_map, - }; - - return $msg_args; -} - - =head2 run_cgi_log() log. @@ -715,7 +616,7 @@ execute cgi_menu() given as FML::Command::* # Arguments: OBJ($curproc) # Side Effects: load module # Return Value: none -sub run_cgi_menu +sub cgi_execute_cgi_menu { my ($curproc) = @_; my $pcb = $curproc->pcb(); |
