line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormWidgets::Anchor; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
680
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
5
|
use parent 'HTML::FormWidgets'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
11
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( qw( config fhelp href imgclass target ) ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init { |
10
|
1
|
|
|
1
|
1
|
3
|
my ($self, $args) = @_; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
|
|
6
|
$self->class ( 'anchor_button fade' ); |
13
|
1
|
|
|
|
|
7
|
$self->config ( undef ); |
14
|
1
|
|
|
|
|
6
|
$self->fhelp ( q() ); |
15
|
1
|
|
|
|
|
7
|
$self->href ( undef ); |
16
|
1
|
|
|
|
|
6
|
$self->imgclass( undef ); |
17
|
1
|
|
|
|
|
6
|
$self->target ( undef ); |
18
|
1
|
|
|
|
|
10
|
$self->tiptype ( 'normal' ); |
19
|
1
|
|
|
|
|
5
|
return; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub render_field { |
23
|
1
|
|
|
1
|
1
|
3
|
my ($self, $args) = @_; my $hacc = $self->hacc; |
|
1
|
|
|
|
|
3
|
|
24
|
|
|
|
|
|
|
|
25
|
1
|
50
|
33
|
|
|
5
|
$self->id and $self->config |
26
|
|
|
|
|
|
|
and $self->add_literal_js( 'anchors', $self->id, $self->config ); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $src = 'http:' eq (substr $self->text, 0, 5) |
29
|
1
|
50
|
50
|
|
|
11
|
? $self->text : ($self->options->{assets} // q()).$self->text; |
30
|
1
|
0
|
33
|
|
|
21
|
my $html = $self->imgclass |
|
|
50
|
|
|
|
|
|
31
|
|
|
|
|
|
|
? $self->text |
32
|
|
|
|
|
|
|
? $hacc->img ( { alt => $self->fhelp, |
33
|
|
|
|
|
|
|
class => $self->imgclass, |
34
|
|
|
|
|
|
|
src => $src } ) |
35
|
|
|
|
|
|
|
: $hacc->span( { class => $self->imgclass } ) |
36
|
|
|
|
|
|
|
: $self->text || $self->loc( 'link' ); |
37
|
|
|
|
|
|
|
|
38
|
1
|
50
|
|
|
|
3
|
$self->href or return $html; delete $args->{name}; |
|
1
|
|
|
|
|
7
|
|
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
|
|
3
|
$args->{class} = $self->class; $args->{href} = $self->uri_for( $self->href ); |
|
1
|
|
|
|
|
7
|
|
41
|
|
|
|
|
|
|
|
42
|
1
|
50
|
|
|
|
13
|
defined $self->target and $args->{target} = $self->target; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
13
|
return $hacc->a( $args, $html ); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|