line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormHandler::Widget::Field::ButtonTag; |
2
|
|
|
|
|
|
|
# ABSTRACT: button field rendering widget, using button tag |
3
|
|
|
|
|
|
|
$HTML::FormHandler::Widget::Field::ButtonTag::VERSION = '0.40067'; |
4
|
6
|
|
|
6
|
|
3936
|
use Moose::Role; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
53
|
|
5
|
6
|
|
|
6
|
|
21891
|
use namespace::autoclean; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
59
|
|
6
|
6
|
|
|
6
|
|
416
|
use HTML::FormHandler::Render::Util ('process_attrs'); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
47
|
|
7
|
|
|
|
|
|
|
|
8
|
0
|
|
|
0
|
0
|
0
|
sub html_element { 'button' } |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub render_element { |
11
|
13
|
|
|
13
|
0
|
17
|
my ( $self, $result ) = @_; |
12
|
13
|
|
33
|
|
|
26
|
$result ||= $self->result; |
13
|
|
|
|
|
|
|
|
14
|
13
|
|
|
|
|
98
|
my $output = '<button type="' . $self->input_type . '" name="' |
15
|
|
|
|
|
|
|
. $self->html_name . '" id="' . $self->id . '"'; |
16
|
13
|
|
|
|
|
70
|
$output .= process_attrs($self->element_attributes($result)); |
17
|
13
|
|
|
|
|
29
|
$output .= '>'; |
18
|
13
|
|
|
|
|
413
|
$output .= $self->_localize($self->value); |
19
|
13
|
|
|
|
|
22
|
$output .= "</button>"; |
20
|
13
|
|
|
|
|
26
|
return $output; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub render { |
24
|
13
|
|
|
13
|
0
|
20
|
my ( $self, $result ) = @_; |
25
|
13
|
|
33
|
|
|
36
|
$result ||= $self->result; |
26
|
13
|
50
|
|
|
|
29
|
die "No result for form field '" . $self->full_name . "'. Field may be inactive." unless $result; |
27
|
13
|
|
|
|
|
42
|
my $output = $self->render_element( $result ); |
28
|
13
|
|
|
|
|
60
|
return $self->wrap_field( $result, $output ); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=pod |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=encoding UTF-8 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
HTML::FormHandler::Widget::Field::ButtonTag - button field rendering widget, using button tag |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 VERSION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
version 0.40067 |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 AUTHOR |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
FormHandler Contributors - see HTML::FormHandler |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
This software is copyright (c) 2016 by Gerda Shank. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
57
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |