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

banghart lon-capa-cvs@mail.lon-capa.org
Tue, 14 Dec 2004 19:10:07 -0000


banghart		Tue Dec 14 14:10:07 2004 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  	Inform user when filename clean changes their filename.
  	Inform user file must be checked to be deleted.
  	List multiple files to be deleted on separate lines.
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.65 loncom/interface/portfolio.pm:1.66
--- loncom/interface/portfolio.pm:1.65	Sat Dec 11 20:35:44 2004
+++ loncom/interface/portfolio.pm	Tue Dec 14 14:10:07 2004
@@ -249,7 +249,7 @@
         $display_file_text = '<tt>'.$path.$filename.'</tt>';
     } elsif (ref($filename) eq "ARRAY") {
         foreach (@$filename) {
-            $display_file_text .= '<tt>'.$path.$_.'</tt>';
+            $display_file_text .= '<tt>'.$path.$_.'</tt><br />';
         }
     } elsif (ref($filename) eq "SCALAR") {
         $display_file_text = '<tt>'.$path.$filename.'</tt>';        
@@ -270,13 +270,19 @@
     my @check;
     my $file_name = $ENV{'form.currentpath'}.$ENV{'form.selectfile'};
     my @files=&Apache::loncommon::get_env_multiple('form.selectfile');
+
     if (&Apache::lonnet::is_locked($file_name,$ENV{'user.domain'},$ENV{'user.name'} ) eq 'true') {
         $r->print ("The file is locked and cannot be deleted.<br />");
         $r->print(&done());
     } else {
-        &open_form($r);
-        $r->print('<p>'.&mt('Delete').' '.&display_file(undef,\@files).'?</p>');
-        &close_form($r);
+        if (scalar(@files)) {
+            &open_form($r);
+            $r->print('<p>'.&mt('Delete').' '.&display_file(undef,\@files).'?</p>');
+            &close_form($r);
+        } else {
+            $r->print("No file was checked to delete.<br />");
+            $r->print(&done());
+        }
     }
 } 
 
@@ -366,6 +372,9 @@
 		  ') while trying to rename '.&display_file().' to '.
 		  &display_file(undef,$filenewname).'</font><br />');
     }
+    if ($filenewname ne $ENV{'form.filenewname'}) {
+        $r->print("The new file name was changed from:<br /><strong>".$ENV{'form.filenewname'}."</strong> to <strong>$filenewname </strong>");
+    }
     $r->print(&done());
 }
 sub select_files {