line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormWidgets::Image; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
703
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
4
|
use parent 'HTML::FormWidgets'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( qw( fhelp subtype ) ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init { |
10
|
1
|
|
|
1
|
1
|
2
|
my ($self, $args) = @_; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
|
|
4
|
$self->fhelp ( q() ); |
13
|
1
|
|
|
|
|
7
|
$self->subtype( q(normal) ); |
14
|
1
|
|
|
|
|
9
|
$self->tiptype( q(normal) ); |
15
|
1
|
|
|
|
|
4
|
return; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub render_field { |
19
|
1
|
|
|
1
|
1
|
3
|
my ($self, $args) = @_; my $hacc = $self->hacc; |
|
1
|
|
|
|
|
3
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $src = 'http:' eq (substr $self->text, 0, 5) |
22
|
1
|
50
|
0
|
|
|
7
|
? $self->text : ($self->options->{assets} // q()).$self->text; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
11
|
$args = { alt => $self->fhelp, src => $src }; |
25
|
|
|
|
|
|
|
|
26
|
1
|
50
|
|
|
|
10
|
$self->class and $args->{class} = $self->class; |
27
|
1
|
50
|
|
|
|
15
|
$self->id and $args->{id } = $self->id; |
28
|
|
|
|
|
|
|
|
29
|
1
|
50
|
|
|
|
7
|
$self->subtype eq 'icon' and return $hacc->span( $args ); |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
13
|
return $hacc->img( $args ); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|