1 # Copyright 2005-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: uploadblob.widget,v 1.5 2007-03-30 23:40:58 pajamian Exp $
10 CodeDef uploadblob Widget 1
11 CodeDef uploadblob Description File upload to BLOB
12 CodeDef uploadblob Routine <<EOR
14 # $column, $value, $record->{outboard}, $record->{width}
16 my $name = $opt->{name};
17 my $size = $opt->{cols} || $opt->{width};
19 my $pre = $opt->{prepend} || '';
20 my $app = $opt->{append} || '';
23 if(my $n = $opt->{name_to}) {
24 $out .= qq{<INPUT TYPE=hidden NAME="mv_data_file_name_to_$name" VALUE="$n">};
26 if(my $s = $opt->{size_to}) {
27 $out .= qq{<INPUT TYPE=hidden NAME="mv_data_file_size_to_$name" VALUE="$s">};
30 $size = qq{ SIZE="$size"} if $size > 0;
31 $out .= qq{<INPUT TYPE=hidden NAME="mv_data_file_field" VALUE="$name">
32 <INPUT TYPE=hidden NAME="mv_data_file_path" VALUE="">
33 <INPUT TYPE=hidden NAME="mv_data_file_oldfile" VALUE="">
34 <INPUT TYPE=file NAME="$name"$size>$app};
39 CodeDef uploadblob ExtraMeta <<EOM
41 _order => [ qw/ name_to size_to /],
43 options => 'columns::',
44 label => 'Field to store uploadblob file name in',
45 help => 'if any -- must be in fields of table editor',
49 options => 'columns::',
50 label => 'Field to store uploadblob size in',
51 help => 'if any -- must be in fields of table editor',