#-*- perl -*-
#
# Copyright (C) 2003,2004 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: OldFashion.pm,v 1.1 2004/10/09 12:06:46 fukachan Exp $
#
package FML::CGI::Skin::OldFashion;
use strict;
use Carp;
use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
use CGI qw/:standard/; # load standard CGI routines
use FML::CGI::Skin::Base;
@ISA = qw(FML::CGI::Skin::Base);
my $debug = 0;
=head1 NAME
FML::CGI::Skin::OldFashion - provides CGI control function for the specific domain.
=head1 SYNOPSIS
$obj = new FML::CGI::Menu;
$obj->prepare();
$obj->verify_request();
$obj->run();
$obj->finish();
=cut
# Descriptions: dummy.
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: none
sub run_cgi_navigator
{
my ($curproc) = @_;
if ($curproc->is_valid_input()) {
return $curproc->SUPER::run_cgi_navigator();
}
else {
$curproc->cgi_var_navigator_title();
# 1.1 menu description.
my $desc = $curproc->message_nl("cgi.oldfashion_navigation",
"select command and ml_name");
print $desc, "\n";
print "\n
\n";
}
}
# Descriptions: show menu (old style, list based menu).
# Arguments: OBJ($curproc)
# Side Effects: none
# Return Value: none
sub run_cgi_menu
{
my ($curproc) = @_;
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_switch = $curproc->message_nl('term.switch', 'switch to');
my $name_reset = $curproc->message_nl('term.reset', 'reset');
my $next_button = $curproc->message_nl("cgi.button_next", "next");
# 0. call command specific menu if both ml_name and command specified.
if ($curproc->is_valid_input()) {
return $curproc->cgi_execute_cgi_menu();
}
# title
my $ml_name = $curproc->cgi_var_ml_name();
my $ml_list = $curproc->cgi_var_ml_name_list();
my $size = $#$ml_list + 1;
my $title = $curproc->cgi_var_navigator_title();
print $title, "\n";
# list up command with ml_name selection.
print "\n