--- loncom/interface/londocs.pm 2005/06/08 19:36:54 1.180 +++ loncom/interface/londocs.pm 2005/06/08 21:38:44 1.182 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.180 2005/06/08 19:36:54 raeburn Exp $ +# $Id: londocs.pm,v 1.182 2005/06/08 21:38:44 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1044,9 +1044,11 @@ sub editor { } # this is for a course, not a user, so set coursedoc flag # probably the only place in the system where this should be "1" - my $newidx=$#Apache::lonratedt::resources+1; + + my $newidx=&Apache::lonratedt::getresidx(); $destination .= $newidx; my $url=&Apache::lonnet::userfileupload('uploaddoc',1,$destination); + my $ext='false'; if ($url=~/^http\:\/\//) { $ext='true'; } $url=~s/\:/\:/g; @@ -1151,8 +1153,8 @@ sub editor { # Loading a complete map if (($env{'form.importmap'}) && ($env{'form.loadmap'})) { foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$env{'form.importmap'}))) { - my $idx=$#Apache::lonratedt::resources; - $idx++; + my ($title,$url,$ext,$type)=split(/\:/,$_); + my $idx=&Apache::lonratedt::getresidx($url); $Apache::lonratedt::resources[$idx]=$_; $Apache::lonratedt::order [$#Apache::lonratedt::order+1]=$idx; @@ -1865,7 +1867,7 @@ sub changewarning { } $r->print( ''. -'
'. +''. '

'. &mt($message,' $lt{'file'}:
- +
$lt{'title'}:
@@ -2288,8 +2290,8 @@ $help{'Importing_LON-CAPA_Resource'}


-$lt{'copm'} -
+$lt{'copm'}
+
@@ -2404,6 +2406,7 @@ $uploadtag + ENDFORM } if ($env{'form.pagepath'}) { @@ -2424,8 +2427,8 @@ $uploadtag onClick="javascript:makeexamupload();" /> $help{'Score_Upload_Form'} + ENDBLOCK - $r->print(''); } $r->print(''."\n". ''); @@ -2514,7 +2517,7 @@ ENDSUPFORM } } if ($allowed) { - $r->print('
'); + $r->print('
'); } $r->print(''); } else {