fixed file fields
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Field / File.pm
CommitLineData
7adfd53f 1package Reaction::UI::ViewPort::Field::File;
2
3use Reaction::Class;
4use Reaction::Types::File;
5
6class File is 'Reaction::UI::ViewPort::Field', which {
7
8 has '+value' => (isa => 'File', required => 0);
6ab43711 9
10 #has '+layout' => (default => 'file');
11
5db4d87c 12 override value_string => sub { '' };
13
7adfd53f 14 override apply_our_events => sub {
15 my ($self, $ctx, $events) = @_;
16 my $value_key = join(':', $self->location, 'value');
17 if (my $upload = $ctx->req->upload($value_key)) {
18 local $events->{$value_key} = $upload;
19 return super();
20 } else {
21 return super();
22 }
23 };
24
25};
26
271;
28
29=head1 NAME
30
31Reaction::UI::ViewPort::Field::File
32
33=head1 DESCRIPTION
34
35=head1 SEE ALSO
36
37=head2 L<Reaction::UI::ViewPort::Field>
38
39=head1 AUTHORS
40
41See L<Reaction::Class> for authors.
42
43=head1 LICENSE
44
45See L<Reaction::Class> for the license.
46
47=cut