line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1563
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
2
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
357
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
HTML::Obj2HTML::register_extension("repeat", { |
5
|
|
|
|
|
|
|
tag => "", |
6
|
|
|
|
|
|
|
before => sub { |
7
|
|
|
|
|
|
|
my $o = shift; |
8
|
|
|
|
|
|
|
my $ret = []; |
9
|
|
|
|
|
|
|
if (!defined $o->{num}) { $o->{num} = 1; } |
10
|
|
|
|
|
|
|
for (my $i=0; $i<$o->{num}; $i++) { |
11
|
|
|
|
|
|
|
push(@{$ret}, @{$o->{_}}); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
return $ret; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
}); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
HTML::Obj2HTML::register_extension("editable", { |
18
|
|
|
|
|
|
|
tag => "", |
19
|
|
|
|
|
|
|
before => sub { |
20
|
|
|
|
|
|
|
my $o = shift; |
21
|
|
|
|
|
|
|
my $prevro = HTML::Obj2HTML::get_opt("readonly"); |
22
|
|
|
|
|
|
|
HTML::Obj2HTML::set_opt("readonly", 0); |
23
|
|
|
|
|
|
|
my $ret = HTML::Obj2HTML::gen($o); |
24
|
|
|
|
|
|
|
HTML::Obj2HTML::set_opt("readonly", $prevro); |
25
|
|
|
|
|
|
|
return $ret; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
}); |
28
|
|
|
|
|
|
|
HTML::Obj2HTML::register_extension("readonly", { |
29
|
|
|
|
|
|
|
tag => "", |
30
|
|
|
|
|
|
|
before => sub { |
31
|
|
|
|
|
|
|
my $o = shift; |
32
|
|
|
|
|
|
|
my $prevro = HTML::Obj2HTML::get_opt("readonly"); |
33
|
|
|
|
|
|
|
HTML::Obj2HTML::set_opt("readonly", 1); |
34
|
|
|
|
|
|
|
my $ret = HTML::Obj2HTML::gen($o); |
35
|
|
|
|
|
|
|
HTML::Obj2HTML::set_opt("readonly", $prevro); |
36
|
|
|
|
|
|
|
return $ret; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
}); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
HTML::Obj2HTML::register_extension("ifReadOnly", { |
41
|
|
|
|
|
|
|
tag => "if", |
42
|
|
|
|
|
|
|
before => sub { |
43
|
|
|
|
|
|
|
my $o = shift; |
44
|
|
|
|
|
|
|
if (ref $o eq "HASH") { |
45
|
|
|
|
|
|
|
$o->{cond} = HTML::Obj2HTML::get_opt('readonly'); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
return ""; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
}); |
50
|
|
|
|
|
|
|
HTML::Obj2HTML::register_extension("ifEditable", { |
51
|
|
|
|
|
|
|
tag => "if", |
52
|
|
|
|
|
|
|
before => sub { |
53
|
|
|
|
|
|
|
my $o = shift; |
54
|
|
|
|
|
|
|
if (ref $o eq "HASH") { |
55
|
|
|
|
|
|
|
$o->{cond} = !Obj2HTML::get_opt("readonly"); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
return ""; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
}); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |