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

raeburn raeburn at source.lon-capa.org
Sun Aug 24 21:43:51 EDT 2014


raeburn		Mon Aug 25 01:43:51 2014 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	londocs.pm 
  Log:
  - For 2.11
    - Backport 1.583, 1.584.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.484.2.53 loncom/interface/londocs.pm:1.484.2.54
--- loncom/interface/londocs.pm:1.484.2.53	Mon Jun 16 05:32:45 2014
+++ loncom/interface/londocs.pm	Mon Aug 25 01:43:51 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.484.2.53 2014/06/16 05:32:45 raeburn Exp $
+# $Id: londocs.pm,v 1.484.2.54 2014/08/25 01:43:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5459,7 +5459,7 @@
     my $docuname=$env{'course.'.$env{'request.course.id'}.'.num'};
     my $container='sequence';
     my ($pathitem,$hiddenelem);
-    my @hiddens = ('newidx','comment','position','folderpath');
+    my @hiddens = ('newidx','comment','position','folderpath','archiveurl');
     if ($env{'form.folderpath'} =~ /\:1$/) {
         $container='page';
     }
@@ -5467,7 +5467,7 @@
     foreach my $item (@hiddens) {
         if ($env{'form.'.$item}) {
             $hiddenelem .= '<input type="hidden" name="'.$item.'" value="'.
-                           $env{'form.'.$item}.'" />'."\n";
+                           &HTML::Entities::encode($env{'form.'.$item},'<>&"').'" />'."\n";
         }
     }
     return ($destination,$dir_root,$londocroot,$docudom,$docuname,$container,
@@ -5524,25 +5524,34 @@
         } else {
             $delwarning = &mt('An error occurred retrieving the contents of the current folder.');
         }
-        $delwarning .= &mt('As a result the archive file has not been removed.');
+        $delwarning .= ' '.&mt('As a result the archive file has not been removed.');
     } else {
         my $currcmd = $env{'form.cmd'};
         my $position = $env{'form.position'};
-        if ($position > 0) { 
-            $env{'form.cmd'} = 'remove_'.$position;
-            my ($title,$url, at rrest) = 
-                split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$position]]);
-            if (&handle_edit_cmd($docuname,$docudom)) {
-                ($errtext,$fatal) = &storemap($docuname,$docudom,$map,1);
-                if ($fatal) {
-                    if ($container eq 'page') {
-                        $delwarning = &mt('An error occurred updating the contents of the current page.');
+        my $archiveidx = $position;
+        if ($position > 0) {
+            if (($env{'form.autoextract_camtasia'}) && (scalar(@LONCAPA::map::order) == 2)) {
+                $archiveidx = $position-1;
+            }
+            $env{'form.cmd'} = 'remove_'.$archiveidx;
+            my ($title,$url, at rrest) =
+                split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$archiveidx]]);
+            if ($url eq $env{'form.archiveurl'}) {
+                if (&handle_edit_cmd($docuname,$docudom)) {
+                    ($errtext,$fatal) = &storemap($docuname,$docudom,$map,1);
+                    if ($fatal) {
+                        if ($container eq 'page') {
+                            $delwarning = &mt('An error occurred updating the contents of the current page.');
+                        } else {
+                            $delwarning = &mt('An error occurred updating the contents of the current folder.');
+                        }
                     } else {
-                        $delwarning = &mt('An error occurred updating the contents of the current folder.');
+                        $delresult = &mt('Archive file removed.');
                     }
-                } else {
-                    $delresult = &mt('Archive file removed.');
                 }
+            } else {
+                $delwarning .=  &mt('Archive file had unexpected item number in folder.').
+                                ' '.&mt('As a result the archive file has not been removed.');
             }
         }
         $env{'form.cmd'} = $currcmd;




More information about the LON-CAPA-cvs mailing list