line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::Calendar::Simple; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
913
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
916
|
use Calendar::Simple; |
|
1
|
|
|
|
|
282332
|
|
|
1
|
|
|
|
|
91
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
886
|
use Template::Plugin; |
|
1
|
|
|
|
|
5704
|
|
|
1
|
|
|
|
|
28
|
|
9
|
1
|
|
|
1
|
|
799
|
use Template::Iterator; |
|
1
|
|
|
|
|
3228
|
|
|
1
|
|
|
|
|
34
|
|
10
|
1
|
|
|
1
|
|
6
|
use Template::Exception; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
101
|
|
11
|
1
|
|
|
1
|
|
5
|
use base qw( Template::Plugin ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
633
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
0
|
|
|
0
|
1
|
|
my ($class, $context, @arg) = @_; |
17
|
0
|
|
|
|
|
|
my @cal = Calendar::Simple::calendar(@arg); |
18
|
0
|
|
|
|
|
|
return bless { |
19
|
|
|
|
|
|
|
_CONTEXT => $context, |
20
|
|
|
|
|
|
|
rows => Template::Iterator->new([@cal]), |
21
|
|
|
|
|
|
|
days => [qw(Sun Mon Tue Wed Thu Fri Sat)], |
22
|
|
|
|
|
|
|
}, $class; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub rows { |
26
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
27
|
0
|
|
|
|
|
|
return $self->{rows}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub days { |
31
|
0
|
|
|
0
|
1
|
|
my ($self, $mon) = @_; |
32
|
0
|
|
|
|
|
|
my @day = @{$self->{days}}; |
|
0
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
|
push @day, shift @day if $mon; |
34
|
0
|
|
|
|
|
|
return [@day]; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |