version 1.179, 2005/06/08 18:49:38
|
version 1.180, 2005/06/08 19:36:54
|
Line 1036 sub editor {
|
Line 1036 sub editor {
|
if (($env{'form.uploaddoc.filename'}) && |
if (($env{'form.uploaddoc.filename'}) && |
($env{'form.cmd'}=~/^upload_(\w+)/)) { |
($env{'form.cmd'}=~/^upload_(\w+)/)) { |
if ( ($folder=~/^$1/) || ($1 eq 'default') ) { |
if ( ($folder=~/^$1/) || ($1 eq 'default') ) { |
|
my $destination = 'docs/'; |
|
if ($folder eq 'default') { |
|
$destination .= 'default/'; |
|
} elsif ($folder =~ /^default_(\d+)$/) { |
|
$destination .= $1.'/'; |
|
} |
# this is for a course, not a user, so set coursedoc flag |
# this is for a course, not a user, so set coursedoc flag |
# probably the only place in the system where this should be "1" |
# probably the only place in the system where this should be "1" |
my $newidx=$#Apache::lonratedt::resources+1; |
my $newidx=$#Apache::lonratedt::resources+1; |
my $url=&Apache::lonnet::userfileupload('uploaddoc',1,'docs/'.$newidx); |
$destination .= $newidx; |
|
my $url=&Apache::lonnet::userfileupload('uploaddoc',1,$destination); |
my $ext='false'; |
my $ext='false'; |
if ($url=~/^http\:\/\//) { $ext='true'; } |
if ($url=~/^http\:\/\//) { $ext='true'; } |
$url=~s/\:/\:/g; |
$url=~s/\:/\:/g; |