--- loncom/interface/londocs.pm 2005/08/24 21:08:14 1.201
+++ loncom/interface/londocs.pm 2006/03/06 17:15:29 1.223
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.201 2005/08/24 21:08:14 albertel Exp $
+# $Id: londocs.pm,v 1.223 2006/03/06 17:15:29 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -155,9 +155,7 @@ sub dumpcourse {
my ($ca,$cd)=split(/\@/,$env{'form.authorspace'});
$r->print('
'.&mt('Copying Files').'
');
my $title=$env{'form.authorfolder'};
- my ($ext)=($title=~s/\.(\w+)$//);
$title=&clean($title);
- $title.='.'.$ext;
my %replacehash=();
foreach (keys %env) {
if ($_=~/^form\.namefor\_(.+)/) {
@@ -168,7 +166,10 @@ sub dumpcourse {
$crs=~s/\_/\//g;
foreach (keys %replacehash) {
my $newfilename=$title.'/'.$replacehash{$_};
+ $newfilename=~s/\.(\w+)$//;
+ my $ext=$1;
$newfilename=&clean($newfilename);
+ $newfilename.='.'.$ext;
my @dirs=split(/\//,$newfilename);
my $path='/home/'.$ca.'/public_html';
my $makepath=$path;
@@ -254,7 +255,7 @@ sub exportbutton {
return '
'.
''.
- &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs');
+ &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs');
}
sub exportcourse {
@@ -1113,7 +1114,7 @@ sub editor {
if ($cmd eq 'del') {
my (undef,$url)=split(':',$Apache::lonratedt::resources[$Apache::lonratedt::order[$idx]]);
if (($url=~m|/+uploaded/\Q$coursedom\E/\Q$coursenum\E/|) &&
- ($url!~/\.(page|sequence|problem|exam|quiz|assess|survey|form|library)$/)) {
+ ($url!~/\.(page|sequence|problem|exam|quiz|assess|survey|form|library|task)$/)) {
&Apache::lonnet::removeuploadedurl($url);
} else {
&Apache::lonratedt::makezombie($Apache::lonratedt::order[$idx]);
@@ -1189,22 +1190,25 @@ sub editor {
}
}
# Loading a complete map
- if (($env{'form.importmap'}) && ($env{'form.loadmap'})) {
- foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$env{'form.importmap'}))) {
- my ($title,$url,$ext,$type)=split(/\:/,$_);
- my $idx=&Apache::lonratedt::getresidx($url);
- $Apache::lonratedt::resources[$idx]=$_;
- $Apache::lonratedt::order
- [$#Apache::lonratedt::order+1]=$idx;
- }
-
+ if ($env{'form.loadmap'}) {
+ if ($env{'form.importmap'}=~/\w/) {
+ foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$env{'form.importmap'}))) {
+ my ($title,$url,$ext,$type)=split(/\:/,$_);
+ my $idx=&Apache::lonratedt::getresidx($url);
+ $Apache::lonratedt::resources[$idx]=$_;
+ $Apache::lonratedt::order
+ [$#Apache::lonratedt::order+1]=$idx;
+ }
# Store the changed version
- ($errtext,$fatal)=&storemap($coursenum,$coursedom,
+ ($errtext,$fatal)=&storemap($coursenum,$coursedom,
$folder.'.'.$container);
- if ($fatal) {
- $r->print('
'.$errtext.'
');
- return;
- }
+ if ($fatal) {
+ $r->print('
'.$errtext.'
');
+ return;
+ }
+ } else {
+ $r->print('
'.&mt('No map selected.').'
');
+ }
}
}
# ---------------------------------------------------------------- End commands
@@ -1214,6 +1218,8 @@ sub editor {
$r->print('