line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::Monta; |
2
|
1
|
|
|
1
|
|
689
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
3
|
1
|
|
|
1
|
|
7
|
use base qw/Template::Plugin::Filter/; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
793
|
|
4
|
1
|
|
|
1
|
|
6747
|
use vars qw/$VERSION $DYNAMIC $FILTER_NAME/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
48
|
|
5
|
1
|
|
|
1
|
|
919
|
use Acme::Monta; |
|
1
|
|
|
|
|
900
|
|
|
1
|
|
|
|
|
260
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$VERSION = 0.03; |
8
|
|
|
|
|
|
|
$DYNAMIC = 1; |
9
|
|
|
|
|
|
|
$FILTER_NAME = 'monta'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my @setting_params = qw/ |
12
|
|
|
|
|
|
|
start end open_font open_back close_font |
13
|
|
|
|
|
|
|
close_back close_img replace_tag cursor |
14
|
|
|
|
|
|
|
/; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub init { |
17
|
0
|
|
|
0
|
0
|
|
my($self, $args) = @_; |
18
|
0
|
|
0
|
|
|
|
my $name = $self->{_ARGS}->[0] || $FILTER_NAME; |
19
|
0
|
|
|
|
|
|
$self->install_filter($name); |
20
|
0
|
|
|
|
|
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _param_check { |
24
|
0
|
|
|
0
|
|
|
my $key = shift; |
25
|
0
|
|
|
|
|
|
foreach(@setting_params){ |
26
|
0
|
0
|
|
|
|
|
return 1 if($key eq $_); |
27
|
|
|
|
|
|
|
} |
28
|
0
|
|
|
|
|
|
return undef; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub filter { |
32
|
0
|
|
|
0
|
0
|
|
my($self, $text, $args, $config) = @_; |
33
|
0
|
|
|
|
|
|
my $monta = Acme::Monta->new( |
34
|
0
|
|
|
|
|
|
map { ( $_ => $config->{$_} ) } |
35
|
0
|
|
|
|
|
|
grep{ _param_check($_) } |
36
|
|
|
|
|
|
|
keys %$config |
37
|
|
|
|
|
|
|
); |
38
|
0
|
|
|
|
|
|
return $monta->montaize($text); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
__END__ |