--- loncom/interface/londocs.pm 2006/01/27 23:14:20 1.220 +++ 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.220 2006/01/27 23:14:20 albertel Exp $ +# $Id: londocs.pm,v 1.223 2006/03/06 17:15:29 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1190,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 @@ -1400,8 +1403,8 @@ sub entryline { &Apache::loncommon::plainname($2,$3).':
'. $foldertitle; } - $renametitle=~s/\"\;/\\\"/g; $renametitle=~s/\\/\\\\/g; + $renametitle=~s/\"\;/\\\"/g; my $line=''; # Edit commands my $container; @@ -1667,6 +1670,7 @@ sub tiehash { sub untiehash { if ($hashtied) { untie %hash; } $hashtied=0; + return OK; } # --------------------------------------------------------------- check on this