line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormWidgets::Freelist; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
861
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
37
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
5
|
1
|
|
|
1
|
|
6
|
use parent 'HTML::FormWidgets'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( qw( height values width ) ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $TTS = q( ~ ); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub init { |
12
|
1
|
|
|
1
|
1
|
3
|
my ($self, $args) = @_; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
8
|
$self->container_class( q(freelist_container) ); |
15
|
1
|
|
|
|
|
7
|
$self->height ( 5 ); |
16
|
1
|
|
|
|
|
9
|
$self->values ( [] ); |
17
|
1
|
|
|
|
|
9
|
return; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub render_field { |
21
|
1
|
|
|
1
|
1
|
3
|
my ($self, $args) = @_; my $hacc = $self->hacc; |
|
1
|
|
|
|
|
4
|
|
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
7
|
my $add_tip = $self->hint_title.$TTS.$self->loc( q(freelistAddTip) ); |
24
|
1
|
|
|
|
|
4
|
my $remove_tip = $self->hint_title.$TTS.$self->loc( q(freelistRemoveTip) ); |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
3
|
$args = {}; |
27
|
1
|
|
|
|
|
3
|
$args->{class } .= q( ifield freelist); |
28
|
1
|
|
|
|
|
4
|
$args->{id } = $self->id; |
29
|
1
|
|
|
|
|
7
|
$args->{name } = q(_).$self->name; |
30
|
1
|
50
|
|
|
|
8
|
$args->{size } = $self->width if (defined $self->width); |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
11
|
my $html = $hacc->textfield( $args ); |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
67
|
$args = {}; |
35
|
1
|
|
|
|
|
5
|
$args->{class } = q( ifield freelist); |
36
|
1
|
|
|
|
|
4
|
$args->{id } = $self->id.q(_list); |
37
|
1
|
|
|
|
|
8
|
$args->{multiple} = q(true); |
38
|
1
|
|
|
|
|
5
|
$args->{name } = q(_).$self->name.q(_list); |
39
|
1
|
|
|
|
|
9
|
$args->{size } = $self->height; |
40
|
1
|
|
|
|
|
7
|
$args->{values } = $self->values; |
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
8
|
$html .= $hacc->scrolling_list( $args ); |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
60
|
for my $val (@{ $self->{values} }) { |
|
1
|
|
|
|
|
6
|
|
45
|
0
|
|
|
|
|
0
|
$html .= $hacc->hidden( { name => $self->name, value => $val } ); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
10
|
$html = $hacc->span( { class => q(freelist_ifields) }, $html ); |
49
|
|
|
|
|
|
|
|
50
|
1
|
|
|
|
|
73
|
my $text = $hacc->span( { class => q(add_item_icon) }, q( ) ); |
51
|
|
|
|
|
|
|
|
52
|
1
|
|
|
|
|
38
|
$args = { class => q(icon_button tips add), |
53
|
|
|
|
|
|
|
id => $self->id.q(_add), |
54
|
|
|
|
|
|
|
title => $add_tip }; |
55
|
|
|
|
|
|
|
|
56
|
1
|
|
|
|
|
17
|
my $text1 = $hacc->span( $args, $text ); |
57
|
|
|
|
|
|
|
|
58
|
1
|
|
|
|
|
41
|
$text = $hacc->span( { class => q(remove_item_icon) }, q( ) ); |
59
|
1
|
|
|
|
|
34
|
$args = { class => q(icon_button tips remove), |
60
|
|
|
|
|
|
|
id => $self->id.q(_remove), |
61
|
|
|
|
|
|
|
title => $remove_tip }; |
62
|
1
|
|
|
|
|
15
|
$text1 .= $hacc->span( $args, $text ); |
63
|
1
|
|
|
|
|
39
|
$html .= $hacc->span( { class => q(freelist_buttons) }, $text1 ); |
64
|
|
|
|
|
|
|
|
65
|
1
|
|
|
|
|
35
|
return $html; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|