line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::Calendar::Simple; |
2
|
3
|
|
|
3
|
|
83750
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
97
|
|
3
|
3
|
|
|
3
|
|
12
|
use warnings FATAL => 'all'; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
184
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.06'; |
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
664839
|
use Calendar::Simple; |
|
3
|
|
|
|
|
10014855
|
|
|
3
|
|
|
|
|
272
|
|
7
|
3
|
|
|
3
|
|
431140
|
use Template::Plugin; |
|
3
|
|
|
|
|
5758
|
|
|
3
|
|
|
|
|
80
|
|
8
|
3
|
|
|
3
|
|
17523
|
use Template::Iterator; |
|
3
|
|
|
|
|
5685
|
|
|
3
|
|
|
|
|
88
|
|
9
|
3
|
|
|
3
|
|
18
|
use Template::Exception; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
60
|
|
10
|
3
|
|
|
3
|
|
15
|
use base qw( Template::Plugin ); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
635
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
2
|
|
|
2
|
1
|
139910
|
my ($class, $context, @args) = @_; |
14
|
2
|
|
|
|
|
14
|
my @cal = Calendar::Simple::calendar( @args ); |
15
|
2
|
|
|
|
|
1211
|
return bless { |
16
|
|
|
|
|
|
|
_CONTEXT => $context, |
17
|
|
|
|
|
|
|
rows => Template::Iterator->new( [@cal] ), |
18
|
|
|
|
|
|
|
days => [qw( Sun Mon Tue Wed Thu Fri Sat )], |
19
|
|
|
|
|
|
|
}, $class; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub rows { |
23
|
2
|
|
|
2
|
1
|
655
|
my ($self) = shift; |
24
|
2
|
|
|
|
|
12
|
return $self->{rows}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub days { |
28
|
2
|
|
|
2
|
1
|
175
|
my ($self, $monday_starts_week) = @_; |
29
|
2
|
|
|
|
|
5
|
my @days = @{ $self->{days} }; |
|
2
|
|
|
|
|
20
|
|
30
|
2
|
100
|
|
|
|
15
|
push @days, shift @days if $monday_starts_week; |
31
|
2
|
|
|
|
|
14
|
return [@days]; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
__END__ |