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