[LON-CAPA-cvs] cvs: loncom /interface londocs.pm

www lon-capa-cvs@mail.lon-capa.org
Wed, 08 Jun 2005 20:44:55 -0000


www		Wed Jun  8 16:44:55 2005 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  Missed calls to &getresidx - thanks Guy!
  (conflict with Stuart's edit hopefully correctly resolved)
  Bug #1959: hopefully less confusing description of what "Load Map" does
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.180 loncom/interface/londocs.pm:1.181
--- loncom/interface/londocs.pm:1.180	Wed Jun  8 15:36:54 2005
+++ loncom/interface/londocs.pm	Wed Jun  8 16:44:54 2005
@@ -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.181 2005/06/08 20:44:54 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1044,9 +1044,11 @@
                 }
 # 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 @@
 # 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;
@@ -2158,7 +2160,7 @@
                 'upls' => 'Upload a new supplemental course document',
                 'impp' => 'Import a document',
                 'pubd' => 'Published documents',
-		'copm' => 'All documents out of a published map',
+		'copm' => 'All documents out of a published map into this folder',
                 'spec' => 'Special documents',
                 'upld' => 'Upload Document',
                 'srch' => 'Search',
@@ -2288,8 +2290,8 @@
 </nobr>
 <p>
 <hr />
-$lt{'copm'}
-<input type="text" size="20" name="importmap"><br />
+$lt{'copm'}<br />
+<input type="text" size="40" name="importmap"><br />
 <nobr><input type=button 
 onClick="javascript:openbrowser('simpleeditdefault','importmap','sequence,page','')"
 value="$lt{'selm'}"> <input type="submit" name="loadmap" value="$lt{'load'}">