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.40067'; |
4
|
131
|
|
|
131
|
|
88058
|
use Moose::Role; |
|
131
|
|
|
|
|
241
|
|
|
131
|
|
|
|
|
1254
|
|
5
|
131
|
|
|
131
|
|
489917
|
use namespace::autoclean; |
|
131
|
|
|
|
|
213
|
|
|
131
|
|
|
|
|
1163
|
|
6
|
131
|
|
|
131
|
|
8708
|
use HTML::FormHandler::Render::Util ('process_attrs'); |
|
131
|
|
|
|
|
189
|
|
|
131
|
|
|
|
|
1072
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub render_element { |
10
|
306
|
|
|
306
|
0
|
389
|
my $self = shift; |
11
|
306
|
|
66
|
|
|
645
|
my $result = shift || $self->result; |
12
|
|
|
|
|
|
|
|
13
|
306
|
|
|
|
|
326
|
my $t; |
14
|
306
|
|
|
|
|
1013
|
my $rendered = $self->html_filter($result->fif); |
15
|
306
|
|
|
|
|
1145
|
my $output = '<input type="' . $self->input_type . '" name="' |
16
|
|
|
|
|
|
|
. $self->html_name . '" id="' . $self->id . '"'; |
17
|
306
|
100
|
|
|
|
8139
|
$output .= qq{ size="$t"} if $t = $self->size; |
18
|
306
|
100
|
|
|
|
7799
|
$output .= qq{ maxlength="$t"} if $t = $self->maxlength; |
19
|
306
|
|
|
|
|
993
|
$output .= ' value="' . $self->html_filter($result->fif) . '"'; |
20
|
306
|
|
|
|
|
1240
|
$output .= process_attrs($self->element_attributes($result)); |
21
|
306
|
|
|
|
|
592
|
$output .= ' />'; |
22
|
306
|
|
|
|
|
564
|
return $output; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub render { |
26
|
304
|
|
|
304
|
0
|
414
|
my ( $self, $result ) = @_; |
27
|
304
|
|
100
|
|
|
1805
|
$result ||= $self->result; |
28
|
304
|
100
|
|
|
|
611
|
die "No result for form field '" . $self->full_name . "'. Field may be inactive." unless $result; |
29
|
303
|
|
|
|
|
818
|
my $output = $self->render_element( $result ); |
30
|
303
|
|
|
|
|
1116
|
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.40067 |
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) 2016 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 |