PlotCalendar
view release on metacpan or search on metacpan
PlotCalendar/Month.pm view on Meta::CPAN
else {
$string .= "<H3>" . $textdow . "</H3>";
}
$string .= "</TD>\n";
}
$string .= "</TR>\n";
# If there are comments, we'll need to deal with them
my $comments = 0;
my (@prefs, @comments, @comcol, @comstyle, @comsize);
if ($self->{COMMFLAG}) {
@prefs = @{$self->{COMMENTS}[0]};
@comments = @{$self->{COMMENTS}[1]};
@comcol = @{$self->{COMMENTS}[2]};
@comstyle = @{$self->{COMMENTS}[3]};
@comsize = @{$self->{COMMENTS}[4]};
$comments = @prefs;
}
# add in all the days
my $numdays = Days_in_Month($year, $self->{MONTH}); # num days in month
my $dow = Day_of_Week($year, $self->{MONTH},1); # day of week of first
my $curday = 0; # current day of month
$dow = 0 if $dow == 7;
$frstdow = 0 if $frstdow == 7;
PlotCalendar/Month.pm view on Meta::CPAN
$day -> textcolor(@{$self->{TEXTCOL}[$curday]});
$day -> textsize(@{$self->{TEXTSIZE}[$curday]});
$day -> textstyle(@{$self->{TEXTSTYLE}[$curday]});
$day -> textref(@{$self->{TEXTREF}[$curday]});
if ($self->{HTMLREF}[$curday]) {
$day -> htmlref($self->{HTMLREF}[$curday]);
}
$string .= $day -> gethtml; # ---- add in cell
}
else {
if ($comments && $curday == 0 && grep(/before/,@prefs)) {
# I am in the before zone and can use it
my $k;
for ($k=0;$k<@prefs;$k++) {
last if $prefs[$k] eq 'before' ;
}
$string .= &makecomm($self,$comments[$k],$comcol[$k],$comstyle[$k],$comsize[$k]);
splice(@prefs,$k,1);
splice(@comments,$k,1);
splice(@comcol,$k,1);
splice(@comstyle,$k,1);
splice(@comsize,$k,1);
$comments--;
}
elsif ($comments && $curday > 0 ) {
# I am in the after zone and can use it
$string .= &makecomm($self,$comments[0],$comcol[0],$comstyle[0],$comsize[0]);
shift @prefs;
shift @comments;
shift @comcol;
shift @comstyle;
shift @comsize;
$comments--;
}
else {
$string .= "<TD WIDTH=$self->{CELLWIDTH} BGCOLOR=$self->{TABLEBG}> </TD>\n";
}
}
}
$string .= "</TR>\n";
}
# If I have leftover comments, I have to create an extra row to display them
if ($comments) {
$string .= "<TR>\n";
for (my $col=0;$col<7;$col++) {
if ($comments) {
# I am in the after zone and can use it
$string .= &makecomm($self,$comments[0],$comcol[0],$comstyle[0],$comsize[0]);
shift @prefs;
shift @comments;
shift @comcol;
shift @comstyle;
shift @comsize;
$comments--;
}
else {
$string .= "<TD WIDTH=$self->{CELLWIDTH} BGCOLOR=$self->{TABLEBG}> </TD>\n";
}
PlotCalendar/Month.pm view on Meta::CPAN
}
------------------------- Set global values
$month -> fgcolor('BLACK',); # Global foreground color
$month -> bgcolor(@bgcolor); # Background color per day
$month -> styles('b','bi','ui',); # Global text styles
# Comments
my @prefs = ('before','after','after');
my @comments = (['Comment one'],["Comment two","and so on"],['Comment three']);
my @comcol = qw(b g b);
my @comstyle = qw(n b bi);
my @comsize = qw(8 10 14);
------------------------- Comments get stuck into an otherwise empty cell
$month->comments(\@prefs,\@comments,\@comcol,\@comstyle,\@comsize);
------------------------- Wrap a hotlink around the whole day, for each day
$month -> htmlref(@url);
------------------------- set the names for every day
$month -> dayname(@daynames);
------------------------- wrap the name in a hotlink
$month -> nameref(@nameref);
------------------------- set the text and it's properties for each day
demo/test_month view on Meta::CPAN
@style = reverse(@style);
$url[$i] = '<A href="http://some.org/name_number_' . $i . '">';
}
$month -> fgcolor('BLACK',); # Global foreground color
$month -> bgcolor(@bgcolor); # Background color per day
$month -> styles('b','bi','ui',); # Global text styles
# Comments
my @prefs = ('before','after','after');
my @comments = (['Comment one'],["Comment two","and so on"],['Comment three']);
my @comcol = qw(b g b);
my @comstyle = qw(n b bi);
my @comsize = qw(8 10 14);
$month->comments(\@prefs,\@comments,\@comcol,\@comstyle,\@comsize);
#$month -> htmlref(@url);
#my @fgcolor = $month->fgcolor;
#my @bgcolors = $month->bgcolor;
#print "@fgcolor\n";
#print "@bgcolors\n";
$month -> dayname(@daynames);
$month -> nameref(@nameref);
@style = reverse(@style);
$url[$i] = '<A href="http://some.org/name_number_' . $i . '">';
}
$month -> fgcolor('BLACK',); # Global foreground color
$month -> bgcolor(@bgcolor); # Background color per day
$month -> styles('b','bi','ui',); # Global text styles
# Comments
my @prefs = ('before','after','after');
my @comments = (['Comment one'],["Comment two","and so on"],['Comment three']);
my @comcol = qw(b g b);
my @comstyle = qw(n b bi);
my @comsize = qw(8 10 14);
$month->comments(\@prefs,\@comments,\@comcol,\@comstyle,\@comsize);
$month -> dayname(@daynames);
$month -> nameref(@nameref);
$month -> text(@text);
$month -> textcolor(@textcol);
$month -> textsize(@textsize);
$month -> textstyle(@textstyle);
$month -> textref(@textref);
( run in 0.697 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )