line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Tag::RADIO; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
63
|
|
4
|
1
|
|
|
1
|
|
10
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use Class::AutoAccess; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
7
|
1
|
|
|
1
|
|
6
|
use base qw(Class::AutoAccess HTML::Tag); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
216
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.00'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
1
|
|
|
1
|
|
315
|
our $class_def = { |
13
|
|
|
|
|
|
|
element => 'RADIO', |
14
|
|
|
|
|
|
|
tag => 'INPUT', |
15
|
|
|
|
|
|
|
has_end_tag => 0, |
16
|
|
|
|
|
|
|
value => {}, |
17
|
|
|
|
|
|
|
selected => '', |
18
|
|
|
|
|
|
|
type => 'radio', |
19
|
|
|
|
|
|
|
attributes => ['type'], |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub html { |
24
|
2
|
|
|
2
|
0
|
538
|
my $self = shift; |
25
|
2
|
|
|
|
|
5
|
my $ret = ''; |
26
|
2
|
50
|
|
|
|
6
|
if (ref($self->value) eq 'HASH') { |
27
|
2
|
|
|
|
|
15
|
while (my ($k,$v) = each %{$self->value}) { |
|
5
|
|
|
|
|
15
|
|
28
|
3
|
|
|
|
|
33
|
$ret .= "<" . lc($self->tag); |
29
|
3
|
|
|
|
|
44
|
foreach (@{$self->attributes}) { |
|
3
|
|
|
|
|
18
|
|
30
|
72
|
|
|
|
|
384
|
my @attr_value = $self->$_; |
31
|
72
|
|
|
|
|
809
|
my $attr_value = $attr_value[0]; |
32
|
72
|
100
|
|
|
|
151
|
if ("$attr_value" ne '') { |
33
|
6
|
|
|
|
|
25
|
$ret .= " " . $self->_build_attribute($_,$attr_value); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
3
|
50
|
|
|
|
16
|
$ret .= qq| value="$k"| . ($self->selected eq $k ? ' checked' : ''); |
37
|
3
|
50
|
|
|
|
51
|
$ret .= $self->has_end_tag ? '>' : ' />'; |
38
|
3
|
|
|
|
|
40
|
$ret .= "$v\n"; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
2
|
|
|
|
|
23
|
return $ret; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# vim: set ts=2: |