1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
#-*- perl -*-
#
# Copyright (C) 2001 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: Calender.pm,v 1.9 2001/12/23 11:39:45 fukachan Exp $
#
package FML::CGI::Calender;
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::Calender - demonstration CGI module to show schedule (HTML TABLE)
=head1 SYNOPSIS
$obj = new FML::CGI::Calender;
$obj->prepare();
$obj->verify_request();
$obj->run();
$obj->finish();
run() executes html_start(), run_cgi() and html_end() described below.
See L<FML::Process::Flow> for flow details.
=head1 DESCRIPTION
=head2 CLASS HIERARCHY
C<FML::CGI::Calender> is a subclass of C<FML::Process::CGI>.
=head1 METHODS
Almost methods common for CGI or HTML are forwarded to
C<FML::Process::CGI> base class.
This module has routines needed for CGI main methond run().
=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 $user = $curproc->safe_param_user;
my $myname = $curproc->myname();
my $title = "$user schedule";
my $color = '#E6E6FA';
my $charset = 'euc-jp';
# o.k start html
print start_html(-title=>$title,
-lang => $charset,
-BGCOLOR=>$color);
print "\n";
$curproc->_show_guide($args);
print "<HR>\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 "<HR>\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 "<A HREF=\"\#$n\">[$n month]</A>\n";
}
}
# Descriptions: main routine for calender (HTML TABLE format)
# Arguments: OBJ($curproc) HASH_REF($args)
# Side Effects: none
# Return Value: none
sub run_cgi
{
my ($curproc, $args) = @_;
my $user = $curproc->safe_param_user;
use Calender::Lite;
my $schedule = new Calender::Lite { user => $user };
for my $n ('this', 'next', 'last') {
$schedule->print_specific_month(\*STDOUT, $n);
}
}
=head1 SEE ALSO
L<CGI>,
L<FML::Process::CGI>
and
L<FML::Process::Flow>
=head1 AUTHOR
Ken'ichi Fukamachi
=head1 COPYRIGHT
Copyright (C) 2001 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::Calender appeared in fml5 mailing list driver package.
See C<http://www.fml.org/> for more details.
=cut
1;
|