line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::Calendar::Simple; |
2
|
3
|
|
|
3
|
|
106864
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
92
|
|
3
|
3
|
|
|
3
|
|
17
|
use warnings FATAL => 'all'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
166
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.00'; |
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
2210
|
use Calendar::Simple; |
|
3
|
|
|
|
|
362469
|
|
|
3
|
|
|
|
|
238
|
|
7
|
3
|
|
|
3
|
|
17460
|
use Template::Plugin; |
|
3
|
|
|
|
|
8877
|
|
|
3
|
|
|
|
|
106
|
|
8
|
3
|
|
|
3
|
|
2455
|
use Template::Iterator; |
|
3
|
|
|
|
|
5559
|
|
|
3
|
|
|
|
|
84
|
|
9
|
3
|
|
|
3
|
|
20
|
use Template::Exception; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
64
|
|
10
|
3
|
|
|
3
|
|
17
|
use base qw( Template::Plugin ); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
731
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
2
|
|
|
2
|
1
|
155675
|
my ($class, $context, @args) = @_; |
14
|
2
|
|
|
|
|
16
|
my @cal = Calendar::Simple::calendar( @args ); |
15
|
2
|
|
|
|
|
1057
|
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
|
569
|
my ($self) = shift; |
24
|
2
|
|
|
|
|
9
|
return $self->{rows}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub days { |
28
|
2
|
|
|
2
|
1
|
190
|
my ($self, $monday_starts_week) = @_; |
29
|
2
|
|
|
|
|
7
|
my @days = @{ $self->{days} }; |
|
2
|
|
|
|
|
17
|
|
30
|
2
|
100
|
|
|
|
13
|
push @days, shift @days if $monday_starts_week; |
31
|
2
|
|
|
|
|
14
|
return [@days]; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
__END__ |