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