Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (36 sloc) 1.227 kb
# Copyright 2005 Interchange Development Group (http://www.icdevgroup.org/)
# Licensed under the GNU GPL v2. See file LICENSE for details.
# $Id: uploadhelper.widget,v 1.3 2005-09-11 23:46:40 docelic Exp $
CodeDef uploadhelper Widget 1
CodeDef uploadhelper Description File upload
CodeDef uploadhelper Routine <<EOR
sub {
# $column, $value, $record->{outboard}, $record->{width}
my ($opt) = @_;
my $name = $opt->{name};
my $val = $opt->{value};
my $path = $opt->{path} || $opt->{outboard};
my $size = $opt->{cols} || $opt->{width};
$path =~ s:^/+::;
my $view_url;
$size = qq{ SIZE="$size"} if $size > 0;
my $out = '';
if ($val) {
if($path) {
my $base = $::Variable->{UI_BASE} || 'admin';
my $view_url = Vend::Interpolate::tag_area("$base/do_view", "$path/$val");
$out .= qq{<A HREF="$view_url">};
}
$out .= $val;
$out .= "</A>" if $path;
$out .= qq{&nbsp;<INPUT TYPE=file NAME="$name" VALUE="$val">
<INPUT TYPE=hidden NAME="ui_upload_file_path:$name" VALUE="$path">
<INPUT TYPE=hidden NAME="$name" VALUE="$val">};
}
else {
$out = qq{<INPUT TYPE=hidden NAME="ui_upload_file_path:$name" VALUE="$path">
<INPUT TYPE=file NAME="$name"$size>};
}
return $out;
}
EOR
Jump to Line
Something went wrong with that request. Please try again.