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

www lon-capa-cvs@mail.lon-capa.org
Thu, 01 May 2003 02:20:17 -0000


www		Wed Apr 30 22:20:17 2003 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  Bug #1395 - be able to load complete maps (and then delete what is not needed)
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.52 loncom/interface/londocs.pm:1.53
--- loncom/interface/londocs.pm:1.52	Wed Apr 30 17:09:12 2003
+++ loncom/interface/londocs.pm	Wed Apr 30 22:20:17 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.52 2003/04/30 21:09:12 www Exp $
+# $Id: londocs.pm,v 1.53 2003/05/01 02:20:17 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -179,6 +179,20 @@
 # Store the changed version
 		&storemap($coursenum,$coursedom,$folder.'.sequence');
             }
+# 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++;
+                   $Apache::lonratedt::resources[$idx]=$_;
+                   $Apache::lonratedt::order
+                            [$#Apache::lonratedt::order+1]=$idx;
+                }
+
+# Store the changed version
+		&storemap($coursenum,$coursedom,$folder.'.sequence');
+           }
        }
 # ---------------------------------------------------------------- End commands
 # ---------------------------------------------------------------- Print screen
@@ -659,6 +673,8 @@
 </td>
 <td bgcolor="#DDDDDD">
 <form action="/adm/coursedocs" method="post" name="simpleeditdefault">
+<input type="hidden" name="folder" value="$folder">
+<input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
 <input type=button onClick=
 "javascript:document.forms.simpleedit.folder.value='$folder';groupsearch()" value="Search">
 <input type=button onClick=
@@ -759,11 +775,18 @@
 </td>
 <td bgcolor="#DDDDDD">
 <form action="/adm/coursedocs" method="post" name="simpleeditsupplement">
+<input type="hidden" name="folder" value="$folder">
+<input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
 <input type=hidden name="importdetail" value="">
 <input type=button onClick=
 "javascript:document.forms.simpleedit.folder.value='$folder';groupsearch()" value="Search">
 <input type=button onClick=
 "javascript:document.forms.simpleedit.folder.value='$folder';groupimport();" value="Import">$help{'Importing_LON-CAPA_Resource'}
+<br />
+<input type="text" size="20" name="importmap">
+<input type=button 
+onClick="javascript:openbrowser('simpleeditsupplement','importmap','sequence,page','')"
+value="Browse"><input type="submit" name="loadmap" value="Load Map">
 </form>
 </td><td bgcolor="#DDDDDD">
 <form action="/adm/coursedocs" method="post" name="supnewfolder">