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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 11 May 2004 06:45:35 -0000


albertel		Tue May 11 02:45:35 2004 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - remove the uploaded file if it is deleted from the sequence
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.127 loncom/interface/londocs.pm:1.128
--- loncom/interface/londocs.pm:1.127	Tue May 11 02:37:39 2004
+++ loncom/interface/londocs.pm	Tue May 11 02:45:35 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.127 2004/05/11 06:37:39 albertel Exp $
+# $Id: londocs.pm,v 1.128 2004/05/11 06:45:35 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -399,6 +399,10 @@
 	    if ($ENV{'form.cmd'}) {
                 my ($cmd,$idx)=split(/\_/,$ENV{'form.cmd'});
                 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/|) {
+			&Apache::lonnet::removeuploadedurl($url);
+		    }
 		    for (my $i=$idx;$i<$#Apache::lonratedt::order;$i++) {
                         $Apache::lonratedt::order[$i]=
                           $Apache::lonratedt::order[$i+1];