#-*- perl -*- # # Copyright (C) 2002,2003 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: Calendar.pm,v 1.2 2003/01/31 14:56:14 fukachan Exp $ # package FML::CGI::Calendar; use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; use CGI qw/:standard/; # load standard CGI routines use FML::Process::CGI; @ISA = qw(FML::Process::CGI); =head1 NAME FML::CGI::Calendar - CGI module to show calendar as HTML TABLE (DEMO) =head1 SYNOPSIS $obj = new FML::CGI::Calendar; $obj->prepare(); $obj->verify_request(); $obj->run(); $obj->finish(); run() executes html_start(), run_cgi() and html_end() described below. See L for flow details. =head1 DESCRIPTION =head2 CLASS HIERARCHY C is a subclass of C. Almost all methods inherit C base class. =head1 METHODS =cut # Descriptions: print out HTML header + body former part # Arguments: OBJ($curproc) HASH_REF($args) # Side Effects: none # Return Value: none sub html_start { my ($curproc, $args) = @_; my $config = $curproc->{ config }; my $user = $curproc->safe_param_user; my $myname = $curproc->myname(); my $title = "$user schedule"; my $color = '#E6E6FA'; my $charset = $curproc->language_of_cgi_message(); # o.k start html print start_html(-title => $title, -lang => $charset, -BGCOLOR => $color); print "\n"; $curproc->_show_guide($args); print "
\n"; } # Descriptions: print out body latter part # Arguments: OBJ($curproc) HASH_REF($args) # Side Effects: none # Return Value: none sub html_end { my ($curproc, $args) = @_; print "
\n"; $curproc->_show_guide($args); # o.k. end of html print end_html; print "\n"; } # Descriptions: print out navigation bar # Arguments: OBJ($curproc) HASH_REF($args) # Side Effects: none # Return Value: none sub _show_guide { my ($curproc, $args) = @_; for my $n ('this', 'next', 'last') { print "[$n month]\n"; } } # Descriptions: main routine for calendar as HTML TABLE format # Arguments: OBJ($curproc) HASH_REF($args) # Side Effects: none # Return Value: none sub run_cgi_main { my ($curproc, $args) = @_; my $user = $curproc->safe_param_user; use Calendar::Lite; my $schedule = new Calendar::Lite { user => $user }; for my $n ('this', 'next', 'last') { $schedule->print_specific_month(\*STDOUT, $n); } } # Descriptions: show menu (table based menu) # Arguments: OBJ($curproc) HASH_REF($args) # Side Effects: none # Return Value: none sub run_cgi_navigator { my ($curproc, $args) = @_; ; } # Descriptions: show menu (table based menu) # Arguments: OBJ($curproc) HASH_REF($args) # Side Effects: none # Return Value: none sub run_cgi_options { my ($curproc, $args) = @_; ; } =head1 SEE ALSO L, L and L =head1 CODING STYLE See C on fml coding style guide. =head1 AUTHOR Ken'ichi Fukamachi =head1 COPYRIGHT Copyright (C) 2002,2003 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::Calendar first appeared in fml8 mailing list driver package. See C for more details. =cut 1;