r20898@agaton (orig r755): wreis | 2008-07-24 00:32:56 +0100
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Field / .ToDo / File.pm
CommitLineData
ddccc6a2 1package Reaction::UI::ViewPort::InterfaceModel::Field::File;
2
3use Reaction::Class;
4use Reaction::Types::File;
5
6class File is 'Reaction::UI::ViewPort::InterfaceModel::Field', which {
7
8 has '+value' => (isa => 'File', required => 0);
9
10 override apply_our_events => sub {
11 my ($self, $ctx, $events) = @_;
12 my $value_key = join(':', $self->location, 'value');
13 if (my $upload = $ctx->req->upload($value_key)) {
14 local $events->{$value_key} = $upload;
15 return super();
16 } else {
17 return super();
18 }
19 };
20
21};
22
231;
24
25=head1 NAME
26
27Reaction::UI::ViewPort::Field::File
28
29=head1 DESCRIPTION
30
31=head1 SEE ALSO
32
33=head2 L<Reaction::UI::ViewPort::Field>
34
35=head1 AUTHORS
36
37See L<Reaction::Class> for authors.
38
39=head1 LICENSE
40
41See L<Reaction::Class> for the license.
42
43=cut