line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormHandler::Widget::Field::Text; |
2
|
|
|
|
|
|
|
# ABSTRACT: text field rendering widget |
3
|
|
|
|
|
|
|
$HTML::FormHandler::Widget::Field::Text::VERSION = '0.40068'; |
4
|
133
|
|
|
133
|
|
108232
|
use Moose::Role; |
|
133
|
|
|
|
|
396
|
|
|
133
|
|
|
|
|
1442
|
|
5
|
133
|
|
|
133
|
|
731991
|
use namespace::autoclean; |
|
133
|
|
|
|
|
456
|
|
|
133
|
|
|
|
|
8102
|
|
6
|
133
|
|
|
133
|
|
11266
|
use HTML::FormHandler::Render::Util ('process_attrs'); |
|
133
|
|
|
|
|
355
|
|
|
133
|
|
|
|
|
1275
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub render_element { |
10
|
309
|
|
|
309
|
0
|
691
|
my $self = shift; |
11
|
309
|
|
66
|
|
|
966
|
my $result = shift || $self->result; |
12
|
|
|
|
|
|
|
|
13
|
309
|
|
|
|
|
601
|
my $t; |
14
|
309
|
|
|
|
|
1420
|
my $rendered = $self->html_filter($result->fif); |
15
|
309
|
|
|
|
|
1587
|
my $output = '<input type="' . $self->input_type . '" name="' |
16
|
|
|
|
|
|
|
. $self->html_name . '" id="' . $self->id . '"'; |
17
|
309
|
100
|
|
|
|
9008
|
$output .= qq{ size="$t"} if $t = $self->size; |
18
|
309
|
100
|
|
|
|
8647
|
$output .= qq{ maxlength="$t"} if $t = $self->maxlength; |
19
|
309
|
|
|
|
|
1647
|
$output .= ' value="' . $self->html_filter($result->fif) . '"'; |
20
|
309
|
|
|
|
|
1761
|
$output .= process_attrs($self->element_attributes($result)); |
21
|
309
|
|
|
|
|
955
|
$output .= ' />'; |
22
|
309
|
|
|
|
|
914
|
return $output; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub render { |
26
|
307
|
|
|
307
|
0
|
895
|
my ( $self, $result ) = @_; |
27
|
307
|
|
100
|
|
|
2420
|
$result ||= $self->result; |
28
|
307
|
100
|
|
|
|
940
|
die "No result for form field '" . $self->full_name . "'. Field may be inactive." unless $result; |
29
|
306
|
|
|
|
|
1190
|
my $output = $self->render_element( $result ); |
30
|
306
|
|
|
|
|
1544
|
return $self->wrap_field( $result, $output ); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=pod |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=encoding UTF-8 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 NAME |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
HTML::FormHandler::Widget::Field::Text - text field rendering widget |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 VERSION |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
version 0.40068 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 SYNOPSIS |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Renders a text field |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 AUTHOR |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
FormHandler Contributors - see HTML::FormHandler |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Gerda Shank. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
62
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |