[LON-CAPA-cvs] cvs: loncom /publisher lonupload.pm

www lon-capa-cvs-allow@mail.lon-capa.org
Tue, 15 Jan 2008 16:04:38 -0000


www		Tue Jan 15 11:04:38 2008 EDT

  Modified files:              
    /loncom/publisher	lonupload.pm 
  Log:
  Bug #5533: Untranslatable upload interface, cancel button
  
  
Index: loncom/publisher/lonupload.pm
diff -u loncom/publisher/lonupload.pm:1.35 loncom/publisher/lonupload.pm:1.36
--- loncom/publisher/lonupload.pm:1.35	Tue May  1 21:34:23 2007
+++ loncom/publisher/lonupload.pm	Tue Jan 15 11:04:38 2008
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # Handler to upload files into construction space
 #
-# $Id: lonupload.pm,v 1.35 2007/05/02 01:34:23 albertel Exp $
+# $Id: lonupload.pm,v 1.36 2008/01/15 16:04:38 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -158,15 +158,22 @@
 	&Debug($r, "URL is now ".$url);
 	my $datatoken=$env{'form.datatoken'};
 	if (($fn) && ($datatoken)) {
-	    if ((-e $target) && ($env{'form.override'} ne 'Yes')) {
+            if ($env{'form.cancel'}) {
+                my $source=$r->dir_config('lonDaemons').'/tmp/'.$datatoken.'.tmp';
+                my $dirpath=$path.'/';
+                $dirpath=~s/\/+/\//g;
+                $r->print(&mt('Upload cancelled.').'<br /><font size="+2"><a href="'.$dirpath.'">'.
+                          &mt('Back to Directory').'</a></font>');
+	    } elsif ((-e $target) && (!$env{'form.override'})) {
 		$r->print('<form action="'.$action.'" method="post">'.
-			  &mt('File').' <span class="LC_filename">'.$fn.'</span> '.
-			  &mt('exists. Overwrite?').' '.
+			  &mt('File [_1] exists. Overwrite?','<span class="LC_filename">'.$fn.'</span>').
 			  '<input type="hidden" name="phase" value="two" />'.
 			  '<input type="hidden" name="filename" value="'."$url".'" />'.
 			  '<input type="hidden" name="datatoken" value="'.$datatoken.'" />'.
-			  '<input type="submit" name="override" value="'.&mt('Yes').'" /></form>');
-	    } else {
+			  '<input type="submit" name="override" value="'.&mt('Yes').'" />'.
+                          '<input type="submit" name="cancel" value="'.&mt('Cancel').'" />'.
+                          '</form>');
+            } else {
 		my $source=$r->dir_config('lonDaemons').'/tmp/'.$datatoken.'.tmp';
 		my $dirpath=$path.'/';
 		$dirpath=~s/\/+/\//g;